@lls/store 24.10.0 → 24.11.0-076370c6
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/lib/index.js +1817 -0
- package/package.json +5 -3
package/lib/index.js
ADDED
|
@@ -0,0 +1,1817 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __esm = (fn, res) => function __init() {
|
|
8
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
9
|
+
};
|
|
10
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
11
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
29
|
+
|
|
30
|
+
// <define:import.meta>
|
|
31
|
+
var init_define_import_meta = __esm({
|
|
32
|
+
"<define:import.meta>"() {
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
// ../../node_modules/.pnpm/reselect@4.1.8/node_modules/reselect/lib/defaultMemoize.js
|
|
37
|
+
var require_defaultMemoize = __commonJS({
|
|
38
|
+
"../../node_modules/.pnpm/reselect@4.1.8/node_modules/reselect/lib/defaultMemoize.js"(exports) {
|
|
39
|
+
"use strict";
|
|
40
|
+
init_define_import_meta();
|
|
41
|
+
Object.defineProperty(exports, "__esModule", {
|
|
42
|
+
value: true
|
|
43
|
+
});
|
|
44
|
+
exports.createCacheKeyComparator = createCacheKeyComparator;
|
|
45
|
+
exports.defaultEqualityCheck = void 0;
|
|
46
|
+
exports.defaultMemoize = defaultMemoize;
|
|
47
|
+
var NOT_FOUND = "NOT_FOUND";
|
|
48
|
+
function createSingletonCache(equals) {
|
|
49
|
+
var entry;
|
|
50
|
+
return {
|
|
51
|
+
get: function get(key) {
|
|
52
|
+
if (entry && equals(entry.key, key)) {
|
|
53
|
+
return entry.value;
|
|
54
|
+
}
|
|
55
|
+
return NOT_FOUND;
|
|
56
|
+
},
|
|
57
|
+
put: function put(key, value) {
|
|
58
|
+
entry = {
|
|
59
|
+
key,
|
|
60
|
+
value
|
|
61
|
+
};
|
|
62
|
+
},
|
|
63
|
+
getEntries: function getEntries() {
|
|
64
|
+
return entry ? [entry] : [];
|
|
65
|
+
},
|
|
66
|
+
clear: function clear() {
|
|
67
|
+
entry = void 0;
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
function createLruCache(maxSize, equals) {
|
|
72
|
+
var entries = [];
|
|
73
|
+
function get(key) {
|
|
74
|
+
var cacheIndex = entries.findIndex(function(entry2) {
|
|
75
|
+
return equals(key, entry2.key);
|
|
76
|
+
});
|
|
77
|
+
if (cacheIndex > -1) {
|
|
78
|
+
var entry = entries[cacheIndex];
|
|
79
|
+
if (cacheIndex > 0) {
|
|
80
|
+
entries.splice(cacheIndex, 1);
|
|
81
|
+
entries.unshift(entry);
|
|
82
|
+
}
|
|
83
|
+
return entry.value;
|
|
84
|
+
}
|
|
85
|
+
return NOT_FOUND;
|
|
86
|
+
}
|
|
87
|
+
function put(key, value) {
|
|
88
|
+
if (get(key) === NOT_FOUND) {
|
|
89
|
+
entries.unshift({
|
|
90
|
+
key,
|
|
91
|
+
value
|
|
92
|
+
});
|
|
93
|
+
if (entries.length > maxSize) {
|
|
94
|
+
entries.pop();
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
function getEntries() {
|
|
99
|
+
return entries;
|
|
100
|
+
}
|
|
101
|
+
function clear() {
|
|
102
|
+
entries = [];
|
|
103
|
+
}
|
|
104
|
+
return {
|
|
105
|
+
get,
|
|
106
|
+
put,
|
|
107
|
+
getEntries,
|
|
108
|
+
clear
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
var defaultEqualityCheck = function defaultEqualityCheck2(a, b) {
|
|
112
|
+
return a === b;
|
|
113
|
+
};
|
|
114
|
+
exports.defaultEqualityCheck = defaultEqualityCheck;
|
|
115
|
+
function createCacheKeyComparator(equalityCheck) {
|
|
116
|
+
return function areArgumentsShallowlyEqual(prev, next) {
|
|
117
|
+
if (prev === null || next === null || prev.length !== next.length) {
|
|
118
|
+
return false;
|
|
119
|
+
}
|
|
120
|
+
var length = prev.length;
|
|
121
|
+
for (var i = 0; i < length; i++) {
|
|
122
|
+
if (!equalityCheck(prev[i], next[i])) {
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return true;
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
function defaultMemoize(func, equalityCheckOrOptions) {
|
|
130
|
+
var providedOptions = typeof equalityCheckOrOptions === "object" ? equalityCheckOrOptions : {
|
|
131
|
+
equalityCheck: equalityCheckOrOptions
|
|
132
|
+
};
|
|
133
|
+
var _providedOptions$equa = providedOptions.equalityCheck, equalityCheck = _providedOptions$equa === void 0 ? defaultEqualityCheck : _providedOptions$equa, _providedOptions$maxS = providedOptions.maxSize, maxSize = _providedOptions$maxS === void 0 ? 1 : _providedOptions$maxS, resultEqualityCheck = providedOptions.resultEqualityCheck;
|
|
134
|
+
var comparator = createCacheKeyComparator(equalityCheck);
|
|
135
|
+
var cache = maxSize === 1 ? createSingletonCache(comparator) : createLruCache(maxSize, comparator);
|
|
136
|
+
function memoized() {
|
|
137
|
+
var value = cache.get(arguments);
|
|
138
|
+
if (value === NOT_FOUND) {
|
|
139
|
+
value = func.apply(null, arguments);
|
|
140
|
+
if (resultEqualityCheck) {
|
|
141
|
+
var entries = cache.getEntries();
|
|
142
|
+
var matchingEntry = entries.find(function(entry) {
|
|
143
|
+
return resultEqualityCheck(entry.value, value);
|
|
144
|
+
});
|
|
145
|
+
if (matchingEntry) {
|
|
146
|
+
value = matchingEntry.value;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
cache.put(arguments, value);
|
|
150
|
+
}
|
|
151
|
+
return value;
|
|
152
|
+
}
|
|
153
|
+
memoized.clearCache = function() {
|
|
154
|
+
return cache.clear();
|
|
155
|
+
};
|
|
156
|
+
return memoized;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
// ../../node_modules/.pnpm/reselect@4.1.8/node_modules/reselect/lib/index.js
|
|
162
|
+
var require_lib = __commonJS({
|
|
163
|
+
"../../node_modules/.pnpm/reselect@4.1.8/node_modules/reselect/lib/index.js"(exports) {
|
|
164
|
+
"use strict";
|
|
165
|
+
init_define_import_meta();
|
|
166
|
+
Object.defineProperty(exports, "__esModule", {
|
|
167
|
+
value: true
|
|
168
|
+
});
|
|
169
|
+
exports.createSelector = void 0;
|
|
170
|
+
exports.createSelectorCreator = createSelectorCreator;
|
|
171
|
+
exports.createStructuredSelector = void 0;
|
|
172
|
+
Object.defineProperty(exports, "defaultEqualityCheck", {
|
|
173
|
+
enumerable: true,
|
|
174
|
+
get: function get() {
|
|
175
|
+
return _defaultMemoize.defaultEqualityCheck;
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
Object.defineProperty(exports, "defaultMemoize", {
|
|
179
|
+
enumerable: true,
|
|
180
|
+
get: function get() {
|
|
181
|
+
return _defaultMemoize.defaultMemoize;
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
var _defaultMemoize = require_defaultMemoize();
|
|
185
|
+
function getDependencies(funcs) {
|
|
186
|
+
var dependencies = Array.isArray(funcs[0]) ? funcs[0] : funcs;
|
|
187
|
+
if (!dependencies.every(function(dep) {
|
|
188
|
+
return typeof dep === "function";
|
|
189
|
+
})) {
|
|
190
|
+
var dependencyTypes = dependencies.map(function(dep) {
|
|
191
|
+
return typeof dep === "function" ? "function " + (dep.name || "unnamed") + "()" : typeof dep;
|
|
192
|
+
}).join(", ");
|
|
193
|
+
throw new Error("createSelector expects all input-selectors to be functions, but received the following types: [" + dependencyTypes + "]");
|
|
194
|
+
}
|
|
195
|
+
return dependencies;
|
|
196
|
+
}
|
|
197
|
+
function createSelectorCreator(memoize) {
|
|
198
|
+
for (var _len = arguments.length, memoizeOptionsFromArgs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
199
|
+
memoizeOptionsFromArgs[_key - 1] = arguments[_key];
|
|
200
|
+
}
|
|
201
|
+
var createSelector6 = function createSelector7() {
|
|
202
|
+
for (var _len2 = arguments.length, funcs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
203
|
+
funcs[_key2] = arguments[_key2];
|
|
204
|
+
}
|
|
205
|
+
var _recomputations = 0;
|
|
206
|
+
var _lastResult;
|
|
207
|
+
var directlyPassedOptions = {
|
|
208
|
+
memoizeOptions: void 0
|
|
209
|
+
};
|
|
210
|
+
var resultFunc = funcs.pop();
|
|
211
|
+
if (typeof resultFunc === "object") {
|
|
212
|
+
directlyPassedOptions = resultFunc;
|
|
213
|
+
resultFunc = funcs.pop();
|
|
214
|
+
}
|
|
215
|
+
if (typeof resultFunc !== "function") {
|
|
216
|
+
throw new Error("createSelector expects an output function after the inputs, but received: [" + typeof resultFunc + "]");
|
|
217
|
+
}
|
|
218
|
+
var _directlyPassedOption = directlyPassedOptions, _directlyPassedOption2 = _directlyPassedOption.memoizeOptions, memoizeOptions = _directlyPassedOption2 === void 0 ? memoizeOptionsFromArgs : _directlyPassedOption2;
|
|
219
|
+
var finalMemoizeOptions = Array.isArray(memoizeOptions) ? memoizeOptions : [memoizeOptions];
|
|
220
|
+
var dependencies = getDependencies(funcs);
|
|
221
|
+
var memoizedResultFunc = memoize.apply(void 0, [function recomputationWrapper() {
|
|
222
|
+
_recomputations++;
|
|
223
|
+
return resultFunc.apply(null, arguments);
|
|
224
|
+
}].concat(finalMemoizeOptions));
|
|
225
|
+
var selector = memoize(function dependenciesChecker() {
|
|
226
|
+
var params = [];
|
|
227
|
+
var length = dependencies.length;
|
|
228
|
+
for (var i = 0; i < length; i++) {
|
|
229
|
+
params.push(dependencies[i].apply(null, arguments));
|
|
230
|
+
}
|
|
231
|
+
_lastResult = memoizedResultFunc.apply(null, params);
|
|
232
|
+
return _lastResult;
|
|
233
|
+
});
|
|
234
|
+
Object.assign(selector, {
|
|
235
|
+
resultFunc,
|
|
236
|
+
memoizedResultFunc,
|
|
237
|
+
dependencies,
|
|
238
|
+
lastResult: function lastResult() {
|
|
239
|
+
return _lastResult;
|
|
240
|
+
},
|
|
241
|
+
recomputations: function recomputations() {
|
|
242
|
+
return _recomputations;
|
|
243
|
+
},
|
|
244
|
+
resetRecomputations: function resetRecomputations() {
|
|
245
|
+
return _recomputations = 0;
|
|
246
|
+
}
|
|
247
|
+
});
|
|
248
|
+
return selector;
|
|
249
|
+
};
|
|
250
|
+
return createSelector6;
|
|
251
|
+
}
|
|
252
|
+
var createSelector5 = /* @__PURE__ */ createSelectorCreator(_defaultMemoize.defaultMemoize);
|
|
253
|
+
exports.createSelector = createSelector5;
|
|
254
|
+
var createStructuredSelector = function createStructuredSelector2(selectors, selectorCreator) {
|
|
255
|
+
if (selectorCreator === void 0) {
|
|
256
|
+
selectorCreator = createSelector5;
|
|
257
|
+
}
|
|
258
|
+
if (typeof selectors !== "object") {
|
|
259
|
+
throw new Error("createStructuredSelector expects first argument to be an object " + ("where each property is a selector, instead received a " + typeof selectors));
|
|
260
|
+
}
|
|
261
|
+
var objectKeys = Object.keys(selectors);
|
|
262
|
+
var resultSelector = selectorCreator(
|
|
263
|
+
// @ts-ignore
|
|
264
|
+
objectKeys.map(function(key) {
|
|
265
|
+
return selectors[key];
|
|
266
|
+
}),
|
|
267
|
+
function() {
|
|
268
|
+
for (var _len3 = arguments.length, values = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
269
|
+
values[_key3] = arguments[_key3];
|
|
270
|
+
}
|
|
271
|
+
return values.reduce(function(composition, value, index) {
|
|
272
|
+
composition[objectKeys[index]] = value;
|
|
273
|
+
return composition;
|
|
274
|
+
}, {});
|
|
275
|
+
}
|
|
276
|
+
);
|
|
277
|
+
return resultSelector;
|
|
278
|
+
};
|
|
279
|
+
exports.createStructuredSelector = createStructuredSelector;
|
|
280
|
+
}
|
|
281
|
+
});
|
|
282
|
+
|
|
283
|
+
// ../../node_modules/.pnpm/normalizr@3.6.2/node_modules/normalizr/dist/normalizr.js
|
|
284
|
+
var require_normalizr = __commonJS({
|
|
285
|
+
"../../node_modules/.pnpm/normalizr@3.6.2/node_modules/normalizr/dist/normalizr.js"(exports) {
|
|
286
|
+
"use strict";
|
|
287
|
+
init_define_import_meta();
|
|
288
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
289
|
+
function _defineProperties(target, props) {
|
|
290
|
+
for (var i = 0; i < props.length; i++) {
|
|
291
|
+
var descriptor = props[i];
|
|
292
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
293
|
+
descriptor.configurable = true;
|
|
294
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
295
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
function _createClass(Constructor, protoProps, staticProps) {
|
|
299
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
300
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
301
|
+
return Constructor;
|
|
302
|
+
}
|
|
303
|
+
function _extends() {
|
|
304
|
+
_extends = Object.assign || function(target) {
|
|
305
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
306
|
+
var source = arguments[i];
|
|
307
|
+
for (var key in source) {
|
|
308
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
309
|
+
target[key] = source[key];
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
return target;
|
|
314
|
+
};
|
|
315
|
+
return _extends.apply(this, arguments);
|
|
316
|
+
}
|
|
317
|
+
function _inheritsLoose(subClass, superClass) {
|
|
318
|
+
subClass.prototype = Object.create(superClass.prototype);
|
|
319
|
+
subClass.prototype.constructor = subClass;
|
|
320
|
+
subClass.__proto__ = superClass;
|
|
321
|
+
}
|
|
322
|
+
function isImmutable(object) {
|
|
323
|
+
return !!(object && typeof object.hasOwnProperty === "function" && (object.hasOwnProperty("__ownerID") || // Immutable.Map
|
|
324
|
+
object._map && object._map.hasOwnProperty("__ownerID")));
|
|
325
|
+
}
|
|
326
|
+
function denormalizeImmutable(schema3, input, unvisit) {
|
|
327
|
+
return Object.keys(schema3).reduce(function(object, key) {
|
|
328
|
+
var stringKey = "" + key;
|
|
329
|
+
if (object.has(stringKey)) {
|
|
330
|
+
return object.set(stringKey, unvisit(object.get(stringKey), schema3[stringKey]));
|
|
331
|
+
} else {
|
|
332
|
+
return object;
|
|
333
|
+
}
|
|
334
|
+
}, input);
|
|
335
|
+
}
|
|
336
|
+
var getDefaultGetId = function getDefaultGetId2(idAttribute) {
|
|
337
|
+
return function(input) {
|
|
338
|
+
return isImmutable(input) ? input.get(idAttribute) : input[idAttribute];
|
|
339
|
+
};
|
|
340
|
+
};
|
|
341
|
+
var EntitySchema = /* @__PURE__ */ function() {
|
|
342
|
+
function EntitySchema2(key, definition, options) {
|
|
343
|
+
if (definition === void 0) {
|
|
344
|
+
definition = {};
|
|
345
|
+
}
|
|
346
|
+
if (options === void 0) {
|
|
347
|
+
options = {};
|
|
348
|
+
}
|
|
349
|
+
if (!key || typeof key !== "string") {
|
|
350
|
+
throw new Error("Expected a string key for Entity, but found " + key + ".");
|
|
351
|
+
}
|
|
352
|
+
var _options = options, _options$idAttribute = _options.idAttribute, idAttribute = _options$idAttribute === void 0 ? "id" : _options$idAttribute, _options$mergeStrateg = _options.mergeStrategy, mergeStrategy = _options$mergeStrateg === void 0 ? function(entityA, entityB) {
|
|
353
|
+
return _extends({}, entityA, entityB);
|
|
354
|
+
} : _options$mergeStrateg, _options$processStrat = _options.processStrategy, processStrategy = _options$processStrat === void 0 ? function(input) {
|
|
355
|
+
return _extends({}, input);
|
|
356
|
+
} : _options$processStrat, _options$fallbackStra = _options.fallbackStrategy, fallbackStrategy = _options$fallbackStra === void 0 ? function(key2, schema3) {
|
|
357
|
+
return void 0;
|
|
358
|
+
} : _options$fallbackStra;
|
|
359
|
+
this._key = key;
|
|
360
|
+
this._getId = typeof idAttribute === "function" ? idAttribute : getDefaultGetId(idAttribute);
|
|
361
|
+
this._idAttribute = idAttribute;
|
|
362
|
+
this._mergeStrategy = mergeStrategy;
|
|
363
|
+
this._processStrategy = processStrategy;
|
|
364
|
+
this._fallbackStrategy = fallbackStrategy;
|
|
365
|
+
this.define(definition);
|
|
366
|
+
}
|
|
367
|
+
var _proto = EntitySchema2.prototype;
|
|
368
|
+
_proto.define = function define2(definition) {
|
|
369
|
+
this.schema = Object.keys(definition).reduce(function(entitySchema, key) {
|
|
370
|
+
var _extends2;
|
|
371
|
+
var schema3 = definition[key];
|
|
372
|
+
return _extends({}, entitySchema, (_extends2 = {}, _extends2[key] = schema3, _extends2));
|
|
373
|
+
}, this.schema || {});
|
|
374
|
+
};
|
|
375
|
+
_proto.getId = function getId(input, parent, key) {
|
|
376
|
+
return this._getId(input, parent, key);
|
|
377
|
+
};
|
|
378
|
+
_proto.merge = function merge(entityA, entityB) {
|
|
379
|
+
return this._mergeStrategy(entityA, entityB);
|
|
380
|
+
};
|
|
381
|
+
_proto.fallback = function fallback(id, schema3) {
|
|
382
|
+
return this._fallbackStrategy(id, schema3);
|
|
383
|
+
};
|
|
384
|
+
_proto.normalize = function normalize3(input, parent, key, visit2, addEntity, visitedEntities) {
|
|
385
|
+
var _this = this;
|
|
386
|
+
var id = this.getId(input, parent, key);
|
|
387
|
+
var entityType = this.key;
|
|
388
|
+
if (!(entityType in visitedEntities)) {
|
|
389
|
+
visitedEntities[entityType] = {};
|
|
390
|
+
}
|
|
391
|
+
if (!(id in visitedEntities[entityType])) {
|
|
392
|
+
visitedEntities[entityType][id] = [];
|
|
393
|
+
}
|
|
394
|
+
if (visitedEntities[entityType][id].some(function(entity) {
|
|
395
|
+
return entity === input;
|
|
396
|
+
})) {
|
|
397
|
+
return id;
|
|
398
|
+
}
|
|
399
|
+
visitedEntities[entityType][id].push(input);
|
|
400
|
+
var processedEntity = this._processStrategy(input, parent, key);
|
|
401
|
+
Object.keys(this.schema).forEach(function(key2) {
|
|
402
|
+
if (processedEntity.hasOwnProperty(key2) && typeof processedEntity[key2] === "object") {
|
|
403
|
+
var schema3 = _this.schema[key2];
|
|
404
|
+
var resolvedSchema = typeof schema3 === "function" ? schema3(input) : schema3;
|
|
405
|
+
processedEntity[key2] = visit2(processedEntity[key2], processedEntity, key2, resolvedSchema, addEntity, visitedEntities);
|
|
406
|
+
}
|
|
407
|
+
});
|
|
408
|
+
addEntity(this, processedEntity, input, parent, key);
|
|
409
|
+
return id;
|
|
410
|
+
};
|
|
411
|
+
_proto.denormalize = function denormalize2(entity, unvisit) {
|
|
412
|
+
var _this2 = this;
|
|
413
|
+
if (isImmutable(entity)) {
|
|
414
|
+
return denormalizeImmutable(this.schema, entity, unvisit);
|
|
415
|
+
}
|
|
416
|
+
Object.keys(this.schema).forEach(function(key) {
|
|
417
|
+
if (entity.hasOwnProperty(key)) {
|
|
418
|
+
var schema3 = _this2.schema[key];
|
|
419
|
+
entity[key] = unvisit(entity[key], schema3);
|
|
420
|
+
}
|
|
421
|
+
});
|
|
422
|
+
return entity;
|
|
423
|
+
};
|
|
424
|
+
_createClass(EntitySchema2, [{
|
|
425
|
+
key: "key",
|
|
426
|
+
get: function get() {
|
|
427
|
+
return this._key;
|
|
428
|
+
}
|
|
429
|
+
}, {
|
|
430
|
+
key: "idAttribute",
|
|
431
|
+
get: function get() {
|
|
432
|
+
return this._idAttribute;
|
|
433
|
+
}
|
|
434
|
+
}]);
|
|
435
|
+
return EntitySchema2;
|
|
436
|
+
}();
|
|
437
|
+
var PolymorphicSchema = /* @__PURE__ */ function() {
|
|
438
|
+
function PolymorphicSchema2(definition, schemaAttribute) {
|
|
439
|
+
if (schemaAttribute) {
|
|
440
|
+
this._schemaAttribute = typeof schemaAttribute === "string" ? function(input) {
|
|
441
|
+
return input[schemaAttribute];
|
|
442
|
+
} : schemaAttribute;
|
|
443
|
+
}
|
|
444
|
+
this.define(definition);
|
|
445
|
+
}
|
|
446
|
+
var _proto = PolymorphicSchema2.prototype;
|
|
447
|
+
_proto.define = function define2(definition) {
|
|
448
|
+
this.schema = definition;
|
|
449
|
+
};
|
|
450
|
+
_proto.getSchemaAttribute = function getSchemaAttribute(input, parent, key) {
|
|
451
|
+
return !this.isSingleSchema && this._schemaAttribute(input, parent, key);
|
|
452
|
+
};
|
|
453
|
+
_proto.inferSchema = function inferSchema(input, parent, key) {
|
|
454
|
+
if (this.isSingleSchema) {
|
|
455
|
+
return this.schema;
|
|
456
|
+
}
|
|
457
|
+
var attr = this.getSchemaAttribute(input, parent, key);
|
|
458
|
+
return this.schema[attr];
|
|
459
|
+
};
|
|
460
|
+
_proto.normalizeValue = function normalizeValue(value, parent, key, visit2, addEntity, visitedEntities) {
|
|
461
|
+
var schema3 = this.inferSchema(value, parent, key);
|
|
462
|
+
if (!schema3) {
|
|
463
|
+
return value;
|
|
464
|
+
}
|
|
465
|
+
var normalizedValue = visit2(value, parent, key, schema3, addEntity, visitedEntities);
|
|
466
|
+
return this.isSingleSchema || normalizedValue === void 0 || normalizedValue === null ? normalizedValue : {
|
|
467
|
+
id: normalizedValue,
|
|
468
|
+
schema: this.getSchemaAttribute(value, parent, key)
|
|
469
|
+
};
|
|
470
|
+
};
|
|
471
|
+
_proto.denormalizeValue = function denormalizeValue(value, unvisit) {
|
|
472
|
+
var schemaKey = isImmutable(value) ? value.get("schema") : value.schema;
|
|
473
|
+
if (!this.isSingleSchema && !schemaKey) {
|
|
474
|
+
return value;
|
|
475
|
+
}
|
|
476
|
+
var id = this.isSingleSchema ? void 0 : isImmutable(value) ? value.get("id") : value.id;
|
|
477
|
+
var schema3 = this.isSingleSchema ? this.schema : this.schema[schemaKey];
|
|
478
|
+
return unvisit(id || value, schema3);
|
|
479
|
+
};
|
|
480
|
+
_createClass(PolymorphicSchema2, [{
|
|
481
|
+
key: "isSingleSchema",
|
|
482
|
+
get: function get() {
|
|
483
|
+
return !this._schemaAttribute;
|
|
484
|
+
}
|
|
485
|
+
}]);
|
|
486
|
+
return PolymorphicSchema2;
|
|
487
|
+
}();
|
|
488
|
+
var UnionSchema = /* @__PURE__ */ function(_PolymorphicSchema) {
|
|
489
|
+
_inheritsLoose(UnionSchema2, _PolymorphicSchema);
|
|
490
|
+
function UnionSchema2(definition, schemaAttribute) {
|
|
491
|
+
if (!schemaAttribute) {
|
|
492
|
+
throw new Error('Expected option "schemaAttribute" not found on UnionSchema.');
|
|
493
|
+
}
|
|
494
|
+
return _PolymorphicSchema.call(this, definition, schemaAttribute) || this;
|
|
495
|
+
}
|
|
496
|
+
var _proto = UnionSchema2.prototype;
|
|
497
|
+
_proto.normalize = function normalize3(input, parent, key, visit2, addEntity, visitedEntities) {
|
|
498
|
+
return this.normalizeValue(input, parent, key, visit2, addEntity, visitedEntities);
|
|
499
|
+
};
|
|
500
|
+
_proto.denormalize = function denormalize2(input, unvisit) {
|
|
501
|
+
return this.denormalizeValue(input, unvisit);
|
|
502
|
+
};
|
|
503
|
+
return UnionSchema2;
|
|
504
|
+
}(PolymorphicSchema);
|
|
505
|
+
var ValuesSchema = /* @__PURE__ */ function(_PolymorphicSchema) {
|
|
506
|
+
_inheritsLoose(ValuesSchema2, _PolymorphicSchema);
|
|
507
|
+
function ValuesSchema2() {
|
|
508
|
+
return _PolymorphicSchema.apply(this, arguments) || this;
|
|
509
|
+
}
|
|
510
|
+
var _proto = ValuesSchema2.prototype;
|
|
511
|
+
_proto.normalize = function normalize3(input, parent, key, visit2, addEntity, visitedEntities) {
|
|
512
|
+
var _this = this;
|
|
513
|
+
return Object.keys(input).reduce(function(output, key2, index) {
|
|
514
|
+
var _extends2;
|
|
515
|
+
var value = input[key2];
|
|
516
|
+
return value !== void 0 && value !== null ? _extends({}, output, (_extends2 = {}, _extends2[key2] = _this.normalizeValue(value, input, key2, visit2, addEntity, visitedEntities), _extends2)) : output;
|
|
517
|
+
}, {});
|
|
518
|
+
};
|
|
519
|
+
_proto.denormalize = function denormalize2(input, unvisit) {
|
|
520
|
+
var _this2 = this;
|
|
521
|
+
return Object.keys(input).reduce(function(output, key) {
|
|
522
|
+
var _extends3;
|
|
523
|
+
var entityOrId = input[key];
|
|
524
|
+
return _extends({}, output, (_extends3 = {}, _extends3[key] = _this2.denormalizeValue(entityOrId, unvisit), _extends3));
|
|
525
|
+
}, {});
|
|
526
|
+
};
|
|
527
|
+
return ValuesSchema2;
|
|
528
|
+
}(PolymorphicSchema);
|
|
529
|
+
var validateSchema = function validateSchema2(definition) {
|
|
530
|
+
var isArray = Array.isArray(definition);
|
|
531
|
+
if (isArray && definition.length > 1) {
|
|
532
|
+
throw new Error("Expected schema definition to be a single schema, but found " + definition.length + ".");
|
|
533
|
+
}
|
|
534
|
+
return definition[0];
|
|
535
|
+
};
|
|
536
|
+
var getValues = function getValues2(input) {
|
|
537
|
+
return Array.isArray(input) ? input : Object.keys(input).map(function(key) {
|
|
538
|
+
return input[key];
|
|
539
|
+
});
|
|
540
|
+
};
|
|
541
|
+
var normalize2 = function normalize3(schema3, input, parent, key, visit2, addEntity, visitedEntities) {
|
|
542
|
+
schema3 = validateSchema(schema3);
|
|
543
|
+
var values = getValues(input);
|
|
544
|
+
return values.map(function(value, index) {
|
|
545
|
+
return visit2(value, parent, key, schema3, addEntity, visitedEntities);
|
|
546
|
+
});
|
|
547
|
+
};
|
|
548
|
+
var denormalize = function denormalize2(schema3, input, unvisit) {
|
|
549
|
+
schema3 = validateSchema(schema3);
|
|
550
|
+
return input && input.map ? input.map(function(entityOrId) {
|
|
551
|
+
return unvisit(entityOrId, schema3);
|
|
552
|
+
}) : input;
|
|
553
|
+
};
|
|
554
|
+
var ArraySchema = /* @__PURE__ */ function(_PolymorphicSchema) {
|
|
555
|
+
_inheritsLoose(ArraySchema2, _PolymorphicSchema);
|
|
556
|
+
function ArraySchema2() {
|
|
557
|
+
return _PolymorphicSchema.apply(this, arguments) || this;
|
|
558
|
+
}
|
|
559
|
+
var _proto = ArraySchema2.prototype;
|
|
560
|
+
_proto.normalize = function normalize3(input, parent, key, visit2, addEntity, visitedEntities) {
|
|
561
|
+
var _this = this;
|
|
562
|
+
var values = getValues(input);
|
|
563
|
+
return values.map(function(value, index) {
|
|
564
|
+
return _this.normalizeValue(value, parent, key, visit2, addEntity, visitedEntities);
|
|
565
|
+
}).filter(function(value) {
|
|
566
|
+
return value !== void 0 && value !== null;
|
|
567
|
+
});
|
|
568
|
+
};
|
|
569
|
+
_proto.denormalize = function denormalize2(input, unvisit) {
|
|
570
|
+
var _this2 = this;
|
|
571
|
+
return input && input.map ? input.map(function(value) {
|
|
572
|
+
return _this2.denormalizeValue(value, unvisit);
|
|
573
|
+
}) : input;
|
|
574
|
+
};
|
|
575
|
+
return ArraySchema2;
|
|
576
|
+
}(PolymorphicSchema);
|
|
577
|
+
var _normalize = function normalize3(schema3, input, parent, key, visit2, addEntity, visitedEntities) {
|
|
578
|
+
var object = _extends({}, input);
|
|
579
|
+
Object.keys(schema3).forEach(function(key2) {
|
|
580
|
+
var localSchema = schema3[key2];
|
|
581
|
+
var resolvedLocalSchema = typeof localSchema === "function" ? localSchema(input) : localSchema;
|
|
582
|
+
var value = visit2(input[key2], input, key2, resolvedLocalSchema, addEntity, visitedEntities);
|
|
583
|
+
if (value === void 0 || value === null) {
|
|
584
|
+
delete object[key2];
|
|
585
|
+
} else {
|
|
586
|
+
object[key2] = value;
|
|
587
|
+
}
|
|
588
|
+
});
|
|
589
|
+
return object;
|
|
590
|
+
};
|
|
591
|
+
var _denormalize = function denormalize2(schema3, input, unvisit) {
|
|
592
|
+
if (isImmutable(input)) {
|
|
593
|
+
return denormalizeImmutable(schema3, input, unvisit);
|
|
594
|
+
}
|
|
595
|
+
var object = _extends({}, input);
|
|
596
|
+
Object.keys(schema3).forEach(function(key) {
|
|
597
|
+
if (object[key] != null) {
|
|
598
|
+
object[key] = unvisit(object[key], schema3[key]);
|
|
599
|
+
}
|
|
600
|
+
});
|
|
601
|
+
return object;
|
|
602
|
+
};
|
|
603
|
+
var ObjectSchema = /* @__PURE__ */ function() {
|
|
604
|
+
function ObjectSchema2(definition) {
|
|
605
|
+
this.define(definition);
|
|
606
|
+
}
|
|
607
|
+
var _proto = ObjectSchema2.prototype;
|
|
608
|
+
_proto.define = function define2(definition) {
|
|
609
|
+
this.schema = Object.keys(definition).reduce(function(entitySchema, key) {
|
|
610
|
+
var _extends2;
|
|
611
|
+
var schema3 = definition[key];
|
|
612
|
+
return _extends({}, entitySchema, (_extends2 = {}, _extends2[key] = schema3, _extends2));
|
|
613
|
+
}, this.schema || {});
|
|
614
|
+
};
|
|
615
|
+
_proto.normalize = function normalize3() {
|
|
616
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
617
|
+
args[_key] = arguments[_key];
|
|
618
|
+
}
|
|
619
|
+
return _normalize.apply(void 0, [this.schema].concat(args));
|
|
620
|
+
};
|
|
621
|
+
_proto.denormalize = function denormalize2() {
|
|
622
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
623
|
+
args[_key2] = arguments[_key2];
|
|
624
|
+
}
|
|
625
|
+
return _denormalize.apply(void 0, [this.schema].concat(args));
|
|
626
|
+
};
|
|
627
|
+
return ObjectSchema2;
|
|
628
|
+
}();
|
|
629
|
+
var visit = function visit2(value, parent, key, schema3, addEntity, visitedEntities) {
|
|
630
|
+
if (typeof value !== "object" || !value) {
|
|
631
|
+
return value;
|
|
632
|
+
}
|
|
633
|
+
if (typeof schema3 === "object" && (!schema3.normalize || typeof schema3.normalize !== "function")) {
|
|
634
|
+
var method2 = Array.isArray(schema3) ? normalize2 : _normalize;
|
|
635
|
+
return method2(schema3, value, parent, key, visit2, addEntity, visitedEntities);
|
|
636
|
+
}
|
|
637
|
+
return schema3.normalize(value, parent, key, visit2, addEntity, visitedEntities);
|
|
638
|
+
};
|
|
639
|
+
var addEntities = function addEntities2(entities2) {
|
|
640
|
+
return function(schema3, processedEntity, value, parent, key) {
|
|
641
|
+
var schemaKey = schema3.key;
|
|
642
|
+
var id = schema3.getId(value, parent, key);
|
|
643
|
+
if (!(schemaKey in entities2)) {
|
|
644
|
+
entities2[schemaKey] = {};
|
|
645
|
+
}
|
|
646
|
+
var existingEntity = entities2[schemaKey][id];
|
|
647
|
+
if (existingEntity) {
|
|
648
|
+
entities2[schemaKey][id] = schema3.merge(existingEntity, processedEntity);
|
|
649
|
+
} else {
|
|
650
|
+
entities2[schemaKey][id] = processedEntity;
|
|
651
|
+
}
|
|
652
|
+
};
|
|
653
|
+
};
|
|
654
|
+
var schema2 = {
|
|
655
|
+
Array: ArraySchema,
|
|
656
|
+
Entity: EntitySchema,
|
|
657
|
+
Object: ObjectSchema,
|
|
658
|
+
Union: UnionSchema,
|
|
659
|
+
Values: ValuesSchema
|
|
660
|
+
};
|
|
661
|
+
var normalize$1 = function normalize3(input, schema3) {
|
|
662
|
+
if (!input || typeof input !== "object") {
|
|
663
|
+
throw new Error('Unexpected input given to normalize. Expected type to be "object", found "' + (input === null ? "null" : typeof input) + '".');
|
|
664
|
+
}
|
|
665
|
+
var entities2 = {};
|
|
666
|
+
var addEntity = addEntities(entities2);
|
|
667
|
+
var visitedEntities = {};
|
|
668
|
+
var result = visit(input, input, null, schema3, addEntity, visitedEntities);
|
|
669
|
+
return {
|
|
670
|
+
entities: entities2,
|
|
671
|
+
result
|
|
672
|
+
};
|
|
673
|
+
};
|
|
674
|
+
var unvisitEntity = function unvisitEntity2(id, schema3, unvisit, getEntity, cache) {
|
|
675
|
+
var entity = getEntity(id, schema3);
|
|
676
|
+
if (entity === void 0 && schema3 instanceof EntitySchema) {
|
|
677
|
+
entity = schema3.fallback(id, schema3);
|
|
678
|
+
}
|
|
679
|
+
if (typeof entity !== "object" || entity === null) {
|
|
680
|
+
return entity;
|
|
681
|
+
}
|
|
682
|
+
if (!cache[schema3.key]) {
|
|
683
|
+
cache[schema3.key] = {};
|
|
684
|
+
}
|
|
685
|
+
if (!cache[schema3.key][id]) {
|
|
686
|
+
var entityCopy = isImmutable(entity) ? entity : _extends({}, entity);
|
|
687
|
+
cache[schema3.key][id] = entityCopy;
|
|
688
|
+
cache[schema3.key][id] = schema3.denormalize(entityCopy, unvisit);
|
|
689
|
+
}
|
|
690
|
+
return cache[schema3.key][id];
|
|
691
|
+
};
|
|
692
|
+
var getUnvisit = function getUnvisit2(entities2) {
|
|
693
|
+
var cache = {};
|
|
694
|
+
var getEntity = getEntities(entities2);
|
|
695
|
+
return function unvisit(input, schema3) {
|
|
696
|
+
if (typeof schema3 === "object" && (!schema3.denormalize || typeof schema3.denormalize !== "function")) {
|
|
697
|
+
var method2 = Array.isArray(schema3) ? denormalize : _denormalize;
|
|
698
|
+
return method2(schema3, input, unvisit);
|
|
699
|
+
}
|
|
700
|
+
if (input === void 0 || input === null) {
|
|
701
|
+
return input;
|
|
702
|
+
}
|
|
703
|
+
if (schema3 instanceof EntitySchema) {
|
|
704
|
+
return unvisitEntity(input, schema3, unvisit, getEntity, cache);
|
|
705
|
+
}
|
|
706
|
+
return schema3.denormalize(input, unvisit);
|
|
707
|
+
};
|
|
708
|
+
};
|
|
709
|
+
var getEntities = function getEntities2(entities2) {
|
|
710
|
+
var isImmutable$1 = isImmutable(entities2);
|
|
711
|
+
return function(entityOrId, schema3) {
|
|
712
|
+
var schemaKey = schema3.key;
|
|
713
|
+
if (typeof entityOrId === "object") {
|
|
714
|
+
return entityOrId;
|
|
715
|
+
}
|
|
716
|
+
if (isImmutable$1) {
|
|
717
|
+
return entities2.getIn([schemaKey, entityOrId.toString()]);
|
|
718
|
+
}
|
|
719
|
+
return entities2[schemaKey] && entities2[schemaKey][entityOrId];
|
|
720
|
+
};
|
|
721
|
+
};
|
|
722
|
+
var denormalize$1 = function denormalize2(input, schema3, entities2) {
|
|
723
|
+
if (typeof input !== "undefined") {
|
|
724
|
+
return getUnvisit(entities2)(input, schema3);
|
|
725
|
+
}
|
|
726
|
+
};
|
|
727
|
+
exports.denormalize = denormalize$1;
|
|
728
|
+
exports.normalize = normalize$1;
|
|
729
|
+
exports.schema = schema2;
|
|
730
|
+
}
|
|
731
|
+
});
|
|
732
|
+
|
|
733
|
+
// src/index.ts
|
|
734
|
+
init_define_import_meta();
|
|
735
|
+
|
|
736
|
+
// src/selectors/auth.ts
|
|
737
|
+
init_define_import_meta();
|
|
738
|
+
import _ from "lodash/fp.js";
|
|
739
|
+
var getAuth = _.get("auth");
|
|
740
|
+
var getIsLogged = _.flow(_.get("auth.id"), _.negate(_.isNil));
|
|
741
|
+
var getToken = _.get("auth.token");
|
|
742
|
+
|
|
743
|
+
// src/selectors/school.ts
|
|
744
|
+
init_define_import_meta();
|
|
745
|
+
import { makeEntitiesFilter, pipe } from "@lls/utils";
|
|
746
|
+
import _2 from "lodash/fp.js";
|
|
747
|
+
|
|
748
|
+
// src/selectors/crud.ts
|
|
749
|
+
init_define_import_meta();
|
|
750
|
+
import { createSearchSelector, makeGetAllEntities, makeGetEntityById } from "@lls/utils";
|
|
751
|
+
import { useMemo } from "react";
|
|
752
|
+
import { useSelector } from "react-redux";
|
|
753
|
+
var crud = (entityName, { search: search31 }) => {
|
|
754
|
+
const getElements = makeGetAllEntities(entityName);
|
|
755
|
+
const makeSearchElements = () => createSearchSelector(
|
|
756
|
+
makeGetAllEntities(entityName),
|
|
757
|
+
(_state, params) => params,
|
|
758
|
+
(elements, params) => search31(params)(elements)
|
|
759
|
+
);
|
|
760
|
+
const methodName = `${entityName.charAt(0).toUpperCase()}${entityName.slice(1)}`;
|
|
761
|
+
const getElementById = makeGetEntityById(entityName);
|
|
762
|
+
const useSearch = makeUseSearch(makeSearchElements);
|
|
763
|
+
const back = {
|
|
764
|
+
[`get${methodName}`]: getElements,
|
|
765
|
+
[`search${methodName}`]: makeSearchElements(),
|
|
766
|
+
[`get${methodName.replace(/s$/, "")}`]: getElementById,
|
|
767
|
+
[`makeSearch${methodName}`]: makeSearchElements,
|
|
768
|
+
[`filter${methodName}`]: search31,
|
|
769
|
+
[`useSearch${methodName}`]: useSearch
|
|
770
|
+
};
|
|
771
|
+
return back;
|
|
772
|
+
};
|
|
773
|
+
var makeUseSearch = (makeSearchElements) => {
|
|
774
|
+
return (params) => {
|
|
775
|
+
const fn = useMemo(makeSearchElements, []);
|
|
776
|
+
return useSelector((state) => fn(state, params));
|
|
777
|
+
};
|
|
778
|
+
};
|
|
779
|
+
|
|
780
|
+
// src/selectors/school.ts
|
|
781
|
+
var search = ({ ids, academyIds, sortByQuery }) => {
|
|
782
|
+
return (schools) => pipe(
|
|
783
|
+
schools,
|
|
784
|
+
makeEntitiesFilter({ id: ids, academy: academyIds }),
|
|
785
|
+
_2.isFunction(sortByQuery) ? sortByQuery : sortByQuery ? _2.sortBy(sortByQuery) : _2.identity
|
|
786
|
+
);
|
|
787
|
+
};
|
|
788
|
+
var { getSchools, getSchool, useSearchSchools } = crud("schools", {
|
|
789
|
+
search
|
|
790
|
+
});
|
|
791
|
+
|
|
792
|
+
// src/selectors/book.ts
|
|
793
|
+
init_define_import_meta();
|
|
794
|
+
import { createSearchSelector as createSearchSelector2, makeEntitiesFilter as makeEntitiesFilter2, makeGetEntityById as makeGetEntityById2, pipe as pipe2 } from "@lls/utils";
|
|
795
|
+
import _3 from "lodash/fp.js";
|
|
796
|
+
var search2 = ({
|
|
797
|
+
ids,
|
|
798
|
+
levelIds,
|
|
799
|
+
subjectIds,
|
|
800
|
+
years,
|
|
801
|
+
isValid,
|
|
802
|
+
isWorkbook,
|
|
803
|
+
isWorkplan,
|
|
804
|
+
hasNoTeacherBook,
|
|
805
|
+
sortByQuery,
|
|
806
|
+
hasNewDesign,
|
|
807
|
+
slugs,
|
|
808
|
+
uris,
|
|
809
|
+
publishers,
|
|
810
|
+
isRenewed,
|
|
811
|
+
isPrimary
|
|
812
|
+
}) => {
|
|
813
|
+
return (books) => pipe2(
|
|
814
|
+
books,
|
|
815
|
+
makeEntitiesFilter2({
|
|
816
|
+
id: ids,
|
|
817
|
+
year: years,
|
|
818
|
+
levels: levelIds,
|
|
819
|
+
subjects: subjectIds,
|
|
820
|
+
valid: isValid,
|
|
821
|
+
publisher: publishers,
|
|
822
|
+
hasNewDesign,
|
|
823
|
+
isWorkbook,
|
|
824
|
+
isWorkplan,
|
|
825
|
+
hasNoTeacherBook,
|
|
826
|
+
slug: slugs,
|
|
827
|
+
uri: uris,
|
|
828
|
+
isRenewed,
|
|
829
|
+
isPrimary
|
|
830
|
+
}),
|
|
831
|
+
_3.isFunction(sortByQuery) ? sortByQuery : sortByQuery ? _3.sortBy(sortByQuery) : _3.identity
|
|
832
|
+
);
|
|
833
|
+
};
|
|
834
|
+
var { getBooks, getBook, filterBooks, useSearchBooks, makeSearchBooks } = crud("books", {
|
|
835
|
+
search: search2
|
|
836
|
+
});
|
|
837
|
+
var makeSearchValidBooks = () => createSearchSelector2(makeSearchBooks(), (books) => _3.filter({ valid: true, hasNewDesign: true }, books));
|
|
838
|
+
var useSearchValidBooks = makeUseSearch(makeSearchValidBooks);
|
|
839
|
+
var makeGetBook = () => makeGetEntityById2("books");
|
|
840
|
+
|
|
841
|
+
// src/selectors/user.ts
|
|
842
|
+
init_define_import_meta();
|
|
843
|
+
var import_reselect = __toESM(require_lib(), 1);
|
|
844
|
+
import { makeEntitiesFilter as makeEntitiesFilter3 } from "@lls/utils";
|
|
845
|
+
var search3 = ({ ids, schoolIds }) => makeEntitiesFilter3({
|
|
846
|
+
schools: schoolIds,
|
|
847
|
+
id: ids
|
|
848
|
+
});
|
|
849
|
+
var { getUsers, getUser, useSearchUsers } = crud("users", {
|
|
850
|
+
search: search3
|
|
851
|
+
});
|
|
852
|
+
var makeGetCurrentUser = () => (0, import_reselect.createSelector)(getAuth, getUsers, (auth2, users) => users?.find((user2) => user2?.id === auth2?.id));
|
|
853
|
+
var getCurrentUser = makeGetCurrentUser();
|
|
854
|
+
|
|
855
|
+
// src/selectors/chapter.ts
|
|
856
|
+
init_define_import_meta();
|
|
857
|
+
import { makeEntitiesFilter as makeEntitiesFilter4, pipe as pipe3 } from "@lls/utils";
|
|
858
|
+
import _4 from "lodash/fp.js";
|
|
859
|
+
var search4 = ({ bookIds, ids, hasTeacherBook, sortByQuery }) => (chapters) => pipe3(
|
|
860
|
+
chapters,
|
|
861
|
+
makeEntitiesFilter4(
|
|
862
|
+
{
|
|
863
|
+
book: bookIds,
|
|
864
|
+
id: ids
|
|
865
|
+
},
|
|
866
|
+
!_4.isNil(hasTeacherBook) && ((chapter2) => !!chapter2?.teacherBook === hasTeacherBook)
|
|
867
|
+
),
|
|
868
|
+
_4.isFunction(sortByQuery) ? sortByQuery : sortByQuery ? _4.sortBy(sortByQuery) : _4.identity
|
|
869
|
+
);
|
|
870
|
+
var { getChapters, getChapter, useSearchChapters } = crud("chapters", {
|
|
871
|
+
search: search4
|
|
872
|
+
});
|
|
873
|
+
|
|
874
|
+
// src/selectors/page.ts
|
|
875
|
+
init_define_import_meta();
|
|
876
|
+
import { makeEntitiesFilter as makeEntitiesFilter5, pipe as pipe4 } from "@lls/utils";
|
|
877
|
+
import _5 from "lodash/fp.js";
|
|
878
|
+
var search5 = ({
|
|
879
|
+
ids,
|
|
880
|
+
chapterIds,
|
|
881
|
+
isValid,
|
|
882
|
+
oldLessonIds,
|
|
883
|
+
premium,
|
|
884
|
+
thematicNames,
|
|
885
|
+
bookIds,
|
|
886
|
+
isOriginal,
|
|
887
|
+
hasNewDesign,
|
|
888
|
+
slugs,
|
|
889
|
+
isLearningAssessment,
|
|
890
|
+
isCreatedFromScratch,
|
|
891
|
+
userIds,
|
|
892
|
+
parentIds,
|
|
893
|
+
originalPageIds,
|
|
894
|
+
sharedUserIds,
|
|
895
|
+
sharedGroups,
|
|
896
|
+
isDraft,
|
|
897
|
+
isParentCreatedFromScratch,
|
|
898
|
+
updatedAfter,
|
|
899
|
+
sortByQuery
|
|
900
|
+
}) => {
|
|
901
|
+
let pageById = false;
|
|
902
|
+
return (pages) => pipe4(
|
|
903
|
+
pages,
|
|
904
|
+
makeEntitiesFilter5(
|
|
905
|
+
{
|
|
906
|
+
id: ids,
|
|
907
|
+
chapter: chapterIds,
|
|
908
|
+
valid: isValid,
|
|
909
|
+
isOriginal,
|
|
910
|
+
hasNewDesign,
|
|
911
|
+
slug: slugs,
|
|
912
|
+
oldLesson: oldLessonIds,
|
|
913
|
+
isLearningAssessment,
|
|
914
|
+
isCreatedFromScratch,
|
|
915
|
+
premium,
|
|
916
|
+
thematicName: thematicNames,
|
|
917
|
+
book: bookIds,
|
|
918
|
+
parent: parentIds,
|
|
919
|
+
user: userIds,
|
|
920
|
+
originalPage: originalPageIds,
|
|
921
|
+
sharedUsers: sharedUserIds,
|
|
922
|
+
sharedGroups,
|
|
923
|
+
isDraft
|
|
924
|
+
},
|
|
925
|
+
isParentCreatedFromScratch && ((page2, pages2) => {
|
|
926
|
+
pageById = pageById || _5.keyBy("id", pages2);
|
|
927
|
+
return !!_5.get([page2?.originalPage, "isCreatedFromScratch"], pageById);
|
|
928
|
+
}),
|
|
929
|
+
updatedAfter && _5.flow(_5.get("updatedAt"), (date) => new Date(date).getTime() - updatedAfter.getTime() >= 0)
|
|
930
|
+
),
|
|
931
|
+
_5.isFunction(sortByQuery) ? sortByQuery : sortByQuery ? _5.sortBy(sortByQuery) : _5.identity
|
|
932
|
+
);
|
|
933
|
+
};
|
|
934
|
+
var { getPages, getPage, filterPages, useSearchPages, makeSearchPages } = crud("pages", {
|
|
935
|
+
search: search5
|
|
936
|
+
});
|
|
937
|
+
var { getDrafts, getDraft, useSearchDrafts } = crud("drafts", { search: search5 });
|
|
938
|
+
var searchModifiedPages = (params) => {
|
|
939
|
+
return (pages) => search5({ ...params, isOriginal: false })(pages);
|
|
940
|
+
};
|
|
941
|
+
var { useSearchPages: useSearchModifiedPages } = crud("pages", { search: searchModifiedPages });
|
|
942
|
+
|
|
943
|
+
// src/selectors/collection.ts
|
|
944
|
+
init_define_import_meta();
|
|
945
|
+
import _6 from "lodash/fp.js";
|
|
946
|
+
var search6 = (_params) => _6.identity;
|
|
947
|
+
var { getCollections, getCollection, useSearchCollections } = crud("collections", {
|
|
948
|
+
search: search6
|
|
949
|
+
});
|
|
950
|
+
|
|
951
|
+
// src/selectors/communityProject.ts
|
|
952
|
+
init_define_import_meta();
|
|
953
|
+
import { makeEntitiesFilter as makeEntitiesFilter6 } from "@lls/utils";
|
|
954
|
+
var search7 = ({
|
|
955
|
+
slugs,
|
|
956
|
+
isFeatured,
|
|
957
|
+
projectTypes
|
|
958
|
+
}) => makeEntitiesFilter6({
|
|
959
|
+
slug: slugs,
|
|
960
|
+
isFeatured,
|
|
961
|
+
projectTypes
|
|
962
|
+
});
|
|
963
|
+
var { getCommunityProjects, getCommunityProject, useSearchCommunityProjects } = crud("communityProjects", {
|
|
964
|
+
search: search7
|
|
965
|
+
});
|
|
966
|
+
|
|
967
|
+
// src/selectors/contact.ts
|
|
968
|
+
init_define_import_meta();
|
|
969
|
+
import _7 from "lodash/fp.js";
|
|
970
|
+
var search8 = (_params) => _7.identity;
|
|
971
|
+
var { getContacts, getContact, useSearchContacts } = crud("contacts", {
|
|
972
|
+
search: search8
|
|
973
|
+
});
|
|
974
|
+
|
|
975
|
+
// src/selectors/copyNotification.ts
|
|
976
|
+
init_define_import_meta();
|
|
977
|
+
import { createSearchSelector as createSearchSelector3, makeEntitiesFilter as makeEntitiesFilter7, makeGetAllEntities as makeGetAllEntities2 } from "@lls/utils";
|
|
978
|
+
var search9 = ({ ids, read, pageIds }) => {
|
|
979
|
+
return makeEntitiesFilter7({ read, id: ids, page: pageIds });
|
|
980
|
+
};
|
|
981
|
+
var makeSearchCopyNotifications = () => createSearchSelector3(
|
|
982
|
+
[makeGetCurrentUser(), makeGetAllEntities2("copyNotifications"), (_20, params) => params],
|
|
983
|
+
(currentUser, copyNotifications, { pageIds, read }) => {
|
|
984
|
+
const ids = currentUser?.copyNotifications;
|
|
985
|
+
return search9({ ids, read, pageIds })(copyNotifications);
|
|
986
|
+
}
|
|
987
|
+
);
|
|
988
|
+
var useSearchCopyNotifications = makeUseSearch(makeSearchCopyNotifications);
|
|
989
|
+
|
|
990
|
+
// src/selectors/document.ts
|
|
991
|
+
init_define_import_meta();
|
|
992
|
+
import { makeEntitiesFilter as makeEntitiesFilter8 } from "@lls/utils";
|
|
993
|
+
var search10 = ({
|
|
994
|
+
ids,
|
|
995
|
+
uuids,
|
|
996
|
+
resourceIds,
|
|
997
|
+
levelIds,
|
|
998
|
+
formats,
|
|
999
|
+
documentTypes,
|
|
1000
|
+
subDocumentTypes
|
|
1001
|
+
}) => {
|
|
1002
|
+
return makeEntitiesFilter8({
|
|
1003
|
+
id: ids,
|
|
1004
|
+
resourceId: resourceIds,
|
|
1005
|
+
levels: levelIds,
|
|
1006
|
+
uuidV2: uuids,
|
|
1007
|
+
format: formats,
|
|
1008
|
+
documentType: documentTypes,
|
|
1009
|
+
subDocumentType: subDocumentTypes
|
|
1010
|
+
});
|
|
1011
|
+
};
|
|
1012
|
+
var { useSearchDocuments, getDocument } = crud("documents", {
|
|
1013
|
+
search: search10
|
|
1014
|
+
});
|
|
1015
|
+
|
|
1016
|
+
// src/selectors/drawerNotification.ts
|
|
1017
|
+
init_define_import_meta();
|
|
1018
|
+
import { createSearchSelector as createSearchSelector4, makeEntitiesFilter as makeEntitiesFilter9, makeGetAllEntities as makeGetAllEntities3 } from "@lls/utils";
|
|
1019
|
+
var search11 = ({ ids, read, pageIds }) => {
|
|
1020
|
+
return makeEntitiesFilter9({ read, id: ids, page: pageIds });
|
|
1021
|
+
};
|
|
1022
|
+
var makeSearchDrawerNotifications = () => createSearchSelector4(
|
|
1023
|
+
[makeGetCurrentUser(), makeGetAllEntities3("drawerNotifications"), (_20, params) => params],
|
|
1024
|
+
(currentUser, drawerNotifications, { read, pageIds }) => {
|
|
1025
|
+
const ids = currentUser?.drawerNotifications;
|
|
1026
|
+
return search11({ ids, read, pageIds })(drawerNotifications);
|
|
1027
|
+
}
|
|
1028
|
+
);
|
|
1029
|
+
var useSearchDrawerNotifications = makeUseSearch(makeSearchDrawerNotifications);
|
|
1030
|
+
|
|
1031
|
+
// src/selectors/faq.ts
|
|
1032
|
+
init_define_import_meta();
|
|
1033
|
+
import { makeGetAllEntities as makeGetAllEntities4 } from "@lls/utils";
|
|
1034
|
+
var getFaqs = makeGetAllEntities4("faq");
|
|
1035
|
+
|
|
1036
|
+
// src/selectors/garDivision.ts
|
|
1037
|
+
init_define_import_meta();
|
|
1038
|
+
import _8 from "lodash/fp.js";
|
|
1039
|
+
var search12 = (_params) => _8.identity;
|
|
1040
|
+
var { getGarDivisions, getGarDivision, useSearchGarDivisions } = crud("garDivisions", {
|
|
1041
|
+
search: search12
|
|
1042
|
+
});
|
|
1043
|
+
|
|
1044
|
+
// src/selectors/group.ts
|
|
1045
|
+
init_define_import_meta();
|
|
1046
|
+
var import_reselect2 = __toESM(require_lib(), 1);
|
|
1047
|
+
import { makeEntitiesFilter as makeEntitiesFilter10 } from "@lls/utils";
|
|
1048
|
+
import _9 from "lodash/fp.js";
|
|
1049
|
+
var search13 = ({ ownerIds }) => _9.flow(makeEntitiesFilter10({ owner: ownerIds }), _9.orderBy("createdAt", ["desc"]));
|
|
1050
|
+
var { getGroups, getGroup, useSearchGroups } = crud("groups", {
|
|
1051
|
+
search: search13
|
|
1052
|
+
});
|
|
1053
|
+
var getUserGroups = (0, import_reselect2.createSelector)(
|
|
1054
|
+
[getGroups, getCurrentUser],
|
|
1055
|
+
(groups, currentUser) => search13({ ownerIds: [currentUser?.id] })(groups)
|
|
1056
|
+
);
|
|
1057
|
+
|
|
1058
|
+
// src/selectors/level.ts
|
|
1059
|
+
init_define_import_meta();
|
|
1060
|
+
var import_reselect3 = __toESM(require_lib(), 1);
|
|
1061
|
+
import { createSearchSelector as createSearchSelector5, makeEntitiesFilter as makeEntitiesFilter12, makeGetAllEntities as makeGetAllEntities5 } from "@lls/utils";
|
|
1062
|
+
import _10 from "lodash/fp.js";
|
|
1063
|
+
|
|
1064
|
+
// src/selectors/schoolType.ts
|
|
1065
|
+
init_define_import_meta();
|
|
1066
|
+
import { makeEntitiesFilter as makeEntitiesFilter11 } from "@lls/utils";
|
|
1067
|
+
var search14 = ({ slugs }) => makeEntitiesFilter11({ slug: slugs });
|
|
1068
|
+
var { getSchoolTypes, getSchoolType, useSearchSchoolTypes, makeSearchSchoolTypes, searchSchoolTypes } = crud(
|
|
1069
|
+
"schoolTypes",
|
|
1070
|
+
{
|
|
1071
|
+
search: search14
|
|
1072
|
+
}
|
|
1073
|
+
);
|
|
1074
|
+
|
|
1075
|
+
// src/selectors/level.ts
|
|
1076
|
+
var search15 = ({
|
|
1077
|
+
ids,
|
|
1078
|
+
slugs,
|
|
1079
|
+
isPreSchool,
|
|
1080
|
+
isMiddleSchool,
|
|
1081
|
+
isHighSchool,
|
|
1082
|
+
isProHighSchool,
|
|
1083
|
+
isGenHighSchool,
|
|
1084
|
+
isElementarySchool,
|
|
1085
|
+
schoolTypes
|
|
1086
|
+
}) => _10.flow(
|
|
1087
|
+
makeEntitiesFilter12({
|
|
1088
|
+
id: ids,
|
|
1089
|
+
slug: slugs,
|
|
1090
|
+
isPreSchool,
|
|
1091
|
+
isMiddleSchool,
|
|
1092
|
+
isHighSchool,
|
|
1093
|
+
isProHighSchool,
|
|
1094
|
+
isGenHighSchool,
|
|
1095
|
+
isElementarySchool,
|
|
1096
|
+
schoolTypes
|
|
1097
|
+
}),
|
|
1098
|
+
_10.orderBy("order", "desc")
|
|
1099
|
+
);
|
|
1100
|
+
var makeSearchLevels = () => {
|
|
1101
|
+
const searchSchoolTypes2 = makeSearchSchoolTypes();
|
|
1102
|
+
return createSearchSelector5(
|
|
1103
|
+
makeGetAllEntities5("levels"),
|
|
1104
|
+
(state, { schoolTypes }) => schoolTypes ? searchSchoolTypes2(state, { slugs: schoolTypes }) : void 0,
|
|
1105
|
+
(_state, params) => params,
|
|
1106
|
+
(levels, schoolTypes, params) => search15({ ...params, schoolTypes: schoolTypes?.length ? schoolTypes?.map(({ id }) => id) : void 0 })(levels)
|
|
1107
|
+
);
|
|
1108
|
+
};
|
|
1109
|
+
var crudLevels = crud("levels", { search: search15 });
|
|
1110
|
+
var { getLevel, searchLevels } = crudLevels;
|
|
1111
|
+
var getLevels = (0, import_reselect3.createSelector)(
|
|
1112
|
+
crudLevels.getLevels,
|
|
1113
|
+
_10.orderBy("order", "desc")
|
|
1114
|
+
);
|
|
1115
|
+
var useSearchLevels = makeUseSearch(makeSearchLevels);
|
|
1116
|
+
|
|
1117
|
+
// src/selectors/mainNotification.ts
|
|
1118
|
+
init_define_import_meta();
|
|
1119
|
+
var import_reselect4 = __toESM(require_lib(), 1);
|
|
1120
|
+
import { makeEntitiesFilter as makeEntitiesFilter13, makeGetAllEntities as makeGetAllEntities6 } from "@lls/utils";
|
|
1121
|
+
import _11 from "lodash/fp.js";
|
|
1122
|
+
var search16 = ({ ids }) => makeEntitiesFilter13({ id: ids });
|
|
1123
|
+
var getMainNotifications = (0, import_reselect4.createSelector)(
|
|
1124
|
+
[_11.flow(makeGetCurrentUser(), _11.get("mainNotifications")), makeGetAllEntities6("mainNotifications")],
|
|
1125
|
+
(userNotifications, notifications) => search16({ ids: userNotifications })(notifications)
|
|
1126
|
+
);
|
|
1127
|
+
|
|
1128
|
+
// src/selectors/news.ts
|
|
1129
|
+
init_define_import_meta();
|
|
1130
|
+
import { makeEntitiesFilter as makeEntitiesFilter14 } from "@lls/utils";
|
|
1131
|
+
var search17 = ({ ids }) => makeEntitiesFilter14({ id: ids });
|
|
1132
|
+
var {
|
|
1133
|
+
getNews: getAllNews,
|
|
1134
|
+
getNew: getNews,
|
|
1135
|
+
useSearchNews
|
|
1136
|
+
} = crud("news", {
|
|
1137
|
+
search: search17
|
|
1138
|
+
});
|
|
1139
|
+
|
|
1140
|
+
// src/selectors/panorama.ts
|
|
1141
|
+
init_define_import_meta();
|
|
1142
|
+
import { makeGetEntityById as makeGetEntityById3 } from "@lls/utils";
|
|
1143
|
+
var getPanorama = makeGetEntityById3("panoramas");
|
|
1144
|
+
|
|
1145
|
+
// src/selectors/premiumResource.ts
|
|
1146
|
+
init_define_import_meta();
|
|
1147
|
+
import { makeEntitiesFilter as makeEntitiesFilter15 } from "@lls/utils";
|
|
1148
|
+
var search18 = ({ bookIds }) => makeEntitiesFilter15({ book: bookIds });
|
|
1149
|
+
var { getPremiumResources, getPremiumResource, useSearchPremiumResources } = crud("premiumResources", {
|
|
1150
|
+
search: search18
|
|
1151
|
+
});
|
|
1152
|
+
|
|
1153
|
+
// src/selectors/lexicalFlower.ts
|
|
1154
|
+
init_define_import_meta();
|
|
1155
|
+
import { makeEntitiesFilter as makeEntitiesFilter16 } from "@lls/utils";
|
|
1156
|
+
var search19 = ({ ids }) => makeEntitiesFilter16({ id: ids });
|
|
1157
|
+
var { getLexicalFlowers, useSearchLexicalFlowers } = crud("lexicalFlowers", {
|
|
1158
|
+
search: search19
|
|
1159
|
+
});
|
|
1160
|
+
|
|
1161
|
+
// src/selectors/product.ts
|
|
1162
|
+
init_define_import_meta();
|
|
1163
|
+
import _12 from "lodash/fp.js";
|
|
1164
|
+
import { createSearchSelector as createSearchSelector6, makeEntitiesFilter as makeEntitiesFilter17, makeGetAllEntities as makeGetAllEntities7 } from "@lls/utils";
|
|
1165
|
+
var getProducts = makeGetAllEntities7("products");
|
|
1166
|
+
var search20 = ({
|
|
1167
|
+
ids,
|
|
1168
|
+
eans,
|
|
1169
|
+
isAdoptant,
|
|
1170
|
+
isSupportPlus,
|
|
1171
|
+
levelIds,
|
|
1172
|
+
subjectIds,
|
|
1173
|
+
productTypes
|
|
1174
|
+
}) => {
|
|
1175
|
+
let bookIds;
|
|
1176
|
+
const filter = makeEntitiesFilter17(
|
|
1177
|
+
{
|
|
1178
|
+
id: ids,
|
|
1179
|
+
ean: eans,
|
|
1180
|
+
isAdoptant,
|
|
1181
|
+
isSupportPlus,
|
|
1182
|
+
productType: productTypes
|
|
1183
|
+
},
|
|
1184
|
+
levelIds || subjectIds ? (product2) => !!product2?.books?.some((bookId) => bookIds.has(bookId)) : false
|
|
1185
|
+
);
|
|
1186
|
+
return (products, books) => {
|
|
1187
|
+
bookIds = new Set(_12.flow(_12.map("id"), _12.map(_12.parseInt(10)))(books));
|
|
1188
|
+
return filter(products);
|
|
1189
|
+
};
|
|
1190
|
+
};
|
|
1191
|
+
var makeSearchProducts = () => {
|
|
1192
|
+
const searchBooks = makeSearchBooks();
|
|
1193
|
+
return createSearchSelector6(
|
|
1194
|
+
makeGetAllEntities7("products"),
|
|
1195
|
+
(state, { levelIds, subjectIds }) => searchBooks(state, { levelIds, subjectIds }),
|
|
1196
|
+
(_state, params) => params,
|
|
1197
|
+
(products, books, params) => search20(params)(products, books)
|
|
1198
|
+
);
|
|
1199
|
+
};
|
|
1200
|
+
var useSearchProducts = makeUseSearch(makeSearchProducts);
|
|
1201
|
+
|
|
1202
|
+
// src/selectors/resource.ts
|
|
1203
|
+
init_define_import_meta();
|
|
1204
|
+
import { makeEntitiesFilter as makeEntitiesFilter18 } from "@lls/utils";
|
|
1205
|
+
var search21 = ({ chapterIds }) => makeEntitiesFilter18({
|
|
1206
|
+
chapter: chapterIds
|
|
1207
|
+
});
|
|
1208
|
+
var { getResources, getResource, useSearchResources } = crud("resources", {
|
|
1209
|
+
search: search21
|
|
1210
|
+
});
|
|
1211
|
+
|
|
1212
|
+
// src/selectors/sharedPage.ts
|
|
1213
|
+
init_define_import_meta();
|
|
1214
|
+
import { createSearchSelector as createSearchSelector7, makeEntitiesFilter as makeEntitiesFilter19 } from "@lls/utils";
|
|
1215
|
+
import _13 from "lodash/fp.js";
|
|
1216
|
+
var search22 = ({
|
|
1217
|
+
parentIds,
|
|
1218
|
+
userIds,
|
|
1219
|
+
bookIds,
|
|
1220
|
+
isCreatedFromScratch,
|
|
1221
|
+
isLearningAssessment,
|
|
1222
|
+
ids
|
|
1223
|
+
}) => makeEntitiesFilter19({
|
|
1224
|
+
id: ids,
|
|
1225
|
+
parent: parentIds,
|
|
1226
|
+
user: userIds,
|
|
1227
|
+
book: bookIds,
|
|
1228
|
+
isLearningAssessment,
|
|
1229
|
+
isCreatedFromScratch
|
|
1230
|
+
});
|
|
1231
|
+
var { getSharedPages, getSharedPage, useSearchSharedPages } = crud("sharedPages", {
|
|
1232
|
+
search: search22
|
|
1233
|
+
});
|
|
1234
|
+
var makeSearchCurrentUserSharedPages = () => createSearchSelector7(
|
|
1235
|
+
getCurrentUser,
|
|
1236
|
+
getSharedPages,
|
|
1237
|
+
(__, params) => params,
|
|
1238
|
+
(user2, sharedPages, params) => {
|
|
1239
|
+
const sharedUserPageIds = user2?.sharedPages ?? [];
|
|
1240
|
+
return search22({ ...params, ids: _13.intersection(sharedUserPageIds, params.ids || sharedUserPageIds) })(sharedPages);
|
|
1241
|
+
}
|
|
1242
|
+
);
|
|
1243
|
+
var useSearchCurrentUserSharedPages = makeUseSearch(makeSearchCurrentUserSharedPages);
|
|
1244
|
+
|
|
1245
|
+
// src/selectors/student.ts
|
|
1246
|
+
init_define_import_meta();
|
|
1247
|
+
import { makeEntitiesFilter as makeEntitiesFilter20 } from "@lls/utils";
|
|
1248
|
+
var search23 = ({ ids }) => makeEntitiesFilter20({ id: ids });
|
|
1249
|
+
var { getStudents, getStudent, useSearchStudents } = crud("students", {
|
|
1250
|
+
search: search23
|
|
1251
|
+
});
|
|
1252
|
+
|
|
1253
|
+
// src/selectors/subject.ts
|
|
1254
|
+
init_define_import_meta();
|
|
1255
|
+
import { limitToTeacherSubjects, makeEntitiesFilter as makeEntitiesFilter21, pipe as pipe5 } from "@lls/utils";
|
|
1256
|
+
import _14 from "lodash/fp.js";
|
|
1257
|
+
var search24 = ({
|
|
1258
|
+
ids,
|
|
1259
|
+
slugs,
|
|
1260
|
+
isTeacherSubject,
|
|
1261
|
+
hasNewsletterUrl,
|
|
1262
|
+
schoolTypes,
|
|
1263
|
+
hasBooks,
|
|
1264
|
+
names,
|
|
1265
|
+
sortByQuery
|
|
1266
|
+
}) => (subjects) => pipe5(
|
|
1267
|
+
subjects,
|
|
1268
|
+
makeEntitiesFilter21(
|
|
1269
|
+
{
|
|
1270
|
+
id: ids,
|
|
1271
|
+
slug: slugs,
|
|
1272
|
+
name: names,
|
|
1273
|
+
hasBooks,
|
|
1274
|
+
schoolTypes
|
|
1275
|
+
},
|
|
1276
|
+
!_14.isNil(hasNewsletterUrl) && ((subject2) => Boolean(subject2?.newsletterUrl) === hasNewsletterUrl)
|
|
1277
|
+
),
|
|
1278
|
+
(subjects2) => _14.isNil(isTeacherSubject) ? subjects2 : limitToTeacherSubjects(subjects2),
|
|
1279
|
+
_14.isFunction(sortByQuery) ? sortByQuery : sortByQuery ? _14.sortBy(sortByQuery) : _14.identity
|
|
1280
|
+
);
|
|
1281
|
+
var { getSubjects, getSubject, useSearchSubjects, makeSearchSubjects } = crud("subjects", {
|
|
1282
|
+
search: search24
|
|
1283
|
+
});
|
|
1284
|
+
|
|
1285
|
+
// src/selectors/teacher.ts
|
|
1286
|
+
init_define_import_meta();
|
|
1287
|
+
import { makeEntitiesFilter as makeEntitiesFilter22 } from "@lls/utils";
|
|
1288
|
+
var search25 = ({ ids, schoolIds }) => makeEntitiesFilter22({
|
|
1289
|
+
id: ids,
|
|
1290
|
+
schools: schoolIds
|
|
1291
|
+
});
|
|
1292
|
+
var { getTeachers, getTeacher, useSearchTeachers } = crud("teachers", {
|
|
1293
|
+
search: search25
|
|
1294
|
+
});
|
|
1295
|
+
|
|
1296
|
+
// src/selectors/method.ts
|
|
1297
|
+
init_define_import_meta();
|
|
1298
|
+
import { makeEntitiesFilter as makeEntitiesFilter23 } from "@lls/utils";
|
|
1299
|
+
var search26 = ({ ids, uris }) => makeEntitiesFilter23({ id: ids, uri: uris });
|
|
1300
|
+
var { getMethods, useSearchMethods } = crud("methods", {
|
|
1301
|
+
search: search26
|
|
1302
|
+
});
|
|
1303
|
+
|
|
1304
|
+
// src/selectors/tool.ts
|
|
1305
|
+
init_define_import_meta();
|
|
1306
|
+
import { makeEntitiesFilter as makeEntitiesFilter24 } from "@lls/utils";
|
|
1307
|
+
var search27 = ({ ids, locked, bookIds }) => makeEntitiesFilter24({
|
|
1308
|
+
id: ids,
|
|
1309
|
+
locked,
|
|
1310
|
+
books: bookIds
|
|
1311
|
+
});
|
|
1312
|
+
var { getTools, getTool, useSearchTools } = crud("tools", {
|
|
1313
|
+
search: search27
|
|
1314
|
+
});
|
|
1315
|
+
|
|
1316
|
+
// src/selectors/builderIo.ts
|
|
1317
|
+
init_define_import_meta();
|
|
1318
|
+
import { makeEntitiesFilter as makeEntitiesFilter25 } from "@lls/utils";
|
|
1319
|
+
var search28 = ({ modelIds, subjects, schoolTypes }) => makeEntitiesFilter25(
|
|
1320
|
+
{
|
|
1321
|
+
modelId: modelIds
|
|
1322
|
+
},
|
|
1323
|
+
subjects && ((builderIo2) => !!builderIo2?.data?.subjects?.some((x) => subjects.includes(x))),
|
|
1324
|
+
schoolTypes && ((builderIo2) => !!builderIo2?.data?.schoolTypes?.some((x) => schoolTypes.includes(x)))
|
|
1325
|
+
);
|
|
1326
|
+
var { getBuilderIos, getBuilderIo, useSearchBuilderIos } = crud("builderIos", {
|
|
1327
|
+
search: search28
|
|
1328
|
+
});
|
|
1329
|
+
|
|
1330
|
+
// src/selectors/circonscription.ts
|
|
1331
|
+
init_define_import_meta();
|
|
1332
|
+
import _15 from "lodash/fp.js";
|
|
1333
|
+
var search29 = (_params) => _15.identity;
|
|
1334
|
+
var { getCirconscriptions } = crud("circonscriptions", {
|
|
1335
|
+
search: search29
|
|
1336
|
+
});
|
|
1337
|
+
|
|
1338
|
+
// src/selectors/documentType.ts
|
|
1339
|
+
init_define_import_meta();
|
|
1340
|
+
import { makeEntitiesFilter as makeEntitiesFilter26 } from "@lls/utils";
|
|
1341
|
+
var search30 = ({ ids }) => {
|
|
1342
|
+
return makeEntitiesFilter26({
|
|
1343
|
+
id: ids
|
|
1344
|
+
});
|
|
1345
|
+
};
|
|
1346
|
+
var searchSubDocumentType = ({
|
|
1347
|
+
ids
|
|
1348
|
+
}) => {
|
|
1349
|
+
return makeEntitiesFilter26({
|
|
1350
|
+
id: ids
|
|
1351
|
+
});
|
|
1352
|
+
};
|
|
1353
|
+
var { getSubDocumentTypes, useSearchSubDocumentTypes } = crud("subDocumentTypes", {
|
|
1354
|
+
search: searchSubDocumentType
|
|
1355
|
+
});
|
|
1356
|
+
var { getDocumentTypes, getDocumentType, useSearchDocumentTypes } = crud("documentTypes", {
|
|
1357
|
+
search: search30
|
|
1358
|
+
});
|
|
1359
|
+
|
|
1360
|
+
// src/selectors/globalRights.ts
|
|
1361
|
+
init_define_import_meta();
|
|
1362
|
+
import _16 from "lodash/fp.js";
|
|
1363
|
+
var getGlobalRights = _16.get("entities.globalRights");
|
|
1364
|
+
|
|
1365
|
+
// src/reducers/entities.ts
|
|
1366
|
+
init_define_import_meta();
|
|
1367
|
+
import { makeReducer } from "@lls/utils";
|
|
1368
|
+
import _17 from "lodash/fp.js";
|
|
1369
|
+
|
|
1370
|
+
// src/actions/index.ts
|
|
1371
|
+
init_define_import_meta();
|
|
1372
|
+
import { makeActionCreator } from "@lls/utils";
|
|
1373
|
+
var actionTypes = {
|
|
1374
|
+
DELETE_ENTITY: "DELETE_ENTITY",
|
|
1375
|
+
UPDATE_ENTITY: "UPDATE_ENTITY",
|
|
1376
|
+
SET_ENTITY: "SET_ENTITY",
|
|
1377
|
+
SET_ENTITIES: "SET_ENTITIES",
|
|
1378
|
+
RESET_AUTH: "RESET_AUTH",
|
|
1379
|
+
SET_AUTH: "SET_AUTH"
|
|
1380
|
+
};
|
|
1381
|
+
var deleteEntity = makeActionCreator(actionTypes.DELETE_ENTITY);
|
|
1382
|
+
var updateEntity = makeActionCreator(actionTypes.UPDATE_ENTITY);
|
|
1383
|
+
var setEntity = makeActionCreator(actionTypes.SET_ENTITY);
|
|
1384
|
+
var setEntities = makeActionCreator(actionTypes.SET_ENTITIES);
|
|
1385
|
+
var setAuth = makeActionCreator(actionTypes.SET_AUTH);
|
|
1386
|
+
var resetAuth = makeActionCreator(actionTypes.RESET_AUTH);
|
|
1387
|
+
|
|
1388
|
+
// src/reducers/entities.ts
|
|
1389
|
+
var deleteEntityReducer = (state, payload) => {
|
|
1390
|
+
const { path } = payload;
|
|
1391
|
+
return _17.omit(path, state);
|
|
1392
|
+
};
|
|
1393
|
+
var updateEntityReducer = (state, payload) => {
|
|
1394
|
+
const { path, entity } = payload;
|
|
1395
|
+
const currentEntity = _17.get(path, state);
|
|
1396
|
+
return _17.set(path, _17.merge(currentEntity, entity), state);
|
|
1397
|
+
};
|
|
1398
|
+
var setEntityReducer = (state, payload) => {
|
|
1399
|
+
const { path, entity } = payload;
|
|
1400
|
+
return _17.set(path, entity, state);
|
|
1401
|
+
};
|
|
1402
|
+
var setEntitiesReducer = (state, payload) => {
|
|
1403
|
+
if (typeof payload !== "object") return state;
|
|
1404
|
+
const stateDrafts = {};
|
|
1405
|
+
Object.keys(payload).forEach((entityName) => {
|
|
1406
|
+
const entities2 = payload[entityName];
|
|
1407
|
+
const entityDraft = {};
|
|
1408
|
+
if (!entities2) {
|
|
1409
|
+
return;
|
|
1410
|
+
}
|
|
1411
|
+
Object.keys(entities2).forEach((id) => {
|
|
1412
|
+
const entity = entities2[id];
|
|
1413
|
+
if (!state[entityName]?.[id]) {
|
|
1414
|
+
entityDraft[id] = entity;
|
|
1415
|
+
} else {
|
|
1416
|
+
if (typeof entity === "undefined") {
|
|
1417
|
+
return;
|
|
1418
|
+
}
|
|
1419
|
+
const diff = Object.keys(entity).some((prop) => {
|
|
1420
|
+
const value = entity[prop];
|
|
1421
|
+
if (!_17.isEqual(state[entityName]?.[id]?.[prop], value)) {
|
|
1422
|
+
return true;
|
|
1423
|
+
}
|
|
1424
|
+
});
|
|
1425
|
+
if (diff) {
|
|
1426
|
+
entityDraft[id] = Object.assign({}, state[entityName]?.[id], entity);
|
|
1427
|
+
}
|
|
1428
|
+
}
|
|
1429
|
+
});
|
|
1430
|
+
if (Object.keys(entityDraft).length !== 0) {
|
|
1431
|
+
stateDrafts[entityName] = { ...state[entityName], ...entityDraft };
|
|
1432
|
+
}
|
|
1433
|
+
});
|
|
1434
|
+
if (Object.keys(stateDrafts).length !== 0) {
|
|
1435
|
+
return { ...state, ...stateDrafts };
|
|
1436
|
+
}
|
|
1437
|
+
return state;
|
|
1438
|
+
};
|
|
1439
|
+
var entities = makeReducer(
|
|
1440
|
+
{},
|
|
1441
|
+
{
|
|
1442
|
+
[actionTypes.DELETE_ENTITY]: deleteEntityReducer,
|
|
1443
|
+
[actionTypes.UPDATE_ENTITY]: updateEntityReducer,
|
|
1444
|
+
[actionTypes.SET_ENTITY]: setEntityReducer,
|
|
1445
|
+
[actionTypes.SET_ENTITIES]: setEntitiesReducer
|
|
1446
|
+
}
|
|
1447
|
+
);
|
|
1448
|
+
var entities_default = entities;
|
|
1449
|
+
|
|
1450
|
+
// src/reducers/auth.ts
|
|
1451
|
+
init_define_import_meta();
|
|
1452
|
+
import { makeReducer as makeReducer2 } from "@lls/utils";
|
|
1453
|
+
import _18 from "lodash/fp.js";
|
|
1454
|
+
var initialState = {
|
|
1455
|
+
id: void 0,
|
|
1456
|
+
role: null,
|
|
1457
|
+
token: null,
|
|
1458
|
+
isStudent: null,
|
|
1459
|
+
isTeacher: null,
|
|
1460
|
+
isPremium: null,
|
|
1461
|
+
userPages: null,
|
|
1462
|
+
username: null,
|
|
1463
|
+
llsUserId: null
|
|
1464
|
+
};
|
|
1465
|
+
var auth = makeReducer2(initialState, {
|
|
1466
|
+
[actionTypes.SET_AUTH]: _18.assign,
|
|
1467
|
+
[actionTypes.RESET_AUTH]: _18.constant(initialState)
|
|
1468
|
+
});
|
|
1469
|
+
var auth_default = auth;
|
|
1470
|
+
|
|
1471
|
+
// src/schema/index.ts
|
|
1472
|
+
init_define_import_meta();
|
|
1473
|
+
var import_normalizr = __toESM(require_normalizr(), 1);
|
|
1474
|
+
import _19 from "lodash/fp.js";
|
|
1475
|
+
var document = new import_normalizr.schema.Entity("documents");
|
|
1476
|
+
var documentType = new import_normalizr.schema.Entity("documentTypes");
|
|
1477
|
+
var subDocumentType = new import_normalizr.schema.Entity("subDocumentTypes");
|
|
1478
|
+
var subject = new import_normalizr.schema.Entity("subjects");
|
|
1479
|
+
var level = new import_normalizr.schema.Entity("levels");
|
|
1480
|
+
var book = new import_normalizr.schema.Entity("books");
|
|
1481
|
+
var tool = new import_normalizr.schema.Entity("tools");
|
|
1482
|
+
var chapter = new import_normalizr.schema.Entity("chapters");
|
|
1483
|
+
var page = new import_normalizr.schema.Entity("pages");
|
|
1484
|
+
var resource = new import_normalizr.schema.Entity("resources");
|
|
1485
|
+
var user = new import_normalizr.schema.Entity("users");
|
|
1486
|
+
var school = new import_normalizr.schema.Entity("schools");
|
|
1487
|
+
var teacher = new import_normalizr.schema.Entity("teachers");
|
|
1488
|
+
var faq = new import_normalizr.schema.Entity("faq");
|
|
1489
|
+
var product = new import_normalizr.schema.Entity("products");
|
|
1490
|
+
var communityProjects = new import_normalizr.schema.Entity("communityProjects");
|
|
1491
|
+
var builderIo = new import_normalizr.schema.Entity("builderIos");
|
|
1492
|
+
var lexicalFlower = new import_normalizr.schema.Entity("lexicalFlowers");
|
|
1493
|
+
var globalRights = new import_normalizr.schema.Entity(
|
|
1494
|
+
"globalRights",
|
|
1495
|
+
{},
|
|
1496
|
+
{
|
|
1497
|
+
idAttribute: (_20, __, key) => key
|
|
1498
|
+
// Use keys from globalRights(anonymous, classroom, connected, teacher) as Id
|
|
1499
|
+
}
|
|
1500
|
+
);
|
|
1501
|
+
var grammarRule = new import_normalizr.schema.Entity("grammarRules", {}, { idAttribute: "objectID" });
|
|
1502
|
+
var mainNotification = new import_normalizr.schema.Entity("mainNotifications");
|
|
1503
|
+
var explorerResult = new import_normalizr.schema.Entity("explorerResults", {}, { idAttribute: "resourceId" });
|
|
1504
|
+
var drawerNotification = new import_normalizr.schema.Entity("drawerNotifications");
|
|
1505
|
+
var copyNotification = new import_normalizr.schema.Entity("copyNotifications");
|
|
1506
|
+
var quote = new import_normalizr.schema.Entity("quotes");
|
|
1507
|
+
var group = new import_normalizr.schema.Entity("groups");
|
|
1508
|
+
var method = new import_normalizr.schema.Entity("methods");
|
|
1509
|
+
var analytic = new import_normalizr.schema.Entity("analytics");
|
|
1510
|
+
var contact = new import_normalizr.schema.Entity("contacts");
|
|
1511
|
+
var collection = new import_normalizr.schema.Entity("collections");
|
|
1512
|
+
var sharedPage = new import_normalizr.schema.Entity("sharedPages");
|
|
1513
|
+
var student = new import_normalizr.schema.Entity("students");
|
|
1514
|
+
var news = new import_normalizr.schema.Entity("news");
|
|
1515
|
+
var schoolType = new import_normalizr.schema.Entity("schoolTypes");
|
|
1516
|
+
var panorama = new import_normalizr.schema.Entity("panoramas");
|
|
1517
|
+
var premiumResource = new import_normalizr.schema.Entity("premiumResources");
|
|
1518
|
+
var garDivision = new import_normalizr.schema.Entity("garDivisions");
|
|
1519
|
+
var circonscription = new import_normalizr.schema.Entity("circonscriptions");
|
|
1520
|
+
var define = (el, scheme) => {
|
|
1521
|
+
el.define(scheme);
|
|
1522
|
+
return scheme;
|
|
1523
|
+
};
|
|
1524
|
+
var bookSchema = define(book, {
|
|
1525
|
+
chapters: [chapter],
|
|
1526
|
+
collection,
|
|
1527
|
+
firstValidPage: page,
|
|
1528
|
+
levels: [level],
|
|
1529
|
+
news: [news],
|
|
1530
|
+
oldBook: book,
|
|
1531
|
+
premiumResources: [premiumResource],
|
|
1532
|
+
revisionPages: [page],
|
|
1533
|
+
subjects: [subject],
|
|
1534
|
+
textbooks: [book],
|
|
1535
|
+
educationalGuides: [book],
|
|
1536
|
+
tools: [tool],
|
|
1537
|
+
workbooks: [book],
|
|
1538
|
+
workplans: [book]
|
|
1539
|
+
});
|
|
1540
|
+
var garDivisionSchema = define(garDivision, {
|
|
1541
|
+
students: [user],
|
|
1542
|
+
school
|
|
1543
|
+
});
|
|
1544
|
+
var documentTypeSchema = define(documentType, {
|
|
1545
|
+
subTypes: [subDocumentType]
|
|
1546
|
+
});
|
|
1547
|
+
var documentSchema = define(document, {
|
|
1548
|
+
page,
|
|
1549
|
+
levels: [level],
|
|
1550
|
+
documentType,
|
|
1551
|
+
subDocumentType
|
|
1552
|
+
});
|
|
1553
|
+
var chapterSchema = define(chapter, {
|
|
1554
|
+
book,
|
|
1555
|
+
oldBook: book,
|
|
1556
|
+
oldChapter: chapter,
|
|
1557
|
+
pages: [page],
|
|
1558
|
+
resources: [resource]
|
|
1559
|
+
});
|
|
1560
|
+
var pageSchema = define(page, {
|
|
1561
|
+
book,
|
|
1562
|
+
chapter,
|
|
1563
|
+
oldBook: book,
|
|
1564
|
+
oldChapter: chapter,
|
|
1565
|
+
oldLesson: page,
|
|
1566
|
+
originalPage: page,
|
|
1567
|
+
parent: page,
|
|
1568
|
+
sharedGroups: [group],
|
|
1569
|
+
sharedTeacher: user,
|
|
1570
|
+
sharedUsers: [user],
|
|
1571
|
+
user
|
|
1572
|
+
});
|
|
1573
|
+
var userSchema = define(user, {
|
|
1574
|
+
books: [book],
|
|
1575
|
+
booksV2: [book],
|
|
1576
|
+
contacts: [contact],
|
|
1577
|
+
copies: [page],
|
|
1578
|
+
copyNotifications: [copyNotification],
|
|
1579
|
+
drawerNotifications: [drawerNotification],
|
|
1580
|
+
garDivisions: [garDivision],
|
|
1581
|
+
groups: [group],
|
|
1582
|
+
lastBooksViewed: [book],
|
|
1583
|
+
lastPagesViewed: [page],
|
|
1584
|
+
levels: [level],
|
|
1585
|
+
mainNotifications: [mainNotification],
|
|
1586
|
+
pages: [page],
|
|
1587
|
+
schools: [school],
|
|
1588
|
+
sharedPages: [sharedPage],
|
|
1589
|
+
students: [student],
|
|
1590
|
+
subjects: [subject],
|
|
1591
|
+
teachers: [teacher],
|
|
1592
|
+
userPages: [page],
|
|
1593
|
+
userBookPages: [page],
|
|
1594
|
+
lexicalFlowers: { hits: [lexicalFlower] }
|
|
1595
|
+
});
|
|
1596
|
+
var notificationSchema = define(mainNotification, { page });
|
|
1597
|
+
drawerNotification.define({ page });
|
|
1598
|
+
copyNotification.define({ page });
|
|
1599
|
+
var resourceSchema = define(resource, {
|
|
1600
|
+
chapter,
|
|
1601
|
+
page
|
|
1602
|
+
});
|
|
1603
|
+
var toolSchema = define(tool, {
|
|
1604
|
+
books: [book]
|
|
1605
|
+
});
|
|
1606
|
+
var sharedPageSchema = define(sharedPage, {
|
|
1607
|
+
user,
|
|
1608
|
+
chapter,
|
|
1609
|
+
parent: page,
|
|
1610
|
+
book,
|
|
1611
|
+
originalPage: page
|
|
1612
|
+
});
|
|
1613
|
+
var studentSchema = define(student, {
|
|
1614
|
+
levels: [level]
|
|
1615
|
+
});
|
|
1616
|
+
var teacherSchema = define(teacher, {
|
|
1617
|
+
schools: [school],
|
|
1618
|
+
subjects: [subject]
|
|
1619
|
+
});
|
|
1620
|
+
var productSchema = define(product, {
|
|
1621
|
+
books: [book]
|
|
1622
|
+
});
|
|
1623
|
+
var groupSchema = define(group, {
|
|
1624
|
+
owner: teacher,
|
|
1625
|
+
students: [student]
|
|
1626
|
+
});
|
|
1627
|
+
var schoolSchema = define(school, {
|
|
1628
|
+
groups: [group]
|
|
1629
|
+
});
|
|
1630
|
+
var methodSchema = define(method, {
|
|
1631
|
+
book
|
|
1632
|
+
});
|
|
1633
|
+
var newsSchema = define(news, {
|
|
1634
|
+
books: [book],
|
|
1635
|
+
subjects: [subject],
|
|
1636
|
+
levels: [level]
|
|
1637
|
+
});
|
|
1638
|
+
var premiumResourceSchema = define(premiumResource, {
|
|
1639
|
+
book
|
|
1640
|
+
});
|
|
1641
|
+
var levelSchema = define(level, {
|
|
1642
|
+
schoolTypes: [schoolType]
|
|
1643
|
+
});
|
|
1644
|
+
var querySchema = {
|
|
1645
|
+
viewer: {
|
|
1646
|
+
addCorrectionsToGroup: group,
|
|
1647
|
+
addCorrectionsToStudents: page,
|
|
1648
|
+
addPageAppreciation: page,
|
|
1649
|
+
addStudentToGroup: group,
|
|
1650
|
+
books: { hits: [book] },
|
|
1651
|
+
methods: { hits: [method] },
|
|
1652
|
+
chapters: { hits: [chapter] },
|
|
1653
|
+
createEstimate: quote,
|
|
1654
|
+
createGroup: group,
|
|
1655
|
+
createPage: page,
|
|
1656
|
+
createUser: user,
|
|
1657
|
+
createLexicalFlower: lexicalFlower,
|
|
1658
|
+
documents: { hits: [document] },
|
|
1659
|
+
documentTypes: { hits: [documentType] },
|
|
1660
|
+
subDocumentTypes: { hits: [subDocumentType] },
|
|
1661
|
+
explorerResults: [explorerResult],
|
|
1662
|
+
levels: [level],
|
|
1663
|
+
globalRights: new import_normalizr.schema.Values(globalRights),
|
|
1664
|
+
me: user,
|
|
1665
|
+
// mutations
|
|
1666
|
+
pages: { hits: [page] },
|
|
1667
|
+
panoramas: [panorama],
|
|
1668
|
+
parents: { hits: [page] },
|
|
1669
|
+
//pages alias
|
|
1670
|
+
product: { hits: [product] },
|
|
1671
|
+
schoolTypes: { hits: [schoolType] },
|
|
1672
|
+
sharePageToGroup: page,
|
|
1673
|
+
sharePageToUsers: page,
|
|
1674
|
+
subjects: { hits: [subject] },
|
|
1675
|
+
updateCopyNotification: copyNotification,
|
|
1676
|
+
updateDrawerNotification: drawerNotification,
|
|
1677
|
+
updateGroup: group,
|
|
1678
|
+
updateMainNotification: mainNotification,
|
|
1679
|
+
updatePage: page,
|
|
1680
|
+
updateTrialUser: user,
|
|
1681
|
+
updateUserLastActivitySeenAt: user,
|
|
1682
|
+
updateUser: user,
|
|
1683
|
+
updateLexicalFlower: lexicalFlower
|
|
1684
|
+
},
|
|
1685
|
+
auth: {
|
|
1686
|
+
user
|
|
1687
|
+
},
|
|
1688
|
+
marketing: {
|
|
1689
|
+
addLikeFaq: faq,
|
|
1690
|
+
communityProjects: [communityProjects],
|
|
1691
|
+
createAnalytics: analytic,
|
|
1692
|
+
faq: [faq],
|
|
1693
|
+
builderIos: [builderIo],
|
|
1694
|
+
circonscriptions: [circonscription]
|
|
1695
|
+
},
|
|
1696
|
+
static: {
|
|
1697
|
+
projetVoltaire: {
|
|
1698
|
+
grammarRules: [grammarRule]
|
|
1699
|
+
}
|
|
1700
|
+
}
|
|
1701
|
+
};
|
|
1702
|
+
var normalizeData = _19.flow((data) => (0, import_normalizr.normalize)(data, querySchema));
|
|
1703
|
+
export {
|
|
1704
|
+
auth_default as authReducer,
|
|
1705
|
+
entities_default as entitiesReducer,
|
|
1706
|
+
filterBooks,
|
|
1707
|
+
filterPages,
|
|
1708
|
+
getAllNews,
|
|
1709
|
+
getAuth,
|
|
1710
|
+
getBook,
|
|
1711
|
+
getBooks,
|
|
1712
|
+
getBuilderIo,
|
|
1713
|
+
getBuilderIos,
|
|
1714
|
+
getChapter,
|
|
1715
|
+
getChapters,
|
|
1716
|
+
getCirconscriptions,
|
|
1717
|
+
getCollection,
|
|
1718
|
+
getCollections,
|
|
1719
|
+
getCommunityProject,
|
|
1720
|
+
getCommunityProjects,
|
|
1721
|
+
getContact,
|
|
1722
|
+
getContacts,
|
|
1723
|
+
getCurrentUser,
|
|
1724
|
+
getDocument,
|
|
1725
|
+
getDocumentType,
|
|
1726
|
+
getDocumentTypes,
|
|
1727
|
+
getDraft,
|
|
1728
|
+
getDrafts,
|
|
1729
|
+
getFaqs,
|
|
1730
|
+
getGarDivision,
|
|
1731
|
+
getGarDivisions,
|
|
1732
|
+
getGlobalRights,
|
|
1733
|
+
getGroup,
|
|
1734
|
+
getGroups,
|
|
1735
|
+
getIsLogged,
|
|
1736
|
+
getLevel,
|
|
1737
|
+
getLevels,
|
|
1738
|
+
getLexicalFlowers,
|
|
1739
|
+
getMainNotifications,
|
|
1740
|
+
getMethods,
|
|
1741
|
+
getNews,
|
|
1742
|
+
getPage,
|
|
1743
|
+
getPages,
|
|
1744
|
+
getPanorama,
|
|
1745
|
+
getPremiumResource,
|
|
1746
|
+
getPremiumResources,
|
|
1747
|
+
getProducts,
|
|
1748
|
+
getResource,
|
|
1749
|
+
getResources,
|
|
1750
|
+
getSchool,
|
|
1751
|
+
getSchoolType,
|
|
1752
|
+
getSchoolTypes,
|
|
1753
|
+
getSchools,
|
|
1754
|
+
getSharedPage,
|
|
1755
|
+
getSharedPages,
|
|
1756
|
+
getStudent,
|
|
1757
|
+
getStudents,
|
|
1758
|
+
getSubDocumentTypes,
|
|
1759
|
+
getSubject,
|
|
1760
|
+
getSubjects,
|
|
1761
|
+
getTeacher,
|
|
1762
|
+
getTeachers,
|
|
1763
|
+
getToken,
|
|
1764
|
+
getTool,
|
|
1765
|
+
getTools,
|
|
1766
|
+
getUser,
|
|
1767
|
+
getUserGroups,
|
|
1768
|
+
getUsers,
|
|
1769
|
+
makeGetBook,
|
|
1770
|
+
makeGetCurrentUser,
|
|
1771
|
+
makeSearchBooks,
|
|
1772
|
+
makeSearchDrawerNotifications,
|
|
1773
|
+
makeSearchLevels,
|
|
1774
|
+
makeSearchPages,
|
|
1775
|
+
makeSearchSchoolTypes,
|
|
1776
|
+
makeSearchSubjects,
|
|
1777
|
+
makeSearchValidBooks,
|
|
1778
|
+
makeUseSearch,
|
|
1779
|
+
normalizeData,
|
|
1780
|
+
querySchema,
|
|
1781
|
+
searchLevels,
|
|
1782
|
+
searchSchoolTypes,
|
|
1783
|
+
setEntitiesReducer,
|
|
1784
|
+
useSearchBooks,
|
|
1785
|
+
useSearchBuilderIos,
|
|
1786
|
+
useSearchChapters,
|
|
1787
|
+
useSearchCollections,
|
|
1788
|
+
useSearchCommunityProjects,
|
|
1789
|
+
useSearchContacts,
|
|
1790
|
+
useSearchCopyNotifications,
|
|
1791
|
+
useSearchCurrentUserSharedPages,
|
|
1792
|
+
useSearchDocumentTypes,
|
|
1793
|
+
useSearchDocuments,
|
|
1794
|
+
useSearchDrafts,
|
|
1795
|
+
useSearchDrawerNotifications,
|
|
1796
|
+
useSearchGarDivisions,
|
|
1797
|
+
useSearchGroups,
|
|
1798
|
+
useSearchLevels,
|
|
1799
|
+
useSearchLexicalFlowers,
|
|
1800
|
+
useSearchMethods,
|
|
1801
|
+
useSearchModifiedPages,
|
|
1802
|
+
useSearchNews,
|
|
1803
|
+
useSearchPages,
|
|
1804
|
+
useSearchPremiumResources,
|
|
1805
|
+
useSearchProducts,
|
|
1806
|
+
useSearchResources,
|
|
1807
|
+
useSearchSchoolTypes,
|
|
1808
|
+
useSearchSchools,
|
|
1809
|
+
useSearchSharedPages,
|
|
1810
|
+
useSearchStudents,
|
|
1811
|
+
useSearchSubDocumentTypes,
|
|
1812
|
+
useSearchSubjects,
|
|
1813
|
+
useSearchTeachers,
|
|
1814
|
+
useSearchTools,
|
|
1815
|
+
useSearchUsers,
|
|
1816
|
+
useSearchValidBooks
|
|
1817
|
+
};
|