@epam/uui-db 4.5.0 → 4.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle-stats.json +1 -1
- package/index.js +1 -1
- package/package.json +4 -4
package/bundle-stats.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"errors":[],"warnings":[],"version":"4.44.2","hash":"017daedb21bc9d57ba26","time":58642,"builtAt":1640277837275,"publicPath":"/","outputPath":"C:\\work\\UUI\\uui-db\\build","assetsByChunkName":{"main":["index.js","index.js.map"]},"assets":[{"name":"index.d.ts","size":59,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"index.d.ts.map","size":120,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"index.js","size":77821,"chunks":["main"],"chunkNames":["main"],"info":{},"emitted":true},{"name":"index.js.map","size":118503,"chunks":["main"],"chunkNames":["main"],"info":{"development":true},"emitted":true},{"name":"src\\Db.d.ts","size":616,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\Db.d.ts.map","size":697,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\DbRef.d.ts","size":2396,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\DbRef.d.ts.map","size":2260,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\DbTable.d.ts","size":1592,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\DbTable.d.ts.map","size":1780,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\IxSet.d.ts","size":1080,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\IxSet.d.ts.map","size":1178,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\ListLoadingTracker.d.ts","size":868,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\ListLoadingTracker.d.ts.map","size":807,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\Loader.d.ts","size":1121,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\Loader.d.ts.map","size":1171,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\Scheduler.d.ts","size":563,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\Scheduler.d.ts.map","size":640,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\SimpleLoadingTracker.d.ts","size":361,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\SimpleLoadingTracker.d.ts.map","size":391,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\__benchmarks__\\filter.d.ts","size":48,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\__benchmarks__\\filter.d.ts.map","size":127,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\__benchmarks__\\index.d.ts","size":76,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\__benchmarks__\\index.d.ts.map","size":165,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\__benchmarks__\\pkLookup.d.ts","size":50,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\__benchmarks__\\pkLookup.d.ts.map","size":131,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\__benchmarks__\\pkUpdate.d.ts","size":50,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\__benchmarks__\\pkUpdate.d.ts.map","size":131,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\__benchmarks__\\query.d.ts","size":47,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\__benchmarks__\\query.d.ts.map","size":125,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\__benchmarks__\\sorting.d.ts","size":49,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\__benchmarks__\\sorting.d.ts.map","size":129,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\__benchmarks__\\testData.d.ts","size":421,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\__benchmarks__\\testData.d.ts.map","size":405,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\index.d.ts","size":256,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\index.d.ts.map","size":275,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\patchHelpers.d.ts","size":2086,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\patchHelpers.d.ts.map","size":2047,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\reactHooks.d.ts","size":533,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\reactHooks.d.ts.map","size":577,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\tempIds.d.ts","size":1582,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\tempIds.d.ts.map","size":1500,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\types.d.ts","size":5172,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\types.d.ts.map","size":5337,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\utils.d.ts","size":471,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\utils.d.ts.map","size":360,"chunks":[],"chunkNames":[],"info":{},"emitted":true}],"filteredAssets":0,"entrypoints":{"main":{"chunks":["main"],"assets":["index.js","index.js.map"],"children":{},"childAssets":{}}},"namedChunkGroups":{"main":{"chunks":["main"],"assets":["index.js","index.js.map"],"children":{},"childAssets":{}}},"chunks":[{"id":"main","rendered":true,"initial":true,"entry":true,"size":62644,"names":["main"],"files":["index.js","index.js.map"],"hash":"3589ea350cce704be11f","siblings":[],"parents":[],"children":[],"childrenByOrder":{},"modules":[{"id":0,"identifier":"multi C:\\work\\UUI\\uui-db\\index.tsx","name":"multi ./index.tsx","index":0,"index2":29,"size":28,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":null,"issuerId":null,"issuerName":null,"issuerPath":null,"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":null,"moduleIdentifier":null,"module":null,"moduleName":null,"type":"multi entry"}],"providedExports":null,"optimizationBailout":[],"depth":0},{"id":"../node_modules/tslib/tslib.es6.js","identifier":"C:\\work\\UUI\\node_modules\\tslib\\tslib.es6.js","name":"../node_modules/tslib/tslib.es6.js","index":2,"index2":0,"size":10274,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","issuerId":"./index.tsx","issuerName":"./index.tsx","issuerPath":[{"id":0,"identifier":"multi C:\\work\\UUI\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","name":"./index.tsx"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./index.tsx","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","module":"./index.tsx","moduleName":"./index.tsx","type":"cjs require","userRequest":"tslib","loc":"3:14-30"},{"moduleId":"./src/Db.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\Db.ts","module":"./src/Db.ts","moduleName":"./src/Db.ts","type":"cjs require","userRequest":"tslib","loc":"4:14-30"},{"moduleId":"./src/DbRef.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\DbRef.ts","module":"./src/DbRef.ts","moduleName":"./src/DbRef.ts","type":"cjs require","userRequest":"tslib","loc":"4:14-30"},{"moduleId":"./src/DbTable.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\DbTable.ts","module":"./src/DbTable.ts","moduleName":"./src/DbTable.ts","type":"cjs require","userRequest":"tslib","loc":"4:14-30"},{"moduleId":"./src/ListLoadingTracker.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\ListLoadingTracker.ts","module":"./src/ListLoadingTracker.ts","moduleName":"./src/ListLoadingTracker.ts","type":"cjs require","userRequest":"tslib","loc":"4:14-30"},{"moduleId":"./src/index.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","module":"./src/index.ts","moduleName":"./src/index.ts","type":"cjs require","userRequest":"tslib","loc":"3:14-30"},{"moduleId":"./src/patchHelpers.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\patchHelpers.ts","module":"./src/patchHelpers.ts","moduleName":"./src/patchHelpers.ts","type":"cjs require","userRequest":"tslib","loc":"4:14-30"},{"moduleId":"./src/reactHooks.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\reactHooks.ts","module":"./src/reactHooks.ts","moduleName":"./src/reactHooks.ts","type":"cjs require","userRequest":"tslib","loc":"4:14-30"},{"moduleId":"./src/tempIds.tsx","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\tempIds.tsx","module":"./src/tempIds.tsx","moduleName":"./src/tempIds.tsx","type":"cjs require","userRequest":"tslib","loc":"4:14-30"},{"moduleId":"./src/utils.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\utils.ts","module":"./src/utils.ts","moduleName":"./src/utils.ts","type":"cjs require","userRequest":"tslib","loc":"4:14-30"}],"providedExports":["__extends","__assign","__rest","__decorate","__param","__metadata","__awaiter","__generator","__createBinding","__exportStar","__values","__read","__spread","__spreadArrays","__await","__asyncGenerator","__asyncDelegator","__asyncValues","__makeTemplateObject","__importStar","__importDefault","__classPrivateFieldGet","__classPrivateFieldSet"],"optimizationBailout":[],"depth":2,"source":"/*! *****************************************************************************\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\nexport function __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}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n"},{"id":"./index.tsx","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","name":"./index.tsx","index":1,"index2":28,"size":162,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"multi C:\\work\\UUI\\uui-db\\index.tsx","issuerId":0,"issuerName":"multi ./index.tsx","issuerPath":[{"id":0,"identifier":"multi C:\\work\\UUI\\uui-db\\index.tsx","name":"multi ./index.tsx"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":0,"moduleIdentifier":"multi C:\\work\\UUI\\uui-db\\index.tsx","module":"multi ./index.tsx","moduleName":"multi ./index.tsx","type":"single entry","userRequest":"C:\\work\\UUI\\uui-db\\index.tsx","loc":"main[0]"}],"providedExports":null,"optimizationBailout":[],"depth":1,"source":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar tslib_1 = require(\"tslib\");\r\ntslib_1.__exportStar(require(\"./src\"), exports);\r\n"},{"id":"./src/Db.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\Db.ts","name":"./src/Db.ts","index":5,"index2":7,"size":2893,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","issuerId":"./src/index.ts","issuerName":"./src/index.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\UUI\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","name":"./src/index.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/index.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","module":"./src/index.ts","moduleName":"./src/index.ts","type":"cjs require","userRequest":"./Db","loc":"5:21-36"}],"providedExports":null,"optimizationBailout":[],"depth":3,"source":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.Db = void 0;\r\nvar tslib_1 = require(\"tslib\");\r\nvar utils_1 = require(\"./utils\");\r\nvar lodash_isequal_1 = tslib_1.__importDefault(require(\"lodash.isequal\"));\r\nvar Db = /** @class */ (function () {\r\n function Db(tables, reusedCache) {\r\n this.tables = tables;\r\n this.viewCache = new Map();\r\n /* Views (cached db projections) */\r\n this.valueAbsent = Symbol(\"ValueAbsent\");\r\n if (reusedCache) {\r\n this.viewCache = new Map(reusedCache);\r\n }\r\n else {\r\n this.viewCache = new Map();\r\n }\r\n }\r\n Db.prototype.update = function (mutate) {\r\n var clone = new this.constructor(tslib_1.__assign({}, this.tables), this.viewCache);\r\n mutate(clone);\r\n return clone;\r\n };\r\n Db.prototype.with = function (patch) {\r\n return this.update(function (db) {\r\n utils_1.objectKeys(db.tables).forEach(function (entityName) {\r\n if (patch[entityName]) {\r\n db.tables[entityName] = db.tables[entityName].with(patch[entityName]);\r\n }\r\n });\r\n });\r\n };\r\n Db.prototype.runView = function (view, params) {\r\n var cache = this.viewCache.get(view);\r\n if (!cache) {\r\n cache = new Map();\r\n this.viewCache.set(view, cache);\r\n }\r\n var key = view.getKey ? view.getKey(params) : JSON.stringify(params);\r\n var cacheItem = cache.get(key);\r\n if (!cacheItem) {\r\n cacheItem = {\r\n dependencies: this.valueAbsent,\r\n currentValue: this.valueAbsent,\r\n computedOnDb: this.valueAbsent,\r\n };\r\n cache.set(key, cacheItem);\r\n }\r\n var shouldUpdate = this !== cacheItem.computedOnDb;\r\n var dependencies = this.valueAbsent;\r\n if (view.getDependencies) {\r\n var compare = view.compareDependencies || utils_1.defaultCompareViewDependencies;\r\n dependencies = view.getDependencies(this, params);\r\n shouldUpdate = !compare(cacheItem.dependencies, dependencies);\r\n }\r\n var previousValue = cacheItem.currentValue;\r\n if (shouldUpdate) {\r\n cacheItem.dependencies = dependencies;\r\n var newValue = view.compute(this, params, dependencies);\r\n cacheItem.computedOnDb = this;\r\n var compareResults = view.compareResults || lodash_isequal_1.default;\r\n if (!compareResults(previousValue, newValue)) {\r\n if (view.traceDiff) {\r\n console.debug(utils_1.difference(previousValue, newValue));\r\n }\r\n cacheItem.currentValue = newValue;\r\n }\r\n }\r\n return cacheItem.currentValue;\r\n };\r\n return Db;\r\n}());\r\nexports.Db = Db;\r\n"},{"id":"./src/DbRef.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\DbRef.ts","name":"./src/DbRef.ts","index":14,"index2":24,"size":9791,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","issuerId":"./src/index.ts","issuerName":"./src/index.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\UUI\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","name":"./src/index.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/index.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","module":"./src/index.ts","moduleName":"./src/index.ts","type":"cjs require","userRequest":"./DbRef","loc":"7:21-39"}],"providedExports":null,"optimizationBailout":[],"depth":3,"source":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.DbRef = void 0;\r\nvar tslib_1 = require(\"tslib\");\r\nvar patchHelpers_1 = require(\"./patchHelpers\");\r\nvar tempIds_1 = require(\"./tempIds\");\r\nvar utils_1 = require(\"./utils\");\r\nvar lodash_isempty_1 = tslib_1.__importDefault(require(\"lodash.isempty\"));\r\nvar Loader_1 = require(\"./Loader\");\r\nvar SimpleLoadingTracker_1 = require(\"./SimpleLoadingTracker\");\r\nvar ListLoadingTracker_1 = require(\"./ListLoadingTracker\");\r\nvar DbRef = /** @class */ (function () {\r\n function DbRef(blank) {\r\n var _this = this;\r\n this.blank = blank;\r\n this.log = [];\r\n this.autoSave = true;\r\n this.savedPoint = 0;\r\n this.errors = [];\r\n this.throttleSaveMs = 1000;\r\n /* Update subscriptions (aka live views) */\r\n this.lastSubscriptionId = 1;\r\n this.subscriptions = new Map();\r\n this.updateHandlers = [];\r\n /* Error Subscriptions */\r\n this.saveErrorHandlers = [];\r\n /* Save scheduling */\r\n this.isSaveInProgress = false;\r\n this.isSaveThrottled = false;\r\n this.handleBeforeUnload = function (e) {\r\n if (_this.isSaveInProgress || _this.isSaveThrottled) {\r\n e.returnValue = false;\r\n return false;\r\n }\r\n };\r\n this.loaders = [];\r\n this.db = blank;\r\n this.base = blank;\r\n this.tempIdMap = new tempIds_1.TempIdMap(blank);\r\n this.idMap = this.tempIdMap;\r\n window.addEventListener('beforeunload', this.handleBeforeUnload);\r\n }\r\n /** Saves all committed patches. Useful only if autoSave is off. */\r\n DbRef.prototype.save = function () {\r\n this.enqueueSave();\r\n this.update();\r\n };\r\n DbRef.prototype.getAutoSave = function () {\r\n return this.autoSave;\r\n };\r\n DbRef.prototype.setAutoSave = function (val) {\r\n if (this.autoSave != val) {\r\n this.autoSave = val;\r\n this.enqueueSave();\r\n this.update();\r\n }\r\n };\r\n /** Concrete DbRef instances should override and implement their save logic in this method */\r\n DbRef.prototype.savePatch = function (patch) {\r\n return Promise.resolve({ submit: {} });\r\n };\r\n /* Db Update logic */\r\n DbRef.prototype.commit = function (patch) {\r\n try {\r\n var dbBeforeUpdate = this.db.with(patch);\r\n patch = this.beforeUpdate(patch, dbBeforeUpdate.tables, this.db.tables);\r\n patch = patchHelpers_1.mergeEntityPatches(this.db.tables, patch);\r\n this.log.push({ patch: patch });\r\n this.db = this.db.with(patch);\r\n this.autoSave && this.enqueueSave();\r\n this.update();\r\n }\r\n catch (e) {\r\n this.saveError(patch, e);\r\n }\r\n };\r\n DbRef.prototype.beforeUpdate = function (patch, tables, prevTables) {\r\n var _this = this;\r\n var patchAndDependencies = {};\r\n utils_1.objectKeys(tables).filter(function (entityName) { return patch[entityName] && !tables[entityName].schema.beforeUpdate; }).forEach(function (entityName) {\r\n patchAndDependencies[entityName] = patch[entityName];\r\n });\r\n utils_1.objectKeys(tables).filter(function (entityName) { return patch[entityName] && tables[entityName].schema.beforeUpdate; }).forEach(function (entityName) {\r\n var _a;\r\n var schema = tables[entityName].schema;\r\n var beforeUpdate = schema.beforeUpdate;\r\n var context = {\r\n clientIdsMap: _this.tempIdMap,\r\n schema: schema,\r\n tables: tables,\r\n prevTables: prevTables,\r\n };\r\n var results = patch[entityName].map(function (e) { return beforeUpdate(e, context); });\r\n var updatedPatch = (_a = {}, _a[entityName] = results.map(function (result) { return result.entity; }), _a);\r\n var dependentEntityPatchesForUpdate = patchHelpers_1.unionPatches(results.filter(function (result) { return result.dependentEntities; }).map(function (result) { return result.dependentEntities; }));\r\n var dependentEntityPatches = _this.beforeUpdate(dependentEntityPatchesForUpdate, tables, prevTables);\r\n patchAndDependencies = patchHelpers_1.mergeEntityPatches(tables, patchHelpers_1.unionPatches([patchAndDependencies, updatedPatch, dependentEntityPatches]));\r\n });\r\n return patchAndDependencies;\r\n };\r\n DbRef.prototype.commitFetch = function (patch) {\r\n patch = this.tempIdMap.serverToClientPatch(patch);\r\n this.rebase(this.base.with(patch));\r\n this.update();\r\n };\r\n DbRef.prototype.rebase = function (newBase) {\r\n this.base = newBase;\r\n this.db = newBase;\r\n for (var n = this.savedPoint; n < this.log.length; n++) {\r\n this.db = this.db.with(this.log[n].patch);\r\n }\r\n };\r\n DbRef.prototype.makeCumulativePatch = function () {\r\n var lastLogEntry = this.log.length;\r\n var logEntriesToSave = this.log.slice(this.savedPoint, lastLogEntry);\r\n var cumulativePatch = patchHelpers_1.makeCumulativePatch(this.db, logEntriesToSave.map(function (t) { return t.patch; }), this.tempIdMap);\r\n cumulativePatch = this.tempIdMap.clientToServerPatch(cumulativePatch);\r\n return cumulativePatch;\r\n };\r\n DbRef.prototype.applyResponse = function (response, newSavedPoint) {\r\n var _this = this;\r\n if (this.errors.length == 0) {\r\n this.tempIdMap.appendServerMapping(response);\r\n var serverPatch = patchHelpers_1.flattenResponse(response.submit, this.db.tables);\r\n serverPatch = patchHelpers_1.mergeEntityPatches(this.db.tables, serverPatch);\r\n this.savedPoint = newSavedPoint;\r\n this.base = this.db;\r\n this.commitFetch(serverPatch);\r\n if (this.autoSave) {\r\n this.isSaveThrottled = true;\r\n setTimeout(function () {\r\n _this.isSaveThrottled = false;\r\n if (_this.savedPoint < _this.log.length) {\r\n _this.enqueueSave();\r\n }\r\n }, this.throttleSaveMs);\r\n }\r\n }\r\n };\r\n DbRef.prototype.subscribe = function (view, params, onUpdate) {\r\n var _this = this;\r\n var id = this.lastSubscriptionId++;\r\n var subscription = {\r\n update: function (params) {\r\n subscription.currentParams = params;\r\n subscription.currentValue = _this.db.runView(view, params);\r\n return subscription.currentValue;\r\n },\r\n currentParams: null,\r\n currentValue: null,\r\n onUpdate: onUpdate,\r\n unsubscribe: function () { _this.subscriptions.delete(id); },\r\n };\r\n subscription.update(params);\r\n this.subscriptions.set(id, subscription);\r\n return subscription;\r\n };\r\n DbRef.prototype.onUpdate = function (handler) {\r\n this.subscribe({\r\n compute: function (db) { return db; },\r\n compareResults: function (a, b) { return a === b; },\r\n }, null, handler);\r\n };\r\n DbRef.prototype.update = function () {\r\n this.subscriptions.forEach(function (subscription) {\r\n var previousValue = subscription.currentValue;\r\n subscription.update(subscription.currentParams);\r\n if (subscription.currentValue !== previousValue && subscription.onUpdate) {\r\n subscription.onUpdate(subscription.currentValue);\r\n }\r\n });\r\n };\r\n DbRef.prototype.onSaveError = function (handler) {\r\n this.saveErrorHandlers.push(handler);\r\n };\r\n DbRef.prototype.saveError = function (request, error) {\r\n this.saveErrorHandlers.forEach(function (handler) { return handler(request, error); });\r\n };\r\n DbRef.prototype.enqueueSave = function () {\r\n var _this = this;\r\n if (!this.isSaveInProgress && !this.isSaveThrottled) {\r\n try {\r\n this.isSaveInProgress = true;\r\n var lastLogEntry_1 = this.log.length;\r\n var cumulativePatch_1 = this.makeCumulativePatch();\r\n if (lodash_isempty_1.default(cumulativePatch_1)) {\r\n this.isSaveInProgress = false;\r\n return;\r\n }\r\n this.savePatch(cumulativePatch_1)\r\n .then(function (response) {\r\n _this.applyResponse(response, lastLogEntry_1);\r\n _this.isSaveInProgress = false;\r\n _this.update();\r\n })\r\n .catch(function (reason) {\r\n _this.saveError(cumulativePatch_1, reason);\r\n _this.isSaveInProgress = false;\r\n _this.update();\r\n });\r\n }\r\n catch (e) {\r\n this.isSaveInProgress = false;\r\n this.isSaveThrottled = false;\r\n throw e;\r\n }\r\n }\r\n };\r\n DbRef.prototype.makeLoader = function (options) {\r\n var loader = new Loader_1.Loader(this, function () { return new SimpleLoadingTracker_1.SimpleLoadingTracker(); }, options);\r\n this.loaders.push(loader);\r\n return loader;\r\n };\r\n DbRef.prototype.makeListLoader = function (options) {\r\n var loader = new Loader_1.Loader(this, function () { return new ListLoadingTracker_1.ListLoadingTracker(); }, options);\r\n this.loaders.push(loader);\r\n return loader;\r\n };\r\n DbRef.prototype.reload = function () {\r\n this.loaders = [];\r\n };\r\n return DbRef;\r\n}());\r\nexports.DbRef = DbRef;\r\n"},{"id":"./src/DbTable.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\DbTable.ts","name":"./src/DbTable.ts","index":11,"index2":10,"size":9565,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","issuerId":"./src/index.ts","issuerName":"./src/index.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\UUI\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","name":"./src/index.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/index.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","module":"./src/index.ts","moduleName":"./src/index.ts","type":"cjs require","userRequest":"./DbTable","loc":"6:21-41"}],"providedExports":null,"optimizationBailout":[],"depth":3,"source":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.DbTable = void 0;\r\nvar tslib_1 = require(\"tslib\");\r\nvar I = tslib_1.__importStar(require(\"immutable\"));\r\nvar uui_1 = require(\"@epam/uui\");\r\nvar immutable_1 = require(\"immutable\");\r\nvar DbTable = /** @class */ (function () {\r\n function DbTable(schema, state, q) {\r\n this.schema = schema;\r\n this.state = state;\r\n this.q = q;\r\n if (!state) {\r\n var indexes = (schema.indexes || []).map(function (indexDef) {\r\n return {\r\n field: indexDef,\r\n map: I.Map(),\r\n };\r\n });\r\n this.state = { pk: I.Map(), indexes: indexes };\r\n }\r\n if (!q) {\r\n this.q = {};\r\n }\r\n }\r\n DbTable.prototype.keyToImmutable = function (id) {\r\n if (Array.isArray(id)) {\r\n return I.List(id);\r\n }\r\n else {\r\n return id;\r\n }\r\n };\r\n DbTable.prototype.byId = function (id) {\r\n return this.state.pk.get(this.keyToImmutable(id));\r\n };\r\n DbTable.prototype.getId = function (entity) {\r\n if (Array.isArray(this.schema.primaryKey)) {\r\n return this.schema.primaryKey.map(function (key) { return entity[key]; });\r\n }\r\n return entity[this.schema.primaryKey];\r\n };\r\n DbTable.prototype.update = function (mutate) {\r\n var clone = new this.constructor(this.schema, this.state, this.q);\r\n mutate(clone);\r\n return clone;\r\n };\r\n /* Mutation */\r\n DbTable.prototype.with = function (patch) {\r\n var _this = this;\r\n var updates = patch.map(function (entityPatch) {\r\n var id = _this.getId(entityPatch);\r\n var immId = _this.keyToImmutable(id);\r\n var existing = _this.state.pk.get(immId);\r\n var updated = entityPatch;\r\n if (existing) {\r\n updated = tslib_1.__assign(tslib_1.__assign({}, existing), entityPatch);\r\n }\r\n return { id: id, immId: immId, patch: entityPatch, existing: existing, updated: updated, updatedFieldsisNew: !existing };\r\n });\r\n var idVal = immutable_1.Seq.Keyed(updates.map(function (entity) { return [entity.immId, entity.updated]; }));\r\n var newPk = this.state.pk.merge(idVal);\r\n var newIndexes = this.state.indexes.map(function (index) {\r\n var newMap = index.map;\r\n var _loop_1 = function (n) {\r\n var update = updates[n];\r\n var newKey = update.updated[index.field];\r\n if (update.existing) {\r\n var oldKey = update.existing[index.field];\r\n if (oldKey !== newKey) {\r\n newMap = newMap.update(oldKey, function (set) { return set.remove(update.immId); });\r\n }\r\n }\r\n newMap = newMap.update(newKey, I.Set(), function (set) { return set.add(update.immId); });\r\n };\r\n for (var n = 0; n < updates.length; n++) {\r\n _loop_1(n);\r\n }\r\n return tslib_1.__assign(tslib_1.__assign({}, index), { map: newMap });\r\n });\r\n var newState = { pk: newPk, indexes: newIndexes };\r\n return this.update(function (t) { return t.state = newState; });\r\n };\r\n /* Query */\r\n DbTable.prototype.find = function (filter) {\r\n var _this = this;\r\n return this.update(function (t) { return t.q = tslib_1.__assign(tslib_1.__assign({}, t.q), { filter: tslib_1.__assign(tslib_1.__assign({}, _this.q.filter), filter) }); });\r\n };\r\n DbTable.prototype.order = function (order) {\r\n return this.update(function (t) { return t.q = tslib_1.__assign(tslib_1.__assign({}, t.q), { sorting: order }); });\r\n };\r\n DbTable.prototype.orderBy = function (field, direction) {\r\n if (direction === void 0) { direction = 'asc'; }\r\n return this.update(function (t) { return t.q = tslib_1.__assign(tslib_1.__assign({}, t.q), { sorting: [{ field: field, direction: direction }] }); });\r\n };\r\n DbTable.prototype.thenBy = function (field, direction) {\r\n return this.update(function (t) { return t.q = tslib_1.__assign(tslib_1.__assign({}, t.q), { sorting: tslib_1.__spreadArrays(t.q.sorting, [{ field: field, direction: direction }]) }); });\r\n };\r\n DbTable.prototype.search = function (text) {\r\n if (!this.schema.searchBy) {\r\n throw new Error(\"Can't search in the \" + this.schema.typeName + \" table - searchBy is not defined in the schema.\");\r\n }\r\n return this.update(function (t) { return t.q = tslib_1.__assign(tslib_1.__assign({}, t.q), { search: text }); });\r\n };\r\n /* Materializing */\r\n DbTable.prototype.range = function (from, count) {\r\n return this.runQuery(tslib_1.__assign(tslib_1.__assign({}, this.q), { range: { from: from, count: count } }));\r\n };\r\n DbTable.prototype.count = function () {\r\n return this.runQuery(this.q).length;\r\n };\r\n DbTable.prototype.one = function () {\r\n return this.runQuery(this.q)[0] || null;\r\n };\r\n DbTable.prototype.toArray = function () {\r\n return this.runQuery(this.q);\r\n };\r\n DbTable.prototype.map = function (fn) {\r\n return this.toArray().map(fn);\r\n };\r\n /* Query implementation */\r\n DbTable.prototype.runQuery = function (q) {\r\n var _this = this;\r\n var result = null;\r\n var filter = q.filter;\r\n if (filter) {\r\n var indexes = this.state.indexes;\r\n // Try to use indexes to fulfill filter conditions\r\n for (var n = 0; n < indexes.length; n++) {\r\n var index = indexes[n];\r\n if (index.field in filter) {\r\n var _a = filter, _b = index.field, condition = _a[_b], rest = tslib_1.__rest(_a, [typeof _b === \"symbol\" ? _b : _b + \"\"]);\r\n var conditionValues = null;\r\n if (condition != null && typeof condition === \"object\") {\r\n // Attempt to use index for 'in' and 'isNull' criteria.\r\n // We need to be very conservative here, indexed field should work the same way as getPatternPredicate. So\r\n // - it's better to leave corner cases to getPatternPredicate\r\n var _c = condition, inCriteria = _c.in, nullCriteria = _c.isNull, restCriteria = tslib_1.__rest(_c, [\"in\", \"isNull\"]);\r\n if (inCriteria && Array.isArray(inCriteria)) {\r\n conditionValues = inCriteria;\r\n }\r\n else {\r\n restCriteria.in = inCriteria;\r\n }\r\n // Conditions in getPatternPredicate are composed with 'and' logic,\r\n // For now, let's not attempt to handle tricky cases like { in: [1,2] isNull: true }, or { in: [1, null] isNull: false }\r\n // - just leave this to getPatternPredicate.\r\n // Let's just handle the a most common case { isNull: true } - find all null and undefined\r\n if (nullCriteria === true && !conditionValues) {\r\n conditionValues = [null, undefined];\r\n }\r\n else {\r\n restCriteria.in = inCriteria;\r\n }\r\n // Keep other conditions, e.g. { in: [1,2,3], isNull: true } - in works via index, isNull - via filter\r\n if (Object.keys(restCriteria).length > 0) {\r\n rest[index.field] = restCriteria;\r\n }\r\n }\r\n else {\r\n conditionValues = [condition];\r\n }\r\n if (conditionValues) {\r\n result = [];\r\n for (var i = 0; i < conditionValues.length; i++) {\r\n var idsSet = index.map.get(conditionValues[i]);\r\n if (idsSet) {\r\n var idsArray = idsSet.toArray();\r\n for (var j = 0; j < idsArray.length; j++) {\r\n var item = this.state.pk.get(idsArray[j]);\r\n result.push(item);\r\n }\r\n }\r\n }\r\n filter = Object.keys(rest).length > 0 ? rest : null;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n if (!result) {\r\n result = this.state.pk.toArray();\r\n }\r\n if (filter) {\r\n var predicate = uui_1.getPatternPredicate(q.filter);\r\n result = result.filter(predicate);\r\n }\r\n if (q.search) {\r\n var searchFilter_1 = uui_1.getSearchFilter(q.search);\r\n result = result.filter(function (item) { return searchFilter_1(_this.schema.searchBy.map(function (field) { return item[field]; })); });\r\n }\r\n if (q.sorting) {\r\n var comparer = uui_1.getOrderComparer(q.sorting);\r\n result = result.sort(comparer);\r\n }\r\n if (q.range) {\r\n result = result.slice(q.range.from, q.range.from + q.range.count);\r\n }\r\n return result;\r\n };\r\n return DbTable;\r\n}());\r\nexports.DbTable = DbTable;\r\n"},{"id":"./src/ListLoadingTracker.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\ListLoadingTracker.ts","name":"./src/ListLoadingTracker.ts","index":27,"index2":23,"size":4034,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\DbRef.ts","issuerId":"./src/DbRef.ts","issuerName":"./src/DbRef.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\UUI\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/DbRef.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\DbRef.ts","name":"./src/DbRef.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/DbRef.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\DbRef.ts","module":"./src/DbRef.ts","moduleName":"./src/DbRef.ts","type":"cjs require","userRequest":"./ListLoadingTracker","loc":"11:27-58"}],"providedExports":null,"optimizationBailout":[],"depth":4,"source":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.ListLoadingTracker = void 0;\r\nvar tslib_1 = require(\"tslib\");\r\nvar ListLoadingTracker = /** @class */ (function () {\r\n function ListLoadingTracker(options) {\r\n this.options = options;\r\n this.cache = new Map();\r\n this.extractList = (options === null || options === void 0 ? void 0 : options.extractList) || (function (r) { return r; });\r\n }\r\n ListLoadingTracker.prototype.prepare = function (request) {\r\n var filter = request.filter, sorting = request.sorting, search = request.search, range = request.range, unknownFields = tslib_1.__rest(request, [\"filter\", \"sorting\", \"search\", \"range\"]);\r\n var options = {};\r\n if (filter) {\r\n options.filter = filter;\r\n }\r\n if (sorting) {\r\n options.sorting = sorting;\r\n }\r\n if (search) {\r\n options.search = search;\r\n }\r\n var keyObject = tslib_1.__assign(tslib_1.__assign({}, options), unknownFields);\r\n var key = JSON.stringify(keyObject);\r\n var entry = this.cache.get(key);\r\n if (!entry) {\r\n entry = { options: options, count: 0, maxCount: null, isComplete: false };\r\n this.cache.set(key, entry);\r\n }\r\n return { options: options, range: range, unknownFields: unknownFields, entry: entry };\r\n };\r\n ListLoadingTracker.prototype.diff = function (request) {\r\n var _a = this.prepare(request), options = _a.options, range = _a.range, unknownFields = _a.unknownFields, entry = _a.entry;\r\n if (entry.isComplete) {\r\n return null;\r\n }\r\n if (!request.range) {\r\n return request;\r\n }\r\n else {\r\n var requestedMax = request.range.from + request.range.count;\r\n var missingCount = requestedMax - entry.count;\r\n if (entry.maxCount) {\r\n missingCount = Math.min(missingCount, entry.maxCount);\r\n }\r\n if (missingCount > 0) {\r\n return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, options), unknownFields), { range: { from: entry.count, count: requestedMax - entry.count } });\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n };\r\n ListLoadingTracker.prototype.count = function (request) {\r\n var _a = this.prepare(request), options = _a.options, range = _a.range, unknownFields = _a.unknownFields, entry = _a.entry;\r\n return { knownCount: Math.max(entry.count, entry.maxCount), exactCount: entry.maxCount };\r\n };\r\n ListLoadingTracker.prototype.append = function (request, response) {\r\n var _a = this.prepare(request), options = _a.options, range = _a.range, unknownFields = _a.unknownFields, entry = _a.entry;\r\n if (response) {\r\n var list = this.extractList(response);\r\n if (list.count) {\r\n entry.maxCount = list.count;\r\n }\r\n if (!range) {\r\n entry.count = list.items.length;\r\n entry.maxCount = list.items.length;\r\n entry.isComplete = true;\r\n }\r\n else {\r\n var from = (list.from == null) ? range.from : list.from;\r\n if (list.items.length > 0) {\r\n entry.count = Math.max(entry.count, from + list.items.length);\r\n }\r\n if (list.items.length < range.count) {\r\n entry.maxCount = from + list.items.length;\r\n entry.count = entry.maxCount;\r\n entry.isComplete = true;\r\n }\r\n }\r\n }\r\n else {\r\n if (range) {\r\n entry.count = Math.max(entry.count, request.range.from + request.range.count);\r\n }\r\n else {\r\n entry.isComplete = true;\r\n }\r\n }\r\n };\r\n return ListLoadingTracker;\r\n}());\r\nexports.ListLoadingTracker = ListLoadingTracker;\r\n"},{"id":"./src/Loader.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\Loader.ts","name":"./src/Loader.ts","index":25,"index2":21,"size":3340,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\DbRef.ts","issuerId":"./src/DbRef.ts","issuerName":"./src/DbRef.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\UUI\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/DbRef.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\DbRef.ts","name":"./src/DbRef.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/DbRef.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\DbRef.ts","module":"./src/DbRef.ts","moduleName":"./src/DbRef.ts","type":"cjs require","userRequest":"./Loader","loc":"9:15-34"}],"providedExports":null,"optimizationBailout":[],"depth":4,"source":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.Loader = void 0;\r\nvar Loader = /** @class */ (function () {\r\n function Loader(dbRef, getTracker, options) {\r\n var _this = this;\r\n this.dbRef = dbRef;\r\n this.getTracker = getTracker;\r\n this.options = options;\r\n this.currentRequests = new Set();\r\n this.load = function (inputRequest) {\r\n var result = {\r\n isComplete: _this.loaded.diff(inputRequest) == null,\r\n isLoading: false,\r\n request: inputRequest,\r\n missing: _this.loadedAndLoading.diff(inputRequest),\r\n promise: null,\r\n reload: null,\r\n };\r\n result.reload = function () {\r\n result.missing = inputRequest;\r\n _this.loadImpl(result);\r\n };\r\n if (result.isComplete) {\r\n // Everything requested is already loaded\r\n result.isComplete = true;\r\n result.isLoading = false;\r\n result.promise = Promise.resolve();\r\n return result;\r\n }\r\n else {\r\n if (result.missing == null) {\r\n // Everything requested is either loaded already, or being loaded\r\n result.isComplete = false;\r\n result.isLoading = true;\r\n // There's no good way to tell which of current requests is querying requested data - there actually can be 2 of them.\r\n // So we track all running requests, and await all of them in such case.\r\n result.promise = Promise.all(_this.currentRequests.entries()).then(function () { });\r\n return result;\r\n }\r\n else {\r\n // Something requested is not loaded, nor being loaded. Need to perform a new request.\r\n _this.loadImpl(result);\r\n return result;\r\n }\r\n }\r\n };\r\n this.loaded = getTracker();\r\n this.loadedAndLoading = getTracker();\r\n }\r\n Loader.prototype.loadImpl = function (state) {\r\n var _this = this;\r\n this.loadedAndLoading.append(state.missing);\r\n state.isLoading = true;\r\n var serverRequest = state.missing;\r\n if (this.options.clientToServerRequest) {\r\n serverRequest = this.options.clientToServerRequest(serverRequest);\r\n }\r\n state.promise = this.options.api(serverRequest).then(function (result) {\r\n _this.loaded.append(state.missing, result);\r\n _this.loadedAndLoading.append(state.missing, result);\r\n state.missing = null;\r\n state.isLoading = false;\r\n state.isComplete = true;\r\n state.promise = Promise.resolve();\r\n var flatten = _this.options.convertToPatch(result);\r\n _this.options.postProcess && _this.options.postProcess(flatten);\r\n _this.dbRef.commitFetch(flatten);\r\n });\r\n this.currentRequests.add(state.promise);\r\n state.promise.finally(function () {\r\n _this.currentRequests.delete(state.promise);\r\n });\r\n return state.promise;\r\n };\r\n return Loader;\r\n}());\r\nexports.Loader = Loader;\r\n"},{"id":"./src/SimpleLoadingTracker.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\SimpleLoadingTracker.ts","name":"./src/SimpleLoadingTracker.ts","index":26,"index2":22,"size":731,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\DbRef.ts","issuerId":"./src/DbRef.ts","issuerName":"./src/DbRef.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\UUI\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/DbRef.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\DbRef.ts","name":"./src/DbRef.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/DbRef.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\DbRef.ts","module":"./src/DbRef.ts","moduleName":"./src/DbRef.ts","type":"cjs require","userRequest":"./SimpleLoadingTracker","loc":"10:29-62"}],"providedExports":null,"optimizationBailout":[],"depth":4,"source":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.SimpleLoadingTracker = void 0;\r\nvar SimpleLoadingTracker = /** @class */ (function () {\r\n function SimpleLoadingTracker() {\r\n this.set = new Set();\r\n }\r\n SimpleLoadingTracker.prototype.getKey = function (request) {\r\n return JSON.stringify(request);\r\n };\r\n SimpleLoadingTracker.prototype.diff = function (request) {\r\n return this.set.has(this.getKey(request)) ? null : request;\r\n };\r\n SimpleLoadingTracker.prototype.append = function (request, result) {\r\n this.set.add(this.getKey(request));\r\n };\r\n return SimpleLoadingTracker;\r\n}());\r\nexports.SimpleLoadingTracker = SimpleLoadingTracker;\r\n"},{"id":"./src/index.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","name":"./src/index.ts","index":3,"index2":27,"size":541,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","issuerId":"./index.tsx","issuerName":"./index.tsx","issuerPath":[{"id":0,"identifier":"multi C:\\work\\UUI\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","name":"./index.tsx"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./index.tsx","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","module":"./index.tsx","moduleName":"./index.tsx","type":"cjs require","userRequest":"./src","loc":"4:21-37"}],"providedExports":null,"optimizationBailout":[],"depth":2,"source":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar tslib_1 = require(\"tslib\");\r\ntslib_1.__exportStar(require(\"./types\"), exports);\r\ntslib_1.__exportStar(require(\"./Db\"), exports);\r\ntslib_1.__exportStar(require(\"./DbTable\"), exports);\r\ntslib_1.__exportStar(require(\"./DbRef\"), exports);\r\ntslib_1.__exportStar(require(\"./tempIds\"), exports);\r\ntslib_1.__exportStar(require(\"./utils\"), exports);\r\ntslib_1.__exportStar(require(\"./patchHelpers\"), exports);\r\ntslib_1.__exportStar(require(\"./reactHooks\"), exports);\r\n"},{"id":"./src/patchHelpers.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\patchHelpers.ts","name":"./src/patchHelpers.ts","index":15,"index2":18,"size":9010,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","issuerId":"./src/index.ts","issuerName":"./src/index.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\UUI\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","name":"./src/index.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/DbRef.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\DbRef.ts","module":"./src/DbRef.ts","moduleName":"./src/DbRef.ts","type":"cjs require","userRequest":"./patchHelpers","loc":"5:21-46"},{"moduleId":"./src/index.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","module":"./src/index.ts","moduleName":"./src/index.ts","type":"cjs require","userRequest":"./patchHelpers","loc":"10:21-46"}],"providedExports":null,"optimizationBailout":[],"depth":3,"source":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.getEntityParentDependencies = exports.getParentEntities = exports.hasServerFields = exports.isNew = exports.getId = exports.isClientOnly = exports.makeCumulativePatch = exports.isPatchBlank = exports.flattenResponse = exports.mergeEntityPatches = exports.unionPatches = void 0;\r\nvar tslib_1 = require(\"tslib\");\r\nvar types_1 = require(\"./types\");\r\nvar I = tslib_1.__importStar(require(\"immutable\"));\r\nvar utils_1 = require(\"./utils\");\r\nvar lodash_groupby_1 = tslib_1.__importDefault(require(\"lodash.groupby\"));\r\nvar lodash_map_1 = tslib_1.__importDefault(require(\"lodash.map\"));\r\nvar lodash_merge_1 = tslib_1.__importDefault(require(\"lodash.merge\"));\r\nvar lodash_countby_1 = tslib_1.__importDefault(require(\"lodash.countby\"));\r\nvar lodash_filter_1 = tslib_1.__importDefault(require(\"lodash.filter\"));\r\nvar lodash_foreach_1 = tslib_1.__importDefault(require(\"lodash.foreach\"));\r\nvar lodash_pick_1 = tslib_1.__importDefault(require(\"lodash.pick\"));\r\nfunction unionPatches(patches) {\r\n var result = {};\r\n patches.forEach(function (patch) {\r\n utils_1.objectKeys(patch).forEach(function (tableName) {\r\n result[tableName] = result[tableName] ? tslib_1.__spreadArrays(result[tableName], patch[tableName]) : patch[tableName];\r\n });\r\n });\r\n return result;\r\n}\r\nexports.unionPatches = unionPatches;\r\nfunction mergeEntityPatches(tables, patch) {\r\n var result = {};\r\n utils_1.objectKeys(patch).forEach(function (key) {\r\n var table = tables[key];\r\n var groupedEntities = lodash_groupby_1.default(patch[key], function (item) { return table.getId(item); });\r\n var tablePatch = lodash_map_1.default(groupedEntities, function (entities) {\r\n var result = lodash_merge_1.default.apply(void 0, tslib_1.__spreadArrays([{}], entities));\r\n if (process.env.NODE_ENV !== 'production') {\r\n var props = utils_1.objectKeys(result).filter(function (prop) {\r\n return Object.keys(lodash_countby_1.default(entities.filter(function (entity) {\r\n return entity[prop] !== undefined;\r\n }), function (entity) { return entity[prop]; })).length > 1;\r\n });\r\n if (props.length) {\r\n console.warn.apply(console, tslib_1.__spreadArrays(['mergeEntityPatches: Different property values found for the same entity.\\nProperty names:\\n', props, '\\nEntities:\\n'], entities));\r\n }\r\n }\r\n return result;\r\n });\r\n result[key] = tablePatch;\r\n });\r\n return result;\r\n}\r\nexports.mergeEntityPatches = mergeEntityPatches;\r\nfunction flattenResponseHelper(result, object, tablesByTypeName) {\r\n if (Array.isArray(object)) {\r\n object.forEach(function (item) { return flattenResponseHelper(result, item, tablesByTypeName); });\r\n }\r\n else if (typeof object === 'object') {\r\n var clone = {};\r\n var tableKey = void 0;\r\n var fields = {};\r\n if ('__typename' in object) {\r\n var table = tablesByTypeName[object.__typename];\r\n if (table) {\r\n tableKey = table.schema.tableName;\r\n fields = table.schema.fields;\r\n }\r\n }\r\n for (var key in object) {\r\n var value = object[key];\r\n var field = fields[key];\r\n if ((field && !!field.disableFlatten)\r\n || typeof value !== 'object'\r\n || value === null\r\n || (Array.isArray(value) && value.every(function (item) { return typeof item !== 'object'; }))) {\r\n clone[key] = value;\r\n }\r\n else {\r\n flattenResponseHelper(result, value, tablesByTypeName);\r\n }\r\n }\r\n if (tableKey) {\r\n result[tableKey].push(clone);\r\n }\r\n }\r\n}\r\nfunction flattenResponse(response, tables) {\r\n var result = {};\r\n var tablesByTypeName = {};\r\n Object.values(tables).forEach(function (table) { return tablesByTypeName[table.schema.typeName] = table; });\r\n utils_1.objectKeys(tables).forEach(function (tableName) { return tablesByTypeName; });\r\n utils_1.objectKeys(tables).forEach(function (key) { return result[key] = []; });\r\n flattenResponseHelper(result, response, tablesByTypeName);\r\n return result;\r\n}\r\nexports.flattenResponse = flattenResponse;\r\nfunction isPatchBlank(patch) {\r\n return !utils_1.objectKeys(patch).some(function (key) { return patch[key].length > 0; });\r\n}\r\nexports.isPatchBlank = isPatchBlank;\r\n/**\r\n * Given several patches, creates a new single patch with all fields from all entities in all patches.\r\n */\r\nfunction makeCumulativePatch(updatedDb, patches, clientIdsMap) {\r\n var result = {};\r\n utils_1.objectKeys(updatedDb.tables).forEach(function (entityName) {\r\n var table = updatedDb.tables[entityName];\r\n var schema = table.schema;\r\n var ids = I.Set();\r\n patches.forEach(function (patch) {\r\n var filteredPatch = (patch[entityName] || []).filter(function (entity) { return hasServerFields(entity, schema, clientIdsMap, updatedDb.tables); });\r\n ids = ids.union(filteredPatch.map(function (e) { return table.getId(e); }));\r\n });\r\n var entities = ids\r\n .map(function (id) { return table.byId(id); })\r\n .filter(function (e) { return !isClientOnly(e, schema); })\r\n .toArray();\r\n if (entities.length > 0) {\r\n result[entityName] = entities;\r\n }\r\n });\r\n return result;\r\n}\r\nexports.makeCumulativePatch = makeCumulativePatch;\r\nfunction isClientOnly(entity, schema) {\r\n if (typeof schema.isClientOnly === 'function') {\r\n return schema.isClientOnly(entity);\r\n }\r\n return !!schema.isClientOnly;\r\n}\r\nexports.isClientOnly = isClientOnly;\r\nfunction getId(entity, schema) {\r\n if (typeof schema.primaryKey == 'string') {\r\n return entity[schema.primaryKey];\r\n }\r\n var result = [];\r\n lodash_foreach_1.default(lodash_pick_1.default(entity, schema.primaryKey), function (value) {\r\n result.push(value);\r\n });\r\n return result;\r\n}\r\nexports.getId = getId;\r\nfunction isNew(entity, schema, clientIdsMap) {\r\n var id = getId(entity, schema);\r\n return !clientIdsMap.clientToServer(id);\r\n}\r\nexports.isNew = isNew;\r\nfunction hasServerFields(entity, schema, clientIdsMap, tables) {\r\n var fullEntity = tslib_1.__assign(tslib_1.__assign({}, tables[schema.tableName].byId(entity.id) || {}), entity);\r\n if (isClientOnly(fullEntity, schema)) {\r\n return false;\r\n }\r\n return utils_1.objectKeys(entity).some(function (fieldName) {\r\n var fieldSchema = schema.fields[fieldName];\r\n return !fieldSchema || !(fieldSchema.isClientOnly || fieldSchema.isReadOnly || (fieldSchema.isGenerated && !isNew(entity, schema, clientIdsMap)));\r\n });\r\n}\r\nexports.hasServerFields = hasServerFields;\r\nfunction getParentEntities(patch, tables) {\r\n var dependenciesPatch = {};\r\n utils_1.objectKeys(patch).forEach(function (key) {\r\n var table = tables[key];\r\n var tableSchema = table.schema;\r\n var fields = lodash_filter_1.default(lodash_map_1.default(tableSchema.fields, function (field, name) { return (tslib_1.__assign(tslib_1.__assign({}, field), { name: name })); }), function (field) { return field.fk && field.fk.relationType == types_1.DbRelationType.Aggregation; });\r\n var tablePatch = patch[key];\r\n fields.forEach(function (field) {\r\n var tableName = field.fk.tableName, name = field.name;\r\n tablePatch.forEach(function (entity) {\r\n var actualTableName = (typeof tableName == 'function' ? tableName(entity) : tableName);\r\n var dbEntity = table.byId(table.getId(entity));\r\n var parentEntity = tables[actualTableName].byId(dbEntity[name]);\r\n var idFields = lodash_pick_1.default(parentEntity, tables[actualTableName].schema.primaryKey);\r\n if (parentEntity) {\r\n dependenciesPatch[actualTableName] = dependenciesPatch[actualTableName] || [];\r\n dependenciesPatch[actualTableName].push(idFields);\r\n }\r\n });\r\n });\r\n });\r\n return dependenciesPatch;\r\n}\r\nexports.getParentEntities = getParentEntities;\r\nfunction getEntityParentDependencies(entity, entityName, tables) {\r\n var _a;\r\n var patch = (_a = {}, _a[entityName] = [entity], _a);\r\n var resultPatches = [];\r\n while (true) {\r\n var parents = getParentEntities(patch, tables);\r\n if (isPatchBlank(parents)) {\r\n break;\r\n }\r\n resultPatches.push(parents);\r\n patch = parents;\r\n }\r\n var result = unionPatches(tslib_1.__spreadArrays([patch], resultPatches));\r\n result = mergeEntityPatches(tables, result);\r\n return result;\r\n}\r\nexports.getEntityParentDependencies = getEntityParentDependencies;\r\n"},{"id":"./src/reactHooks.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\reactHooks.ts","name":"./src/reactHooks.ts","index":28,"index2":26,"size":883,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","issuerId":"./src/index.ts","issuerName":"./src/index.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\UUI\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","name":"./src/index.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/index.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","module":"./src/index.ts","moduleName":"./src/index.ts","type":"cjs require","userRequest":"./reactHooks","loc":"11:21-44"}],"providedExports":null,"optimizationBailout":[],"depth":3,"source":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.useDbView = exports.useDbRef = exports.DbContext = void 0;\r\nvar tslib_1 = require(\"tslib\");\r\nvar react_1 = require(\"react\");\r\nexports.DbContext = react_1.createContext(null);\r\nfunction useDbRef() {\r\n return react_1.useContext(exports.DbContext);\r\n}\r\nexports.useDbRef = useDbRef;\r\nfunction useDbView(fn, params, options) {\r\n var dbRef = useDbRef();\r\n var _a = react_1.useState(), state = _a[0], setState = _a[1];\r\n var subscription = react_1.useMemo(function () { return dbRef.subscribe(tslib_1.__assign({ compute: fn }, options), params, setState); }, []);\r\n subscription.update(params);\r\n react_1.useEffect(function () {\r\n return function () { return subscription.unsubscribe(); };\r\n }, []);\r\n return subscription.currentValue;\r\n}\r\nexports.useDbView = useDbView;\r\n"},{"id":"./src/tempIds.tsx","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\tempIds.tsx","name":"./src/tempIds.tsx","index":23,"index2":19,"size":8557,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","issuerId":"./src/index.ts","issuerName":"./src/index.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\UUI\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","name":"./src/index.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/DbRef.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\DbRef.ts","module":"./src/DbRef.ts","moduleName":"./src/DbRef.ts","type":"cjs require","userRequest":"./tempIds","loc":"6:16-36"},{"moduleId":"./src/index.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","module":"./src/index.ts","moduleName":"./src/index.ts","type":"cjs require","userRequest":"./tempIds","loc":"8:21-41"}],"providedExports":null,"optimizationBailout":[],"depth":3,"source":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.TempIdMap = exports.isTempId = exports.getTempId = void 0;\r\nvar tslib_1 = require(\"tslib\");\r\nvar utils_1 = require(\"./utils\");\r\nvar lastTempId = -1;\r\nfunction getTempId() {\r\n return --lastTempId;\r\n}\r\nexports.getTempId = getTempId;\r\nfunction isTempId(val) {\r\n return typeof val === 'number' && val < 0;\r\n}\r\nexports.isTempId = isTempId;\r\nvar TempIdMap = /** @class */ (function () {\r\n function TempIdMap(db) {\r\n var _this = this;\r\n this.db = db;\r\n this.serverToClientIds = new Map();\r\n this.clientToServerIds = new Map();\r\n this.clientToServer = function (id) { return _this.clientToServerIds.get(id); };\r\n this.serverToClient = function (tableName, id) { return _this.getServerToClientMap(tableName).get(id); };\r\n this.clientToServerRequest = function (request) {\r\n request = tslib_1.__assign({}, request);\r\n if (request.filter) {\r\n request.filter = _this.clientToServerDataFilter(request.filter);\r\n }\r\n return request;\r\n };\r\n this.clientToServerDataFilter = function (filter) {\r\n filter = tslib_1.__assign({}, filter);\r\n var keys = Object.keys(filter);\r\n // I hope that we can rely that there won't be any negative numbers, which are not IDs, in queries.\r\n // We need to invent better heuristics or a schema otherwise.\r\n var clientToServer = function (id) {\r\n var found = _this.clientToServer(id);\r\n if (found) {\r\n return found;\r\n }\r\n else {\r\n return id;\r\n }\r\n };\r\n for (var n = 0; n < keys.length; n++) {\r\n var key = keys[n];\r\n var condition = filter[key];\r\n if (condition != null && typeof condition === \"object\") {\r\n condition = tslib_1.__assign({}, condition);\r\n if ('in' in condition && Array.isArray(condition.in) && condition.in.length) {\r\n condition.in = condition.in.map(clientToServer);\r\n }\r\n }\r\n else {\r\n condition = clientToServer(condition);\r\n }\r\n filter[key] = condition;\r\n }\r\n return filter;\r\n };\r\n }\r\n TempIdMap.prototype.copyPatch = function (patch) {\r\n var newPatch = tslib_1.__assign({}, patch);\r\n utils_1.objectKeys(patch).forEach(function (tableName) {\r\n var tablePatch = patch[tableName].map(function (entityPatch) { return (tslib_1.__assign({}, entityPatch)); });\r\n newPatch[tableName] = tablePatch;\r\n });\r\n return newPatch;\r\n };\r\n // Iterate thru every field in every patch for every table, matching certain field criteria. The patch is mutated!\r\n TempIdMap.prototype.mapFields = function (patch, filter, callback) {\r\n var _this = this;\r\n utils_1.objectKeys(patch).forEach(function (tableName) {\r\n var schema = _this.db.tables[tableName].schema;\r\n var fields = utils_1.objectKeys(schema.fields || [])\r\n .map(function (fieldName) {\r\n var fieldSchema = schema.fields[fieldName];\r\n if (filter(fieldSchema, fieldName)) {\r\n return { name: fieldName, schema: fieldSchema };\r\n }\r\n })\r\n .filter(function (f) { return !!f; });\r\n if (!fields.length) {\r\n return;\r\n }\r\n patch[tableName].forEach(function (entityPatch) {\r\n for (var n = 0; n < fields.length; n++) {\r\n var field = fields[n];\r\n var fieldValue = entityPatch[field.name];\r\n callback(field.name, field.schema, fieldValue, entityPatch, tableName);\r\n }\r\n });\r\n });\r\n };\r\n TempIdMap.prototype.getServerToClientMap = function (tableName) {\r\n var existing = this.serverToClientIds.get(tableName);\r\n if (existing) {\r\n return existing;\r\n }\r\n else {\r\n var newMap = new Map();\r\n this.serverToClientIds.set(tableName, newMap);\r\n return newMap;\r\n }\r\n };\r\n TempIdMap.prototype.serverToClientPatch = function (patch) {\r\n var _this = this;\r\n patch = this.copyPatch(patch);\r\n // We map PK in a separate pass, as we need to remap all PKs before re-mapping FKs\r\n this.mapFields(patch, function (f) { return f.isGenerated; }, function (fieldName, fieldSchema, fieldValue, entityPatch, tableName) {\r\n var clientId = _this.getServerToClientMap(tableName).get(fieldValue);\r\n if (!clientId) {\r\n clientId = getTempId();\r\n _this.clientToServerIds.set(clientId, fieldValue);\r\n _this.getServerToClientMap(tableName).set(fieldValue, clientId);\r\n }\r\n entityPatch[fieldName] = clientId;\r\n });\r\n this.mapFields(patch, function (f) { return !!(f.fk || (f.default != null) || f.toClient); }, function (fieldName, fieldSchema, fieldValue, entityPatch, tableName) {\r\n var isUndefined = typeof (fieldValue) === 'undefined';\r\n if (fieldSchema.default != null && fieldValue == null) {\r\n fieldValue = fieldSchema.default;\r\n isUndefined = false;\r\n }\r\n if (fieldSchema.fk && fieldValue != null) {\r\n var fkTableName = typeof fieldSchema.fk.tableName === 'function' ? fieldSchema.fk.tableName(entityPatch) : fieldSchema.fk.tableName;\r\n var clientId = _this.getServerToClientMap(fkTableName).get(fieldValue);\r\n if (!clientId) {\r\n clientId = getTempId();\r\n _this.clientToServerIds.set(clientId, fieldValue);\r\n _this.getServerToClientMap(fkTableName).set(fieldValue, clientId);\r\n }\r\n fieldValue = clientId;\r\n }\r\n if (!isUndefined && fieldSchema.toClient) {\r\n fieldValue = fieldSchema.toClient(fieldValue);\r\n }\r\n if (!isUndefined) {\r\n entityPatch[fieldName] = fieldValue;\r\n }\r\n });\r\n return patch;\r\n };\r\n TempIdMap.prototype.clientToServerPatch = function (patch) {\r\n var _this = this;\r\n patch = this.copyPatch(patch);\r\n this.mapFields(patch, function (f) { return f.isGenerated || !!f.fk; }, function (fieldName, fieldSchema, fieldValue, entityPatch, tableName) {\r\n if (fieldValue != null) {\r\n var existingId = _this.clientToServerIds.get(fieldValue);\r\n if (existingId) {\r\n entityPatch[fieldName] = existingId;\r\n }\r\n }\r\n });\r\n this.mapFields(patch, function (f) { return !(f.isClientOnly || f.isReadOnly) && !!f.toServer; }, function (fieldName, fieldSchema, fieldValue, entityPatch, tableName) {\r\n entityPatch[fieldName] = fieldSchema.toServer(entityPatch[fieldName]);\r\n });\r\n this.mapFields(patch, function (meta) { return meta.isClientOnly || meta.isReadOnly; }, function (fieldName, fieldSchema, fieldValue, entityPatch, tableName) {\r\n delete entityPatch[fieldName];\r\n });\r\n return patch;\r\n };\r\n TempIdMap.prototype.appendServerMapping = function (response) {\r\n var _this = this;\r\n utils_1.objectKeys(response.submit).forEach(function (tableName) {\r\n if (_this.db.tables[tableName]) {\r\n var tablePatch = response.submit[tableName];\r\n if (tablePatch) {\r\n var serverToClientIds_1 = _this.getServerToClientMap(tableName);\r\n var table_1 = _this.db.tables[tableName];\r\n tablePatch.forEach(function (patch) {\r\n if (isTempId(patch.id)) {\r\n var clientId = patch.id;\r\n var serverId = table_1.getId(patch.payload);\r\n serverToClientIds_1.set(serverId, clientId);\r\n _this.clientToServerIds.set(clientId, serverId);\r\n }\r\n });\r\n }\r\n }\r\n });\r\n };\r\n return TempIdMap;\r\n}());\r\nexports.TempIdMap = TempIdMap;\r\n"},{"id":"./src/types.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\types.ts","name":"./src/types.ts","index":4,"index2":1,"size":387,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","issuerId":"./src/index.ts","issuerName":"./src/index.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\UUI\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","name":"./src/index.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/index.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","module":"./src/index.ts","moduleName":"./src/index.ts","type":"cjs require","userRequest":"./types","loc":"4:21-39"},{"moduleId":"./src/patchHelpers.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\patchHelpers.ts","module":"./src/patchHelpers.ts","moduleName":"./src/patchHelpers.ts","type":"cjs require","userRequest":"./types","loc":"5:14-32"}],"providedExports":null,"optimizationBailout":[],"depth":3,"source":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.DbRelationType = void 0;\r\nvar DbRelationType;\r\n(function (DbRelationType) {\r\n DbRelationType[DbRelationType[\"Aggregation\"] = 0] = \"Aggregation\";\r\n DbRelationType[DbRelationType[\"Association\"] = 1] = \"Association\";\r\n})(DbRelationType = exports.DbRelationType || (exports.DbRelationType = {}));\r\n"},{"id":"./src/utils.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\utils.ts","name":"./src/utils.ts","index":6,"index2":6,"size":1818,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","issuerId":"./src/index.ts","issuerName":"./src/index.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\UUI\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","name":"./src/index.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/Db.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\Db.ts","module":"./src/Db.ts","moduleName":"./src/Db.ts","type":"cjs require","userRequest":"./utils","loc":"5:14-32"},{"moduleId":"./src/DbRef.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\DbRef.ts","module":"./src/DbRef.ts","moduleName":"./src/DbRef.ts","type":"cjs require","userRequest":"./utils","loc":"7:14-32"},{"moduleId":"./src/index.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","module":"./src/index.ts","moduleName":"./src/index.ts","type":"cjs require","userRequest":"./utils","loc":"9:21-39"},{"moduleId":"./src/patchHelpers.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\patchHelpers.ts","module":"./src/patchHelpers.ts","moduleName":"./src/patchHelpers.ts","type":"cjs require","userRequest":"./utils","loc":"7:14-32"},{"moduleId":"./src/tempIds.tsx","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\tempIds.tsx","module":"./src/tempIds.tsx","moduleName":"./src/tempIds.tsx","type":"cjs require","userRequest":"./utils","loc":"5:14-32"}],"providedExports":null,"optimizationBailout":[],"depth":3,"source":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.difference = exports.defaultCompareViewDependencies = exports.objectKeys = void 0;\r\nvar tslib_1 = require(\"tslib\");\r\nvar shallowequal_1 = tslib_1.__importDefault(require(\"shallowequal\"));\r\nvar lodash_zip_1 = tslib_1.__importDefault(require(\"lodash.zip\"));\r\nvar lodash_transform_1 = tslib_1.__importDefault(require(\"lodash.transform\"));\r\nvar lodash_isequal_1 = tslib_1.__importDefault(require(\"lodash.isequal\"));\r\n// TBD: New typescript would contain better typing for this. Remove this hack after update.\r\nexports.objectKeys = Object.keys;\r\nfunction defaultCompareViewDependencies(prev, next) {\r\n if (Array.isArray(prev) && Array.isArray(next)) {\r\n if (prev.length === next.length) {\r\n return lodash_zip_1.default(prev, next).every(function (_a) {\r\n var p = _a[0], n = _a[1];\r\n return shallowequal_1.default(p, n);\r\n });\r\n }\r\n return false;\r\n }\r\n return shallowequal_1.default(prev, next);\r\n}\r\nexports.defaultCompareViewDependencies = defaultCompareViewDependencies;\r\n/**\r\n * Deep diff between two object, using lodash\r\n * @param {Object} object Object compared\r\n * @param {Object} base Object to compare with\r\n * @return {Object} Return a new object who represent the diff\r\n */\r\nfunction difference(object, base) {\r\n function changes(object, base) {\r\n return lodash_transform_1.default(object, function (result, value, key) {\r\n if (!lodash_isequal_1.default(value, base[key])) {\r\n result[key] = (typeof value === \"object\" && typeof base[key] === \"object\") ? changes(value, base[key]) : value;\r\n }\r\n });\r\n }\r\n return changes(object, base);\r\n}\r\nexports.difference = difference;\r\n"},{"id":"@epam/uui","identifier":"external \"@epam/uui\"","name":"external \"@epam/uui\"","index":13,"index2":9,"size":42,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\DbTable.ts","issuerId":"./src/DbTable.ts","issuerName":"./src/DbTable.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\UUI\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/DbTable.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\DbTable.ts","name":"./src/DbTable.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/DbTable.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\DbTable.ts","module":"./src/DbTable.ts","moduleName":"./src/DbTable.ts","type":"cjs require","userRequest":"@epam/uui","loc":"6:12-32"}],"providedExports":null,"optimizationBailout":[],"depth":4},{"id":"immutable","identifier":"external \"immutable\"","name":"external \"immutable\"","index":12,"index2":8,"size":42,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\DbTable.ts","issuerId":"./src/DbTable.ts","issuerName":"./src/DbTable.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\UUI\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/DbTable.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\DbTable.ts","name":"./src/DbTable.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/DbTable.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\DbTable.ts","module":"./src/DbTable.ts","moduleName":"./src/DbTable.ts","type":"cjs require","userRequest":"immutable","loc":"5:29-49"},{"moduleId":"./src/DbTable.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\DbTable.ts","module":"./src/DbTable.ts","moduleName":"./src/DbTable.ts","type":"cjs require","userRequest":"immutable","loc":"7:18-38"},{"moduleId":"./src/patchHelpers.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\patchHelpers.ts","module":"./src/patchHelpers.ts","moduleName":"./src/patchHelpers.ts","type":"cjs require","userRequest":"immutable","loc":"6:29-49"}],"providedExports":null,"optimizationBailout":[],"depth":4},{"id":"lodash.countby","identifier":"external \"lodash.countby\"","name":"external \"lodash.countby\"","index":19,"index2":14,"size":42,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\patchHelpers.ts","issuerId":"./src/patchHelpers.ts","issuerName":"./src/patchHelpers.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\UUI\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/patchHelpers.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\patchHelpers.ts","name":"./src/patchHelpers.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/patchHelpers.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\patchHelpers.ts","module":"./src/patchHelpers.ts","moduleName":"./src/patchHelpers.ts","type":"cjs require","userRequest":"lodash.countby","loc":"11:47-72"}],"providedExports":null,"optimizationBailout":[],"depth":4},{"id":"lodash.filter","identifier":"external \"lodash.filter\"","name":"external \"lodash.filter\"","index":20,"index2":15,"size":42,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\patchHelpers.ts","issuerId":"./src/patchHelpers.ts","issuerName":"./src/patchHelpers.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\UUI\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/patchHelpers.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\patchHelpers.ts","name":"./src/patchHelpers.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/patchHelpers.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\patchHelpers.ts","module":"./src/patchHelpers.ts","moduleName":"./src/patchHelpers.ts","type":"cjs require","userRequest":"lodash.filter","loc":"12:46-70"}],"providedExports":null,"optimizationBailout":[],"depth":4},{"id":"lodash.foreach","identifier":"external \"lodash.foreach\"","name":"external \"lodash.foreach\"","index":21,"index2":16,"size":42,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\patchHelpers.ts","issuerId":"./src/patchHelpers.ts","issuerName":"./src/patchHelpers.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\UUI\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/patchHelpers.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\patchHelpers.ts","name":"./src/patchHelpers.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/patchHelpers.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\patchHelpers.ts","module":"./src/patchHelpers.ts","moduleName":"./src/patchHelpers.ts","type":"cjs require","userRequest":"lodash.foreach","loc":"13:47-72"}],"providedExports":null,"optimizationBailout":[],"depth":4},{"id":"lodash.groupby","identifier":"external \"lodash.groupby\"","name":"external \"lodash.groupby\"","index":16,"index2":11,"size":42,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\patchHelpers.ts","issuerId":"./src/patchHelpers.ts","issuerName":"./src/patchHelpers.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\UUI\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/patchHelpers.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\patchHelpers.ts","name":"./src/patchHelpers.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/patchHelpers.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\patchHelpers.ts","module":"./src/patchHelpers.ts","moduleName":"./src/patchHelpers.ts","type":"cjs require","userRequest":"lodash.groupby","loc":"8:47-72"}],"providedExports":null,"optimizationBailout":[],"depth":4},{"id":"lodash.isempty","identifier":"external \"lodash.isempty\"","name":"external \"lodash.isempty\"","index":24,"index2":20,"size":42,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\DbRef.ts","issuerId":"./src/DbRef.ts","issuerName":"./src/DbRef.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\UUI\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/DbRef.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\DbRef.ts","name":"./src/DbRef.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/DbRef.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\DbRef.ts","module":"./src/DbRef.ts","moduleName":"./src/DbRef.ts","type":"cjs require","userRequest":"lodash.isempty","loc":"8:47-72"}],"providedExports":null,"optimizationBailout":[],"depth":4},{"id":"lodash.isequal","identifier":"external \"lodash.isequal\"","name":"external \"lodash.isequal\"","index":10,"index2":5,"size":42,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\Db.ts","issuerId":"./src/Db.ts","issuerName":"./src/Db.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\UUI\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/Db.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\Db.ts","name":"./src/Db.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/Db.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\Db.ts","module":"./src/Db.ts","moduleName":"./src/Db.ts","type":"cjs require","userRequest":"lodash.isequal","loc":"6:47-72"},{"moduleId":"./src/utils.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\utils.ts","module":"./src/utils.ts","moduleName":"./src/utils.ts","type":"cjs require","userRequest":"lodash.isequal","loc":"8:47-72"}],"providedExports":null,"optimizationBailout":[],"depth":4},{"id":"lodash.map","identifier":"external \"lodash.map\"","name":"external \"lodash.map\"","index":17,"index2":12,"size":42,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\patchHelpers.ts","issuerId":"./src/patchHelpers.ts","issuerName":"./src/patchHelpers.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\UUI\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/patchHelpers.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\patchHelpers.ts","name":"./src/patchHelpers.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/patchHelpers.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\patchHelpers.ts","module":"./src/patchHelpers.ts","moduleName":"./src/patchHelpers.ts","type":"cjs require","userRequest":"lodash.map","loc":"9:43-64"}],"providedExports":null,"optimizationBailout":[],"depth":4},{"id":"lodash.merge","identifier":"external \"lodash.merge\"","name":"external \"lodash.merge\"","index":18,"index2":13,"size":42,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\patchHelpers.ts","issuerId":"./src/patchHelpers.ts","issuerName":"./src/patchHelpers.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\UUI\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/patchHelpers.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\patchHelpers.ts","name":"./src/patchHelpers.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/patchHelpers.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\patchHelpers.ts","module":"./src/patchHelpers.ts","moduleName":"./src/patchHelpers.ts","type":"cjs require","userRequest":"lodash.merge","loc":"10:45-68"}],"providedExports":null,"optimizationBailout":[],"depth":4},{"id":"lodash.pick","identifier":"external \"lodash.pick\"","name":"external \"lodash.pick\"","index":22,"index2":17,"size":42,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\patchHelpers.ts","issuerId":"./src/patchHelpers.ts","issuerName":"./src/patchHelpers.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\UUI\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/patchHelpers.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\patchHelpers.ts","name":"./src/patchHelpers.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/patchHelpers.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\patchHelpers.ts","module":"./src/patchHelpers.ts","moduleName":"./src/patchHelpers.ts","type":"cjs require","userRequest":"lodash.pick","loc":"14:44-66"}],"providedExports":null,"optimizationBailout":[],"depth":4},{"id":"lodash.transform","identifier":"external \"lodash.transform\"","name":"external \"lodash.transform\"","index":9,"index2":4,"size":42,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\utils.ts","issuerId":"./src/utils.ts","issuerName":"./src/utils.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\UUI\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/utils.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\utils.ts","name":"./src/utils.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/utils.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\utils.ts","module":"./src/utils.ts","moduleName":"./src/utils.ts","type":"cjs require","userRequest":"lodash.transform","loc":"7:49-76"}],"providedExports":null,"optimizationBailout":[],"depth":4},{"id":"lodash.zip","identifier":"external \"lodash.zip\"","name":"external \"lodash.zip\"","index":8,"index2":3,"size":42,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\utils.ts","issuerId":"./src/utils.ts","issuerName":"./src/utils.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\UUI\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/utils.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\utils.ts","name":"./src/utils.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/utils.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\utils.ts","module":"./src/utils.ts","moduleName":"./src/utils.ts","type":"cjs require","userRequest":"lodash.zip","loc":"6:43-64"}],"providedExports":null,"optimizationBailout":[],"depth":4},{"id":"react","identifier":"external \"react\"","name":"external \"react\"","index":29,"index2":25,"size":42,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\reactHooks.ts","issuerId":"./src/reactHooks.ts","issuerName":"./src/reactHooks.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\UUI\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/reactHooks.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\reactHooks.ts","name":"./src/reactHooks.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/reactHooks.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\reactHooks.ts","module":"./src/reactHooks.ts","moduleName":"./src/reactHooks.ts","type":"cjs require","userRequest":"react","loc":"5:14-30"}],"providedExports":null,"optimizationBailout":[],"depth":4},{"id":"shallowequal","identifier":"external \"shallowequal\"","name":"external \"shallowequal\"","index":7,"index2":2,"size":42,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\utils.ts","issuerId":"./src/utils.ts","issuerName":"./src/utils.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\UUI\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/utils.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\utils.ts","name":"./src/utils.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/utils.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\utils.ts","module":"./src/utils.ts","moduleName":"./src/utils.ts","type":"cjs require","userRequest":"shallowequal","loc":"5:45-68"}],"providedExports":null,"optimizationBailout":[],"depth":4}],"filteredModules":0,"origins":[{"module":"","moduleIdentifier":"","moduleName":"","loc":"main","request":null,"reasons":[]}]}],"modules":[{"id":0,"identifier":"multi C:\\work\\UUI\\uui-db\\index.tsx","name":"multi ./index.tsx","index":0,"index2":29,"size":28,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":null,"issuerId":null,"issuerName":null,"issuerPath":null,"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":null,"moduleIdentifier":null,"module":null,"moduleName":null,"type":"multi entry"}],"providedExports":null,"optimizationBailout":[],"depth":0},{"id":"../node_modules/tslib/tslib.es6.js","identifier":"C:\\work\\UUI\\node_modules\\tslib\\tslib.es6.js","name":"../node_modules/tslib/tslib.es6.js","index":2,"index2":0,"size":10274,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","issuerId":"./index.tsx","issuerName":"./index.tsx","issuerPath":[{"id":0,"identifier":"multi C:\\work\\UUI\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","name":"./index.tsx"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./index.tsx","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","module":"./index.tsx","moduleName":"./index.tsx","type":"cjs require","userRequest":"tslib","loc":"3:14-30"},{"moduleId":"./src/Db.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\Db.ts","module":"./src/Db.ts","moduleName":"./src/Db.ts","type":"cjs require","userRequest":"tslib","loc":"4:14-30"},{"moduleId":"./src/DbRef.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\DbRef.ts","module":"./src/DbRef.ts","moduleName":"./src/DbRef.ts","type":"cjs require","userRequest":"tslib","loc":"4:14-30"},{"moduleId":"./src/DbTable.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\DbTable.ts","module":"./src/DbTable.ts","moduleName":"./src/DbTable.ts","type":"cjs require","userRequest":"tslib","loc":"4:14-30"},{"moduleId":"./src/ListLoadingTracker.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\ListLoadingTracker.ts","module":"./src/ListLoadingTracker.ts","moduleName":"./src/ListLoadingTracker.ts","type":"cjs require","userRequest":"tslib","loc":"4:14-30"},{"moduleId":"./src/index.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","module":"./src/index.ts","moduleName":"./src/index.ts","type":"cjs require","userRequest":"tslib","loc":"3:14-30"},{"moduleId":"./src/patchHelpers.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\patchHelpers.ts","module":"./src/patchHelpers.ts","moduleName":"./src/patchHelpers.ts","type":"cjs require","userRequest":"tslib","loc":"4:14-30"},{"moduleId":"./src/reactHooks.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\reactHooks.ts","module":"./src/reactHooks.ts","moduleName":"./src/reactHooks.ts","type":"cjs require","userRequest":"tslib","loc":"4:14-30"},{"moduleId":"./src/tempIds.tsx","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\tempIds.tsx","module":"./src/tempIds.tsx","moduleName":"./src/tempIds.tsx","type":"cjs require","userRequest":"tslib","loc":"4:14-30"},{"moduleId":"./src/utils.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\utils.ts","module":"./src/utils.ts","moduleName":"./src/utils.ts","type":"cjs require","userRequest":"tslib","loc":"4:14-30"}],"providedExports":["__extends","__assign","__rest","__decorate","__param","__metadata","__awaiter","__generator","__createBinding","__exportStar","__values","__read","__spread","__spreadArrays","__await","__asyncGenerator","__asyncDelegator","__asyncValues","__makeTemplateObject","__importStar","__importDefault","__classPrivateFieldGet","__classPrivateFieldSet"],"optimizationBailout":[],"depth":2,"source":"/*! *****************************************************************************\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\nexport function __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}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n"},{"id":"./index.tsx","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","name":"./index.tsx","index":1,"index2":28,"size":162,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"multi C:\\work\\UUI\\uui-db\\index.tsx","issuerId":0,"issuerName":"multi ./index.tsx","issuerPath":[{"id":0,"identifier":"multi C:\\work\\UUI\\uui-db\\index.tsx","name":"multi ./index.tsx"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":0,"moduleIdentifier":"multi C:\\work\\UUI\\uui-db\\index.tsx","module":"multi ./index.tsx","moduleName":"multi ./index.tsx","type":"single entry","userRequest":"C:\\work\\UUI\\uui-db\\index.tsx","loc":"main[0]"}],"providedExports":null,"optimizationBailout":[],"depth":1,"source":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar tslib_1 = require(\"tslib\");\r\ntslib_1.__exportStar(require(\"./src\"), exports);\r\n"},{"id":"./src/Db.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\Db.ts","name":"./src/Db.ts","index":5,"index2":7,"size":2893,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","issuerId":"./src/index.ts","issuerName":"./src/index.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\UUI\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","name":"./src/index.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/index.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","module":"./src/index.ts","moduleName":"./src/index.ts","type":"cjs require","userRequest":"./Db","loc":"5:21-36"}],"providedExports":null,"optimizationBailout":[],"depth":3,"source":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.Db = void 0;\r\nvar tslib_1 = require(\"tslib\");\r\nvar utils_1 = require(\"./utils\");\r\nvar lodash_isequal_1 = tslib_1.__importDefault(require(\"lodash.isequal\"));\r\nvar Db = /** @class */ (function () {\r\n function Db(tables, reusedCache) {\r\n this.tables = tables;\r\n this.viewCache = new Map();\r\n /* Views (cached db projections) */\r\n this.valueAbsent = Symbol(\"ValueAbsent\");\r\n if (reusedCache) {\r\n this.viewCache = new Map(reusedCache);\r\n }\r\n else {\r\n this.viewCache = new Map();\r\n }\r\n }\r\n Db.prototype.update = function (mutate) {\r\n var clone = new this.constructor(tslib_1.__assign({}, this.tables), this.viewCache);\r\n mutate(clone);\r\n return clone;\r\n };\r\n Db.prototype.with = function (patch) {\r\n return this.update(function (db) {\r\n utils_1.objectKeys(db.tables).forEach(function (entityName) {\r\n if (patch[entityName]) {\r\n db.tables[entityName] = db.tables[entityName].with(patch[entityName]);\r\n }\r\n });\r\n });\r\n };\r\n Db.prototype.runView = function (view, params) {\r\n var cache = this.viewCache.get(view);\r\n if (!cache) {\r\n cache = new Map();\r\n this.viewCache.set(view, cache);\r\n }\r\n var key = view.getKey ? view.getKey(params) : JSON.stringify(params);\r\n var cacheItem = cache.get(key);\r\n if (!cacheItem) {\r\n cacheItem = {\r\n dependencies: this.valueAbsent,\r\n currentValue: this.valueAbsent,\r\n computedOnDb: this.valueAbsent,\r\n };\r\n cache.set(key, cacheItem);\r\n }\r\n var shouldUpdate = this !== cacheItem.computedOnDb;\r\n var dependencies = this.valueAbsent;\r\n if (view.getDependencies) {\r\n var compare = view.compareDependencies || utils_1.defaultCompareViewDependencies;\r\n dependencies = view.getDependencies(this, params);\r\n shouldUpdate = !compare(cacheItem.dependencies, dependencies);\r\n }\r\n var previousValue = cacheItem.currentValue;\r\n if (shouldUpdate) {\r\n cacheItem.dependencies = dependencies;\r\n var newValue = view.compute(this, params, dependencies);\r\n cacheItem.computedOnDb = this;\r\n var compareResults = view.compareResults || lodash_isequal_1.default;\r\n if (!compareResults(previousValue, newValue)) {\r\n if (view.traceDiff) {\r\n console.debug(utils_1.difference(previousValue, newValue));\r\n }\r\n cacheItem.currentValue = newValue;\r\n }\r\n }\r\n return cacheItem.currentValue;\r\n };\r\n return Db;\r\n}());\r\nexports.Db = Db;\r\n"},{"id":"./src/DbRef.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\DbRef.ts","name":"./src/DbRef.ts","index":14,"index2":24,"size":9791,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","issuerId":"./src/index.ts","issuerName":"./src/index.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\UUI\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","name":"./src/index.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/index.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","module":"./src/index.ts","moduleName":"./src/index.ts","type":"cjs require","userRequest":"./DbRef","loc":"7:21-39"}],"providedExports":null,"optimizationBailout":[],"depth":3,"source":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.DbRef = void 0;\r\nvar tslib_1 = require(\"tslib\");\r\nvar patchHelpers_1 = require(\"./patchHelpers\");\r\nvar tempIds_1 = require(\"./tempIds\");\r\nvar utils_1 = require(\"./utils\");\r\nvar lodash_isempty_1 = tslib_1.__importDefault(require(\"lodash.isempty\"));\r\nvar Loader_1 = require(\"./Loader\");\r\nvar SimpleLoadingTracker_1 = require(\"./SimpleLoadingTracker\");\r\nvar ListLoadingTracker_1 = require(\"./ListLoadingTracker\");\r\nvar DbRef = /** @class */ (function () {\r\n function DbRef(blank) {\r\n var _this = this;\r\n this.blank = blank;\r\n this.log = [];\r\n this.autoSave = true;\r\n this.savedPoint = 0;\r\n this.errors = [];\r\n this.throttleSaveMs = 1000;\r\n /* Update subscriptions (aka live views) */\r\n this.lastSubscriptionId = 1;\r\n this.subscriptions = new Map();\r\n this.updateHandlers = [];\r\n /* Error Subscriptions */\r\n this.saveErrorHandlers = [];\r\n /* Save scheduling */\r\n this.isSaveInProgress = false;\r\n this.isSaveThrottled = false;\r\n this.handleBeforeUnload = function (e) {\r\n if (_this.isSaveInProgress || _this.isSaveThrottled) {\r\n e.returnValue = false;\r\n return false;\r\n }\r\n };\r\n this.loaders = [];\r\n this.db = blank;\r\n this.base = blank;\r\n this.tempIdMap = new tempIds_1.TempIdMap(blank);\r\n this.idMap = this.tempIdMap;\r\n window.addEventListener('beforeunload', this.handleBeforeUnload);\r\n }\r\n /** Saves all committed patches. Useful only if autoSave is off. */\r\n DbRef.prototype.save = function () {\r\n this.enqueueSave();\r\n this.update();\r\n };\r\n DbRef.prototype.getAutoSave = function () {\r\n return this.autoSave;\r\n };\r\n DbRef.prototype.setAutoSave = function (val) {\r\n if (this.autoSave != val) {\r\n this.autoSave = val;\r\n this.enqueueSave();\r\n this.update();\r\n }\r\n };\r\n /** Concrete DbRef instances should override and implement their save logic in this method */\r\n DbRef.prototype.savePatch = function (patch) {\r\n return Promise.resolve({ submit: {} });\r\n };\r\n /* Db Update logic */\r\n DbRef.prototype.commit = function (patch) {\r\n try {\r\n var dbBeforeUpdate = this.db.with(patch);\r\n patch = this.beforeUpdate(patch, dbBeforeUpdate.tables, this.db.tables);\r\n patch = patchHelpers_1.mergeEntityPatches(this.db.tables, patch);\r\n this.log.push({ patch: patch });\r\n this.db = this.db.with(patch);\r\n this.autoSave && this.enqueueSave();\r\n this.update();\r\n }\r\n catch (e) {\r\n this.saveError(patch, e);\r\n }\r\n };\r\n DbRef.prototype.beforeUpdate = function (patch, tables, prevTables) {\r\n var _this = this;\r\n var patchAndDependencies = {};\r\n utils_1.objectKeys(tables).filter(function (entityName) { return patch[entityName] && !tables[entityName].schema.beforeUpdate; }).forEach(function (entityName) {\r\n patchAndDependencies[entityName] = patch[entityName];\r\n });\r\n utils_1.objectKeys(tables).filter(function (entityName) { return patch[entityName] && tables[entityName].schema.beforeUpdate; }).forEach(function (entityName) {\r\n var _a;\r\n var schema = tables[entityName].schema;\r\n var beforeUpdate = schema.beforeUpdate;\r\n var context = {\r\n clientIdsMap: _this.tempIdMap,\r\n schema: schema,\r\n tables: tables,\r\n prevTables: prevTables,\r\n };\r\n var results = patch[entityName].map(function (e) { return beforeUpdate(e, context); });\r\n var updatedPatch = (_a = {}, _a[entityName] = results.map(function (result) { return result.entity; }), _a);\r\n var dependentEntityPatchesForUpdate = patchHelpers_1.unionPatches(results.filter(function (result) { return result.dependentEntities; }).map(function (result) { return result.dependentEntities; }));\r\n var dependentEntityPatches = _this.beforeUpdate(dependentEntityPatchesForUpdate, tables, prevTables);\r\n patchAndDependencies = patchHelpers_1.mergeEntityPatches(tables, patchHelpers_1.unionPatches([patchAndDependencies, updatedPatch, dependentEntityPatches]));\r\n });\r\n return patchAndDependencies;\r\n };\r\n DbRef.prototype.commitFetch = function (patch) {\r\n patch = this.tempIdMap.serverToClientPatch(patch);\r\n this.rebase(this.base.with(patch));\r\n this.update();\r\n };\r\n DbRef.prototype.rebase = function (newBase) {\r\n this.base = newBase;\r\n this.db = newBase;\r\n for (var n = this.savedPoint; n < this.log.length; n++) {\r\n this.db = this.db.with(this.log[n].patch);\r\n }\r\n };\r\n DbRef.prototype.makeCumulativePatch = function () {\r\n var lastLogEntry = this.log.length;\r\n var logEntriesToSave = this.log.slice(this.savedPoint, lastLogEntry);\r\n var cumulativePatch = patchHelpers_1.makeCumulativePatch(this.db, logEntriesToSave.map(function (t) { return t.patch; }), this.tempIdMap);\r\n cumulativePatch = this.tempIdMap.clientToServerPatch(cumulativePatch);\r\n return cumulativePatch;\r\n };\r\n DbRef.prototype.applyResponse = function (response, newSavedPoint) {\r\n var _this = this;\r\n if (this.errors.length == 0) {\r\n this.tempIdMap.appendServerMapping(response);\r\n var serverPatch = patchHelpers_1.flattenResponse(response.submit, this.db.tables);\r\n serverPatch = patchHelpers_1.mergeEntityPatches(this.db.tables, serverPatch);\r\n this.savedPoint = newSavedPoint;\r\n this.base = this.db;\r\n this.commitFetch(serverPatch);\r\n if (this.autoSave) {\r\n this.isSaveThrottled = true;\r\n setTimeout(function () {\r\n _this.isSaveThrottled = false;\r\n if (_this.savedPoint < _this.log.length) {\r\n _this.enqueueSave();\r\n }\r\n }, this.throttleSaveMs);\r\n }\r\n }\r\n };\r\n DbRef.prototype.subscribe = function (view, params, onUpdate) {\r\n var _this = this;\r\n var id = this.lastSubscriptionId++;\r\n var subscription = {\r\n update: function (params) {\r\n subscription.currentParams = params;\r\n subscription.currentValue = _this.db.runView(view, params);\r\n return subscription.currentValue;\r\n },\r\n currentParams: null,\r\n currentValue: null,\r\n onUpdate: onUpdate,\r\n unsubscribe: function () { _this.subscriptions.delete(id); },\r\n };\r\n subscription.update(params);\r\n this.subscriptions.set(id, subscription);\r\n return subscription;\r\n };\r\n DbRef.prototype.onUpdate = function (handler) {\r\n this.subscribe({\r\n compute: function (db) { return db; },\r\n compareResults: function (a, b) { return a === b; },\r\n }, null, handler);\r\n };\r\n DbRef.prototype.update = function () {\r\n this.subscriptions.forEach(function (subscription) {\r\n var previousValue = subscription.currentValue;\r\n subscription.update(subscription.currentParams);\r\n if (subscription.currentValue !== previousValue && subscription.onUpdate) {\r\n subscription.onUpdate(subscription.currentValue);\r\n }\r\n });\r\n };\r\n DbRef.prototype.onSaveError = function (handler) {\r\n this.saveErrorHandlers.push(handler);\r\n };\r\n DbRef.prototype.saveError = function (request, error) {\r\n this.saveErrorHandlers.forEach(function (handler) { return handler(request, error); });\r\n };\r\n DbRef.prototype.enqueueSave = function () {\r\n var _this = this;\r\n if (!this.isSaveInProgress && !this.isSaveThrottled) {\r\n try {\r\n this.isSaveInProgress = true;\r\n var lastLogEntry_1 = this.log.length;\r\n var cumulativePatch_1 = this.makeCumulativePatch();\r\n if (lodash_isempty_1.default(cumulativePatch_1)) {\r\n this.isSaveInProgress = false;\r\n return;\r\n }\r\n this.savePatch(cumulativePatch_1)\r\n .then(function (response) {\r\n _this.applyResponse(response, lastLogEntry_1);\r\n _this.isSaveInProgress = false;\r\n _this.update();\r\n })\r\n .catch(function (reason) {\r\n _this.saveError(cumulativePatch_1, reason);\r\n _this.isSaveInProgress = false;\r\n _this.update();\r\n });\r\n }\r\n catch (e) {\r\n this.isSaveInProgress = false;\r\n this.isSaveThrottled = false;\r\n throw e;\r\n }\r\n }\r\n };\r\n DbRef.prototype.makeLoader = function (options) {\r\n var loader = new Loader_1.Loader(this, function () { return new SimpleLoadingTracker_1.SimpleLoadingTracker(); }, options);\r\n this.loaders.push(loader);\r\n return loader;\r\n };\r\n DbRef.prototype.makeListLoader = function (options) {\r\n var loader = new Loader_1.Loader(this, function () { return new ListLoadingTracker_1.ListLoadingTracker(); }, options);\r\n this.loaders.push(loader);\r\n return loader;\r\n };\r\n DbRef.prototype.reload = function () {\r\n this.loaders = [];\r\n };\r\n return DbRef;\r\n}());\r\nexports.DbRef = DbRef;\r\n"},{"id":"./src/DbTable.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\DbTable.ts","name":"./src/DbTable.ts","index":11,"index2":10,"size":9565,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","issuerId":"./src/index.ts","issuerName":"./src/index.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\UUI\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","name":"./src/index.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/index.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","module":"./src/index.ts","moduleName":"./src/index.ts","type":"cjs require","userRequest":"./DbTable","loc":"6:21-41"}],"providedExports":null,"optimizationBailout":[],"depth":3,"source":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.DbTable = void 0;\r\nvar tslib_1 = require(\"tslib\");\r\nvar I = tslib_1.__importStar(require(\"immutable\"));\r\nvar uui_1 = require(\"@epam/uui\");\r\nvar immutable_1 = require(\"immutable\");\r\nvar DbTable = /** @class */ (function () {\r\n function DbTable(schema, state, q) {\r\n this.schema = schema;\r\n this.state = state;\r\n this.q = q;\r\n if (!state) {\r\n var indexes = (schema.indexes || []).map(function (indexDef) {\r\n return {\r\n field: indexDef,\r\n map: I.Map(),\r\n };\r\n });\r\n this.state = { pk: I.Map(), indexes: indexes };\r\n }\r\n if (!q) {\r\n this.q = {};\r\n }\r\n }\r\n DbTable.prototype.keyToImmutable = function (id) {\r\n if (Array.isArray(id)) {\r\n return I.List(id);\r\n }\r\n else {\r\n return id;\r\n }\r\n };\r\n DbTable.prototype.byId = function (id) {\r\n return this.state.pk.get(this.keyToImmutable(id));\r\n };\r\n DbTable.prototype.getId = function (entity) {\r\n if (Array.isArray(this.schema.primaryKey)) {\r\n return this.schema.primaryKey.map(function (key) { return entity[key]; });\r\n }\r\n return entity[this.schema.primaryKey];\r\n };\r\n DbTable.prototype.update = function (mutate) {\r\n var clone = new this.constructor(this.schema, this.state, this.q);\r\n mutate(clone);\r\n return clone;\r\n };\r\n /* Mutation */\r\n DbTable.prototype.with = function (patch) {\r\n var _this = this;\r\n var updates = patch.map(function (entityPatch) {\r\n var id = _this.getId(entityPatch);\r\n var immId = _this.keyToImmutable(id);\r\n var existing = _this.state.pk.get(immId);\r\n var updated = entityPatch;\r\n if (existing) {\r\n updated = tslib_1.__assign(tslib_1.__assign({}, existing), entityPatch);\r\n }\r\n return { id: id, immId: immId, patch: entityPatch, existing: existing, updated: updated, updatedFieldsisNew: !existing };\r\n });\r\n var idVal = immutable_1.Seq.Keyed(updates.map(function (entity) { return [entity.immId, entity.updated]; }));\r\n var newPk = this.state.pk.merge(idVal);\r\n var newIndexes = this.state.indexes.map(function (index) {\r\n var newMap = index.map;\r\n var _loop_1 = function (n) {\r\n var update = updates[n];\r\n var newKey = update.updated[index.field];\r\n if (update.existing) {\r\n var oldKey = update.existing[index.field];\r\n if (oldKey !== newKey) {\r\n newMap = newMap.update(oldKey, function (set) { return set.remove(update.immId); });\r\n }\r\n }\r\n newMap = newMap.update(newKey, I.Set(), function (set) { return set.add(update.immId); });\r\n };\r\n for (var n = 0; n < updates.length; n++) {\r\n _loop_1(n);\r\n }\r\n return tslib_1.__assign(tslib_1.__assign({}, index), { map: newMap });\r\n });\r\n var newState = { pk: newPk, indexes: newIndexes };\r\n return this.update(function (t) { return t.state = newState; });\r\n };\r\n /* Query */\r\n DbTable.prototype.find = function (filter) {\r\n var _this = this;\r\n return this.update(function (t) { return t.q = tslib_1.__assign(tslib_1.__assign({}, t.q), { filter: tslib_1.__assign(tslib_1.__assign({}, _this.q.filter), filter) }); });\r\n };\r\n DbTable.prototype.order = function (order) {\r\n return this.update(function (t) { return t.q = tslib_1.__assign(tslib_1.__assign({}, t.q), { sorting: order }); });\r\n };\r\n DbTable.prototype.orderBy = function (field, direction) {\r\n if (direction === void 0) { direction = 'asc'; }\r\n return this.update(function (t) { return t.q = tslib_1.__assign(tslib_1.__assign({}, t.q), { sorting: [{ field: field, direction: direction }] }); });\r\n };\r\n DbTable.prototype.thenBy = function (field, direction) {\r\n return this.update(function (t) { return t.q = tslib_1.__assign(tslib_1.__assign({}, t.q), { sorting: tslib_1.__spreadArrays(t.q.sorting, [{ field: field, direction: direction }]) }); });\r\n };\r\n DbTable.prototype.search = function (text) {\r\n if (!this.schema.searchBy) {\r\n throw new Error(\"Can't search in the \" + this.schema.typeName + \" table - searchBy is not defined in the schema.\");\r\n }\r\n return this.update(function (t) { return t.q = tslib_1.__assign(tslib_1.__assign({}, t.q), { search: text }); });\r\n };\r\n /* Materializing */\r\n DbTable.prototype.range = function (from, count) {\r\n return this.runQuery(tslib_1.__assign(tslib_1.__assign({}, this.q), { range: { from: from, count: count } }));\r\n };\r\n DbTable.prototype.count = function () {\r\n return this.runQuery(this.q).length;\r\n };\r\n DbTable.prototype.one = function () {\r\n return this.runQuery(this.q)[0] || null;\r\n };\r\n DbTable.prototype.toArray = function () {\r\n return this.runQuery(this.q);\r\n };\r\n DbTable.prototype.map = function (fn) {\r\n return this.toArray().map(fn);\r\n };\r\n /* Query implementation */\r\n DbTable.prototype.runQuery = function (q) {\r\n var _this = this;\r\n var result = null;\r\n var filter = q.filter;\r\n if (filter) {\r\n var indexes = this.state.indexes;\r\n // Try to use indexes to fulfill filter conditions\r\n for (var n = 0; n < indexes.length; n++) {\r\n var index = indexes[n];\r\n if (index.field in filter) {\r\n var _a = filter, _b = index.field, condition = _a[_b], rest = tslib_1.__rest(_a, [typeof _b === \"symbol\" ? _b : _b + \"\"]);\r\n var conditionValues = null;\r\n if (condition != null && typeof condition === \"object\") {\r\n // Attempt to use index for 'in' and 'isNull' criteria.\r\n // We need to be very conservative here, indexed field should work the same way as getPatternPredicate. So\r\n // - it's better to leave corner cases to getPatternPredicate\r\n var _c = condition, inCriteria = _c.in, nullCriteria = _c.isNull, restCriteria = tslib_1.__rest(_c, [\"in\", \"isNull\"]);\r\n if (inCriteria && Array.isArray(inCriteria)) {\r\n conditionValues = inCriteria;\r\n }\r\n else {\r\n restCriteria.in = inCriteria;\r\n }\r\n // Conditions in getPatternPredicate are composed with 'and' logic,\r\n // For now, let's not attempt to handle tricky cases like { in: [1,2] isNull: true }, or { in: [1, null] isNull: false }\r\n // - just leave this to getPatternPredicate.\r\n // Let's just handle the a most common case { isNull: true } - find all null and undefined\r\n if (nullCriteria === true && !conditionValues) {\r\n conditionValues = [null, undefined];\r\n }\r\n else {\r\n restCriteria.in = inCriteria;\r\n }\r\n // Keep other conditions, e.g. { in: [1,2,3], isNull: true } - in works via index, isNull - via filter\r\n if (Object.keys(restCriteria).length > 0) {\r\n rest[index.field] = restCriteria;\r\n }\r\n }\r\n else {\r\n conditionValues = [condition];\r\n }\r\n if (conditionValues) {\r\n result = [];\r\n for (var i = 0; i < conditionValues.length; i++) {\r\n var idsSet = index.map.get(conditionValues[i]);\r\n if (idsSet) {\r\n var idsArray = idsSet.toArray();\r\n for (var j = 0; j < idsArray.length; j++) {\r\n var item = this.state.pk.get(idsArray[j]);\r\n result.push(item);\r\n }\r\n }\r\n }\r\n filter = Object.keys(rest).length > 0 ? rest : null;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n if (!result) {\r\n result = this.state.pk.toArray();\r\n }\r\n if (filter) {\r\n var predicate = uui_1.getPatternPredicate(q.filter);\r\n result = result.filter(predicate);\r\n }\r\n if (q.search) {\r\n var searchFilter_1 = uui_1.getSearchFilter(q.search);\r\n result = result.filter(function (item) { return searchFilter_1(_this.schema.searchBy.map(function (field) { return item[field]; })); });\r\n }\r\n if (q.sorting) {\r\n var comparer = uui_1.getOrderComparer(q.sorting);\r\n result = result.sort(comparer);\r\n }\r\n if (q.range) {\r\n result = result.slice(q.range.from, q.range.from + q.range.count);\r\n }\r\n return result;\r\n };\r\n return DbTable;\r\n}());\r\nexports.DbTable = DbTable;\r\n"},{"id":"./src/ListLoadingTracker.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\ListLoadingTracker.ts","name":"./src/ListLoadingTracker.ts","index":27,"index2":23,"size":4034,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\DbRef.ts","issuerId":"./src/DbRef.ts","issuerName":"./src/DbRef.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\UUI\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/DbRef.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\DbRef.ts","name":"./src/DbRef.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/DbRef.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\DbRef.ts","module":"./src/DbRef.ts","moduleName":"./src/DbRef.ts","type":"cjs require","userRequest":"./ListLoadingTracker","loc":"11:27-58"}],"providedExports":null,"optimizationBailout":[],"depth":4,"source":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.ListLoadingTracker = void 0;\r\nvar tslib_1 = require(\"tslib\");\r\nvar ListLoadingTracker = /** @class */ (function () {\r\n function ListLoadingTracker(options) {\r\n this.options = options;\r\n this.cache = new Map();\r\n this.extractList = (options === null || options === void 0 ? void 0 : options.extractList) || (function (r) { return r; });\r\n }\r\n ListLoadingTracker.prototype.prepare = function (request) {\r\n var filter = request.filter, sorting = request.sorting, search = request.search, range = request.range, unknownFields = tslib_1.__rest(request, [\"filter\", \"sorting\", \"search\", \"range\"]);\r\n var options = {};\r\n if (filter) {\r\n options.filter = filter;\r\n }\r\n if (sorting) {\r\n options.sorting = sorting;\r\n }\r\n if (search) {\r\n options.search = search;\r\n }\r\n var keyObject = tslib_1.__assign(tslib_1.__assign({}, options), unknownFields);\r\n var key = JSON.stringify(keyObject);\r\n var entry = this.cache.get(key);\r\n if (!entry) {\r\n entry = { options: options, count: 0, maxCount: null, isComplete: false };\r\n this.cache.set(key, entry);\r\n }\r\n return { options: options, range: range, unknownFields: unknownFields, entry: entry };\r\n };\r\n ListLoadingTracker.prototype.diff = function (request) {\r\n var _a = this.prepare(request), options = _a.options, range = _a.range, unknownFields = _a.unknownFields, entry = _a.entry;\r\n if (entry.isComplete) {\r\n return null;\r\n }\r\n if (!request.range) {\r\n return request;\r\n }\r\n else {\r\n var requestedMax = request.range.from + request.range.count;\r\n var missingCount = requestedMax - entry.count;\r\n if (entry.maxCount) {\r\n missingCount = Math.min(missingCount, entry.maxCount);\r\n }\r\n if (missingCount > 0) {\r\n return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, options), unknownFields), { range: { from: entry.count, count: requestedMax - entry.count } });\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n };\r\n ListLoadingTracker.prototype.count = function (request) {\r\n var _a = this.prepare(request), options = _a.options, range = _a.range, unknownFields = _a.unknownFields, entry = _a.entry;\r\n return { knownCount: Math.max(entry.count, entry.maxCount), exactCount: entry.maxCount };\r\n };\r\n ListLoadingTracker.prototype.append = function (request, response) {\r\n var _a = this.prepare(request), options = _a.options, range = _a.range, unknownFields = _a.unknownFields, entry = _a.entry;\r\n if (response) {\r\n var list = this.extractList(response);\r\n if (list.count) {\r\n entry.maxCount = list.count;\r\n }\r\n if (!range) {\r\n entry.count = list.items.length;\r\n entry.maxCount = list.items.length;\r\n entry.isComplete = true;\r\n }\r\n else {\r\n var from = (list.from == null) ? range.from : list.from;\r\n if (list.items.length > 0) {\r\n entry.count = Math.max(entry.count, from + list.items.length);\r\n }\r\n if (list.items.length < range.count) {\r\n entry.maxCount = from + list.items.length;\r\n entry.count = entry.maxCount;\r\n entry.isComplete = true;\r\n }\r\n }\r\n }\r\n else {\r\n if (range) {\r\n entry.count = Math.max(entry.count, request.range.from + request.range.count);\r\n }\r\n else {\r\n entry.isComplete = true;\r\n }\r\n }\r\n };\r\n return ListLoadingTracker;\r\n}());\r\nexports.ListLoadingTracker = ListLoadingTracker;\r\n"},{"id":"./src/Loader.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\Loader.ts","name":"./src/Loader.ts","index":25,"index2":21,"size":3340,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\DbRef.ts","issuerId":"./src/DbRef.ts","issuerName":"./src/DbRef.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\UUI\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/DbRef.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\DbRef.ts","name":"./src/DbRef.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/DbRef.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\DbRef.ts","module":"./src/DbRef.ts","moduleName":"./src/DbRef.ts","type":"cjs require","userRequest":"./Loader","loc":"9:15-34"}],"providedExports":null,"optimizationBailout":[],"depth":4,"source":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.Loader = void 0;\r\nvar Loader = /** @class */ (function () {\r\n function Loader(dbRef, getTracker, options) {\r\n var _this = this;\r\n this.dbRef = dbRef;\r\n this.getTracker = getTracker;\r\n this.options = options;\r\n this.currentRequests = new Set();\r\n this.load = function (inputRequest) {\r\n var result = {\r\n isComplete: _this.loaded.diff(inputRequest) == null,\r\n isLoading: false,\r\n request: inputRequest,\r\n missing: _this.loadedAndLoading.diff(inputRequest),\r\n promise: null,\r\n reload: null,\r\n };\r\n result.reload = function () {\r\n result.missing = inputRequest;\r\n _this.loadImpl(result);\r\n };\r\n if (result.isComplete) {\r\n // Everything requested is already loaded\r\n result.isComplete = true;\r\n result.isLoading = false;\r\n result.promise = Promise.resolve();\r\n return result;\r\n }\r\n else {\r\n if (result.missing == null) {\r\n // Everything requested is either loaded already, or being loaded\r\n result.isComplete = false;\r\n result.isLoading = true;\r\n // There's no good way to tell which of current requests is querying requested data - there actually can be 2 of them.\r\n // So we track all running requests, and await all of them in such case.\r\n result.promise = Promise.all(_this.currentRequests.entries()).then(function () { });\r\n return result;\r\n }\r\n else {\r\n // Something requested is not loaded, nor being loaded. Need to perform a new request.\r\n _this.loadImpl(result);\r\n return result;\r\n }\r\n }\r\n };\r\n this.loaded = getTracker();\r\n this.loadedAndLoading = getTracker();\r\n }\r\n Loader.prototype.loadImpl = function (state) {\r\n var _this = this;\r\n this.loadedAndLoading.append(state.missing);\r\n state.isLoading = true;\r\n var serverRequest = state.missing;\r\n if (this.options.clientToServerRequest) {\r\n serverRequest = this.options.clientToServerRequest(serverRequest);\r\n }\r\n state.promise = this.options.api(serverRequest).then(function (result) {\r\n _this.loaded.append(state.missing, result);\r\n _this.loadedAndLoading.append(state.missing, result);\r\n state.missing = null;\r\n state.isLoading = false;\r\n state.isComplete = true;\r\n state.promise = Promise.resolve();\r\n var flatten = _this.options.convertToPatch(result);\r\n _this.options.postProcess && _this.options.postProcess(flatten);\r\n _this.dbRef.commitFetch(flatten);\r\n });\r\n this.currentRequests.add(state.promise);\r\n state.promise.finally(function () {\r\n _this.currentRequests.delete(state.promise);\r\n });\r\n return state.promise;\r\n };\r\n return Loader;\r\n}());\r\nexports.Loader = Loader;\r\n"},{"id":"./src/SimpleLoadingTracker.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\SimpleLoadingTracker.ts","name":"./src/SimpleLoadingTracker.ts","index":26,"index2":22,"size":731,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\DbRef.ts","issuerId":"./src/DbRef.ts","issuerName":"./src/DbRef.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\UUI\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/DbRef.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\DbRef.ts","name":"./src/DbRef.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/DbRef.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\DbRef.ts","module":"./src/DbRef.ts","moduleName":"./src/DbRef.ts","type":"cjs require","userRequest":"./SimpleLoadingTracker","loc":"10:29-62"}],"providedExports":null,"optimizationBailout":[],"depth":4,"source":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.SimpleLoadingTracker = void 0;\r\nvar SimpleLoadingTracker = /** @class */ (function () {\r\n function SimpleLoadingTracker() {\r\n this.set = new Set();\r\n }\r\n SimpleLoadingTracker.prototype.getKey = function (request) {\r\n return JSON.stringify(request);\r\n };\r\n SimpleLoadingTracker.prototype.diff = function (request) {\r\n return this.set.has(this.getKey(request)) ? null : request;\r\n };\r\n SimpleLoadingTracker.prototype.append = function (request, result) {\r\n this.set.add(this.getKey(request));\r\n };\r\n return SimpleLoadingTracker;\r\n}());\r\nexports.SimpleLoadingTracker = SimpleLoadingTracker;\r\n"},{"id":"./src/index.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","name":"./src/index.ts","index":3,"index2":27,"size":541,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","issuerId":"./index.tsx","issuerName":"./index.tsx","issuerPath":[{"id":0,"identifier":"multi C:\\work\\UUI\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","name":"./index.tsx"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./index.tsx","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","module":"./index.tsx","moduleName":"./index.tsx","type":"cjs require","userRequest":"./src","loc":"4:21-37"}],"providedExports":null,"optimizationBailout":[],"depth":2,"source":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar tslib_1 = require(\"tslib\");\r\ntslib_1.__exportStar(require(\"./types\"), exports);\r\ntslib_1.__exportStar(require(\"./Db\"), exports);\r\ntslib_1.__exportStar(require(\"./DbTable\"), exports);\r\ntslib_1.__exportStar(require(\"./DbRef\"), exports);\r\ntslib_1.__exportStar(require(\"./tempIds\"), exports);\r\ntslib_1.__exportStar(require(\"./utils\"), exports);\r\ntslib_1.__exportStar(require(\"./patchHelpers\"), exports);\r\ntslib_1.__exportStar(require(\"./reactHooks\"), exports);\r\n"},{"id":"./src/patchHelpers.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\patchHelpers.ts","name":"./src/patchHelpers.ts","index":15,"index2":18,"size":9010,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","issuerId":"./src/index.ts","issuerName":"./src/index.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\UUI\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","name":"./src/index.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/DbRef.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\DbRef.ts","module":"./src/DbRef.ts","moduleName":"./src/DbRef.ts","type":"cjs require","userRequest":"./patchHelpers","loc":"5:21-46"},{"moduleId":"./src/index.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","module":"./src/index.ts","moduleName":"./src/index.ts","type":"cjs require","userRequest":"./patchHelpers","loc":"10:21-46"}],"providedExports":null,"optimizationBailout":[],"depth":3,"source":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.getEntityParentDependencies = exports.getParentEntities = exports.hasServerFields = exports.isNew = exports.getId = exports.isClientOnly = exports.makeCumulativePatch = exports.isPatchBlank = exports.flattenResponse = exports.mergeEntityPatches = exports.unionPatches = void 0;\r\nvar tslib_1 = require(\"tslib\");\r\nvar types_1 = require(\"./types\");\r\nvar I = tslib_1.__importStar(require(\"immutable\"));\r\nvar utils_1 = require(\"./utils\");\r\nvar lodash_groupby_1 = tslib_1.__importDefault(require(\"lodash.groupby\"));\r\nvar lodash_map_1 = tslib_1.__importDefault(require(\"lodash.map\"));\r\nvar lodash_merge_1 = tslib_1.__importDefault(require(\"lodash.merge\"));\r\nvar lodash_countby_1 = tslib_1.__importDefault(require(\"lodash.countby\"));\r\nvar lodash_filter_1 = tslib_1.__importDefault(require(\"lodash.filter\"));\r\nvar lodash_foreach_1 = tslib_1.__importDefault(require(\"lodash.foreach\"));\r\nvar lodash_pick_1 = tslib_1.__importDefault(require(\"lodash.pick\"));\r\nfunction unionPatches(patches) {\r\n var result = {};\r\n patches.forEach(function (patch) {\r\n utils_1.objectKeys(patch).forEach(function (tableName) {\r\n result[tableName] = result[tableName] ? tslib_1.__spreadArrays(result[tableName], patch[tableName]) : patch[tableName];\r\n });\r\n });\r\n return result;\r\n}\r\nexports.unionPatches = unionPatches;\r\nfunction mergeEntityPatches(tables, patch) {\r\n var result = {};\r\n utils_1.objectKeys(patch).forEach(function (key) {\r\n var table = tables[key];\r\n var groupedEntities = lodash_groupby_1.default(patch[key], function (item) { return table.getId(item); });\r\n var tablePatch = lodash_map_1.default(groupedEntities, function (entities) {\r\n var result = lodash_merge_1.default.apply(void 0, tslib_1.__spreadArrays([{}], entities));\r\n if (process.env.NODE_ENV !== 'production') {\r\n var props = utils_1.objectKeys(result).filter(function (prop) {\r\n return Object.keys(lodash_countby_1.default(entities.filter(function (entity) {\r\n return entity[prop] !== undefined;\r\n }), function (entity) { return entity[prop]; })).length > 1;\r\n });\r\n if (props.length) {\r\n console.warn.apply(console, tslib_1.__spreadArrays(['mergeEntityPatches: Different property values found for the same entity.\\nProperty names:\\n', props, '\\nEntities:\\n'], entities));\r\n }\r\n }\r\n return result;\r\n });\r\n result[key] = tablePatch;\r\n });\r\n return result;\r\n}\r\nexports.mergeEntityPatches = mergeEntityPatches;\r\nfunction flattenResponseHelper(result, object, tablesByTypeName) {\r\n if (Array.isArray(object)) {\r\n object.forEach(function (item) { return flattenResponseHelper(result, item, tablesByTypeName); });\r\n }\r\n else if (typeof object === 'object') {\r\n var clone = {};\r\n var tableKey = void 0;\r\n var fields = {};\r\n if ('__typename' in object) {\r\n var table = tablesByTypeName[object.__typename];\r\n if (table) {\r\n tableKey = table.schema.tableName;\r\n fields = table.schema.fields;\r\n }\r\n }\r\n for (var key in object) {\r\n var value = object[key];\r\n var field = fields[key];\r\n if ((field && !!field.disableFlatten)\r\n || typeof value !== 'object'\r\n || value === null\r\n || (Array.isArray(value) && value.every(function (item) { return typeof item !== 'object'; }))) {\r\n clone[key] = value;\r\n }\r\n else {\r\n flattenResponseHelper(result, value, tablesByTypeName);\r\n }\r\n }\r\n if (tableKey) {\r\n result[tableKey].push(clone);\r\n }\r\n }\r\n}\r\nfunction flattenResponse(response, tables) {\r\n var result = {};\r\n var tablesByTypeName = {};\r\n Object.values(tables).forEach(function (table) { return tablesByTypeName[table.schema.typeName] = table; });\r\n utils_1.objectKeys(tables).forEach(function (tableName) { return tablesByTypeName; });\r\n utils_1.objectKeys(tables).forEach(function (key) { return result[key] = []; });\r\n flattenResponseHelper(result, response, tablesByTypeName);\r\n return result;\r\n}\r\nexports.flattenResponse = flattenResponse;\r\nfunction isPatchBlank(patch) {\r\n return !utils_1.objectKeys(patch).some(function (key) { return patch[key].length > 0; });\r\n}\r\nexports.isPatchBlank = isPatchBlank;\r\n/**\r\n * Given several patches, creates a new single patch with all fields from all entities in all patches.\r\n */\r\nfunction makeCumulativePatch(updatedDb, patches, clientIdsMap) {\r\n var result = {};\r\n utils_1.objectKeys(updatedDb.tables).forEach(function (entityName) {\r\n var table = updatedDb.tables[entityName];\r\n var schema = table.schema;\r\n var ids = I.Set();\r\n patches.forEach(function (patch) {\r\n var filteredPatch = (patch[entityName] || []).filter(function (entity) { return hasServerFields(entity, schema, clientIdsMap, updatedDb.tables); });\r\n ids = ids.union(filteredPatch.map(function (e) { return table.getId(e); }));\r\n });\r\n var entities = ids\r\n .map(function (id) { return table.byId(id); })\r\n .filter(function (e) { return !isClientOnly(e, schema); })\r\n .toArray();\r\n if (entities.length > 0) {\r\n result[entityName] = entities;\r\n }\r\n });\r\n return result;\r\n}\r\nexports.makeCumulativePatch = makeCumulativePatch;\r\nfunction isClientOnly(entity, schema) {\r\n if (typeof schema.isClientOnly === 'function') {\r\n return schema.isClientOnly(entity);\r\n }\r\n return !!schema.isClientOnly;\r\n}\r\nexports.isClientOnly = isClientOnly;\r\nfunction getId(entity, schema) {\r\n if (typeof schema.primaryKey == 'string') {\r\n return entity[schema.primaryKey];\r\n }\r\n var result = [];\r\n lodash_foreach_1.default(lodash_pick_1.default(entity, schema.primaryKey), function (value) {\r\n result.push(value);\r\n });\r\n return result;\r\n}\r\nexports.getId = getId;\r\nfunction isNew(entity, schema, clientIdsMap) {\r\n var id = getId(entity, schema);\r\n return !clientIdsMap.clientToServer(id);\r\n}\r\nexports.isNew = isNew;\r\nfunction hasServerFields(entity, schema, clientIdsMap, tables) {\r\n var fullEntity = tslib_1.__assign(tslib_1.__assign({}, tables[schema.tableName].byId(entity.id) || {}), entity);\r\n if (isClientOnly(fullEntity, schema)) {\r\n return false;\r\n }\r\n return utils_1.objectKeys(entity).some(function (fieldName) {\r\n var fieldSchema = schema.fields[fieldName];\r\n return !fieldSchema || !(fieldSchema.isClientOnly || fieldSchema.isReadOnly || (fieldSchema.isGenerated && !isNew(entity, schema, clientIdsMap)));\r\n });\r\n}\r\nexports.hasServerFields = hasServerFields;\r\nfunction getParentEntities(patch, tables) {\r\n var dependenciesPatch = {};\r\n utils_1.objectKeys(patch).forEach(function (key) {\r\n var table = tables[key];\r\n var tableSchema = table.schema;\r\n var fields = lodash_filter_1.default(lodash_map_1.default(tableSchema.fields, function (field, name) { return (tslib_1.__assign(tslib_1.__assign({}, field), { name: name })); }), function (field) { return field.fk && field.fk.relationType == types_1.DbRelationType.Aggregation; });\r\n var tablePatch = patch[key];\r\n fields.forEach(function (field) {\r\n var tableName = field.fk.tableName, name = field.name;\r\n tablePatch.forEach(function (entity) {\r\n var actualTableName = (typeof tableName == 'function' ? tableName(entity) : tableName);\r\n var dbEntity = table.byId(table.getId(entity));\r\n var parentEntity = tables[actualTableName].byId(dbEntity[name]);\r\n var idFields = lodash_pick_1.default(parentEntity, tables[actualTableName].schema.primaryKey);\r\n if (parentEntity) {\r\n dependenciesPatch[actualTableName] = dependenciesPatch[actualTableName] || [];\r\n dependenciesPatch[actualTableName].push(idFields);\r\n }\r\n });\r\n });\r\n });\r\n return dependenciesPatch;\r\n}\r\nexports.getParentEntities = getParentEntities;\r\nfunction getEntityParentDependencies(entity, entityName, tables) {\r\n var _a;\r\n var patch = (_a = {}, _a[entityName] = [entity], _a);\r\n var resultPatches = [];\r\n while (true) {\r\n var parents = getParentEntities(patch, tables);\r\n if (isPatchBlank(parents)) {\r\n break;\r\n }\r\n resultPatches.push(parents);\r\n patch = parents;\r\n }\r\n var result = unionPatches(tslib_1.__spreadArrays([patch], resultPatches));\r\n result = mergeEntityPatches(tables, result);\r\n return result;\r\n}\r\nexports.getEntityParentDependencies = getEntityParentDependencies;\r\n"},{"id":"./src/reactHooks.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\reactHooks.ts","name":"./src/reactHooks.ts","index":28,"index2":26,"size":883,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","issuerId":"./src/index.ts","issuerName":"./src/index.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\UUI\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","name":"./src/index.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/index.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","module":"./src/index.ts","moduleName":"./src/index.ts","type":"cjs require","userRequest":"./reactHooks","loc":"11:21-44"}],"providedExports":null,"optimizationBailout":[],"depth":3,"source":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.useDbView = exports.useDbRef = exports.DbContext = void 0;\r\nvar tslib_1 = require(\"tslib\");\r\nvar react_1 = require(\"react\");\r\nexports.DbContext = react_1.createContext(null);\r\nfunction useDbRef() {\r\n return react_1.useContext(exports.DbContext);\r\n}\r\nexports.useDbRef = useDbRef;\r\nfunction useDbView(fn, params, options) {\r\n var dbRef = useDbRef();\r\n var _a = react_1.useState(), state = _a[0], setState = _a[1];\r\n var subscription = react_1.useMemo(function () { return dbRef.subscribe(tslib_1.__assign({ compute: fn }, options), params, setState); }, []);\r\n subscription.update(params);\r\n react_1.useEffect(function () {\r\n return function () { return subscription.unsubscribe(); };\r\n }, []);\r\n return subscription.currentValue;\r\n}\r\nexports.useDbView = useDbView;\r\n"},{"id":"./src/tempIds.tsx","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\tempIds.tsx","name":"./src/tempIds.tsx","index":23,"index2":19,"size":8557,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","issuerId":"./src/index.ts","issuerName":"./src/index.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\UUI\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","name":"./src/index.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/DbRef.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\DbRef.ts","module":"./src/DbRef.ts","moduleName":"./src/DbRef.ts","type":"cjs require","userRequest":"./tempIds","loc":"6:16-36"},{"moduleId":"./src/index.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","module":"./src/index.ts","moduleName":"./src/index.ts","type":"cjs require","userRequest":"./tempIds","loc":"8:21-41"}],"providedExports":null,"optimizationBailout":[],"depth":3,"source":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.TempIdMap = exports.isTempId = exports.getTempId = void 0;\r\nvar tslib_1 = require(\"tslib\");\r\nvar utils_1 = require(\"./utils\");\r\nvar lastTempId = -1;\r\nfunction getTempId() {\r\n return --lastTempId;\r\n}\r\nexports.getTempId = getTempId;\r\nfunction isTempId(val) {\r\n return typeof val === 'number' && val < 0;\r\n}\r\nexports.isTempId = isTempId;\r\nvar TempIdMap = /** @class */ (function () {\r\n function TempIdMap(db) {\r\n var _this = this;\r\n this.db = db;\r\n this.serverToClientIds = new Map();\r\n this.clientToServerIds = new Map();\r\n this.clientToServer = function (id) { return _this.clientToServerIds.get(id); };\r\n this.serverToClient = function (tableName, id) { return _this.getServerToClientMap(tableName).get(id); };\r\n this.clientToServerRequest = function (request) {\r\n request = tslib_1.__assign({}, request);\r\n if (request.filter) {\r\n request.filter = _this.clientToServerDataFilter(request.filter);\r\n }\r\n return request;\r\n };\r\n this.clientToServerDataFilter = function (filter) {\r\n filter = tslib_1.__assign({}, filter);\r\n var keys = Object.keys(filter);\r\n // I hope that we can rely that there won't be any negative numbers, which are not IDs, in queries.\r\n // We need to invent better heuristics or a schema otherwise.\r\n var clientToServer = function (id) {\r\n var found = _this.clientToServer(id);\r\n if (found) {\r\n return found;\r\n }\r\n else {\r\n return id;\r\n }\r\n };\r\n for (var n = 0; n < keys.length; n++) {\r\n var key = keys[n];\r\n var condition = filter[key];\r\n if (condition != null && typeof condition === \"object\") {\r\n condition = tslib_1.__assign({}, condition);\r\n if ('in' in condition && Array.isArray(condition.in) && condition.in.length) {\r\n condition.in = condition.in.map(clientToServer);\r\n }\r\n }\r\n else {\r\n condition = clientToServer(condition);\r\n }\r\n filter[key] = condition;\r\n }\r\n return filter;\r\n };\r\n }\r\n TempIdMap.prototype.copyPatch = function (patch) {\r\n var newPatch = tslib_1.__assign({}, patch);\r\n utils_1.objectKeys(patch).forEach(function (tableName) {\r\n var tablePatch = patch[tableName].map(function (entityPatch) { return (tslib_1.__assign({}, entityPatch)); });\r\n newPatch[tableName] = tablePatch;\r\n });\r\n return newPatch;\r\n };\r\n // Iterate thru every field in every patch for every table, matching certain field criteria. The patch is mutated!\r\n TempIdMap.prototype.mapFields = function (patch, filter, callback) {\r\n var _this = this;\r\n utils_1.objectKeys(patch).forEach(function (tableName) {\r\n var schema = _this.db.tables[tableName].schema;\r\n var fields = utils_1.objectKeys(schema.fields || [])\r\n .map(function (fieldName) {\r\n var fieldSchema = schema.fields[fieldName];\r\n if (filter(fieldSchema, fieldName)) {\r\n return { name: fieldName, schema: fieldSchema };\r\n }\r\n })\r\n .filter(function (f) { return !!f; });\r\n if (!fields.length) {\r\n return;\r\n }\r\n patch[tableName].forEach(function (entityPatch) {\r\n for (var n = 0; n < fields.length; n++) {\r\n var field = fields[n];\r\n var fieldValue = entityPatch[field.name];\r\n callback(field.name, field.schema, fieldValue, entityPatch, tableName);\r\n }\r\n });\r\n });\r\n };\r\n TempIdMap.prototype.getServerToClientMap = function (tableName) {\r\n var existing = this.serverToClientIds.get(tableName);\r\n if (existing) {\r\n return existing;\r\n }\r\n else {\r\n var newMap = new Map();\r\n this.serverToClientIds.set(tableName, newMap);\r\n return newMap;\r\n }\r\n };\r\n TempIdMap.prototype.serverToClientPatch = function (patch) {\r\n var _this = this;\r\n patch = this.copyPatch(patch);\r\n // We map PK in a separate pass, as we need to remap all PKs before re-mapping FKs\r\n this.mapFields(patch, function (f) { return f.isGenerated; }, function (fieldName, fieldSchema, fieldValue, entityPatch, tableName) {\r\n var clientId = _this.getServerToClientMap(tableName).get(fieldValue);\r\n if (!clientId) {\r\n clientId = getTempId();\r\n _this.clientToServerIds.set(clientId, fieldValue);\r\n _this.getServerToClientMap(tableName).set(fieldValue, clientId);\r\n }\r\n entityPatch[fieldName] = clientId;\r\n });\r\n this.mapFields(patch, function (f) { return !!(f.fk || (f.default != null) || f.toClient); }, function (fieldName, fieldSchema, fieldValue, entityPatch, tableName) {\r\n var isUndefined = typeof (fieldValue) === 'undefined';\r\n if (fieldSchema.default != null && fieldValue == null) {\r\n fieldValue = fieldSchema.default;\r\n isUndefined = false;\r\n }\r\n if (fieldSchema.fk && fieldValue != null) {\r\n var fkTableName = typeof fieldSchema.fk.tableName === 'function' ? fieldSchema.fk.tableName(entityPatch) : fieldSchema.fk.tableName;\r\n var clientId = _this.getServerToClientMap(fkTableName).get(fieldValue);\r\n if (!clientId) {\r\n clientId = getTempId();\r\n _this.clientToServerIds.set(clientId, fieldValue);\r\n _this.getServerToClientMap(fkTableName).set(fieldValue, clientId);\r\n }\r\n fieldValue = clientId;\r\n }\r\n if (!isUndefined && fieldSchema.toClient) {\r\n fieldValue = fieldSchema.toClient(fieldValue);\r\n }\r\n if (!isUndefined) {\r\n entityPatch[fieldName] = fieldValue;\r\n }\r\n });\r\n return patch;\r\n };\r\n TempIdMap.prototype.clientToServerPatch = function (patch) {\r\n var _this = this;\r\n patch = this.copyPatch(patch);\r\n this.mapFields(patch, function (f) { return f.isGenerated || !!f.fk; }, function (fieldName, fieldSchema, fieldValue, entityPatch, tableName) {\r\n if (fieldValue != null) {\r\n var existingId = _this.clientToServerIds.get(fieldValue);\r\n if (existingId) {\r\n entityPatch[fieldName] = existingId;\r\n }\r\n }\r\n });\r\n this.mapFields(patch, function (f) { return !(f.isClientOnly || f.isReadOnly) && !!f.toServer; }, function (fieldName, fieldSchema, fieldValue, entityPatch, tableName) {\r\n entityPatch[fieldName] = fieldSchema.toServer(entityPatch[fieldName]);\r\n });\r\n this.mapFields(patch, function (meta) { return meta.isClientOnly || meta.isReadOnly; }, function (fieldName, fieldSchema, fieldValue, entityPatch, tableName) {\r\n delete entityPatch[fieldName];\r\n });\r\n return patch;\r\n };\r\n TempIdMap.prototype.appendServerMapping = function (response) {\r\n var _this = this;\r\n utils_1.objectKeys(response.submit).forEach(function (tableName) {\r\n if (_this.db.tables[tableName]) {\r\n var tablePatch = response.submit[tableName];\r\n if (tablePatch) {\r\n var serverToClientIds_1 = _this.getServerToClientMap(tableName);\r\n var table_1 = _this.db.tables[tableName];\r\n tablePatch.forEach(function (patch) {\r\n if (isTempId(patch.id)) {\r\n var clientId = patch.id;\r\n var serverId = table_1.getId(patch.payload);\r\n serverToClientIds_1.set(serverId, clientId);\r\n _this.clientToServerIds.set(clientId, serverId);\r\n }\r\n });\r\n }\r\n }\r\n });\r\n };\r\n return TempIdMap;\r\n}());\r\nexports.TempIdMap = TempIdMap;\r\n"},{"id":"./src/types.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\types.ts","name":"./src/types.ts","index":4,"index2":1,"size":387,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","issuerId":"./src/index.ts","issuerName":"./src/index.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\UUI\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","name":"./src/index.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/index.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","module":"./src/index.ts","moduleName":"./src/index.ts","type":"cjs require","userRequest":"./types","loc":"4:21-39"},{"moduleId":"./src/patchHelpers.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\patchHelpers.ts","module":"./src/patchHelpers.ts","moduleName":"./src/patchHelpers.ts","type":"cjs require","userRequest":"./types","loc":"5:14-32"}],"providedExports":null,"optimizationBailout":[],"depth":3,"source":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.DbRelationType = void 0;\r\nvar DbRelationType;\r\n(function (DbRelationType) {\r\n DbRelationType[DbRelationType[\"Aggregation\"] = 0] = \"Aggregation\";\r\n DbRelationType[DbRelationType[\"Association\"] = 1] = \"Association\";\r\n})(DbRelationType = exports.DbRelationType || (exports.DbRelationType = {}));\r\n"},{"id":"./src/utils.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\utils.ts","name":"./src/utils.ts","index":6,"index2":6,"size":1818,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","issuerId":"./src/index.ts","issuerName":"./src/index.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\UUI\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","name":"./src/index.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/Db.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\Db.ts","module":"./src/Db.ts","moduleName":"./src/Db.ts","type":"cjs require","userRequest":"./utils","loc":"5:14-32"},{"moduleId":"./src/DbRef.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\DbRef.ts","module":"./src/DbRef.ts","moduleName":"./src/DbRef.ts","type":"cjs require","userRequest":"./utils","loc":"7:14-32"},{"moduleId":"./src/index.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","module":"./src/index.ts","moduleName":"./src/index.ts","type":"cjs require","userRequest":"./utils","loc":"9:21-39"},{"moduleId":"./src/patchHelpers.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\patchHelpers.ts","module":"./src/patchHelpers.ts","moduleName":"./src/patchHelpers.ts","type":"cjs require","userRequest":"./utils","loc":"7:14-32"},{"moduleId":"./src/tempIds.tsx","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\tempIds.tsx","module":"./src/tempIds.tsx","moduleName":"./src/tempIds.tsx","type":"cjs require","userRequest":"./utils","loc":"5:14-32"}],"providedExports":null,"optimizationBailout":[],"depth":3,"source":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.difference = exports.defaultCompareViewDependencies = exports.objectKeys = void 0;\r\nvar tslib_1 = require(\"tslib\");\r\nvar shallowequal_1 = tslib_1.__importDefault(require(\"shallowequal\"));\r\nvar lodash_zip_1 = tslib_1.__importDefault(require(\"lodash.zip\"));\r\nvar lodash_transform_1 = tslib_1.__importDefault(require(\"lodash.transform\"));\r\nvar lodash_isequal_1 = tslib_1.__importDefault(require(\"lodash.isequal\"));\r\n// TBD: New typescript would contain better typing for this. Remove this hack after update.\r\nexports.objectKeys = Object.keys;\r\nfunction defaultCompareViewDependencies(prev, next) {\r\n if (Array.isArray(prev) && Array.isArray(next)) {\r\n if (prev.length === next.length) {\r\n return lodash_zip_1.default(prev, next).every(function (_a) {\r\n var p = _a[0], n = _a[1];\r\n return shallowequal_1.default(p, n);\r\n });\r\n }\r\n return false;\r\n }\r\n return shallowequal_1.default(prev, next);\r\n}\r\nexports.defaultCompareViewDependencies = defaultCompareViewDependencies;\r\n/**\r\n * Deep diff between two object, using lodash\r\n * @param {Object} object Object compared\r\n * @param {Object} base Object to compare with\r\n * @return {Object} Return a new object who represent the diff\r\n */\r\nfunction difference(object, base) {\r\n function changes(object, base) {\r\n return lodash_transform_1.default(object, function (result, value, key) {\r\n if (!lodash_isequal_1.default(value, base[key])) {\r\n result[key] = (typeof value === \"object\" && typeof base[key] === \"object\") ? changes(value, base[key]) : value;\r\n }\r\n });\r\n }\r\n return changes(object, base);\r\n}\r\nexports.difference = difference;\r\n"},{"id":"@epam/uui","identifier":"external \"@epam/uui\"","name":"external \"@epam/uui\"","index":13,"index2":9,"size":42,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\DbTable.ts","issuerId":"./src/DbTable.ts","issuerName":"./src/DbTable.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\UUI\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/DbTable.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\DbTable.ts","name":"./src/DbTable.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/DbTable.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\DbTable.ts","module":"./src/DbTable.ts","moduleName":"./src/DbTable.ts","type":"cjs require","userRequest":"@epam/uui","loc":"6:12-32"}],"providedExports":null,"optimizationBailout":[],"depth":4},{"id":"immutable","identifier":"external \"immutable\"","name":"external \"immutable\"","index":12,"index2":8,"size":42,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\DbTable.ts","issuerId":"./src/DbTable.ts","issuerName":"./src/DbTable.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\UUI\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/DbTable.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\DbTable.ts","name":"./src/DbTable.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/DbTable.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\DbTable.ts","module":"./src/DbTable.ts","moduleName":"./src/DbTable.ts","type":"cjs require","userRequest":"immutable","loc":"5:29-49"},{"moduleId":"./src/DbTable.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\DbTable.ts","module":"./src/DbTable.ts","moduleName":"./src/DbTable.ts","type":"cjs require","userRequest":"immutable","loc":"7:18-38"},{"moduleId":"./src/patchHelpers.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\patchHelpers.ts","module":"./src/patchHelpers.ts","moduleName":"./src/patchHelpers.ts","type":"cjs require","userRequest":"immutable","loc":"6:29-49"}],"providedExports":null,"optimizationBailout":[],"depth":4},{"id":"lodash.countby","identifier":"external \"lodash.countby\"","name":"external \"lodash.countby\"","index":19,"index2":14,"size":42,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\patchHelpers.ts","issuerId":"./src/patchHelpers.ts","issuerName":"./src/patchHelpers.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\UUI\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/patchHelpers.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\patchHelpers.ts","name":"./src/patchHelpers.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/patchHelpers.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\patchHelpers.ts","module":"./src/patchHelpers.ts","moduleName":"./src/patchHelpers.ts","type":"cjs require","userRequest":"lodash.countby","loc":"11:47-72"}],"providedExports":null,"optimizationBailout":[],"depth":4},{"id":"lodash.filter","identifier":"external \"lodash.filter\"","name":"external \"lodash.filter\"","index":20,"index2":15,"size":42,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\patchHelpers.ts","issuerId":"./src/patchHelpers.ts","issuerName":"./src/patchHelpers.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\UUI\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/patchHelpers.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\patchHelpers.ts","name":"./src/patchHelpers.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/patchHelpers.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\patchHelpers.ts","module":"./src/patchHelpers.ts","moduleName":"./src/patchHelpers.ts","type":"cjs require","userRequest":"lodash.filter","loc":"12:46-70"}],"providedExports":null,"optimizationBailout":[],"depth":4},{"id":"lodash.foreach","identifier":"external \"lodash.foreach\"","name":"external \"lodash.foreach\"","index":21,"index2":16,"size":42,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\patchHelpers.ts","issuerId":"./src/patchHelpers.ts","issuerName":"./src/patchHelpers.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\UUI\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/patchHelpers.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\patchHelpers.ts","name":"./src/patchHelpers.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/patchHelpers.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\patchHelpers.ts","module":"./src/patchHelpers.ts","moduleName":"./src/patchHelpers.ts","type":"cjs require","userRequest":"lodash.foreach","loc":"13:47-72"}],"providedExports":null,"optimizationBailout":[],"depth":4},{"id":"lodash.groupby","identifier":"external \"lodash.groupby\"","name":"external \"lodash.groupby\"","index":16,"index2":11,"size":42,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\patchHelpers.ts","issuerId":"./src/patchHelpers.ts","issuerName":"./src/patchHelpers.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\UUI\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/patchHelpers.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\patchHelpers.ts","name":"./src/patchHelpers.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/patchHelpers.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\patchHelpers.ts","module":"./src/patchHelpers.ts","moduleName":"./src/patchHelpers.ts","type":"cjs require","userRequest":"lodash.groupby","loc":"8:47-72"}],"providedExports":null,"optimizationBailout":[],"depth":4},{"id":"lodash.isempty","identifier":"external \"lodash.isempty\"","name":"external \"lodash.isempty\"","index":24,"index2":20,"size":42,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\DbRef.ts","issuerId":"./src/DbRef.ts","issuerName":"./src/DbRef.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\UUI\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/DbRef.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\DbRef.ts","name":"./src/DbRef.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/DbRef.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\DbRef.ts","module":"./src/DbRef.ts","moduleName":"./src/DbRef.ts","type":"cjs require","userRequest":"lodash.isempty","loc":"8:47-72"}],"providedExports":null,"optimizationBailout":[],"depth":4},{"id":"lodash.isequal","identifier":"external \"lodash.isequal\"","name":"external \"lodash.isequal\"","index":10,"index2":5,"size":42,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\Db.ts","issuerId":"./src/Db.ts","issuerName":"./src/Db.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\UUI\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/Db.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\Db.ts","name":"./src/Db.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/Db.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\Db.ts","module":"./src/Db.ts","moduleName":"./src/Db.ts","type":"cjs require","userRequest":"lodash.isequal","loc":"6:47-72"},{"moduleId":"./src/utils.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\utils.ts","module":"./src/utils.ts","moduleName":"./src/utils.ts","type":"cjs require","userRequest":"lodash.isequal","loc":"8:47-72"}],"providedExports":null,"optimizationBailout":[],"depth":4},{"id":"lodash.map","identifier":"external \"lodash.map\"","name":"external \"lodash.map\"","index":17,"index2":12,"size":42,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\patchHelpers.ts","issuerId":"./src/patchHelpers.ts","issuerName":"./src/patchHelpers.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\UUI\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/patchHelpers.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\patchHelpers.ts","name":"./src/patchHelpers.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/patchHelpers.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\patchHelpers.ts","module":"./src/patchHelpers.ts","moduleName":"./src/patchHelpers.ts","type":"cjs require","userRequest":"lodash.map","loc":"9:43-64"}],"providedExports":null,"optimizationBailout":[],"depth":4},{"id":"lodash.merge","identifier":"external \"lodash.merge\"","name":"external \"lodash.merge\"","index":18,"index2":13,"size":42,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\patchHelpers.ts","issuerId":"./src/patchHelpers.ts","issuerName":"./src/patchHelpers.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\UUI\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/patchHelpers.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\patchHelpers.ts","name":"./src/patchHelpers.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/patchHelpers.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\patchHelpers.ts","module":"./src/patchHelpers.ts","moduleName":"./src/patchHelpers.ts","type":"cjs require","userRequest":"lodash.merge","loc":"10:45-68"}],"providedExports":null,"optimizationBailout":[],"depth":4},{"id":"lodash.pick","identifier":"external \"lodash.pick\"","name":"external \"lodash.pick\"","index":22,"index2":17,"size":42,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\patchHelpers.ts","issuerId":"./src/patchHelpers.ts","issuerName":"./src/patchHelpers.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\UUI\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/patchHelpers.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\patchHelpers.ts","name":"./src/patchHelpers.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/patchHelpers.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\patchHelpers.ts","module":"./src/patchHelpers.ts","moduleName":"./src/patchHelpers.ts","type":"cjs require","userRequest":"lodash.pick","loc":"14:44-66"}],"providedExports":null,"optimizationBailout":[],"depth":4},{"id":"lodash.transform","identifier":"external \"lodash.transform\"","name":"external \"lodash.transform\"","index":9,"index2":4,"size":42,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\utils.ts","issuerId":"./src/utils.ts","issuerName":"./src/utils.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\UUI\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/utils.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\utils.ts","name":"./src/utils.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/utils.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\utils.ts","module":"./src/utils.ts","moduleName":"./src/utils.ts","type":"cjs require","userRequest":"lodash.transform","loc":"7:49-76"}],"providedExports":null,"optimizationBailout":[],"depth":4},{"id":"lodash.zip","identifier":"external \"lodash.zip\"","name":"external \"lodash.zip\"","index":8,"index2":3,"size":42,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\utils.ts","issuerId":"./src/utils.ts","issuerName":"./src/utils.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\UUI\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/utils.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\utils.ts","name":"./src/utils.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/utils.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\utils.ts","module":"./src/utils.ts","moduleName":"./src/utils.ts","type":"cjs require","userRequest":"lodash.zip","loc":"6:43-64"}],"providedExports":null,"optimizationBailout":[],"depth":4},{"id":"react","identifier":"external \"react\"","name":"external \"react\"","index":29,"index2":25,"size":42,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\reactHooks.ts","issuerId":"./src/reactHooks.ts","issuerName":"./src/reactHooks.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\UUI\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/reactHooks.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\reactHooks.ts","name":"./src/reactHooks.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/reactHooks.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\reactHooks.ts","module":"./src/reactHooks.ts","moduleName":"./src/reactHooks.ts","type":"cjs require","userRequest":"react","loc":"5:14-30"}],"providedExports":null,"optimizationBailout":[],"depth":4},{"id":"shallowequal","identifier":"external \"shallowequal\"","name":"external \"shallowequal\"","index":7,"index2":2,"size":42,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\utils.ts","issuerId":"./src/utils.ts","issuerName":"./src/utils.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\UUI\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/utils.ts","identifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\utils.ts","name":"./src/utils.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/utils.ts","moduleIdentifier":"C:\\work\\UUI\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\UUI\\uui-db\\src\\utils.ts","module":"./src/utils.ts","moduleName":"./src/utils.ts","type":"cjs require","userRequest":"shallowequal","loc":"5:45-68"}],"providedExports":null,"optimizationBailout":[],"depth":4}],"filteredModules":0,"logging":{"webpack.buildChunkGraph.visitModules":{"entries":[],"filteredEntries":2,"debug":false}},"children":[]}
|
|
1
|
+
{"errors":[],"warnings":[],"version":"4.44.2","hash":"6e0ab64ea8bdf61c14e4","time":31538,"builtAt":1642007345874,"publicPath":"/","outputPath":"C:\\work\\uui\\uui-db\\build","assetsByChunkName":{"main":["index.js","index.js.map"]},"assets":[{"name":"index.d.ts","size":59,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"index.d.ts.map","size":120,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"index.js","size":77821,"chunks":["main"],"chunkNames":["main"],"info":{},"emitted":true},{"name":"index.js.map","size":118503,"chunks":["main"],"chunkNames":["main"],"info":{"development":true},"emitted":true},{"name":"src\\Db.d.ts","size":616,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\Db.d.ts.map","size":697,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\DbRef.d.ts","size":2396,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\DbRef.d.ts.map","size":2260,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\DbTable.d.ts","size":1592,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\DbTable.d.ts.map","size":1780,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\IxSet.d.ts","size":1080,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\IxSet.d.ts.map","size":1178,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\ListLoadingTracker.d.ts","size":868,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\ListLoadingTracker.d.ts.map","size":807,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\Loader.d.ts","size":1121,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\Loader.d.ts.map","size":1171,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\Scheduler.d.ts","size":563,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\Scheduler.d.ts.map","size":640,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\SimpleLoadingTracker.d.ts","size":361,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\SimpleLoadingTracker.d.ts.map","size":391,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\__benchmarks__\\filter.d.ts","size":48,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\__benchmarks__\\filter.d.ts.map","size":127,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\__benchmarks__\\index.d.ts","size":76,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\__benchmarks__\\index.d.ts.map","size":165,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\__benchmarks__\\pkLookup.d.ts","size":50,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\__benchmarks__\\pkLookup.d.ts.map","size":131,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\__benchmarks__\\pkUpdate.d.ts","size":50,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\__benchmarks__\\pkUpdate.d.ts.map","size":131,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\__benchmarks__\\query.d.ts","size":47,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\__benchmarks__\\query.d.ts.map","size":125,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\__benchmarks__\\sorting.d.ts","size":49,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\__benchmarks__\\sorting.d.ts.map","size":129,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\__benchmarks__\\testData.d.ts","size":421,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\__benchmarks__\\testData.d.ts.map","size":405,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\index.d.ts","size":256,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\index.d.ts.map","size":275,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\patchHelpers.d.ts","size":2086,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\patchHelpers.d.ts.map","size":2047,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\reactHooks.d.ts","size":533,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\reactHooks.d.ts.map","size":577,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\tempIds.d.ts","size":1582,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\tempIds.d.ts.map","size":1500,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\types.d.ts","size":5172,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\types.d.ts.map","size":5337,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\utils.d.ts","size":471,"chunks":[],"chunkNames":[],"info":{},"emitted":true},{"name":"src\\utils.d.ts.map","size":360,"chunks":[],"chunkNames":[],"info":{},"emitted":true}],"filteredAssets":0,"entrypoints":{"main":{"chunks":["main"],"assets":["index.js","index.js.map"],"children":{},"childAssets":{}}},"namedChunkGroups":{"main":{"chunks":["main"],"assets":["index.js","index.js.map"],"children":{},"childAssets":{}}},"chunks":[{"id":"main","rendered":true,"initial":true,"entry":true,"size":62644,"names":["main"],"files":["index.js","index.js.map"],"hash":"ff7b465ab4dae96a90e1","siblings":[],"parents":[],"children":[],"childrenByOrder":{},"modules":[{"id":0,"identifier":"multi C:\\work\\uui\\uui-db\\index.tsx","name":"multi ./index.tsx","index":0,"index2":29,"size":28,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":null,"issuerId":null,"issuerName":null,"issuerPath":null,"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":null,"moduleIdentifier":null,"module":null,"moduleName":null,"type":"multi entry"}],"providedExports":null,"optimizationBailout":[],"depth":0},{"id":"../node_modules/tslib/tslib.es6.js","identifier":"C:\\work\\uui\\node_modules\\tslib\\tslib.es6.js","name":"../node_modules/tslib/tslib.es6.js","index":2,"index2":0,"size":10274,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","issuerId":"./index.tsx","issuerName":"./index.tsx","issuerPath":[{"id":0,"identifier":"multi C:\\work\\uui\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","name":"./index.tsx"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./index.tsx","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","module":"./index.tsx","moduleName":"./index.tsx","type":"cjs require","userRequest":"tslib","loc":"3:14-30"},{"moduleId":"./src/Db.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\Db.ts","module":"./src/Db.ts","moduleName":"./src/Db.ts","type":"cjs require","userRequest":"tslib","loc":"4:14-30"},{"moduleId":"./src/DbRef.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\DbRef.ts","module":"./src/DbRef.ts","moduleName":"./src/DbRef.ts","type":"cjs require","userRequest":"tslib","loc":"4:14-30"},{"moduleId":"./src/DbTable.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\DbTable.ts","module":"./src/DbTable.ts","moduleName":"./src/DbTable.ts","type":"cjs require","userRequest":"tslib","loc":"4:14-30"},{"moduleId":"./src/ListLoadingTracker.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\ListLoadingTracker.ts","module":"./src/ListLoadingTracker.ts","moduleName":"./src/ListLoadingTracker.ts","type":"cjs require","userRequest":"tslib","loc":"4:14-30"},{"moduleId":"./src/index.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","module":"./src/index.ts","moduleName":"./src/index.ts","type":"cjs require","userRequest":"tslib","loc":"3:14-30"},{"moduleId":"./src/patchHelpers.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\patchHelpers.ts","module":"./src/patchHelpers.ts","moduleName":"./src/patchHelpers.ts","type":"cjs require","userRequest":"tslib","loc":"4:14-30"},{"moduleId":"./src/reactHooks.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\reactHooks.ts","module":"./src/reactHooks.ts","moduleName":"./src/reactHooks.ts","type":"cjs require","userRequest":"tslib","loc":"4:14-30"},{"moduleId":"./src/tempIds.tsx","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\tempIds.tsx","module":"./src/tempIds.tsx","moduleName":"./src/tempIds.tsx","type":"cjs require","userRequest":"tslib","loc":"4:14-30"},{"moduleId":"./src/utils.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\utils.ts","module":"./src/utils.ts","moduleName":"./src/utils.ts","type":"cjs require","userRequest":"tslib","loc":"4:14-30"}],"providedExports":["__extends","__assign","__rest","__decorate","__param","__metadata","__awaiter","__generator","__createBinding","__exportStar","__values","__read","__spread","__spreadArrays","__await","__asyncGenerator","__asyncDelegator","__asyncValues","__makeTemplateObject","__importStar","__importDefault","__classPrivateFieldGet","__classPrivateFieldSet"],"optimizationBailout":[],"depth":2,"source":"/*! *****************************************************************************\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\nexport function __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}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n"},{"id":"./index.tsx","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","name":"./index.tsx","index":1,"index2":28,"size":162,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"multi C:\\work\\uui\\uui-db\\index.tsx","issuerId":0,"issuerName":"multi ./index.tsx","issuerPath":[{"id":0,"identifier":"multi C:\\work\\uui\\uui-db\\index.tsx","name":"multi ./index.tsx"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":0,"moduleIdentifier":"multi C:\\work\\uui\\uui-db\\index.tsx","module":"multi ./index.tsx","moduleName":"multi ./index.tsx","type":"single entry","userRequest":"C:\\work\\uui\\uui-db\\index.tsx","loc":"main[0]"}],"providedExports":null,"optimizationBailout":[],"depth":1,"source":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar tslib_1 = require(\"tslib\");\r\ntslib_1.__exportStar(require(\"./src\"), exports);\r\n"},{"id":"./src/Db.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\Db.ts","name":"./src/Db.ts","index":5,"index2":7,"size":2893,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","issuerId":"./src/index.ts","issuerName":"./src/index.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\uui\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","name":"./src/index.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/index.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","module":"./src/index.ts","moduleName":"./src/index.ts","type":"cjs require","userRequest":"./Db","loc":"5:21-36"}],"providedExports":null,"optimizationBailout":[],"depth":3,"source":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.Db = void 0;\r\nvar tslib_1 = require(\"tslib\");\r\nvar utils_1 = require(\"./utils\");\r\nvar lodash_isequal_1 = tslib_1.__importDefault(require(\"lodash.isequal\"));\r\nvar Db = /** @class */ (function () {\r\n function Db(tables, reusedCache) {\r\n this.tables = tables;\r\n this.viewCache = new Map();\r\n /* Views (cached db projections) */\r\n this.valueAbsent = Symbol(\"ValueAbsent\");\r\n if (reusedCache) {\r\n this.viewCache = new Map(reusedCache);\r\n }\r\n else {\r\n this.viewCache = new Map();\r\n }\r\n }\r\n Db.prototype.update = function (mutate) {\r\n var clone = new this.constructor(tslib_1.__assign({}, this.tables), this.viewCache);\r\n mutate(clone);\r\n return clone;\r\n };\r\n Db.prototype.with = function (patch) {\r\n return this.update(function (db) {\r\n utils_1.objectKeys(db.tables).forEach(function (entityName) {\r\n if (patch[entityName]) {\r\n db.tables[entityName] = db.tables[entityName].with(patch[entityName]);\r\n }\r\n });\r\n });\r\n };\r\n Db.prototype.runView = function (view, params) {\r\n var cache = this.viewCache.get(view);\r\n if (!cache) {\r\n cache = new Map();\r\n this.viewCache.set(view, cache);\r\n }\r\n var key = view.getKey ? view.getKey(params) : JSON.stringify(params);\r\n var cacheItem = cache.get(key);\r\n if (!cacheItem) {\r\n cacheItem = {\r\n dependencies: this.valueAbsent,\r\n currentValue: this.valueAbsent,\r\n computedOnDb: this.valueAbsent,\r\n };\r\n cache.set(key, cacheItem);\r\n }\r\n var shouldUpdate = this !== cacheItem.computedOnDb;\r\n var dependencies = this.valueAbsent;\r\n if (view.getDependencies) {\r\n var compare = view.compareDependencies || utils_1.defaultCompareViewDependencies;\r\n dependencies = view.getDependencies(this, params);\r\n shouldUpdate = !compare(cacheItem.dependencies, dependencies);\r\n }\r\n var previousValue = cacheItem.currentValue;\r\n if (shouldUpdate) {\r\n cacheItem.dependencies = dependencies;\r\n var newValue = view.compute(this, params, dependencies);\r\n cacheItem.computedOnDb = this;\r\n var compareResults = view.compareResults || lodash_isequal_1.default;\r\n if (!compareResults(previousValue, newValue)) {\r\n if (view.traceDiff) {\r\n console.debug(utils_1.difference(previousValue, newValue));\r\n }\r\n cacheItem.currentValue = newValue;\r\n }\r\n }\r\n return cacheItem.currentValue;\r\n };\r\n return Db;\r\n}());\r\nexports.Db = Db;\r\n"},{"id":"./src/DbRef.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\DbRef.ts","name":"./src/DbRef.ts","index":14,"index2":24,"size":9791,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","issuerId":"./src/index.ts","issuerName":"./src/index.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\uui\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","name":"./src/index.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/index.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","module":"./src/index.ts","moduleName":"./src/index.ts","type":"cjs require","userRequest":"./DbRef","loc":"7:21-39"}],"providedExports":null,"optimizationBailout":[],"depth":3,"source":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.DbRef = void 0;\r\nvar tslib_1 = require(\"tslib\");\r\nvar patchHelpers_1 = require(\"./patchHelpers\");\r\nvar tempIds_1 = require(\"./tempIds\");\r\nvar utils_1 = require(\"./utils\");\r\nvar lodash_isempty_1 = tslib_1.__importDefault(require(\"lodash.isempty\"));\r\nvar Loader_1 = require(\"./Loader\");\r\nvar SimpleLoadingTracker_1 = require(\"./SimpleLoadingTracker\");\r\nvar ListLoadingTracker_1 = require(\"./ListLoadingTracker\");\r\nvar DbRef = /** @class */ (function () {\r\n function DbRef(blank) {\r\n var _this = this;\r\n this.blank = blank;\r\n this.log = [];\r\n this.autoSave = true;\r\n this.savedPoint = 0;\r\n this.errors = [];\r\n this.throttleSaveMs = 1000;\r\n /* Update subscriptions (aka live views) */\r\n this.lastSubscriptionId = 1;\r\n this.subscriptions = new Map();\r\n this.updateHandlers = [];\r\n /* Error Subscriptions */\r\n this.saveErrorHandlers = [];\r\n /* Save scheduling */\r\n this.isSaveInProgress = false;\r\n this.isSaveThrottled = false;\r\n this.handleBeforeUnload = function (e) {\r\n if (_this.isSaveInProgress || _this.isSaveThrottled) {\r\n e.returnValue = false;\r\n return false;\r\n }\r\n };\r\n this.loaders = [];\r\n this.db = blank;\r\n this.base = blank;\r\n this.tempIdMap = new tempIds_1.TempIdMap(blank);\r\n this.idMap = this.tempIdMap;\r\n window.addEventListener('beforeunload', this.handleBeforeUnload);\r\n }\r\n /** Saves all committed patches. Useful only if autoSave is off. */\r\n DbRef.prototype.save = function () {\r\n this.enqueueSave();\r\n this.update();\r\n };\r\n DbRef.prototype.getAutoSave = function () {\r\n return this.autoSave;\r\n };\r\n DbRef.prototype.setAutoSave = function (val) {\r\n if (this.autoSave != val) {\r\n this.autoSave = val;\r\n this.enqueueSave();\r\n this.update();\r\n }\r\n };\r\n /** Concrete DbRef instances should override and implement their save logic in this method */\r\n DbRef.prototype.savePatch = function (patch) {\r\n return Promise.resolve({ submit: {} });\r\n };\r\n /* Db Update logic */\r\n DbRef.prototype.commit = function (patch) {\r\n try {\r\n var dbBeforeUpdate = this.db.with(patch);\r\n patch = this.beforeUpdate(patch, dbBeforeUpdate.tables, this.db.tables);\r\n patch = patchHelpers_1.mergeEntityPatches(this.db.tables, patch);\r\n this.log.push({ patch: patch });\r\n this.db = this.db.with(patch);\r\n this.autoSave && this.enqueueSave();\r\n this.update();\r\n }\r\n catch (e) {\r\n this.saveError(patch, e);\r\n }\r\n };\r\n DbRef.prototype.beforeUpdate = function (patch, tables, prevTables) {\r\n var _this = this;\r\n var patchAndDependencies = {};\r\n utils_1.objectKeys(tables).filter(function (entityName) { return patch[entityName] && !tables[entityName].schema.beforeUpdate; }).forEach(function (entityName) {\r\n patchAndDependencies[entityName] = patch[entityName];\r\n });\r\n utils_1.objectKeys(tables).filter(function (entityName) { return patch[entityName] && tables[entityName].schema.beforeUpdate; }).forEach(function (entityName) {\r\n var _a;\r\n var schema = tables[entityName].schema;\r\n var beforeUpdate = schema.beforeUpdate;\r\n var context = {\r\n clientIdsMap: _this.tempIdMap,\r\n schema: schema,\r\n tables: tables,\r\n prevTables: prevTables,\r\n };\r\n var results = patch[entityName].map(function (e) { return beforeUpdate(e, context); });\r\n var updatedPatch = (_a = {}, _a[entityName] = results.map(function (result) { return result.entity; }), _a);\r\n var dependentEntityPatchesForUpdate = patchHelpers_1.unionPatches(results.filter(function (result) { return result.dependentEntities; }).map(function (result) { return result.dependentEntities; }));\r\n var dependentEntityPatches = _this.beforeUpdate(dependentEntityPatchesForUpdate, tables, prevTables);\r\n patchAndDependencies = patchHelpers_1.mergeEntityPatches(tables, patchHelpers_1.unionPatches([patchAndDependencies, updatedPatch, dependentEntityPatches]));\r\n });\r\n return patchAndDependencies;\r\n };\r\n DbRef.prototype.commitFetch = function (patch) {\r\n patch = this.tempIdMap.serverToClientPatch(patch);\r\n this.rebase(this.base.with(patch));\r\n this.update();\r\n };\r\n DbRef.prototype.rebase = function (newBase) {\r\n this.base = newBase;\r\n this.db = newBase;\r\n for (var n = this.savedPoint; n < this.log.length; n++) {\r\n this.db = this.db.with(this.log[n].patch);\r\n }\r\n };\r\n DbRef.prototype.makeCumulativePatch = function () {\r\n var lastLogEntry = this.log.length;\r\n var logEntriesToSave = this.log.slice(this.savedPoint, lastLogEntry);\r\n var cumulativePatch = patchHelpers_1.makeCumulativePatch(this.db, logEntriesToSave.map(function (t) { return t.patch; }), this.tempIdMap);\r\n cumulativePatch = this.tempIdMap.clientToServerPatch(cumulativePatch);\r\n return cumulativePatch;\r\n };\r\n DbRef.prototype.applyResponse = function (response, newSavedPoint) {\r\n var _this = this;\r\n if (this.errors.length == 0) {\r\n this.tempIdMap.appendServerMapping(response);\r\n var serverPatch = patchHelpers_1.flattenResponse(response.submit, this.db.tables);\r\n serverPatch = patchHelpers_1.mergeEntityPatches(this.db.tables, serverPatch);\r\n this.savedPoint = newSavedPoint;\r\n this.base = this.db;\r\n this.commitFetch(serverPatch);\r\n if (this.autoSave) {\r\n this.isSaveThrottled = true;\r\n setTimeout(function () {\r\n _this.isSaveThrottled = false;\r\n if (_this.savedPoint < _this.log.length) {\r\n _this.enqueueSave();\r\n }\r\n }, this.throttleSaveMs);\r\n }\r\n }\r\n };\r\n DbRef.prototype.subscribe = function (view, params, onUpdate) {\r\n var _this = this;\r\n var id = this.lastSubscriptionId++;\r\n var subscription = {\r\n update: function (params) {\r\n subscription.currentParams = params;\r\n subscription.currentValue = _this.db.runView(view, params);\r\n return subscription.currentValue;\r\n },\r\n currentParams: null,\r\n currentValue: null,\r\n onUpdate: onUpdate,\r\n unsubscribe: function () { _this.subscriptions.delete(id); },\r\n };\r\n subscription.update(params);\r\n this.subscriptions.set(id, subscription);\r\n return subscription;\r\n };\r\n DbRef.prototype.onUpdate = function (handler) {\r\n this.subscribe({\r\n compute: function (db) { return db; },\r\n compareResults: function (a, b) { return a === b; },\r\n }, null, handler);\r\n };\r\n DbRef.prototype.update = function () {\r\n this.subscriptions.forEach(function (subscription) {\r\n var previousValue = subscription.currentValue;\r\n subscription.update(subscription.currentParams);\r\n if (subscription.currentValue !== previousValue && subscription.onUpdate) {\r\n subscription.onUpdate(subscription.currentValue);\r\n }\r\n });\r\n };\r\n DbRef.prototype.onSaveError = function (handler) {\r\n this.saveErrorHandlers.push(handler);\r\n };\r\n DbRef.prototype.saveError = function (request, error) {\r\n this.saveErrorHandlers.forEach(function (handler) { return handler(request, error); });\r\n };\r\n DbRef.prototype.enqueueSave = function () {\r\n var _this = this;\r\n if (!this.isSaveInProgress && !this.isSaveThrottled) {\r\n try {\r\n this.isSaveInProgress = true;\r\n var lastLogEntry_1 = this.log.length;\r\n var cumulativePatch_1 = this.makeCumulativePatch();\r\n if (lodash_isempty_1.default(cumulativePatch_1)) {\r\n this.isSaveInProgress = false;\r\n return;\r\n }\r\n this.savePatch(cumulativePatch_1)\r\n .then(function (response) {\r\n _this.applyResponse(response, lastLogEntry_1);\r\n _this.isSaveInProgress = false;\r\n _this.update();\r\n })\r\n .catch(function (reason) {\r\n _this.saveError(cumulativePatch_1, reason);\r\n _this.isSaveInProgress = false;\r\n _this.update();\r\n });\r\n }\r\n catch (e) {\r\n this.isSaveInProgress = false;\r\n this.isSaveThrottled = false;\r\n throw e;\r\n }\r\n }\r\n };\r\n DbRef.prototype.makeLoader = function (options) {\r\n var loader = new Loader_1.Loader(this, function () { return new SimpleLoadingTracker_1.SimpleLoadingTracker(); }, options);\r\n this.loaders.push(loader);\r\n return loader;\r\n };\r\n DbRef.prototype.makeListLoader = function (options) {\r\n var loader = new Loader_1.Loader(this, function () { return new ListLoadingTracker_1.ListLoadingTracker(); }, options);\r\n this.loaders.push(loader);\r\n return loader;\r\n };\r\n DbRef.prototype.reload = function () {\r\n this.loaders = [];\r\n };\r\n return DbRef;\r\n}());\r\nexports.DbRef = DbRef;\r\n"},{"id":"./src/DbTable.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\DbTable.ts","name":"./src/DbTable.ts","index":11,"index2":10,"size":9565,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","issuerId":"./src/index.ts","issuerName":"./src/index.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\uui\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","name":"./src/index.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/index.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","module":"./src/index.ts","moduleName":"./src/index.ts","type":"cjs require","userRequest":"./DbTable","loc":"6:21-41"}],"providedExports":null,"optimizationBailout":[],"depth":3,"source":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.DbTable = void 0;\r\nvar tslib_1 = require(\"tslib\");\r\nvar I = tslib_1.__importStar(require(\"immutable\"));\r\nvar uui_1 = require(\"@epam/uui\");\r\nvar immutable_1 = require(\"immutable\");\r\nvar DbTable = /** @class */ (function () {\r\n function DbTable(schema, state, q) {\r\n this.schema = schema;\r\n this.state = state;\r\n this.q = q;\r\n if (!state) {\r\n var indexes = (schema.indexes || []).map(function (indexDef) {\r\n return {\r\n field: indexDef,\r\n map: I.Map(),\r\n };\r\n });\r\n this.state = { pk: I.Map(), indexes: indexes };\r\n }\r\n if (!q) {\r\n this.q = {};\r\n }\r\n }\r\n DbTable.prototype.keyToImmutable = function (id) {\r\n if (Array.isArray(id)) {\r\n return I.List(id);\r\n }\r\n else {\r\n return id;\r\n }\r\n };\r\n DbTable.prototype.byId = function (id) {\r\n return this.state.pk.get(this.keyToImmutable(id));\r\n };\r\n DbTable.prototype.getId = function (entity) {\r\n if (Array.isArray(this.schema.primaryKey)) {\r\n return this.schema.primaryKey.map(function (key) { return entity[key]; });\r\n }\r\n return entity[this.schema.primaryKey];\r\n };\r\n DbTable.prototype.update = function (mutate) {\r\n var clone = new this.constructor(this.schema, this.state, this.q);\r\n mutate(clone);\r\n return clone;\r\n };\r\n /* Mutation */\r\n DbTable.prototype.with = function (patch) {\r\n var _this = this;\r\n var updates = patch.map(function (entityPatch) {\r\n var id = _this.getId(entityPatch);\r\n var immId = _this.keyToImmutable(id);\r\n var existing = _this.state.pk.get(immId);\r\n var updated = entityPatch;\r\n if (existing) {\r\n updated = tslib_1.__assign(tslib_1.__assign({}, existing), entityPatch);\r\n }\r\n return { id: id, immId: immId, patch: entityPatch, existing: existing, updated: updated, updatedFieldsisNew: !existing };\r\n });\r\n var idVal = immutable_1.Seq.Keyed(updates.map(function (entity) { return [entity.immId, entity.updated]; }));\r\n var newPk = this.state.pk.merge(idVal);\r\n var newIndexes = this.state.indexes.map(function (index) {\r\n var newMap = index.map;\r\n var _loop_1 = function (n) {\r\n var update = updates[n];\r\n var newKey = update.updated[index.field];\r\n if (update.existing) {\r\n var oldKey = update.existing[index.field];\r\n if (oldKey !== newKey) {\r\n newMap = newMap.update(oldKey, function (set) { return set.remove(update.immId); });\r\n }\r\n }\r\n newMap = newMap.update(newKey, I.Set(), function (set) { return set.add(update.immId); });\r\n };\r\n for (var n = 0; n < updates.length; n++) {\r\n _loop_1(n);\r\n }\r\n return tslib_1.__assign(tslib_1.__assign({}, index), { map: newMap });\r\n });\r\n var newState = { pk: newPk, indexes: newIndexes };\r\n return this.update(function (t) { return t.state = newState; });\r\n };\r\n /* Query */\r\n DbTable.prototype.find = function (filter) {\r\n var _this = this;\r\n return this.update(function (t) { return t.q = tslib_1.__assign(tslib_1.__assign({}, t.q), { filter: tslib_1.__assign(tslib_1.__assign({}, _this.q.filter), filter) }); });\r\n };\r\n DbTable.prototype.order = function (order) {\r\n return this.update(function (t) { return t.q = tslib_1.__assign(tslib_1.__assign({}, t.q), { sorting: order }); });\r\n };\r\n DbTable.prototype.orderBy = function (field, direction) {\r\n if (direction === void 0) { direction = 'asc'; }\r\n return this.update(function (t) { return t.q = tslib_1.__assign(tslib_1.__assign({}, t.q), { sorting: [{ field: field, direction: direction }] }); });\r\n };\r\n DbTable.prototype.thenBy = function (field, direction) {\r\n return this.update(function (t) { return t.q = tslib_1.__assign(tslib_1.__assign({}, t.q), { sorting: tslib_1.__spreadArrays(t.q.sorting, [{ field: field, direction: direction }]) }); });\r\n };\r\n DbTable.prototype.search = function (text) {\r\n if (!this.schema.searchBy) {\r\n throw new Error(\"Can't search in the \" + this.schema.typeName + \" table - searchBy is not defined in the schema.\");\r\n }\r\n return this.update(function (t) { return t.q = tslib_1.__assign(tslib_1.__assign({}, t.q), { search: text }); });\r\n };\r\n /* Materializing */\r\n DbTable.prototype.range = function (from, count) {\r\n return this.runQuery(tslib_1.__assign(tslib_1.__assign({}, this.q), { range: { from: from, count: count } }));\r\n };\r\n DbTable.prototype.count = function () {\r\n return this.runQuery(this.q).length;\r\n };\r\n DbTable.prototype.one = function () {\r\n return this.runQuery(this.q)[0] || null;\r\n };\r\n DbTable.prototype.toArray = function () {\r\n return this.runQuery(this.q);\r\n };\r\n DbTable.prototype.map = function (fn) {\r\n return this.toArray().map(fn);\r\n };\r\n /* Query implementation */\r\n DbTable.prototype.runQuery = function (q) {\r\n var _this = this;\r\n var result = null;\r\n var filter = q.filter;\r\n if (filter) {\r\n var indexes = this.state.indexes;\r\n // Try to use indexes to fulfill filter conditions\r\n for (var n = 0; n < indexes.length; n++) {\r\n var index = indexes[n];\r\n if (index.field in filter) {\r\n var _a = filter, _b = index.field, condition = _a[_b], rest = tslib_1.__rest(_a, [typeof _b === \"symbol\" ? _b : _b + \"\"]);\r\n var conditionValues = null;\r\n if (condition != null && typeof condition === \"object\") {\r\n // Attempt to use index for 'in' and 'isNull' criteria.\r\n // We need to be very conservative here, indexed field should work the same way as getPatternPredicate. So\r\n // - it's better to leave corner cases to getPatternPredicate\r\n var _c = condition, inCriteria = _c.in, nullCriteria = _c.isNull, restCriteria = tslib_1.__rest(_c, [\"in\", \"isNull\"]);\r\n if (inCriteria && Array.isArray(inCriteria)) {\r\n conditionValues = inCriteria;\r\n }\r\n else {\r\n restCriteria.in = inCriteria;\r\n }\r\n // Conditions in getPatternPredicate are composed with 'and' logic,\r\n // For now, let's not attempt to handle tricky cases like { in: [1,2] isNull: true }, or { in: [1, null] isNull: false }\r\n // - just leave this to getPatternPredicate.\r\n // Let's just handle the a most common case { isNull: true } - find all null and undefined\r\n if (nullCriteria === true && !conditionValues) {\r\n conditionValues = [null, undefined];\r\n }\r\n else {\r\n restCriteria.in = inCriteria;\r\n }\r\n // Keep other conditions, e.g. { in: [1,2,3], isNull: true } - in works via index, isNull - via filter\r\n if (Object.keys(restCriteria).length > 0) {\r\n rest[index.field] = restCriteria;\r\n }\r\n }\r\n else {\r\n conditionValues = [condition];\r\n }\r\n if (conditionValues) {\r\n result = [];\r\n for (var i = 0; i < conditionValues.length; i++) {\r\n var idsSet = index.map.get(conditionValues[i]);\r\n if (idsSet) {\r\n var idsArray = idsSet.toArray();\r\n for (var j = 0; j < idsArray.length; j++) {\r\n var item = this.state.pk.get(idsArray[j]);\r\n result.push(item);\r\n }\r\n }\r\n }\r\n filter = Object.keys(rest).length > 0 ? rest : null;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n if (!result) {\r\n result = this.state.pk.toArray();\r\n }\r\n if (filter) {\r\n var predicate = uui_1.getPatternPredicate(q.filter);\r\n result = result.filter(predicate);\r\n }\r\n if (q.search) {\r\n var searchFilter_1 = uui_1.getSearchFilter(q.search);\r\n result = result.filter(function (item) { return searchFilter_1(_this.schema.searchBy.map(function (field) { return item[field]; })); });\r\n }\r\n if (q.sorting) {\r\n var comparer = uui_1.getOrderComparer(q.sorting);\r\n result = result.sort(comparer);\r\n }\r\n if (q.range) {\r\n result = result.slice(q.range.from, q.range.from + q.range.count);\r\n }\r\n return result;\r\n };\r\n return DbTable;\r\n}());\r\nexports.DbTable = DbTable;\r\n"},{"id":"./src/ListLoadingTracker.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\ListLoadingTracker.ts","name":"./src/ListLoadingTracker.ts","index":27,"index2":23,"size":4034,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\DbRef.ts","issuerId":"./src/DbRef.ts","issuerName":"./src/DbRef.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\uui\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/DbRef.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\DbRef.ts","name":"./src/DbRef.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/DbRef.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\DbRef.ts","module":"./src/DbRef.ts","moduleName":"./src/DbRef.ts","type":"cjs require","userRequest":"./ListLoadingTracker","loc":"11:27-58"}],"providedExports":null,"optimizationBailout":[],"depth":4,"source":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.ListLoadingTracker = void 0;\r\nvar tslib_1 = require(\"tslib\");\r\nvar ListLoadingTracker = /** @class */ (function () {\r\n function ListLoadingTracker(options) {\r\n this.options = options;\r\n this.cache = new Map();\r\n this.extractList = (options === null || options === void 0 ? void 0 : options.extractList) || (function (r) { return r; });\r\n }\r\n ListLoadingTracker.prototype.prepare = function (request) {\r\n var filter = request.filter, sorting = request.sorting, search = request.search, range = request.range, unknownFields = tslib_1.__rest(request, [\"filter\", \"sorting\", \"search\", \"range\"]);\r\n var options = {};\r\n if (filter) {\r\n options.filter = filter;\r\n }\r\n if (sorting) {\r\n options.sorting = sorting;\r\n }\r\n if (search) {\r\n options.search = search;\r\n }\r\n var keyObject = tslib_1.__assign(tslib_1.__assign({}, options), unknownFields);\r\n var key = JSON.stringify(keyObject);\r\n var entry = this.cache.get(key);\r\n if (!entry) {\r\n entry = { options: options, count: 0, maxCount: null, isComplete: false };\r\n this.cache.set(key, entry);\r\n }\r\n return { options: options, range: range, unknownFields: unknownFields, entry: entry };\r\n };\r\n ListLoadingTracker.prototype.diff = function (request) {\r\n var _a = this.prepare(request), options = _a.options, range = _a.range, unknownFields = _a.unknownFields, entry = _a.entry;\r\n if (entry.isComplete) {\r\n return null;\r\n }\r\n if (!request.range) {\r\n return request;\r\n }\r\n else {\r\n var requestedMax = request.range.from + request.range.count;\r\n var missingCount = requestedMax - entry.count;\r\n if (entry.maxCount) {\r\n missingCount = Math.min(missingCount, entry.maxCount);\r\n }\r\n if (missingCount > 0) {\r\n return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, options), unknownFields), { range: { from: entry.count, count: requestedMax - entry.count } });\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n };\r\n ListLoadingTracker.prototype.count = function (request) {\r\n var _a = this.prepare(request), options = _a.options, range = _a.range, unknownFields = _a.unknownFields, entry = _a.entry;\r\n return { knownCount: Math.max(entry.count, entry.maxCount), exactCount: entry.maxCount };\r\n };\r\n ListLoadingTracker.prototype.append = function (request, response) {\r\n var _a = this.prepare(request), options = _a.options, range = _a.range, unknownFields = _a.unknownFields, entry = _a.entry;\r\n if (response) {\r\n var list = this.extractList(response);\r\n if (list.count) {\r\n entry.maxCount = list.count;\r\n }\r\n if (!range) {\r\n entry.count = list.items.length;\r\n entry.maxCount = list.items.length;\r\n entry.isComplete = true;\r\n }\r\n else {\r\n var from = (list.from == null) ? range.from : list.from;\r\n if (list.items.length > 0) {\r\n entry.count = Math.max(entry.count, from + list.items.length);\r\n }\r\n if (list.items.length < range.count) {\r\n entry.maxCount = from + list.items.length;\r\n entry.count = entry.maxCount;\r\n entry.isComplete = true;\r\n }\r\n }\r\n }\r\n else {\r\n if (range) {\r\n entry.count = Math.max(entry.count, request.range.from + request.range.count);\r\n }\r\n else {\r\n entry.isComplete = true;\r\n }\r\n }\r\n };\r\n return ListLoadingTracker;\r\n}());\r\nexports.ListLoadingTracker = ListLoadingTracker;\r\n"},{"id":"./src/Loader.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\Loader.ts","name":"./src/Loader.ts","index":25,"index2":21,"size":3340,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\DbRef.ts","issuerId":"./src/DbRef.ts","issuerName":"./src/DbRef.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\uui\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/DbRef.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\DbRef.ts","name":"./src/DbRef.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/DbRef.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\DbRef.ts","module":"./src/DbRef.ts","moduleName":"./src/DbRef.ts","type":"cjs require","userRequest":"./Loader","loc":"9:15-34"}],"providedExports":null,"optimizationBailout":[],"depth":4,"source":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.Loader = void 0;\r\nvar Loader = /** @class */ (function () {\r\n function Loader(dbRef, getTracker, options) {\r\n var _this = this;\r\n this.dbRef = dbRef;\r\n this.getTracker = getTracker;\r\n this.options = options;\r\n this.currentRequests = new Set();\r\n this.load = function (inputRequest) {\r\n var result = {\r\n isComplete: _this.loaded.diff(inputRequest) == null,\r\n isLoading: false,\r\n request: inputRequest,\r\n missing: _this.loadedAndLoading.diff(inputRequest),\r\n promise: null,\r\n reload: null,\r\n };\r\n result.reload = function () {\r\n result.missing = inputRequest;\r\n _this.loadImpl(result);\r\n };\r\n if (result.isComplete) {\r\n // Everything requested is already loaded\r\n result.isComplete = true;\r\n result.isLoading = false;\r\n result.promise = Promise.resolve();\r\n return result;\r\n }\r\n else {\r\n if (result.missing == null) {\r\n // Everything requested is either loaded already, or being loaded\r\n result.isComplete = false;\r\n result.isLoading = true;\r\n // There's no good way to tell which of current requests is querying requested data - there actually can be 2 of them.\r\n // So we track all running requests, and await all of them in such case.\r\n result.promise = Promise.all(_this.currentRequests.entries()).then(function () { });\r\n return result;\r\n }\r\n else {\r\n // Something requested is not loaded, nor being loaded. Need to perform a new request.\r\n _this.loadImpl(result);\r\n return result;\r\n }\r\n }\r\n };\r\n this.loaded = getTracker();\r\n this.loadedAndLoading = getTracker();\r\n }\r\n Loader.prototype.loadImpl = function (state) {\r\n var _this = this;\r\n this.loadedAndLoading.append(state.missing);\r\n state.isLoading = true;\r\n var serverRequest = state.missing;\r\n if (this.options.clientToServerRequest) {\r\n serverRequest = this.options.clientToServerRequest(serverRequest);\r\n }\r\n state.promise = this.options.api(serverRequest).then(function (result) {\r\n _this.loaded.append(state.missing, result);\r\n _this.loadedAndLoading.append(state.missing, result);\r\n state.missing = null;\r\n state.isLoading = false;\r\n state.isComplete = true;\r\n state.promise = Promise.resolve();\r\n var flatten = _this.options.convertToPatch(result);\r\n _this.options.postProcess && _this.options.postProcess(flatten);\r\n _this.dbRef.commitFetch(flatten);\r\n });\r\n this.currentRequests.add(state.promise);\r\n state.promise.finally(function () {\r\n _this.currentRequests.delete(state.promise);\r\n });\r\n return state.promise;\r\n };\r\n return Loader;\r\n}());\r\nexports.Loader = Loader;\r\n"},{"id":"./src/SimpleLoadingTracker.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\SimpleLoadingTracker.ts","name":"./src/SimpleLoadingTracker.ts","index":26,"index2":22,"size":731,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\DbRef.ts","issuerId":"./src/DbRef.ts","issuerName":"./src/DbRef.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\uui\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/DbRef.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\DbRef.ts","name":"./src/DbRef.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/DbRef.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\DbRef.ts","module":"./src/DbRef.ts","moduleName":"./src/DbRef.ts","type":"cjs require","userRequest":"./SimpleLoadingTracker","loc":"10:29-62"}],"providedExports":null,"optimizationBailout":[],"depth":4,"source":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.SimpleLoadingTracker = void 0;\r\nvar SimpleLoadingTracker = /** @class */ (function () {\r\n function SimpleLoadingTracker() {\r\n this.set = new Set();\r\n }\r\n SimpleLoadingTracker.prototype.getKey = function (request) {\r\n return JSON.stringify(request);\r\n };\r\n SimpleLoadingTracker.prototype.diff = function (request) {\r\n return this.set.has(this.getKey(request)) ? null : request;\r\n };\r\n SimpleLoadingTracker.prototype.append = function (request, result) {\r\n this.set.add(this.getKey(request));\r\n };\r\n return SimpleLoadingTracker;\r\n}());\r\nexports.SimpleLoadingTracker = SimpleLoadingTracker;\r\n"},{"id":"./src/index.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","name":"./src/index.ts","index":3,"index2":27,"size":541,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","issuerId":"./index.tsx","issuerName":"./index.tsx","issuerPath":[{"id":0,"identifier":"multi C:\\work\\uui\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","name":"./index.tsx"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./index.tsx","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","module":"./index.tsx","moduleName":"./index.tsx","type":"cjs require","userRequest":"./src","loc":"4:21-37"}],"providedExports":null,"optimizationBailout":[],"depth":2,"source":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar tslib_1 = require(\"tslib\");\r\ntslib_1.__exportStar(require(\"./types\"), exports);\r\ntslib_1.__exportStar(require(\"./Db\"), exports);\r\ntslib_1.__exportStar(require(\"./DbTable\"), exports);\r\ntslib_1.__exportStar(require(\"./DbRef\"), exports);\r\ntslib_1.__exportStar(require(\"./tempIds\"), exports);\r\ntslib_1.__exportStar(require(\"./utils\"), exports);\r\ntslib_1.__exportStar(require(\"./patchHelpers\"), exports);\r\ntslib_1.__exportStar(require(\"./reactHooks\"), exports);\r\n"},{"id":"./src/patchHelpers.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\patchHelpers.ts","name":"./src/patchHelpers.ts","index":15,"index2":18,"size":9010,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","issuerId":"./src/index.ts","issuerName":"./src/index.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\uui\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","name":"./src/index.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/DbRef.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\DbRef.ts","module":"./src/DbRef.ts","moduleName":"./src/DbRef.ts","type":"cjs require","userRequest":"./patchHelpers","loc":"5:21-46"},{"moduleId":"./src/index.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","module":"./src/index.ts","moduleName":"./src/index.ts","type":"cjs require","userRequest":"./patchHelpers","loc":"10:21-46"}],"providedExports":null,"optimizationBailout":[],"depth":3,"source":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.getEntityParentDependencies = exports.getParentEntities = exports.hasServerFields = exports.isNew = exports.getId = exports.isClientOnly = exports.makeCumulativePatch = exports.isPatchBlank = exports.flattenResponse = exports.mergeEntityPatches = exports.unionPatches = void 0;\r\nvar tslib_1 = require(\"tslib\");\r\nvar types_1 = require(\"./types\");\r\nvar I = tslib_1.__importStar(require(\"immutable\"));\r\nvar utils_1 = require(\"./utils\");\r\nvar lodash_groupby_1 = tslib_1.__importDefault(require(\"lodash.groupby\"));\r\nvar lodash_map_1 = tslib_1.__importDefault(require(\"lodash.map\"));\r\nvar lodash_merge_1 = tslib_1.__importDefault(require(\"lodash.merge\"));\r\nvar lodash_countby_1 = tslib_1.__importDefault(require(\"lodash.countby\"));\r\nvar lodash_filter_1 = tslib_1.__importDefault(require(\"lodash.filter\"));\r\nvar lodash_foreach_1 = tslib_1.__importDefault(require(\"lodash.foreach\"));\r\nvar lodash_pick_1 = tslib_1.__importDefault(require(\"lodash.pick\"));\r\nfunction unionPatches(patches) {\r\n var result = {};\r\n patches.forEach(function (patch) {\r\n utils_1.objectKeys(patch).forEach(function (tableName) {\r\n result[tableName] = result[tableName] ? tslib_1.__spreadArrays(result[tableName], patch[tableName]) : patch[tableName];\r\n });\r\n });\r\n return result;\r\n}\r\nexports.unionPatches = unionPatches;\r\nfunction mergeEntityPatches(tables, patch) {\r\n var result = {};\r\n utils_1.objectKeys(patch).forEach(function (key) {\r\n var table = tables[key];\r\n var groupedEntities = lodash_groupby_1.default(patch[key], function (item) { return table.getId(item); });\r\n var tablePatch = lodash_map_1.default(groupedEntities, function (entities) {\r\n var result = lodash_merge_1.default.apply(void 0, tslib_1.__spreadArrays([{}], entities));\r\n if (process.env.NODE_ENV !== 'production') {\r\n var props = utils_1.objectKeys(result).filter(function (prop) {\r\n return Object.keys(lodash_countby_1.default(entities.filter(function (entity) {\r\n return entity[prop] !== undefined;\r\n }), function (entity) { return entity[prop]; })).length > 1;\r\n });\r\n if (props.length) {\r\n console.warn.apply(console, tslib_1.__spreadArrays(['mergeEntityPatches: Different property values found for the same entity.\\nProperty names:\\n', props, '\\nEntities:\\n'], entities));\r\n }\r\n }\r\n return result;\r\n });\r\n result[key] = tablePatch;\r\n });\r\n return result;\r\n}\r\nexports.mergeEntityPatches = mergeEntityPatches;\r\nfunction flattenResponseHelper(result, object, tablesByTypeName) {\r\n if (Array.isArray(object)) {\r\n object.forEach(function (item) { return flattenResponseHelper(result, item, tablesByTypeName); });\r\n }\r\n else if (typeof object === 'object') {\r\n var clone = {};\r\n var tableKey = void 0;\r\n var fields = {};\r\n if ('__typename' in object) {\r\n var table = tablesByTypeName[object.__typename];\r\n if (table) {\r\n tableKey = table.schema.tableName;\r\n fields = table.schema.fields;\r\n }\r\n }\r\n for (var key in object) {\r\n var value = object[key];\r\n var field = fields[key];\r\n if ((field && !!field.disableFlatten)\r\n || typeof value !== 'object'\r\n || value === null\r\n || (Array.isArray(value) && value.every(function (item) { return typeof item !== 'object'; }))) {\r\n clone[key] = value;\r\n }\r\n else {\r\n flattenResponseHelper(result, value, tablesByTypeName);\r\n }\r\n }\r\n if (tableKey) {\r\n result[tableKey].push(clone);\r\n }\r\n }\r\n}\r\nfunction flattenResponse(response, tables) {\r\n var result = {};\r\n var tablesByTypeName = {};\r\n Object.values(tables).forEach(function (table) { return tablesByTypeName[table.schema.typeName] = table; });\r\n utils_1.objectKeys(tables).forEach(function (tableName) { return tablesByTypeName; });\r\n utils_1.objectKeys(tables).forEach(function (key) { return result[key] = []; });\r\n flattenResponseHelper(result, response, tablesByTypeName);\r\n return result;\r\n}\r\nexports.flattenResponse = flattenResponse;\r\nfunction isPatchBlank(patch) {\r\n return !utils_1.objectKeys(patch).some(function (key) { return patch[key].length > 0; });\r\n}\r\nexports.isPatchBlank = isPatchBlank;\r\n/**\r\n * Given several patches, creates a new single patch with all fields from all entities in all patches.\r\n */\r\nfunction makeCumulativePatch(updatedDb, patches, clientIdsMap) {\r\n var result = {};\r\n utils_1.objectKeys(updatedDb.tables).forEach(function (entityName) {\r\n var table = updatedDb.tables[entityName];\r\n var schema = table.schema;\r\n var ids = I.Set();\r\n patches.forEach(function (patch) {\r\n var filteredPatch = (patch[entityName] || []).filter(function (entity) { return hasServerFields(entity, schema, clientIdsMap, updatedDb.tables); });\r\n ids = ids.union(filteredPatch.map(function (e) { return table.getId(e); }));\r\n });\r\n var entities = ids\r\n .map(function (id) { return table.byId(id); })\r\n .filter(function (e) { return !isClientOnly(e, schema); })\r\n .toArray();\r\n if (entities.length > 0) {\r\n result[entityName] = entities;\r\n }\r\n });\r\n return result;\r\n}\r\nexports.makeCumulativePatch = makeCumulativePatch;\r\nfunction isClientOnly(entity, schema) {\r\n if (typeof schema.isClientOnly === 'function') {\r\n return schema.isClientOnly(entity);\r\n }\r\n return !!schema.isClientOnly;\r\n}\r\nexports.isClientOnly = isClientOnly;\r\nfunction getId(entity, schema) {\r\n if (typeof schema.primaryKey == 'string') {\r\n return entity[schema.primaryKey];\r\n }\r\n var result = [];\r\n lodash_foreach_1.default(lodash_pick_1.default(entity, schema.primaryKey), function (value) {\r\n result.push(value);\r\n });\r\n return result;\r\n}\r\nexports.getId = getId;\r\nfunction isNew(entity, schema, clientIdsMap) {\r\n var id = getId(entity, schema);\r\n return !clientIdsMap.clientToServer(id);\r\n}\r\nexports.isNew = isNew;\r\nfunction hasServerFields(entity, schema, clientIdsMap, tables) {\r\n var fullEntity = tslib_1.__assign(tslib_1.__assign({}, tables[schema.tableName].byId(entity.id) || {}), entity);\r\n if (isClientOnly(fullEntity, schema)) {\r\n return false;\r\n }\r\n return utils_1.objectKeys(entity).some(function (fieldName) {\r\n var fieldSchema = schema.fields[fieldName];\r\n return !fieldSchema || !(fieldSchema.isClientOnly || fieldSchema.isReadOnly || (fieldSchema.isGenerated && !isNew(entity, schema, clientIdsMap)));\r\n });\r\n}\r\nexports.hasServerFields = hasServerFields;\r\nfunction getParentEntities(patch, tables) {\r\n var dependenciesPatch = {};\r\n utils_1.objectKeys(patch).forEach(function (key) {\r\n var table = tables[key];\r\n var tableSchema = table.schema;\r\n var fields = lodash_filter_1.default(lodash_map_1.default(tableSchema.fields, function (field, name) { return (tslib_1.__assign(tslib_1.__assign({}, field), { name: name })); }), function (field) { return field.fk && field.fk.relationType == types_1.DbRelationType.Aggregation; });\r\n var tablePatch = patch[key];\r\n fields.forEach(function (field) {\r\n var tableName = field.fk.tableName, name = field.name;\r\n tablePatch.forEach(function (entity) {\r\n var actualTableName = (typeof tableName == 'function' ? tableName(entity) : tableName);\r\n var dbEntity = table.byId(table.getId(entity));\r\n var parentEntity = tables[actualTableName].byId(dbEntity[name]);\r\n var idFields = lodash_pick_1.default(parentEntity, tables[actualTableName].schema.primaryKey);\r\n if (parentEntity) {\r\n dependenciesPatch[actualTableName] = dependenciesPatch[actualTableName] || [];\r\n dependenciesPatch[actualTableName].push(idFields);\r\n }\r\n });\r\n });\r\n });\r\n return dependenciesPatch;\r\n}\r\nexports.getParentEntities = getParentEntities;\r\nfunction getEntityParentDependencies(entity, entityName, tables) {\r\n var _a;\r\n var patch = (_a = {}, _a[entityName] = [entity], _a);\r\n var resultPatches = [];\r\n while (true) {\r\n var parents = getParentEntities(patch, tables);\r\n if (isPatchBlank(parents)) {\r\n break;\r\n }\r\n resultPatches.push(parents);\r\n patch = parents;\r\n }\r\n var result = unionPatches(tslib_1.__spreadArrays([patch], resultPatches));\r\n result = mergeEntityPatches(tables, result);\r\n return result;\r\n}\r\nexports.getEntityParentDependencies = getEntityParentDependencies;\r\n"},{"id":"./src/reactHooks.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\reactHooks.ts","name":"./src/reactHooks.ts","index":28,"index2":26,"size":883,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","issuerId":"./src/index.ts","issuerName":"./src/index.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\uui\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","name":"./src/index.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/index.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","module":"./src/index.ts","moduleName":"./src/index.ts","type":"cjs require","userRequest":"./reactHooks","loc":"11:21-44"}],"providedExports":null,"optimizationBailout":[],"depth":3,"source":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.useDbView = exports.useDbRef = exports.DbContext = void 0;\r\nvar tslib_1 = require(\"tslib\");\r\nvar react_1 = require(\"react\");\r\nexports.DbContext = react_1.createContext(null);\r\nfunction useDbRef() {\r\n return react_1.useContext(exports.DbContext);\r\n}\r\nexports.useDbRef = useDbRef;\r\nfunction useDbView(fn, params, options) {\r\n var dbRef = useDbRef();\r\n var _a = react_1.useState(), state = _a[0], setState = _a[1];\r\n var subscription = react_1.useMemo(function () { return dbRef.subscribe(tslib_1.__assign({ compute: fn }, options), params, setState); }, []);\r\n subscription.update(params);\r\n react_1.useEffect(function () {\r\n return function () { return subscription.unsubscribe(); };\r\n }, []);\r\n return subscription.currentValue;\r\n}\r\nexports.useDbView = useDbView;\r\n"},{"id":"./src/tempIds.tsx","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\tempIds.tsx","name":"./src/tempIds.tsx","index":23,"index2":19,"size":8557,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","issuerId":"./src/index.ts","issuerName":"./src/index.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\uui\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","name":"./src/index.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/DbRef.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\DbRef.ts","module":"./src/DbRef.ts","moduleName":"./src/DbRef.ts","type":"cjs require","userRequest":"./tempIds","loc":"6:16-36"},{"moduleId":"./src/index.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","module":"./src/index.ts","moduleName":"./src/index.ts","type":"cjs require","userRequest":"./tempIds","loc":"8:21-41"}],"providedExports":null,"optimizationBailout":[],"depth":3,"source":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.TempIdMap = exports.isTempId = exports.getTempId = void 0;\r\nvar tslib_1 = require(\"tslib\");\r\nvar utils_1 = require(\"./utils\");\r\nvar lastTempId = -1;\r\nfunction getTempId() {\r\n return --lastTempId;\r\n}\r\nexports.getTempId = getTempId;\r\nfunction isTempId(val) {\r\n return typeof val === 'number' && val < 0;\r\n}\r\nexports.isTempId = isTempId;\r\nvar TempIdMap = /** @class */ (function () {\r\n function TempIdMap(db) {\r\n var _this = this;\r\n this.db = db;\r\n this.serverToClientIds = new Map();\r\n this.clientToServerIds = new Map();\r\n this.clientToServer = function (id) { return _this.clientToServerIds.get(id); };\r\n this.serverToClient = function (tableName, id) { return _this.getServerToClientMap(tableName).get(id); };\r\n this.clientToServerRequest = function (request) {\r\n request = tslib_1.__assign({}, request);\r\n if (request.filter) {\r\n request.filter = _this.clientToServerDataFilter(request.filter);\r\n }\r\n return request;\r\n };\r\n this.clientToServerDataFilter = function (filter) {\r\n filter = tslib_1.__assign({}, filter);\r\n var keys = Object.keys(filter);\r\n // I hope that we can rely that there won't be any negative numbers, which are not IDs, in queries.\r\n // We need to invent better heuristics or a schema otherwise.\r\n var clientToServer = function (id) {\r\n var found = _this.clientToServer(id);\r\n if (found) {\r\n return found;\r\n }\r\n else {\r\n return id;\r\n }\r\n };\r\n for (var n = 0; n < keys.length; n++) {\r\n var key = keys[n];\r\n var condition = filter[key];\r\n if (condition != null && typeof condition === \"object\") {\r\n condition = tslib_1.__assign({}, condition);\r\n if ('in' in condition && Array.isArray(condition.in) && condition.in.length) {\r\n condition.in = condition.in.map(clientToServer);\r\n }\r\n }\r\n else {\r\n condition = clientToServer(condition);\r\n }\r\n filter[key] = condition;\r\n }\r\n return filter;\r\n };\r\n }\r\n TempIdMap.prototype.copyPatch = function (patch) {\r\n var newPatch = tslib_1.__assign({}, patch);\r\n utils_1.objectKeys(patch).forEach(function (tableName) {\r\n var tablePatch = patch[tableName].map(function (entityPatch) { return (tslib_1.__assign({}, entityPatch)); });\r\n newPatch[tableName] = tablePatch;\r\n });\r\n return newPatch;\r\n };\r\n // Iterate thru every field in every patch for every table, matching certain field criteria. The patch is mutated!\r\n TempIdMap.prototype.mapFields = function (patch, filter, callback) {\r\n var _this = this;\r\n utils_1.objectKeys(patch).forEach(function (tableName) {\r\n var schema = _this.db.tables[tableName].schema;\r\n var fields = utils_1.objectKeys(schema.fields || [])\r\n .map(function (fieldName) {\r\n var fieldSchema = schema.fields[fieldName];\r\n if (filter(fieldSchema, fieldName)) {\r\n return { name: fieldName, schema: fieldSchema };\r\n }\r\n })\r\n .filter(function (f) { return !!f; });\r\n if (!fields.length) {\r\n return;\r\n }\r\n patch[tableName].forEach(function (entityPatch) {\r\n for (var n = 0; n < fields.length; n++) {\r\n var field = fields[n];\r\n var fieldValue = entityPatch[field.name];\r\n callback(field.name, field.schema, fieldValue, entityPatch, tableName);\r\n }\r\n });\r\n });\r\n };\r\n TempIdMap.prototype.getServerToClientMap = function (tableName) {\r\n var existing = this.serverToClientIds.get(tableName);\r\n if (existing) {\r\n return existing;\r\n }\r\n else {\r\n var newMap = new Map();\r\n this.serverToClientIds.set(tableName, newMap);\r\n return newMap;\r\n }\r\n };\r\n TempIdMap.prototype.serverToClientPatch = function (patch) {\r\n var _this = this;\r\n patch = this.copyPatch(patch);\r\n // We map PK in a separate pass, as we need to remap all PKs before re-mapping FKs\r\n this.mapFields(patch, function (f) { return f.isGenerated; }, function (fieldName, fieldSchema, fieldValue, entityPatch, tableName) {\r\n var clientId = _this.getServerToClientMap(tableName).get(fieldValue);\r\n if (!clientId) {\r\n clientId = getTempId();\r\n _this.clientToServerIds.set(clientId, fieldValue);\r\n _this.getServerToClientMap(tableName).set(fieldValue, clientId);\r\n }\r\n entityPatch[fieldName] = clientId;\r\n });\r\n this.mapFields(patch, function (f) { return !!(f.fk || (f.default != null) || f.toClient); }, function (fieldName, fieldSchema, fieldValue, entityPatch, tableName) {\r\n var isUndefined = typeof (fieldValue) === 'undefined';\r\n if (fieldSchema.default != null && fieldValue == null) {\r\n fieldValue = fieldSchema.default;\r\n isUndefined = false;\r\n }\r\n if (fieldSchema.fk && fieldValue != null) {\r\n var fkTableName = typeof fieldSchema.fk.tableName === 'function' ? fieldSchema.fk.tableName(entityPatch) : fieldSchema.fk.tableName;\r\n var clientId = _this.getServerToClientMap(fkTableName).get(fieldValue);\r\n if (!clientId) {\r\n clientId = getTempId();\r\n _this.clientToServerIds.set(clientId, fieldValue);\r\n _this.getServerToClientMap(fkTableName).set(fieldValue, clientId);\r\n }\r\n fieldValue = clientId;\r\n }\r\n if (!isUndefined && fieldSchema.toClient) {\r\n fieldValue = fieldSchema.toClient(fieldValue);\r\n }\r\n if (!isUndefined) {\r\n entityPatch[fieldName] = fieldValue;\r\n }\r\n });\r\n return patch;\r\n };\r\n TempIdMap.prototype.clientToServerPatch = function (patch) {\r\n var _this = this;\r\n patch = this.copyPatch(patch);\r\n this.mapFields(patch, function (f) { return f.isGenerated || !!f.fk; }, function (fieldName, fieldSchema, fieldValue, entityPatch, tableName) {\r\n if (fieldValue != null) {\r\n var existingId = _this.clientToServerIds.get(fieldValue);\r\n if (existingId) {\r\n entityPatch[fieldName] = existingId;\r\n }\r\n }\r\n });\r\n this.mapFields(patch, function (f) { return !(f.isClientOnly || f.isReadOnly) && !!f.toServer; }, function (fieldName, fieldSchema, fieldValue, entityPatch, tableName) {\r\n entityPatch[fieldName] = fieldSchema.toServer(entityPatch[fieldName]);\r\n });\r\n this.mapFields(patch, function (meta) { return meta.isClientOnly || meta.isReadOnly; }, function (fieldName, fieldSchema, fieldValue, entityPatch, tableName) {\r\n delete entityPatch[fieldName];\r\n });\r\n return patch;\r\n };\r\n TempIdMap.prototype.appendServerMapping = function (response) {\r\n var _this = this;\r\n utils_1.objectKeys(response.submit).forEach(function (tableName) {\r\n if (_this.db.tables[tableName]) {\r\n var tablePatch = response.submit[tableName];\r\n if (tablePatch) {\r\n var serverToClientIds_1 = _this.getServerToClientMap(tableName);\r\n var table_1 = _this.db.tables[tableName];\r\n tablePatch.forEach(function (patch) {\r\n if (isTempId(patch.id)) {\r\n var clientId = patch.id;\r\n var serverId = table_1.getId(patch.payload);\r\n serverToClientIds_1.set(serverId, clientId);\r\n _this.clientToServerIds.set(clientId, serverId);\r\n }\r\n });\r\n }\r\n }\r\n });\r\n };\r\n return TempIdMap;\r\n}());\r\nexports.TempIdMap = TempIdMap;\r\n"},{"id":"./src/types.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\types.ts","name":"./src/types.ts","index":4,"index2":1,"size":387,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","issuerId":"./src/index.ts","issuerName":"./src/index.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\uui\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","name":"./src/index.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/index.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","module":"./src/index.ts","moduleName":"./src/index.ts","type":"cjs require","userRequest":"./types","loc":"4:21-39"},{"moduleId":"./src/patchHelpers.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\patchHelpers.ts","module":"./src/patchHelpers.ts","moduleName":"./src/patchHelpers.ts","type":"cjs require","userRequest":"./types","loc":"5:14-32"}],"providedExports":null,"optimizationBailout":[],"depth":3,"source":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.DbRelationType = void 0;\r\nvar DbRelationType;\r\n(function (DbRelationType) {\r\n DbRelationType[DbRelationType[\"Aggregation\"] = 0] = \"Aggregation\";\r\n DbRelationType[DbRelationType[\"Association\"] = 1] = \"Association\";\r\n})(DbRelationType = exports.DbRelationType || (exports.DbRelationType = {}));\r\n"},{"id":"./src/utils.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\utils.ts","name":"./src/utils.ts","index":6,"index2":6,"size":1818,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","issuerId":"./src/index.ts","issuerName":"./src/index.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\uui\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","name":"./src/index.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/Db.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\Db.ts","module":"./src/Db.ts","moduleName":"./src/Db.ts","type":"cjs require","userRequest":"./utils","loc":"5:14-32"},{"moduleId":"./src/DbRef.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\DbRef.ts","module":"./src/DbRef.ts","moduleName":"./src/DbRef.ts","type":"cjs require","userRequest":"./utils","loc":"7:14-32"},{"moduleId":"./src/index.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","module":"./src/index.ts","moduleName":"./src/index.ts","type":"cjs require","userRequest":"./utils","loc":"9:21-39"},{"moduleId":"./src/patchHelpers.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\patchHelpers.ts","module":"./src/patchHelpers.ts","moduleName":"./src/patchHelpers.ts","type":"cjs require","userRequest":"./utils","loc":"7:14-32"},{"moduleId":"./src/tempIds.tsx","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\tempIds.tsx","module":"./src/tempIds.tsx","moduleName":"./src/tempIds.tsx","type":"cjs require","userRequest":"./utils","loc":"5:14-32"}],"providedExports":null,"optimizationBailout":[],"depth":3,"source":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.difference = exports.defaultCompareViewDependencies = exports.objectKeys = void 0;\r\nvar tslib_1 = require(\"tslib\");\r\nvar shallowequal_1 = tslib_1.__importDefault(require(\"shallowequal\"));\r\nvar lodash_zip_1 = tslib_1.__importDefault(require(\"lodash.zip\"));\r\nvar lodash_transform_1 = tslib_1.__importDefault(require(\"lodash.transform\"));\r\nvar lodash_isequal_1 = tslib_1.__importDefault(require(\"lodash.isequal\"));\r\n// TBD: New typescript would contain better typing for this. Remove this hack after update.\r\nexports.objectKeys = Object.keys;\r\nfunction defaultCompareViewDependencies(prev, next) {\r\n if (Array.isArray(prev) && Array.isArray(next)) {\r\n if (prev.length === next.length) {\r\n return lodash_zip_1.default(prev, next).every(function (_a) {\r\n var p = _a[0], n = _a[1];\r\n return shallowequal_1.default(p, n);\r\n });\r\n }\r\n return false;\r\n }\r\n return shallowequal_1.default(prev, next);\r\n}\r\nexports.defaultCompareViewDependencies = defaultCompareViewDependencies;\r\n/**\r\n * Deep diff between two object, using lodash\r\n * @param {Object} object Object compared\r\n * @param {Object} base Object to compare with\r\n * @return {Object} Return a new object who represent the diff\r\n */\r\nfunction difference(object, base) {\r\n function changes(object, base) {\r\n return lodash_transform_1.default(object, function (result, value, key) {\r\n if (!lodash_isequal_1.default(value, base[key])) {\r\n result[key] = (typeof value === \"object\" && typeof base[key] === \"object\") ? changes(value, base[key]) : value;\r\n }\r\n });\r\n }\r\n return changes(object, base);\r\n}\r\nexports.difference = difference;\r\n"},{"id":"@epam/uui","identifier":"external \"@epam/uui\"","name":"external \"@epam/uui\"","index":13,"index2":9,"size":42,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\DbTable.ts","issuerId":"./src/DbTable.ts","issuerName":"./src/DbTable.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\uui\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/DbTable.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\DbTable.ts","name":"./src/DbTable.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/DbTable.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\DbTable.ts","module":"./src/DbTable.ts","moduleName":"./src/DbTable.ts","type":"cjs require","userRequest":"@epam/uui","loc":"6:12-32"}],"providedExports":null,"optimizationBailout":[],"depth":4},{"id":"immutable","identifier":"external \"immutable\"","name":"external \"immutable\"","index":12,"index2":8,"size":42,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\DbTable.ts","issuerId":"./src/DbTable.ts","issuerName":"./src/DbTable.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\uui\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/DbTable.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\DbTable.ts","name":"./src/DbTable.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/DbTable.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\DbTable.ts","module":"./src/DbTable.ts","moduleName":"./src/DbTable.ts","type":"cjs require","userRequest":"immutable","loc":"5:29-49"},{"moduleId":"./src/DbTable.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\DbTable.ts","module":"./src/DbTable.ts","moduleName":"./src/DbTable.ts","type":"cjs require","userRequest":"immutable","loc":"7:18-38"},{"moduleId":"./src/patchHelpers.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\patchHelpers.ts","module":"./src/patchHelpers.ts","moduleName":"./src/patchHelpers.ts","type":"cjs require","userRequest":"immutable","loc":"6:29-49"}],"providedExports":null,"optimizationBailout":[],"depth":4},{"id":"lodash.countby","identifier":"external \"lodash.countby\"","name":"external \"lodash.countby\"","index":19,"index2":14,"size":42,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\patchHelpers.ts","issuerId":"./src/patchHelpers.ts","issuerName":"./src/patchHelpers.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\uui\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/patchHelpers.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\patchHelpers.ts","name":"./src/patchHelpers.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/patchHelpers.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\patchHelpers.ts","module":"./src/patchHelpers.ts","moduleName":"./src/patchHelpers.ts","type":"cjs require","userRequest":"lodash.countby","loc":"11:47-72"}],"providedExports":null,"optimizationBailout":[],"depth":4},{"id":"lodash.filter","identifier":"external \"lodash.filter\"","name":"external \"lodash.filter\"","index":20,"index2":15,"size":42,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\patchHelpers.ts","issuerId":"./src/patchHelpers.ts","issuerName":"./src/patchHelpers.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\uui\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/patchHelpers.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\patchHelpers.ts","name":"./src/patchHelpers.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/patchHelpers.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\patchHelpers.ts","module":"./src/patchHelpers.ts","moduleName":"./src/patchHelpers.ts","type":"cjs require","userRequest":"lodash.filter","loc":"12:46-70"}],"providedExports":null,"optimizationBailout":[],"depth":4},{"id":"lodash.foreach","identifier":"external \"lodash.foreach\"","name":"external \"lodash.foreach\"","index":21,"index2":16,"size":42,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\patchHelpers.ts","issuerId":"./src/patchHelpers.ts","issuerName":"./src/patchHelpers.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\uui\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/patchHelpers.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\patchHelpers.ts","name":"./src/patchHelpers.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/patchHelpers.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\patchHelpers.ts","module":"./src/patchHelpers.ts","moduleName":"./src/patchHelpers.ts","type":"cjs require","userRequest":"lodash.foreach","loc":"13:47-72"}],"providedExports":null,"optimizationBailout":[],"depth":4},{"id":"lodash.groupby","identifier":"external \"lodash.groupby\"","name":"external \"lodash.groupby\"","index":16,"index2":11,"size":42,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\patchHelpers.ts","issuerId":"./src/patchHelpers.ts","issuerName":"./src/patchHelpers.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\uui\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/patchHelpers.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\patchHelpers.ts","name":"./src/patchHelpers.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/patchHelpers.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\patchHelpers.ts","module":"./src/patchHelpers.ts","moduleName":"./src/patchHelpers.ts","type":"cjs require","userRequest":"lodash.groupby","loc":"8:47-72"}],"providedExports":null,"optimizationBailout":[],"depth":4},{"id":"lodash.isempty","identifier":"external \"lodash.isempty\"","name":"external \"lodash.isempty\"","index":24,"index2":20,"size":42,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\DbRef.ts","issuerId":"./src/DbRef.ts","issuerName":"./src/DbRef.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\uui\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/DbRef.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\DbRef.ts","name":"./src/DbRef.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/DbRef.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\DbRef.ts","module":"./src/DbRef.ts","moduleName":"./src/DbRef.ts","type":"cjs require","userRequest":"lodash.isempty","loc":"8:47-72"}],"providedExports":null,"optimizationBailout":[],"depth":4},{"id":"lodash.isequal","identifier":"external \"lodash.isequal\"","name":"external \"lodash.isequal\"","index":10,"index2":5,"size":42,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\Db.ts","issuerId":"./src/Db.ts","issuerName":"./src/Db.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\uui\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/Db.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\Db.ts","name":"./src/Db.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/Db.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\Db.ts","module":"./src/Db.ts","moduleName":"./src/Db.ts","type":"cjs require","userRequest":"lodash.isequal","loc":"6:47-72"},{"moduleId":"./src/utils.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\utils.ts","module":"./src/utils.ts","moduleName":"./src/utils.ts","type":"cjs require","userRequest":"lodash.isequal","loc":"8:47-72"}],"providedExports":null,"optimizationBailout":[],"depth":4},{"id":"lodash.map","identifier":"external \"lodash.map\"","name":"external \"lodash.map\"","index":17,"index2":12,"size":42,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\patchHelpers.ts","issuerId":"./src/patchHelpers.ts","issuerName":"./src/patchHelpers.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\uui\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/patchHelpers.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\patchHelpers.ts","name":"./src/patchHelpers.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/patchHelpers.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\patchHelpers.ts","module":"./src/patchHelpers.ts","moduleName":"./src/patchHelpers.ts","type":"cjs require","userRequest":"lodash.map","loc":"9:43-64"}],"providedExports":null,"optimizationBailout":[],"depth":4},{"id":"lodash.merge","identifier":"external \"lodash.merge\"","name":"external \"lodash.merge\"","index":18,"index2":13,"size":42,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\patchHelpers.ts","issuerId":"./src/patchHelpers.ts","issuerName":"./src/patchHelpers.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\uui\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/patchHelpers.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\patchHelpers.ts","name":"./src/patchHelpers.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/patchHelpers.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\patchHelpers.ts","module":"./src/patchHelpers.ts","moduleName":"./src/patchHelpers.ts","type":"cjs require","userRequest":"lodash.merge","loc":"10:45-68"}],"providedExports":null,"optimizationBailout":[],"depth":4},{"id":"lodash.pick","identifier":"external \"lodash.pick\"","name":"external \"lodash.pick\"","index":22,"index2":17,"size":42,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\patchHelpers.ts","issuerId":"./src/patchHelpers.ts","issuerName":"./src/patchHelpers.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\uui\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/patchHelpers.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\patchHelpers.ts","name":"./src/patchHelpers.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/patchHelpers.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\patchHelpers.ts","module":"./src/patchHelpers.ts","moduleName":"./src/patchHelpers.ts","type":"cjs require","userRequest":"lodash.pick","loc":"14:44-66"}],"providedExports":null,"optimizationBailout":[],"depth":4},{"id":"lodash.transform","identifier":"external \"lodash.transform\"","name":"external \"lodash.transform\"","index":9,"index2":4,"size":42,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\utils.ts","issuerId":"./src/utils.ts","issuerName":"./src/utils.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\uui\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/utils.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\utils.ts","name":"./src/utils.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/utils.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\utils.ts","module":"./src/utils.ts","moduleName":"./src/utils.ts","type":"cjs require","userRequest":"lodash.transform","loc":"7:49-76"}],"providedExports":null,"optimizationBailout":[],"depth":4},{"id":"lodash.zip","identifier":"external \"lodash.zip\"","name":"external \"lodash.zip\"","index":8,"index2":3,"size":42,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\utils.ts","issuerId":"./src/utils.ts","issuerName":"./src/utils.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\uui\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/utils.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\utils.ts","name":"./src/utils.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/utils.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\utils.ts","module":"./src/utils.ts","moduleName":"./src/utils.ts","type":"cjs require","userRequest":"lodash.zip","loc":"6:43-64"}],"providedExports":null,"optimizationBailout":[],"depth":4},{"id":"react","identifier":"external \"react\"","name":"external \"react\"","index":29,"index2":25,"size":42,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\reactHooks.ts","issuerId":"./src/reactHooks.ts","issuerName":"./src/reactHooks.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\uui\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/reactHooks.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\reactHooks.ts","name":"./src/reactHooks.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/reactHooks.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\reactHooks.ts","module":"./src/reactHooks.ts","moduleName":"./src/reactHooks.ts","type":"cjs require","userRequest":"react","loc":"5:14-30"}],"providedExports":null,"optimizationBailout":[],"depth":4},{"id":"shallowequal","identifier":"external \"shallowequal\"","name":"external \"shallowequal\"","index":7,"index2":2,"size":42,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\utils.ts","issuerId":"./src/utils.ts","issuerName":"./src/utils.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\uui\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/utils.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\utils.ts","name":"./src/utils.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/utils.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\utils.ts","module":"./src/utils.ts","moduleName":"./src/utils.ts","type":"cjs require","userRequest":"shallowequal","loc":"5:45-68"}],"providedExports":null,"optimizationBailout":[],"depth":4}],"filteredModules":0,"origins":[{"module":"","moduleIdentifier":"","moduleName":"","loc":"main","request":null,"reasons":[]}]}],"modules":[{"id":0,"identifier":"multi C:\\work\\uui\\uui-db\\index.tsx","name":"multi ./index.tsx","index":0,"index2":29,"size":28,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":null,"issuerId":null,"issuerName":null,"issuerPath":null,"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":null,"moduleIdentifier":null,"module":null,"moduleName":null,"type":"multi entry"}],"providedExports":null,"optimizationBailout":[],"depth":0},{"id":"../node_modules/tslib/tslib.es6.js","identifier":"C:\\work\\uui\\node_modules\\tslib\\tslib.es6.js","name":"../node_modules/tslib/tslib.es6.js","index":2,"index2":0,"size":10274,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","issuerId":"./index.tsx","issuerName":"./index.tsx","issuerPath":[{"id":0,"identifier":"multi C:\\work\\uui\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","name":"./index.tsx"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./index.tsx","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","module":"./index.tsx","moduleName":"./index.tsx","type":"cjs require","userRequest":"tslib","loc":"3:14-30"},{"moduleId":"./src/Db.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\Db.ts","module":"./src/Db.ts","moduleName":"./src/Db.ts","type":"cjs require","userRequest":"tslib","loc":"4:14-30"},{"moduleId":"./src/DbRef.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\DbRef.ts","module":"./src/DbRef.ts","moduleName":"./src/DbRef.ts","type":"cjs require","userRequest":"tslib","loc":"4:14-30"},{"moduleId":"./src/DbTable.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\DbTable.ts","module":"./src/DbTable.ts","moduleName":"./src/DbTable.ts","type":"cjs require","userRequest":"tslib","loc":"4:14-30"},{"moduleId":"./src/ListLoadingTracker.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\ListLoadingTracker.ts","module":"./src/ListLoadingTracker.ts","moduleName":"./src/ListLoadingTracker.ts","type":"cjs require","userRequest":"tslib","loc":"4:14-30"},{"moduleId":"./src/index.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","module":"./src/index.ts","moduleName":"./src/index.ts","type":"cjs require","userRequest":"tslib","loc":"3:14-30"},{"moduleId":"./src/patchHelpers.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\patchHelpers.ts","module":"./src/patchHelpers.ts","moduleName":"./src/patchHelpers.ts","type":"cjs require","userRequest":"tslib","loc":"4:14-30"},{"moduleId":"./src/reactHooks.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\reactHooks.ts","module":"./src/reactHooks.ts","moduleName":"./src/reactHooks.ts","type":"cjs require","userRequest":"tslib","loc":"4:14-30"},{"moduleId":"./src/tempIds.tsx","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\tempIds.tsx","module":"./src/tempIds.tsx","moduleName":"./src/tempIds.tsx","type":"cjs require","userRequest":"tslib","loc":"4:14-30"},{"moduleId":"./src/utils.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\utils.ts","module":"./src/utils.ts","moduleName":"./src/utils.ts","type":"cjs require","userRequest":"tslib","loc":"4:14-30"}],"providedExports":["__extends","__assign","__rest","__decorate","__param","__metadata","__awaiter","__generator","__createBinding","__exportStar","__values","__read","__spread","__spreadArrays","__await","__asyncGenerator","__asyncDelegator","__asyncValues","__makeTemplateObject","__importStar","__importDefault","__classPrivateFieldGet","__classPrivateFieldSet"],"optimizationBailout":[],"depth":2,"source":"/*! *****************************************************************************\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\nexport function __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}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n"},{"id":"./index.tsx","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","name":"./index.tsx","index":1,"index2":28,"size":162,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"multi C:\\work\\uui\\uui-db\\index.tsx","issuerId":0,"issuerName":"multi ./index.tsx","issuerPath":[{"id":0,"identifier":"multi C:\\work\\uui\\uui-db\\index.tsx","name":"multi ./index.tsx"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":0,"moduleIdentifier":"multi C:\\work\\uui\\uui-db\\index.tsx","module":"multi ./index.tsx","moduleName":"multi ./index.tsx","type":"single entry","userRequest":"C:\\work\\uui\\uui-db\\index.tsx","loc":"main[0]"}],"providedExports":null,"optimizationBailout":[],"depth":1,"source":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar tslib_1 = require(\"tslib\");\r\ntslib_1.__exportStar(require(\"./src\"), exports);\r\n"},{"id":"./src/Db.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\Db.ts","name":"./src/Db.ts","index":5,"index2":7,"size":2893,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","issuerId":"./src/index.ts","issuerName":"./src/index.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\uui\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","name":"./src/index.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/index.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","module":"./src/index.ts","moduleName":"./src/index.ts","type":"cjs require","userRequest":"./Db","loc":"5:21-36"}],"providedExports":null,"optimizationBailout":[],"depth":3,"source":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.Db = void 0;\r\nvar tslib_1 = require(\"tslib\");\r\nvar utils_1 = require(\"./utils\");\r\nvar lodash_isequal_1 = tslib_1.__importDefault(require(\"lodash.isequal\"));\r\nvar Db = /** @class */ (function () {\r\n function Db(tables, reusedCache) {\r\n this.tables = tables;\r\n this.viewCache = new Map();\r\n /* Views (cached db projections) */\r\n this.valueAbsent = Symbol(\"ValueAbsent\");\r\n if (reusedCache) {\r\n this.viewCache = new Map(reusedCache);\r\n }\r\n else {\r\n this.viewCache = new Map();\r\n }\r\n }\r\n Db.prototype.update = function (mutate) {\r\n var clone = new this.constructor(tslib_1.__assign({}, this.tables), this.viewCache);\r\n mutate(clone);\r\n return clone;\r\n };\r\n Db.prototype.with = function (patch) {\r\n return this.update(function (db) {\r\n utils_1.objectKeys(db.tables).forEach(function (entityName) {\r\n if (patch[entityName]) {\r\n db.tables[entityName] = db.tables[entityName].with(patch[entityName]);\r\n }\r\n });\r\n });\r\n };\r\n Db.prototype.runView = function (view, params) {\r\n var cache = this.viewCache.get(view);\r\n if (!cache) {\r\n cache = new Map();\r\n this.viewCache.set(view, cache);\r\n }\r\n var key = view.getKey ? view.getKey(params) : JSON.stringify(params);\r\n var cacheItem = cache.get(key);\r\n if (!cacheItem) {\r\n cacheItem = {\r\n dependencies: this.valueAbsent,\r\n currentValue: this.valueAbsent,\r\n computedOnDb: this.valueAbsent,\r\n };\r\n cache.set(key, cacheItem);\r\n }\r\n var shouldUpdate = this !== cacheItem.computedOnDb;\r\n var dependencies = this.valueAbsent;\r\n if (view.getDependencies) {\r\n var compare = view.compareDependencies || utils_1.defaultCompareViewDependencies;\r\n dependencies = view.getDependencies(this, params);\r\n shouldUpdate = !compare(cacheItem.dependencies, dependencies);\r\n }\r\n var previousValue = cacheItem.currentValue;\r\n if (shouldUpdate) {\r\n cacheItem.dependencies = dependencies;\r\n var newValue = view.compute(this, params, dependencies);\r\n cacheItem.computedOnDb = this;\r\n var compareResults = view.compareResults || lodash_isequal_1.default;\r\n if (!compareResults(previousValue, newValue)) {\r\n if (view.traceDiff) {\r\n console.debug(utils_1.difference(previousValue, newValue));\r\n }\r\n cacheItem.currentValue = newValue;\r\n }\r\n }\r\n return cacheItem.currentValue;\r\n };\r\n return Db;\r\n}());\r\nexports.Db = Db;\r\n"},{"id":"./src/DbRef.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\DbRef.ts","name":"./src/DbRef.ts","index":14,"index2":24,"size":9791,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","issuerId":"./src/index.ts","issuerName":"./src/index.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\uui\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","name":"./src/index.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/index.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","module":"./src/index.ts","moduleName":"./src/index.ts","type":"cjs require","userRequest":"./DbRef","loc":"7:21-39"}],"providedExports":null,"optimizationBailout":[],"depth":3,"source":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.DbRef = void 0;\r\nvar tslib_1 = require(\"tslib\");\r\nvar patchHelpers_1 = require(\"./patchHelpers\");\r\nvar tempIds_1 = require(\"./tempIds\");\r\nvar utils_1 = require(\"./utils\");\r\nvar lodash_isempty_1 = tslib_1.__importDefault(require(\"lodash.isempty\"));\r\nvar Loader_1 = require(\"./Loader\");\r\nvar SimpleLoadingTracker_1 = require(\"./SimpleLoadingTracker\");\r\nvar ListLoadingTracker_1 = require(\"./ListLoadingTracker\");\r\nvar DbRef = /** @class */ (function () {\r\n function DbRef(blank) {\r\n var _this = this;\r\n this.blank = blank;\r\n this.log = [];\r\n this.autoSave = true;\r\n this.savedPoint = 0;\r\n this.errors = [];\r\n this.throttleSaveMs = 1000;\r\n /* Update subscriptions (aka live views) */\r\n this.lastSubscriptionId = 1;\r\n this.subscriptions = new Map();\r\n this.updateHandlers = [];\r\n /* Error Subscriptions */\r\n this.saveErrorHandlers = [];\r\n /* Save scheduling */\r\n this.isSaveInProgress = false;\r\n this.isSaveThrottled = false;\r\n this.handleBeforeUnload = function (e) {\r\n if (_this.isSaveInProgress || _this.isSaveThrottled) {\r\n e.returnValue = false;\r\n return false;\r\n }\r\n };\r\n this.loaders = [];\r\n this.db = blank;\r\n this.base = blank;\r\n this.tempIdMap = new tempIds_1.TempIdMap(blank);\r\n this.idMap = this.tempIdMap;\r\n window.addEventListener('beforeunload', this.handleBeforeUnload);\r\n }\r\n /** Saves all committed patches. Useful only if autoSave is off. */\r\n DbRef.prototype.save = function () {\r\n this.enqueueSave();\r\n this.update();\r\n };\r\n DbRef.prototype.getAutoSave = function () {\r\n return this.autoSave;\r\n };\r\n DbRef.prototype.setAutoSave = function (val) {\r\n if (this.autoSave != val) {\r\n this.autoSave = val;\r\n this.enqueueSave();\r\n this.update();\r\n }\r\n };\r\n /** Concrete DbRef instances should override and implement their save logic in this method */\r\n DbRef.prototype.savePatch = function (patch) {\r\n return Promise.resolve({ submit: {} });\r\n };\r\n /* Db Update logic */\r\n DbRef.prototype.commit = function (patch) {\r\n try {\r\n var dbBeforeUpdate = this.db.with(patch);\r\n patch = this.beforeUpdate(patch, dbBeforeUpdate.tables, this.db.tables);\r\n patch = patchHelpers_1.mergeEntityPatches(this.db.tables, patch);\r\n this.log.push({ patch: patch });\r\n this.db = this.db.with(patch);\r\n this.autoSave && this.enqueueSave();\r\n this.update();\r\n }\r\n catch (e) {\r\n this.saveError(patch, e);\r\n }\r\n };\r\n DbRef.prototype.beforeUpdate = function (patch, tables, prevTables) {\r\n var _this = this;\r\n var patchAndDependencies = {};\r\n utils_1.objectKeys(tables).filter(function (entityName) { return patch[entityName] && !tables[entityName].schema.beforeUpdate; }).forEach(function (entityName) {\r\n patchAndDependencies[entityName] = patch[entityName];\r\n });\r\n utils_1.objectKeys(tables).filter(function (entityName) { return patch[entityName] && tables[entityName].schema.beforeUpdate; }).forEach(function (entityName) {\r\n var _a;\r\n var schema = tables[entityName].schema;\r\n var beforeUpdate = schema.beforeUpdate;\r\n var context = {\r\n clientIdsMap: _this.tempIdMap,\r\n schema: schema,\r\n tables: tables,\r\n prevTables: prevTables,\r\n };\r\n var results = patch[entityName].map(function (e) { return beforeUpdate(e, context); });\r\n var updatedPatch = (_a = {}, _a[entityName] = results.map(function (result) { return result.entity; }), _a);\r\n var dependentEntityPatchesForUpdate = patchHelpers_1.unionPatches(results.filter(function (result) { return result.dependentEntities; }).map(function (result) { return result.dependentEntities; }));\r\n var dependentEntityPatches = _this.beforeUpdate(dependentEntityPatchesForUpdate, tables, prevTables);\r\n patchAndDependencies = patchHelpers_1.mergeEntityPatches(tables, patchHelpers_1.unionPatches([patchAndDependencies, updatedPatch, dependentEntityPatches]));\r\n });\r\n return patchAndDependencies;\r\n };\r\n DbRef.prototype.commitFetch = function (patch) {\r\n patch = this.tempIdMap.serverToClientPatch(patch);\r\n this.rebase(this.base.with(patch));\r\n this.update();\r\n };\r\n DbRef.prototype.rebase = function (newBase) {\r\n this.base = newBase;\r\n this.db = newBase;\r\n for (var n = this.savedPoint; n < this.log.length; n++) {\r\n this.db = this.db.with(this.log[n].patch);\r\n }\r\n };\r\n DbRef.prototype.makeCumulativePatch = function () {\r\n var lastLogEntry = this.log.length;\r\n var logEntriesToSave = this.log.slice(this.savedPoint, lastLogEntry);\r\n var cumulativePatch = patchHelpers_1.makeCumulativePatch(this.db, logEntriesToSave.map(function (t) { return t.patch; }), this.tempIdMap);\r\n cumulativePatch = this.tempIdMap.clientToServerPatch(cumulativePatch);\r\n return cumulativePatch;\r\n };\r\n DbRef.prototype.applyResponse = function (response, newSavedPoint) {\r\n var _this = this;\r\n if (this.errors.length == 0) {\r\n this.tempIdMap.appendServerMapping(response);\r\n var serverPatch = patchHelpers_1.flattenResponse(response.submit, this.db.tables);\r\n serverPatch = patchHelpers_1.mergeEntityPatches(this.db.tables, serverPatch);\r\n this.savedPoint = newSavedPoint;\r\n this.base = this.db;\r\n this.commitFetch(serverPatch);\r\n if (this.autoSave) {\r\n this.isSaveThrottled = true;\r\n setTimeout(function () {\r\n _this.isSaveThrottled = false;\r\n if (_this.savedPoint < _this.log.length) {\r\n _this.enqueueSave();\r\n }\r\n }, this.throttleSaveMs);\r\n }\r\n }\r\n };\r\n DbRef.prototype.subscribe = function (view, params, onUpdate) {\r\n var _this = this;\r\n var id = this.lastSubscriptionId++;\r\n var subscription = {\r\n update: function (params) {\r\n subscription.currentParams = params;\r\n subscription.currentValue = _this.db.runView(view, params);\r\n return subscription.currentValue;\r\n },\r\n currentParams: null,\r\n currentValue: null,\r\n onUpdate: onUpdate,\r\n unsubscribe: function () { _this.subscriptions.delete(id); },\r\n };\r\n subscription.update(params);\r\n this.subscriptions.set(id, subscription);\r\n return subscription;\r\n };\r\n DbRef.prototype.onUpdate = function (handler) {\r\n this.subscribe({\r\n compute: function (db) { return db; },\r\n compareResults: function (a, b) { return a === b; },\r\n }, null, handler);\r\n };\r\n DbRef.prototype.update = function () {\r\n this.subscriptions.forEach(function (subscription) {\r\n var previousValue = subscription.currentValue;\r\n subscription.update(subscription.currentParams);\r\n if (subscription.currentValue !== previousValue && subscription.onUpdate) {\r\n subscription.onUpdate(subscription.currentValue);\r\n }\r\n });\r\n };\r\n DbRef.prototype.onSaveError = function (handler) {\r\n this.saveErrorHandlers.push(handler);\r\n };\r\n DbRef.prototype.saveError = function (request, error) {\r\n this.saveErrorHandlers.forEach(function (handler) { return handler(request, error); });\r\n };\r\n DbRef.prototype.enqueueSave = function () {\r\n var _this = this;\r\n if (!this.isSaveInProgress && !this.isSaveThrottled) {\r\n try {\r\n this.isSaveInProgress = true;\r\n var lastLogEntry_1 = this.log.length;\r\n var cumulativePatch_1 = this.makeCumulativePatch();\r\n if (lodash_isempty_1.default(cumulativePatch_1)) {\r\n this.isSaveInProgress = false;\r\n return;\r\n }\r\n this.savePatch(cumulativePatch_1)\r\n .then(function (response) {\r\n _this.applyResponse(response, lastLogEntry_1);\r\n _this.isSaveInProgress = false;\r\n _this.update();\r\n })\r\n .catch(function (reason) {\r\n _this.saveError(cumulativePatch_1, reason);\r\n _this.isSaveInProgress = false;\r\n _this.update();\r\n });\r\n }\r\n catch (e) {\r\n this.isSaveInProgress = false;\r\n this.isSaveThrottled = false;\r\n throw e;\r\n }\r\n }\r\n };\r\n DbRef.prototype.makeLoader = function (options) {\r\n var loader = new Loader_1.Loader(this, function () { return new SimpleLoadingTracker_1.SimpleLoadingTracker(); }, options);\r\n this.loaders.push(loader);\r\n return loader;\r\n };\r\n DbRef.prototype.makeListLoader = function (options) {\r\n var loader = new Loader_1.Loader(this, function () { return new ListLoadingTracker_1.ListLoadingTracker(); }, options);\r\n this.loaders.push(loader);\r\n return loader;\r\n };\r\n DbRef.prototype.reload = function () {\r\n this.loaders = [];\r\n };\r\n return DbRef;\r\n}());\r\nexports.DbRef = DbRef;\r\n"},{"id":"./src/DbTable.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\DbTable.ts","name":"./src/DbTable.ts","index":11,"index2":10,"size":9565,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","issuerId":"./src/index.ts","issuerName":"./src/index.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\uui\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","name":"./src/index.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/index.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","module":"./src/index.ts","moduleName":"./src/index.ts","type":"cjs require","userRequest":"./DbTable","loc":"6:21-41"}],"providedExports":null,"optimizationBailout":[],"depth":3,"source":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.DbTable = void 0;\r\nvar tslib_1 = require(\"tslib\");\r\nvar I = tslib_1.__importStar(require(\"immutable\"));\r\nvar uui_1 = require(\"@epam/uui\");\r\nvar immutable_1 = require(\"immutable\");\r\nvar DbTable = /** @class */ (function () {\r\n function DbTable(schema, state, q) {\r\n this.schema = schema;\r\n this.state = state;\r\n this.q = q;\r\n if (!state) {\r\n var indexes = (schema.indexes || []).map(function (indexDef) {\r\n return {\r\n field: indexDef,\r\n map: I.Map(),\r\n };\r\n });\r\n this.state = { pk: I.Map(), indexes: indexes };\r\n }\r\n if (!q) {\r\n this.q = {};\r\n }\r\n }\r\n DbTable.prototype.keyToImmutable = function (id) {\r\n if (Array.isArray(id)) {\r\n return I.List(id);\r\n }\r\n else {\r\n return id;\r\n }\r\n };\r\n DbTable.prototype.byId = function (id) {\r\n return this.state.pk.get(this.keyToImmutable(id));\r\n };\r\n DbTable.prototype.getId = function (entity) {\r\n if (Array.isArray(this.schema.primaryKey)) {\r\n return this.schema.primaryKey.map(function (key) { return entity[key]; });\r\n }\r\n return entity[this.schema.primaryKey];\r\n };\r\n DbTable.prototype.update = function (mutate) {\r\n var clone = new this.constructor(this.schema, this.state, this.q);\r\n mutate(clone);\r\n return clone;\r\n };\r\n /* Mutation */\r\n DbTable.prototype.with = function (patch) {\r\n var _this = this;\r\n var updates = patch.map(function (entityPatch) {\r\n var id = _this.getId(entityPatch);\r\n var immId = _this.keyToImmutable(id);\r\n var existing = _this.state.pk.get(immId);\r\n var updated = entityPatch;\r\n if (existing) {\r\n updated = tslib_1.__assign(tslib_1.__assign({}, existing), entityPatch);\r\n }\r\n return { id: id, immId: immId, patch: entityPatch, existing: existing, updated: updated, updatedFieldsisNew: !existing };\r\n });\r\n var idVal = immutable_1.Seq.Keyed(updates.map(function (entity) { return [entity.immId, entity.updated]; }));\r\n var newPk = this.state.pk.merge(idVal);\r\n var newIndexes = this.state.indexes.map(function (index) {\r\n var newMap = index.map;\r\n var _loop_1 = function (n) {\r\n var update = updates[n];\r\n var newKey = update.updated[index.field];\r\n if (update.existing) {\r\n var oldKey = update.existing[index.field];\r\n if (oldKey !== newKey) {\r\n newMap = newMap.update(oldKey, function (set) { return set.remove(update.immId); });\r\n }\r\n }\r\n newMap = newMap.update(newKey, I.Set(), function (set) { return set.add(update.immId); });\r\n };\r\n for (var n = 0; n < updates.length; n++) {\r\n _loop_1(n);\r\n }\r\n return tslib_1.__assign(tslib_1.__assign({}, index), { map: newMap });\r\n });\r\n var newState = { pk: newPk, indexes: newIndexes };\r\n return this.update(function (t) { return t.state = newState; });\r\n };\r\n /* Query */\r\n DbTable.prototype.find = function (filter) {\r\n var _this = this;\r\n return this.update(function (t) { return t.q = tslib_1.__assign(tslib_1.__assign({}, t.q), { filter: tslib_1.__assign(tslib_1.__assign({}, _this.q.filter), filter) }); });\r\n };\r\n DbTable.prototype.order = function (order) {\r\n return this.update(function (t) { return t.q = tslib_1.__assign(tslib_1.__assign({}, t.q), { sorting: order }); });\r\n };\r\n DbTable.prototype.orderBy = function (field, direction) {\r\n if (direction === void 0) { direction = 'asc'; }\r\n return this.update(function (t) { return t.q = tslib_1.__assign(tslib_1.__assign({}, t.q), { sorting: [{ field: field, direction: direction }] }); });\r\n };\r\n DbTable.prototype.thenBy = function (field, direction) {\r\n return this.update(function (t) { return t.q = tslib_1.__assign(tslib_1.__assign({}, t.q), { sorting: tslib_1.__spreadArrays(t.q.sorting, [{ field: field, direction: direction }]) }); });\r\n };\r\n DbTable.prototype.search = function (text) {\r\n if (!this.schema.searchBy) {\r\n throw new Error(\"Can't search in the \" + this.schema.typeName + \" table - searchBy is not defined in the schema.\");\r\n }\r\n return this.update(function (t) { return t.q = tslib_1.__assign(tslib_1.__assign({}, t.q), { search: text }); });\r\n };\r\n /* Materializing */\r\n DbTable.prototype.range = function (from, count) {\r\n return this.runQuery(tslib_1.__assign(tslib_1.__assign({}, this.q), { range: { from: from, count: count } }));\r\n };\r\n DbTable.prototype.count = function () {\r\n return this.runQuery(this.q).length;\r\n };\r\n DbTable.prototype.one = function () {\r\n return this.runQuery(this.q)[0] || null;\r\n };\r\n DbTable.prototype.toArray = function () {\r\n return this.runQuery(this.q);\r\n };\r\n DbTable.prototype.map = function (fn) {\r\n return this.toArray().map(fn);\r\n };\r\n /* Query implementation */\r\n DbTable.prototype.runQuery = function (q) {\r\n var _this = this;\r\n var result = null;\r\n var filter = q.filter;\r\n if (filter) {\r\n var indexes = this.state.indexes;\r\n // Try to use indexes to fulfill filter conditions\r\n for (var n = 0; n < indexes.length; n++) {\r\n var index = indexes[n];\r\n if (index.field in filter) {\r\n var _a = filter, _b = index.field, condition = _a[_b], rest = tslib_1.__rest(_a, [typeof _b === \"symbol\" ? _b : _b + \"\"]);\r\n var conditionValues = null;\r\n if (condition != null && typeof condition === \"object\") {\r\n // Attempt to use index for 'in' and 'isNull' criteria.\r\n // We need to be very conservative here, indexed field should work the same way as getPatternPredicate. So\r\n // - it's better to leave corner cases to getPatternPredicate\r\n var _c = condition, inCriteria = _c.in, nullCriteria = _c.isNull, restCriteria = tslib_1.__rest(_c, [\"in\", \"isNull\"]);\r\n if (inCriteria && Array.isArray(inCriteria)) {\r\n conditionValues = inCriteria;\r\n }\r\n else {\r\n restCriteria.in = inCriteria;\r\n }\r\n // Conditions in getPatternPredicate are composed with 'and' logic,\r\n // For now, let's not attempt to handle tricky cases like { in: [1,2] isNull: true }, or { in: [1, null] isNull: false }\r\n // - just leave this to getPatternPredicate.\r\n // Let's just handle the a most common case { isNull: true } - find all null and undefined\r\n if (nullCriteria === true && !conditionValues) {\r\n conditionValues = [null, undefined];\r\n }\r\n else {\r\n restCriteria.in = inCriteria;\r\n }\r\n // Keep other conditions, e.g. { in: [1,2,3], isNull: true } - in works via index, isNull - via filter\r\n if (Object.keys(restCriteria).length > 0) {\r\n rest[index.field] = restCriteria;\r\n }\r\n }\r\n else {\r\n conditionValues = [condition];\r\n }\r\n if (conditionValues) {\r\n result = [];\r\n for (var i = 0; i < conditionValues.length; i++) {\r\n var idsSet = index.map.get(conditionValues[i]);\r\n if (idsSet) {\r\n var idsArray = idsSet.toArray();\r\n for (var j = 0; j < idsArray.length; j++) {\r\n var item = this.state.pk.get(idsArray[j]);\r\n result.push(item);\r\n }\r\n }\r\n }\r\n filter = Object.keys(rest).length > 0 ? rest : null;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n if (!result) {\r\n result = this.state.pk.toArray();\r\n }\r\n if (filter) {\r\n var predicate = uui_1.getPatternPredicate(q.filter);\r\n result = result.filter(predicate);\r\n }\r\n if (q.search) {\r\n var searchFilter_1 = uui_1.getSearchFilter(q.search);\r\n result = result.filter(function (item) { return searchFilter_1(_this.schema.searchBy.map(function (field) { return item[field]; })); });\r\n }\r\n if (q.sorting) {\r\n var comparer = uui_1.getOrderComparer(q.sorting);\r\n result = result.sort(comparer);\r\n }\r\n if (q.range) {\r\n result = result.slice(q.range.from, q.range.from + q.range.count);\r\n }\r\n return result;\r\n };\r\n return DbTable;\r\n}());\r\nexports.DbTable = DbTable;\r\n"},{"id":"./src/ListLoadingTracker.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\ListLoadingTracker.ts","name":"./src/ListLoadingTracker.ts","index":27,"index2":23,"size":4034,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\DbRef.ts","issuerId":"./src/DbRef.ts","issuerName":"./src/DbRef.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\uui\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/DbRef.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\DbRef.ts","name":"./src/DbRef.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/DbRef.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\DbRef.ts","module":"./src/DbRef.ts","moduleName":"./src/DbRef.ts","type":"cjs require","userRequest":"./ListLoadingTracker","loc":"11:27-58"}],"providedExports":null,"optimizationBailout":[],"depth":4,"source":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.ListLoadingTracker = void 0;\r\nvar tslib_1 = require(\"tslib\");\r\nvar ListLoadingTracker = /** @class */ (function () {\r\n function ListLoadingTracker(options) {\r\n this.options = options;\r\n this.cache = new Map();\r\n this.extractList = (options === null || options === void 0 ? void 0 : options.extractList) || (function (r) { return r; });\r\n }\r\n ListLoadingTracker.prototype.prepare = function (request) {\r\n var filter = request.filter, sorting = request.sorting, search = request.search, range = request.range, unknownFields = tslib_1.__rest(request, [\"filter\", \"sorting\", \"search\", \"range\"]);\r\n var options = {};\r\n if (filter) {\r\n options.filter = filter;\r\n }\r\n if (sorting) {\r\n options.sorting = sorting;\r\n }\r\n if (search) {\r\n options.search = search;\r\n }\r\n var keyObject = tslib_1.__assign(tslib_1.__assign({}, options), unknownFields);\r\n var key = JSON.stringify(keyObject);\r\n var entry = this.cache.get(key);\r\n if (!entry) {\r\n entry = { options: options, count: 0, maxCount: null, isComplete: false };\r\n this.cache.set(key, entry);\r\n }\r\n return { options: options, range: range, unknownFields: unknownFields, entry: entry };\r\n };\r\n ListLoadingTracker.prototype.diff = function (request) {\r\n var _a = this.prepare(request), options = _a.options, range = _a.range, unknownFields = _a.unknownFields, entry = _a.entry;\r\n if (entry.isComplete) {\r\n return null;\r\n }\r\n if (!request.range) {\r\n return request;\r\n }\r\n else {\r\n var requestedMax = request.range.from + request.range.count;\r\n var missingCount = requestedMax - entry.count;\r\n if (entry.maxCount) {\r\n missingCount = Math.min(missingCount, entry.maxCount);\r\n }\r\n if (missingCount > 0) {\r\n return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, options), unknownFields), { range: { from: entry.count, count: requestedMax - entry.count } });\r\n }\r\n else {\r\n return null;\r\n }\r\n }\r\n };\r\n ListLoadingTracker.prototype.count = function (request) {\r\n var _a = this.prepare(request), options = _a.options, range = _a.range, unknownFields = _a.unknownFields, entry = _a.entry;\r\n return { knownCount: Math.max(entry.count, entry.maxCount), exactCount: entry.maxCount };\r\n };\r\n ListLoadingTracker.prototype.append = function (request, response) {\r\n var _a = this.prepare(request), options = _a.options, range = _a.range, unknownFields = _a.unknownFields, entry = _a.entry;\r\n if (response) {\r\n var list = this.extractList(response);\r\n if (list.count) {\r\n entry.maxCount = list.count;\r\n }\r\n if (!range) {\r\n entry.count = list.items.length;\r\n entry.maxCount = list.items.length;\r\n entry.isComplete = true;\r\n }\r\n else {\r\n var from = (list.from == null) ? range.from : list.from;\r\n if (list.items.length > 0) {\r\n entry.count = Math.max(entry.count, from + list.items.length);\r\n }\r\n if (list.items.length < range.count) {\r\n entry.maxCount = from + list.items.length;\r\n entry.count = entry.maxCount;\r\n entry.isComplete = true;\r\n }\r\n }\r\n }\r\n else {\r\n if (range) {\r\n entry.count = Math.max(entry.count, request.range.from + request.range.count);\r\n }\r\n else {\r\n entry.isComplete = true;\r\n }\r\n }\r\n };\r\n return ListLoadingTracker;\r\n}());\r\nexports.ListLoadingTracker = ListLoadingTracker;\r\n"},{"id":"./src/Loader.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\Loader.ts","name":"./src/Loader.ts","index":25,"index2":21,"size":3340,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\DbRef.ts","issuerId":"./src/DbRef.ts","issuerName":"./src/DbRef.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\uui\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/DbRef.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\DbRef.ts","name":"./src/DbRef.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/DbRef.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\DbRef.ts","module":"./src/DbRef.ts","moduleName":"./src/DbRef.ts","type":"cjs require","userRequest":"./Loader","loc":"9:15-34"}],"providedExports":null,"optimizationBailout":[],"depth":4,"source":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.Loader = void 0;\r\nvar Loader = /** @class */ (function () {\r\n function Loader(dbRef, getTracker, options) {\r\n var _this = this;\r\n this.dbRef = dbRef;\r\n this.getTracker = getTracker;\r\n this.options = options;\r\n this.currentRequests = new Set();\r\n this.load = function (inputRequest) {\r\n var result = {\r\n isComplete: _this.loaded.diff(inputRequest) == null,\r\n isLoading: false,\r\n request: inputRequest,\r\n missing: _this.loadedAndLoading.diff(inputRequest),\r\n promise: null,\r\n reload: null,\r\n };\r\n result.reload = function () {\r\n result.missing = inputRequest;\r\n _this.loadImpl(result);\r\n };\r\n if (result.isComplete) {\r\n // Everything requested is already loaded\r\n result.isComplete = true;\r\n result.isLoading = false;\r\n result.promise = Promise.resolve();\r\n return result;\r\n }\r\n else {\r\n if (result.missing == null) {\r\n // Everything requested is either loaded already, or being loaded\r\n result.isComplete = false;\r\n result.isLoading = true;\r\n // There's no good way to tell which of current requests is querying requested data - there actually can be 2 of them.\r\n // So we track all running requests, and await all of them in such case.\r\n result.promise = Promise.all(_this.currentRequests.entries()).then(function () { });\r\n return result;\r\n }\r\n else {\r\n // Something requested is not loaded, nor being loaded. Need to perform a new request.\r\n _this.loadImpl(result);\r\n return result;\r\n }\r\n }\r\n };\r\n this.loaded = getTracker();\r\n this.loadedAndLoading = getTracker();\r\n }\r\n Loader.prototype.loadImpl = function (state) {\r\n var _this = this;\r\n this.loadedAndLoading.append(state.missing);\r\n state.isLoading = true;\r\n var serverRequest = state.missing;\r\n if (this.options.clientToServerRequest) {\r\n serverRequest = this.options.clientToServerRequest(serverRequest);\r\n }\r\n state.promise = this.options.api(serverRequest).then(function (result) {\r\n _this.loaded.append(state.missing, result);\r\n _this.loadedAndLoading.append(state.missing, result);\r\n state.missing = null;\r\n state.isLoading = false;\r\n state.isComplete = true;\r\n state.promise = Promise.resolve();\r\n var flatten = _this.options.convertToPatch(result);\r\n _this.options.postProcess && _this.options.postProcess(flatten);\r\n _this.dbRef.commitFetch(flatten);\r\n });\r\n this.currentRequests.add(state.promise);\r\n state.promise.finally(function () {\r\n _this.currentRequests.delete(state.promise);\r\n });\r\n return state.promise;\r\n };\r\n return Loader;\r\n}());\r\nexports.Loader = Loader;\r\n"},{"id":"./src/SimpleLoadingTracker.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\SimpleLoadingTracker.ts","name":"./src/SimpleLoadingTracker.ts","index":26,"index2":22,"size":731,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\DbRef.ts","issuerId":"./src/DbRef.ts","issuerName":"./src/DbRef.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\uui\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/DbRef.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\DbRef.ts","name":"./src/DbRef.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/DbRef.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\DbRef.ts","module":"./src/DbRef.ts","moduleName":"./src/DbRef.ts","type":"cjs require","userRequest":"./SimpleLoadingTracker","loc":"10:29-62"}],"providedExports":null,"optimizationBailout":[],"depth":4,"source":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.SimpleLoadingTracker = void 0;\r\nvar SimpleLoadingTracker = /** @class */ (function () {\r\n function SimpleLoadingTracker() {\r\n this.set = new Set();\r\n }\r\n SimpleLoadingTracker.prototype.getKey = function (request) {\r\n return JSON.stringify(request);\r\n };\r\n SimpleLoadingTracker.prototype.diff = function (request) {\r\n return this.set.has(this.getKey(request)) ? null : request;\r\n };\r\n SimpleLoadingTracker.prototype.append = function (request, result) {\r\n this.set.add(this.getKey(request));\r\n };\r\n return SimpleLoadingTracker;\r\n}());\r\nexports.SimpleLoadingTracker = SimpleLoadingTracker;\r\n"},{"id":"./src/index.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","name":"./src/index.ts","index":3,"index2":27,"size":541,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","issuerId":"./index.tsx","issuerName":"./index.tsx","issuerPath":[{"id":0,"identifier":"multi C:\\work\\uui\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","name":"./index.tsx"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./index.tsx","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","module":"./index.tsx","moduleName":"./index.tsx","type":"cjs require","userRequest":"./src","loc":"4:21-37"}],"providedExports":null,"optimizationBailout":[],"depth":2,"source":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nvar tslib_1 = require(\"tslib\");\r\ntslib_1.__exportStar(require(\"./types\"), exports);\r\ntslib_1.__exportStar(require(\"./Db\"), exports);\r\ntslib_1.__exportStar(require(\"./DbTable\"), exports);\r\ntslib_1.__exportStar(require(\"./DbRef\"), exports);\r\ntslib_1.__exportStar(require(\"./tempIds\"), exports);\r\ntslib_1.__exportStar(require(\"./utils\"), exports);\r\ntslib_1.__exportStar(require(\"./patchHelpers\"), exports);\r\ntslib_1.__exportStar(require(\"./reactHooks\"), exports);\r\n"},{"id":"./src/patchHelpers.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\patchHelpers.ts","name":"./src/patchHelpers.ts","index":15,"index2":18,"size":9010,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","issuerId":"./src/index.ts","issuerName":"./src/index.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\uui\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","name":"./src/index.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/DbRef.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\DbRef.ts","module":"./src/DbRef.ts","moduleName":"./src/DbRef.ts","type":"cjs require","userRequest":"./patchHelpers","loc":"5:21-46"},{"moduleId":"./src/index.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","module":"./src/index.ts","moduleName":"./src/index.ts","type":"cjs require","userRequest":"./patchHelpers","loc":"10:21-46"}],"providedExports":null,"optimizationBailout":[],"depth":3,"source":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.getEntityParentDependencies = exports.getParentEntities = exports.hasServerFields = exports.isNew = exports.getId = exports.isClientOnly = exports.makeCumulativePatch = exports.isPatchBlank = exports.flattenResponse = exports.mergeEntityPatches = exports.unionPatches = void 0;\r\nvar tslib_1 = require(\"tslib\");\r\nvar types_1 = require(\"./types\");\r\nvar I = tslib_1.__importStar(require(\"immutable\"));\r\nvar utils_1 = require(\"./utils\");\r\nvar lodash_groupby_1 = tslib_1.__importDefault(require(\"lodash.groupby\"));\r\nvar lodash_map_1 = tslib_1.__importDefault(require(\"lodash.map\"));\r\nvar lodash_merge_1 = tslib_1.__importDefault(require(\"lodash.merge\"));\r\nvar lodash_countby_1 = tslib_1.__importDefault(require(\"lodash.countby\"));\r\nvar lodash_filter_1 = tslib_1.__importDefault(require(\"lodash.filter\"));\r\nvar lodash_foreach_1 = tslib_1.__importDefault(require(\"lodash.foreach\"));\r\nvar lodash_pick_1 = tslib_1.__importDefault(require(\"lodash.pick\"));\r\nfunction unionPatches(patches) {\r\n var result = {};\r\n patches.forEach(function (patch) {\r\n utils_1.objectKeys(patch).forEach(function (tableName) {\r\n result[tableName] = result[tableName] ? tslib_1.__spreadArrays(result[tableName], patch[tableName]) : patch[tableName];\r\n });\r\n });\r\n return result;\r\n}\r\nexports.unionPatches = unionPatches;\r\nfunction mergeEntityPatches(tables, patch) {\r\n var result = {};\r\n utils_1.objectKeys(patch).forEach(function (key) {\r\n var table = tables[key];\r\n var groupedEntities = lodash_groupby_1.default(patch[key], function (item) { return table.getId(item); });\r\n var tablePatch = lodash_map_1.default(groupedEntities, function (entities) {\r\n var result = lodash_merge_1.default.apply(void 0, tslib_1.__spreadArrays([{}], entities));\r\n if (process.env.NODE_ENV !== 'production') {\r\n var props = utils_1.objectKeys(result).filter(function (prop) {\r\n return Object.keys(lodash_countby_1.default(entities.filter(function (entity) {\r\n return entity[prop] !== undefined;\r\n }), function (entity) { return entity[prop]; })).length > 1;\r\n });\r\n if (props.length) {\r\n console.warn.apply(console, tslib_1.__spreadArrays(['mergeEntityPatches: Different property values found for the same entity.\\nProperty names:\\n', props, '\\nEntities:\\n'], entities));\r\n }\r\n }\r\n return result;\r\n });\r\n result[key] = tablePatch;\r\n });\r\n return result;\r\n}\r\nexports.mergeEntityPatches = mergeEntityPatches;\r\nfunction flattenResponseHelper(result, object, tablesByTypeName) {\r\n if (Array.isArray(object)) {\r\n object.forEach(function (item) { return flattenResponseHelper(result, item, tablesByTypeName); });\r\n }\r\n else if (typeof object === 'object') {\r\n var clone = {};\r\n var tableKey = void 0;\r\n var fields = {};\r\n if ('__typename' in object) {\r\n var table = tablesByTypeName[object.__typename];\r\n if (table) {\r\n tableKey = table.schema.tableName;\r\n fields = table.schema.fields;\r\n }\r\n }\r\n for (var key in object) {\r\n var value = object[key];\r\n var field = fields[key];\r\n if ((field && !!field.disableFlatten)\r\n || typeof value !== 'object'\r\n || value === null\r\n || (Array.isArray(value) && value.every(function (item) { return typeof item !== 'object'; }))) {\r\n clone[key] = value;\r\n }\r\n else {\r\n flattenResponseHelper(result, value, tablesByTypeName);\r\n }\r\n }\r\n if (tableKey) {\r\n result[tableKey].push(clone);\r\n }\r\n }\r\n}\r\nfunction flattenResponse(response, tables) {\r\n var result = {};\r\n var tablesByTypeName = {};\r\n Object.values(tables).forEach(function (table) { return tablesByTypeName[table.schema.typeName] = table; });\r\n utils_1.objectKeys(tables).forEach(function (tableName) { return tablesByTypeName; });\r\n utils_1.objectKeys(tables).forEach(function (key) { return result[key] = []; });\r\n flattenResponseHelper(result, response, tablesByTypeName);\r\n return result;\r\n}\r\nexports.flattenResponse = flattenResponse;\r\nfunction isPatchBlank(patch) {\r\n return !utils_1.objectKeys(patch).some(function (key) { return patch[key].length > 0; });\r\n}\r\nexports.isPatchBlank = isPatchBlank;\r\n/**\r\n * Given several patches, creates a new single patch with all fields from all entities in all patches.\r\n */\r\nfunction makeCumulativePatch(updatedDb, patches, clientIdsMap) {\r\n var result = {};\r\n utils_1.objectKeys(updatedDb.tables).forEach(function (entityName) {\r\n var table = updatedDb.tables[entityName];\r\n var schema = table.schema;\r\n var ids = I.Set();\r\n patches.forEach(function (patch) {\r\n var filteredPatch = (patch[entityName] || []).filter(function (entity) { return hasServerFields(entity, schema, clientIdsMap, updatedDb.tables); });\r\n ids = ids.union(filteredPatch.map(function (e) { return table.getId(e); }));\r\n });\r\n var entities = ids\r\n .map(function (id) { return table.byId(id); })\r\n .filter(function (e) { return !isClientOnly(e, schema); })\r\n .toArray();\r\n if (entities.length > 0) {\r\n result[entityName] = entities;\r\n }\r\n });\r\n return result;\r\n}\r\nexports.makeCumulativePatch = makeCumulativePatch;\r\nfunction isClientOnly(entity, schema) {\r\n if (typeof schema.isClientOnly === 'function') {\r\n return schema.isClientOnly(entity);\r\n }\r\n return !!schema.isClientOnly;\r\n}\r\nexports.isClientOnly = isClientOnly;\r\nfunction getId(entity, schema) {\r\n if (typeof schema.primaryKey == 'string') {\r\n return entity[schema.primaryKey];\r\n }\r\n var result = [];\r\n lodash_foreach_1.default(lodash_pick_1.default(entity, schema.primaryKey), function (value) {\r\n result.push(value);\r\n });\r\n return result;\r\n}\r\nexports.getId = getId;\r\nfunction isNew(entity, schema, clientIdsMap) {\r\n var id = getId(entity, schema);\r\n return !clientIdsMap.clientToServer(id);\r\n}\r\nexports.isNew = isNew;\r\nfunction hasServerFields(entity, schema, clientIdsMap, tables) {\r\n var fullEntity = tslib_1.__assign(tslib_1.__assign({}, tables[schema.tableName].byId(entity.id) || {}), entity);\r\n if (isClientOnly(fullEntity, schema)) {\r\n return false;\r\n }\r\n return utils_1.objectKeys(entity).some(function (fieldName) {\r\n var fieldSchema = schema.fields[fieldName];\r\n return !fieldSchema || !(fieldSchema.isClientOnly || fieldSchema.isReadOnly || (fieldSchema.isGenerated && !isNew(entity, schema, clientIdsMap)));\r\n });\r\n}\r\nexports.hasServerFields = hasServerFields;\r\nfunction getParentEntities(patch, tables) {\r\n var dependenciesPatch = {};\r\n utils_1.objectKeys(patch).forEach(function (key) {\r\n var table = tables[key];\r\n var tableSchema = table.schema;\r\n var fields = lodash_filter_1.default(lodash_map_1.default(tableSchema.fields, function (field, name) { return (tslib_1.__assign(tslib_1.__assign({}, field), { name: name })); }), function (field) { return field.fk && field.fk.relationType == types_1.DbRelationType.Aggregation; });\r\n var tablePatch = patch[key];\r\n fields.forEach(function (field) {\r\n var tableName = field.fk.tableName, name = field.name;\r\n tablePatch.forEach(function (entity) {\r\n var actualTableName = (typeof tableName == 'function' ? tableName(entity) : tableName);\r\n var dbEntity = table.byId(table.getId(entity));\r\n var parentEntity = tables[actualTableName].byId(dbEntity[name]);\r\n var idFields = lodash_pick_1.default(parentEntity, tables[actualTableName].schema.primaryKey);\r\n if (parentEntity) {\r\n dependenciesPatch[actualTableName] = dependenciesPatch[actualTableName] || [];\r\n dependenciesPatch[actualTableName].push(idFields);\r\n }\r\n });\r\n });\r\n });\r\n return dependenciesPatch;\r\n}\r\nexports.getParentEntities = getParentEntities;\r\nfunction getEntityParentDependencies(entity, entityName, tables) {\r\n var _a;\r\n var patch = (_a = {}, _a[entityName] = [entity], _a);\r\n var resultPatches = [];\r\n while (true) {\r\n var parents = getParentEntities(patch, tables);\r\n if (isPatchBlank(parents)) {\r\n break;\r\n }\r\n resultPatches.push(parents);\r\n patch = parents;\r\n }\r\n var result = unionPatches(tslib_1.__spreadArrays([patch], resultPatches));\r\n result = mergeEntityPatches(tables, result);\r\n return result;\r\n}\r\nexports.getEntityParentDependencies = getEntityParentDependencies;\r\n"},{"id":"./src/reactHooks.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\reactHooks.ts","name":"./src/reactHooks.ts","index":28,"index2":26,"size":883,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","issuerId":"./src/index.ts","issuerName":"./src/index.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\uui\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","name":"./src/index.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/index.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","module":"./src/index.ts","moduleName":"./src/index.ts","type":"cjs require","userRequest":"./reactHooks","loc":"11:21-44"}],"providedExports":null,"optimizationBailout":[],"depth":3,"source":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.useDbView = exports.useDbRef = exports.DbContext = void 0;\r\nvar tslib_1 = require(\"tslib\");\r\nvar react_1 = require(\"react\");\r\nexports.DbContext = react_1.createContext(null);\r\nfunction useDbRef() {\r\n return react_1.useContext(exports.DbContext);\r\n}\r\nexports.useDbRef = useDbRef;\r\nfunction useDbView(fn, params, options) {\r\n var dbRef = useDbRef();\r\n var _a = react_1.useState(), state = _a[0], setState = _a[1];\r\n var subscription = react_1.useMemo(function () { return dbRef.subscribe(tslib_1.__assign({ compute: fn }, options), params, setState); }, []);\r\n subscription.update(params);\r\n react_1.useEffect(function () {\r\n return function () { return subscription.unsubscribe(); };\r\n }, []);\r\n return subscription.currentValue;\r\n}\r\nexports.useDbView = useDbView;\r\n"},{"id":"./src/tempIds.tsx","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\tempIds.tsx","name":"./src/tempIds.tsx","index":23,"index2":19,"size":8557,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","issuerId":"./src/index.ts","issuerName":"./src/index.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\uui\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","name":"./src/index.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/DbRef.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\DbRef.ts","module":"./src/DbRef.ts","moduleName":"./src/DbRef.ts","type":"cjs require","userRequest":"./tempIds","loc":"6:16-36"},{"moduleId":"./src/index.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","module":"./src/index.ts","moduleName":"./src/index.ts","type":"cjs require","userRequest":"./tempIds","loc":"8:21-41"}],"providedExports":null,"optimizationBailout":[],"depth":3,"source":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.TempIdMap = exports.isTempId = exports.getTempId = void 0;\r\nvar tslib_1 = require(\"tslib\");\r\nvar utils_1 = require(\"./utils\");\r\nvar lastTempId = -1;\r\nfunction getTempId() {\r\n return --lastTempId;\r\n}\r\nexports.getTempId = getTempId;\r\nfunction isTempId(val) {\r\n return typeof val === 'number' && val < 0;\r\n}\r\nexports.isTempId = isTempId;\r\nvar TempIdMap = /** @class */ (function () {\r\n function TempIdMap(db) {\r\n var _this = this;\r\n this.db = db;\r\n this.serverToClientIds = new Map();\r\n this.clientToServerIds = new Map();\r\n this.clientToServer = function (id) { return _this.clientToServerIds.get(id); };\r\n this.serverToClient = function (tableName, id) { return _this.getServerToClientMap(tableName).get(id); };\r\n this.clientToServerRequest = function (request) {\r\n request = tslib_1.__assign({}, request);\r\n if (request.filter) {\r\n request.filter = _this.clientToServerDataFilter(request.filter);\r\n }\r\n return request;\r\n };\r\n this.clientToServerDataFilter = function (filter) {\r\n filter = tslib_1.__assign({}, filter);\r\n var keys = Object.keys(filter);\r\n // I hope that we can rely that there won't be any negative numbers, which are not IDs, in queries.\r\n // We need to invent better heuristics or a schema otherwise.\r\n var clientToServer = function (id) {\r\n var found = _this.clientToServer(id);\r\n if (found) {\r\n return found;\r\n }\r\n else {\r\n return id;\r\n }\r\n };\r\n for (var n = 0; n < keys.length; n++) {\r\n var key = keys[n];\r\n var condition = filter[key];\r\n if (condition != null && typeof condition === \"object\") {\r\n condition = tslib_1.__assign({}, condition);\r\n if ('in' in condition && Array.isArray(condition.in) && condition.in.length) {\r\n condition.in = condition.in.map(clientToServer);\r\n }\r\n }\r\n else {\r\n condition = clientToServer(condition);\r\n }\r\n filter[key] = condition;\r\n }\r\n return filter;\r\n };\r\n }\r\n TempIdMap.prototype.copyPatch = function (patch) {\r\n var newPatch = tslib_1.__assign({}, patch);\r\n utils_1.objectKeys(patch).forEach(function (tableName) {\r\n var tablePatch = patch[tableName].map(function (entityPatch) { return (tslib_1.__assign({}, entityPatch)); });\r\n newPatch[tableName] = tablePatch;\r\n });\r\n return newPatch;\r\n };\r\n // Iterate thru every field in every patch for every table, matching certain field criteria. The patch is mutated!\r\n TempIdMap.prototype.mapFields = function (patch, filter, callback) {\r\n var _this = this;\r\n utils_1.objectKeys(patch).forEach(function (tableName) {\r\n var schema = _this.db.tables[tableName].schema;\r\n var fields = utils_1.objectKeys(schema.fields || [])\r\n .map(function (fieldName) {\r\n var fieldSchema = schema.fields[fieldName];\r\n if (filter(fieldSchema, fieldName)) {\r\n return { name: fieldName, schema: fieldSchema };\r\n }\r\n })\r\n .filter(function (f) { return !!f; });\r\n if (!fields.length) {\r\n return;\r\n }\r\n patch[tableName].forEach(function (entityPatch) {\r\n for (var n = 0; n < fields.length; n++) {\r\n var field = fields[n];\r\n var fieldValue = entityPatch[field.name];\r\n callback(field.name, field.schema, fieldValue, entityPatch, tableName);\r\n }\r\n });\r\n });\r\n };\r\n TempIdMap.prototype.getServerToClientMap = function (tableName) {\r\n var existing = this.serverToClientIds.get(tableName);\r\n if (existing) {\r\n return existing;\r\n }\r\n else {\r\n var newMap = new Map();\r\n this.serverToClientIds.set(tableName, newMap);\r\n return newMap;\r\n }\r\n };\r\n TempIdMap.prototype.serverToClientPatch = function (patch) {\r\n var _this = this;\r\n patch = this.copyPatch(patch);\r\n // We map PK in a separate pass, as we need to remap all PKs before re-mapping FKs\r\n this.mapFields(patch, function (f) { return f.isGenerated; }, function (fieldName, fieldSchema, fieldValue, entityPatch, tableName) {\r\n var clientId = _this.getServerToClientMap(tableName).get(fieldValue);\r\n if (!clientId) {\r\n clientId = getTempId();\r\n _this.clientToServerIds.set(clientId, fieldValue);\r\n _this.getServerToClientMap(tableName).set(fieldValue, clientId);\r\n }\r\n entityPatch[fieldName] = clientId;\r\n });\r\n this.mapFields(patch, function (f) { return !!(f.fk || (f.default != null) || f.toClient); }, function (fieldName, fieldSchema, fieldValue, entityPatch, tableName) {\r\n var isUndefined = typeof (fieldValue) === 'undefined';\r\n if (fieldSchema.default != null && fieldValue == null) {\r\n fieldValue = fieldSchema.default;\r\n isUndefined = false;\r\n }\r\n if (fieldSchema.fk && fieldValue != null) {\r\n var fkTableName = typeof fieldSchema.fk.tableName === 'function' ? fieldSchema.fk.tableName(entityPatch) : fieldSchema.fk.tableName;\r\n var clientId = _this.getServerToClientMap(fkTableName).get(fieldValue);\r\n if (!clientId) {\r\n clientId = getTempId();\r\n _this.clientToServerIds.set(clientId, fieldValue);\r\n _this.getServerToClientMap(fkTableName).set(fieldValue, clientId);\r\n }\r\n fieldValue = clientId;\r\n }\r\n if (!isUndefined && fieldSchema.toClient) {\r\n fieldValue = fieldSchema.toClient(fieldValue);\r\n }\r\n if (!isUndefined) {\r\n entityPatch[fieldName] = fieldValue;\r\n }\r\n });\r\n return patch;\r\n };\r\n TempIdMap.prototype.clientToServerPatch = function (patch) {\r\n var _this = this;\r\n patch = this.copyPatch(patch);\r\n this.mapFields(patch, function (f) { return f.isGenerated || !!f.fk; }, function (fieldName, fieldSchema, fieldValue, entityPatch, tableName) {\r\n if (fieldValue != null) {\r\n var existingId = _this.clientToServerIds.get(fieldValue);\r\n if (existingId) {\r\n entityPatch[fieldName] = existingId;\r\n }\r\n }\r\n });\r\n this.mapFields(patch, function (f) { return !(f.isClientOnly || f.isReadOnly) && !!f.toServer; }, function (fieldName, fieldSchema, fieldValue, entityPatch, tableName) {\r\n entityPatch[fieldName] = fieldSchema.toServer(entityPatch[fieldName]);\r\n });\r\n this.mapFields(patch, function (meta) { return meta.isClientOnly || meta.isReadOnly; }, function (fieldName, fieldSchema, fieldValue, entityPatch, tableName) {\r\n delete entityPatch[fieldName];\r\n });\r\n return patch;\r\n };\r\n TempIdMap.prototype.appendServerMapping = function (response) {\r\n var _this = this;\r\n utils_1.objectKeys(response.submit).forEach(function (tableName) {\r\n if (_this.db.tables[tableName]) {\r\n var tablePatch = response.submit[tableName];\r\n if (tablePatch) {\r\n var serverToClientIds_1 = _this.getServerToClientMap(tableName);\r\n var table_1 = _this.db.tables[tableName];\r\n tablePatch.forEach(function (patch) {\r\n if (isTempId(patch.id)) {\r\n var clientId = patch.id;\r\n var serverId = table_1.getId(patch.payload);\r\n serverToClientIds_1.set(serverId, clientId);\r\n _this.clientToServerIds.set(clientId, serverId);\r\n }\r\n });\r\n }\r\n }\r\n });\r\n };\r\n return TempIdMap;\r\n}());\r\nexports.TempIdMap = TempIdMap;\r\n"},{"id":"./src/types.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\types.ts","name":"./src/types.ts","index":4,"index2":1,"size":387,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","issuerId":"./src/index.ts","issuerName":"./src/index.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\uui\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","name":"./src/index.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/index.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","module":"./src/index.ts","moduleName":"./src/index.ts","type":"cjs require","userRequest":"./types","loc":"4:21-39"},{"moduleId":"./src/patchHelpers.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\patchHelpers.ts","module":"./src/patchHelpers.ts","moduleName":"./src/patchHelpers.ts","type":"cjs require","userRequest":"./types","loc":"5:14-32"}],"providedExports":null,"optimizationBailout":[],"depth":3,"source":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.DbRelationType = void 0;\r\nvar DbRelationType;\r\n(function (DbRelationType) {\r\n DbRelationType[DbRelationType[\"Aggregation\"] = 0] = \"Aggregation\";\r\n DbRelationType[DbRelationType[\"Association\"] = 1] = \"Association\";\r\n})(DbRelationType = exports.DbRelationType || (exports.DbRelationType = {}));\r\n"},{"id":"./src/utils.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\utils.ts","name":"./src/utils.ts","index":6,"index2":6,"size":1818,"cacheable":true,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","issuerId":"./src/index.ts","issuerName":"./src/index.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\uui\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","name":"./src/index.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/Db.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\Db.ts","module":"./src/Db.ts","moduleName":"./src/Db.ts","type":"cjs require","userRequest":"./utils","loc":"5:14-32"},{"moduleId":"./src/DbRef.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\DbRef.ts","module":"./src/DbRef.ts","moduleName":"./src/DbRef.ts","type":"cjs require","userRequest":"./utils","loc":"7:14-32"},{"moduleId":"./src/index.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","module":"./src/index.ts","moduleName":"./src/index.ts","type":"cjs require","userRequest":"./utils","loc":"9:21-39"},{"moduleId":"./src/patchHelpers.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\patchHelpers.ts","module":"./src/patchHelpers.ts","moduleName":"./src/patchHelpers.ts","type":"cjs require","userRequest":"./utils","loc":"7:14-32"},{"moduleId":"./src/tempIds.tsx","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\tempIds.tsx","module":"./src/tempIds.tsx","moduleName":"./src/tempIds.tsx","type":"cjs require","userRequest":"./utils","loc":"5:14-32"}],"providedExports":null,"optimizationBailout":[],"depth":3,"source":"\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.difference = exports.defaultCompareViewDependencies = exports.objectKeys = void 0;\r\nvar tslib_1 = require(\"tslib\");\r\nvar shallowequal_1 = tslib_1.__importDefault(require(\"shallowequal\"));\r\nvar lodash_zip_1 = tslib_1.__importDefault(require(\"lodash.zip\"));\r\nvar lodash_transform_1 = tslib_1.__importDefault(require(\"lodash.transform\"));\r\nvar lodash_isequal_1 = tslib_1.__importDefault(require(\"lodash.isequal\"));\r\n// TBD: New typescript would contain better typing for this. Remove this hack after update.\r\nexports.objectKeys = Object.keys;\r\nfunction defaultCompareViewDependencies(prev, next) {\r\n if (Array.isArray(prev) && Array.isArray(next)) {\r\n if (prev.length === next.length) {\r\n return lodash_zip_1.default(prev, next).every(function (_a) {\r\n var p = _a[0], n = _a[1];\r\n return shallowequal_1.default(p, n);\r\n });\r\n }\r\n return false;\r\n }\r\n return shallowequal_1.default(prev, next);\r\n}\r\nexports.defaultCompareViewDependencies = defaultCompareViewDependencies;\r\n/**\r\n * Deep diff between two object, using lodash\r\n * @param {Object} object Object compared\r\n * @param {Object} base Object to compare with\r\n * @return {Object} Return a new object who represent the diff\r\n */\r\nfunction difference(object, base) {\r\n function changes(object, base) {\r\n return lodash_transform_1.default(object, function (result, value, key) {\r\n if (!lodash_isequal_1.default(value, base[key])) {\r\n result[key] = (typeof value === \"object\" && typeof base[key] === \"object\") ? changes(value, base[key]) : value;\r\n }\r\n });\r\n }\r\n return changes(object, base);\r\n}\r\nexports.difference = difference;\r\n"},{"id":"@epam/uui","identifier":"external \"@epam/uui\"","name":"external \"@epam/uui\"","index":13,"index2":9,"size":42,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\DbTable.ts","issuerId":"./src/DbTable.ts","issuerName":"./src/DbTable.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\uui\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/DbTable.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\DbTable.ts","name":"./src/DbTable.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/DbTable.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\DbTable.ts","module":"./src/DbTable.ts","moduleName":"./src/DbTable.ts","type":"cjs require","userRequest":"@epam/uui","loc":"6:12-32"}],"providedExports":null,"optimizationBailout":[],"depth":4},{"id":"immutable","identifier":"external \"immutable\"","name":"external \"immutable\"","index":12,"index2":8,"size":42,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\DbTable.ts","issuerId":"./src/DbTable.ts","issuerName":"./src/DbTable.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\uui\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/DbTable.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\DbTable.ts","name":"./src/DbTable.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/DbTable.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\DbTable.ts","module":"./src/DbTable.ts","moduleName":"./src/DbTable.ts","type":"cjs require","userRequest":"immutable","loc":"5:29-49"},{"moduleId":"./src/DbTable.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\DbTable.ts","module":"./src/DbTable.ts","moduleName":"./src/DbTable.ts","type":"cjs require","userRequest":"immutable","loc":"7:18-38"},{"moduleId":"./src/patchHelpers.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\patchHelpers.ts","module":"./src/patchHelpers.ts","moduleName":"./src/patchHelpers.ts","type":"cjs require","userRequest":"immutable","loc":"6:29-49"}],"providedExports":null,"optimizationBailout":[],"depth":4},{"id":"lodash.countby","identifier":"external \"lodash.countby\"","name":"external \"lodash.countby\"","index":19,"index2":14,"size":42,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\patchHelpers.ts","issuerId":"./src/patchHelpers.ts","issuerName":"./src/patchHelpers.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\uui\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/patchHelpers.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\patchHelpers.ts","name":"./src/patchHelpers.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/patchHelpers.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\patchHelpers.ts","module":"./src/patchHelpers.ts","moduleName":"./src/patchHelpers.ts","type":"cjs require","userRequest":"lodash.countby","loc":"11:47-72"}],"providedExports":null,"optimizationBailout":[],"depth":4},{"id":"lodash.filter","identifier":"external \"lodash.filter\"","name":"external \"lodash.filter\"","index":20,"index2":15,"size":42,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\patchHelpers.ts","issuerId":"./src/patchHelpers.ts","issuerName":"./src/patchHelpers.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\uui\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/patchHelpers.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\patchHelpers.ts","name":"./src/patchHelpers.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/patchHelpers.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\patchHelpers.ts","module":"./src/patchHelpers.ts","moduleName":"./src/patchHelpers.ts","type":"cjs require","userRequest":"lodash.filter","loc":"12:46-70"}],"providedExports":null,"optimizationBailout":[],"depth":4},{"id":"lodash.foreach","identifier":"external \"lodash.foreach\"","name":"external \"lodash.foreach\"","index":21,"index2":16,"size":42,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\patchHelpers.ts","issuerId":"./src/patchHelpers.ts","issuerName":"./src/patchHelpers.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\uui\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/patchHelpers.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\patchHelpers.ts","name":"./src/patchHelpers.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/patchHelpers.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\patchHelpers.ts","module":"./src/patchHelpers.ts","moduleName":"./src/patchHelpers.ts","type":"cjs require","userRequest":"lodash.foreach","loc":"13:47-72"}],"providedExports":null,"optimizationBailout":[],"depth":4},{"id":"lodash.groupby","identifier":"external \"lodash.groupby\"","name":"external \"lodash.groupby\"","index":16,"index2":11,"size":42,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\patchHelpers.ts","issuerId":"./src/patchHelpers.ts","issuerName":"./src/patchHelpers.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\uui\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/patchHelpers.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\patchHelpers.ts","name":"./src/patchHelpers.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/patchHelpers.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\patchHelpers.ts","module":"./src/patchHelpers.ts","moduleName":"./src/patchHelpers.ts","type":"cjs require","userRequest":"lodash.groupby","loc":"8:47-72"}],"providedExports":null,"optimizationBailout":[],"depth":4},{"id":"lodash.isempty","identifier":"external \"lodash.isempty\"","name":"external \"lodash.isempty\"","index":24,"index2":20,"size":42,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\DbRef.ts","issuerId":"./src/DbRef.ts","issuerName":"./src/DbRef.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\uui\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/DbRef.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\DbRef.ts","name":"./src/DbRef.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/DbRef.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\DbRef.ts","module":"./src/DbRef.ts","moduleName":"./src/DbRef.ts","type":"cjs require","userRequest":"lodash.isempty","loc":"8:47-72"}],"providedExports":null,"optimizationBailout":[],"depth":4},{"id":"lodash.isequal","identifier":"external \"lodash.isequal\"","name":"external \"lodash.isequal\"","index":10,"index2":5,"size":42,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\Db.ts","issuerId":"./src/Db.ts","issuerName":"./src/Db.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\uui\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/Db.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\Db.ts","name":"./src/Db.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/Db.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\Db.ts","module":"./src/Db.ts","moduleName":"./src/Db.ts","type":"cjs require","userRequest":"lodash.isequal","loc":"6:47-72"},{"moduleId":"./src/utils.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\utils.ts","module":"./src/utils.ts","moduleName":"./src/utils.ts","type":"cjs require","userRequest":"lodash.isequal","loc":"8:47-72"}],"providedExports":null,"optimizationBailout":[],"depth":4},{"id":"lodash.map","identifier":"external \"lodash.map\"","name":"external \"lodash.map\"","index":17,"index2":12,"size":42,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\patchHelpers.ts","issuerId":"./src/patchHelpers.ts","issuerName":"./src/patchHelpers.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\uui\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/patchHelpers.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\patchHelpers.ts","name":"./src/patchHelpers.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/patchHelpers.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\patchHelpers.ts","module":"./src/patchHelpers.ts","moduleName":"./src/patchHelpers.ts","type":"cjs require","userRequest":"lodash.map","loc":"9:43-64"}],"providedExports":null,"optimizationBailout":[],"depth":4},{"id":"lodash.merge","identifier":"external \"lodash.merge\"","name":"external \"lodash.merge\"","index":18,"index2":13,"size":42,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\patchHelpers.ts","issuerId":"./src/patchHelpers.ts","issuerName":"./src/patchHelpers.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\uui\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/patchHelpers.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\patchHelpers.ts","name":"./src/patchHelpers.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/patchHelpers.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\patchHelpers.ts","module":"./src/patchHelpers.ts","moduleName":"./src/patchHelpers.ts","type":"cjs require","userRequest":"lodash.merge","loc":"10:45-68"}],"providedExports":null,"optimizationBailout":[],"depth":4},{"id":"lodash.pick","identifier":"external \"lodash.pick\"","name":"external \"lodash.pick\"","index":22,"index2":17,"size":42,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\patchHelpers.ts","issuerId":"./src/patchHelpers.ts","issuerName":"./src/patchHelpers.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\uui\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/patchHelpers.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\patchHelpers.ts","name":"./src/patchHelpers.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/patchHelpers.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\patchHelpers.ts","module":"./src/patchHelpers.ts","moduleName":"./src/patchHelpers.ts","type":"cjs require","userRequest":"lodash.pick","loc":"14:44-66"}],"providedExports":null,"optimizationBailout":[],"depth":4},{"id":"lodash.transform","identifier":"external \"lodash.transform\"","name":"external \"lodash.transform\"","index":9,"index2":4,"size":42,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\utils.ts","issuerId":"./src/utils.ts","issuerName":"./src/utils.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\uui\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/utils.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\utils.ts","name":"./src/utils.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/utils.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\utils.ts","module":"./src/utils.ts","moduleName":"./src/utils.ts","type":"cjs require","userRequest":"lodash.transform","loc":"7:49-76"}],"providedExports":null,"optimizationBailout":[],"depth":4},{"id":"lodash.zip","identifier":"external \"lodash.zip\"","name":"external \"lodash.zip\"","index":8,"index2":3,"size":42,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\utils.ts","issuerId":"./src/utils.ts","issuerName":"./src/utils.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\uui\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/utils.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\utils.ts","name":"./src/utils.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/utils.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\utils.ts","module":"./src/utils.ts","moduleName":"./src/utils.ts","type":"cjs require","userRequest":"lodash.zip","loc":"6:43-64"}],"providedExports":null,"optimizationBailout":[],"depth":4},{"id":"react","identifier":"external \"react\"","name":"external \"react\"","index":29,"index2":25,"size":42,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\reactHooks.ts","issuerId":"./src/reactHooks.ts","issuerName":"./src/reactHooks.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\uui\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/reactHooks.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\reactHooks.ts","name":"./src/reactHooks.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/reactHooks.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\reactHooks.ts","module":"./src/reactHooks.ts","moduleName":"./src/reactHooks.ts","type":"cjs require","userRequest":"react","loc":"5:14-30"}],"providedExports":null,"optimizationBailout":[],"depth":4},{"id":"shallowequal","identifier":"external \"shallowequal\"","name":"external \"shallowequal\"","index":7,"index2":2,"size":42,"built":true,"optional":false,"prefetched":false,"chunks":["main"],"issuer":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\utils.ts","issuerId":"./src/utils.ts","issuerName":"./src/utils.ts","issuerPath":[{"id":0,"identifier":"multi C:\\work\\uui\\uui-db\\index.tsx","name":"multi ./index.tsx"},{"id":"./index.tsx","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\index.tsx","name":"./index.tsx"},{"id":"./src/index.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\index.ts","name":"./src/index.ts"},{"id":"./src/utils.ts","identifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\utils.ts","name":"./src/utils.ts"}],"failed":false,"errors":0,"warnings":0,"assets":[],"reasons":[{"moduleId":"./src/utils.ts","moduleIdentifier":"C:\\work\\uui\\node_modules\\ts-loader\\index.js??ref--5-oneOf-0-0!C:\\work\\uui\\uui-db\\src\\utils.ts","module":"./src/utils.ts","moduleName":"./src/utils.ts","type":"cjs require","userRequest":"shallowequal","loc":"5:45-68"}],"providedExports":null,"optimizationBailout":[],"depth":4}],"filteredModules":0,"logging":{"webpack.buildChunkGraph.visitModules":{"entries":[],"filteredEntries":2,"debug":false}},"children":[]}
|