jsf.js_next_gen 4.0.1-alpha.0 → 4.0.1-beta.2

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.
Files changed (115) hide show
  1. package/README.md +0 -12
  2. package/dist/docs/assets/search.js +1 -1
  3. package/dist/docs/functions/faces.ajax.addOnError.html +4 -4
  4. package/dist/docs/functions/faces.ajax.request.html +7 -7
  5. package/dist/docs/functions/faces.ajax.response.html +0 -1
  6. package/dist/docs/functions/faces.util.chain.html +3 -3
  7. package/dist/docs/functions/myfaces.ab.html +1 -1
  8. package/dist/docs/functions/{myfaces.onDomReady.html → myfaces.onOnDomReady.html} +5 -5
  9. package/dist/docs/index.html +0 -14
  10. package/dist/docs/modules/myfaces.html +2 -2
  11. package/dist/docs/variables/myfaces.oam.html +1 -1
  12. package/dist/window/faces-development.js +1323 -1300
  13. package/dist/window/faces-development.js.br +0 -0
  14. package/dist/window/faces-development.js.gz +0 -0
  15. package/dist/window/faces-development.js.map +1 -1
  16. package/dist/window/faces.js +1 -1
  17. package/dist/window/faces.js.br +0 -0
  18. package/dist/window/faces.js.gz +0 -0
  19. package/dist/window/faces.js.map +1 -1
  20. package/dist/window/jsf-development.js +1323 -1300
  21. package/dist/window/jsf-development.js.br +0 -0
  22. package/dist/window/jsf-development.js.gz +0 -0
  23. package/dist/window/jsf-development.js.map +1 -1
  24. package/dist/window/jsf.js +1 -1
  25. package/dist/window/jsf.js.br +0 -0
  26. package/dist/window/jsf.js.gz +0 -0
  27. package/dist/window/jsf.js.map +1 -1
  28. package/package.json +3 -3
  29. package/pom.xml +1 -1
  30. package/src/main/typescript/@types/definitions/index.d.ts +5 -5
  31. package/src/main/typescript/api/_api.ts +12 -13
  32. package/src/main/typescript/impl/AjaxImpl.ts +68 -65
  33. package/src/main/typescript/impl/core/Const.ts +2 -5
  34. package/src/main/typescript/impl/util/AsyncQueue.ts +133 -0
  35. package/src/main/typescript/impl/util/AsyncRunnable.ts +6 -81
  36. package/src/main/typescript/impl/util/ExtDomQuery.ts +9 -7
  37. package/src/main/typescript/impl/util/FileUtils.ts +22 -26
  38. package/src/main/typescript/impl/util/HiddenInputBuilder.ts +3 -7
  39. package/src/main/typescript/impl/util/Lang.ts +4 -61
  40. package/src/main/typescript/impl/xhrCore/EventData.ts +3 -3
  41. package/src/main/typescript/impl/xhrCore/ResponseProcessor.ts +10 -12
  42. package/src/main/typescript/impl/xhrCore/XhrFormData.ts +19 -32
  43. package/src/main/typescript/impl/xhrCore/XhrRequest.ts +72 -51
  44. package/src/main/typescript/myfaces/OamSubmit.ts +6 -6
  45. package/src/main/typescript/test/frameworkBase/_ext/monadish/DomQueryTest.spec.ts +40 -179
  46. package/src/main/typescript/test/frameworkBase/_ext/monadish/MonadTest.spec.ts +4 -4
  47. package/src/main/typescript/test/frameworkBase/_ext/monadish/StreamTest.spec.ts +231 -0
  48. package/src/main/typescript/test/frameworkBase/_ext/shared/StandardInits.ts +4 -5
  49. package/src/main/typescript/test/queue/AsynchronousProbe.ts +5 -5
  50. package/src/main/typescript/test/queue/AsynchronousQueueTest.spec.ts +3 -4
  51. package/src/main/typescript/test/xhrCore/ClientWindow.spec.ts +78 -0
  52. package/src/main/typescript/test/xhrCore/EventTests.spec.ts +22 -28
  53. package/src/main/typescript/test/xhrCore/NamespacesRequestTest.spec.ts +4 -4
  54. package/src/main/typescript/test/xhrCore/RequestParamsTest.spec.ts +2 -2
  55. package/src/main/typescript/test/xhrCore/RequestTest.spec.ts +6 -80
  56. package/src/main/typescript/test/xhrCore/RequestTest_23.spec.ts +1 -6
  57. package/src/main/typescript/test/xhrCore/ResponseTest.spec.ts +22 -23
  58. package/src/main/typescript/test/xhrCore/TobagoFileUploadTest.spec.ts +5 -5
  59. package/target/api/_api.js +11 -12
  60. package/target/api/_api.js.map +1 -1
  61. package/target/impl/AjaxImpl.js +59 -55
  62. package/target/impl/AjaxImpl.js.map +1 -1
  63. package/target/impl/core/Const.js +5 -7
  64. package/target/impl/core/Const.js.map +1 -1
  65. package/target/impl/util/AsyncRunnable.js +0 -60
  66. package/target/impl/util/AsyncRunnable.js.map +1 -1
  67. package/target/impl/util/ExtDomQuery.js +8 -8
  68. package/target/impl/util/ExtDomQuery.js.map +1 -1
  69. package/target/impl/util/FileUtils.js +20 -21
  70. package/target/impl/util/FileUtils.js.map +1 -1
  71. package/target/impl/util/HiddenInputBuilder.js +3 -7
  72. package/target/impl/util/HiddenInputBuilder.js.map +1 -1
  73. package/target/impl/util/Lang.js +1 -52
  74. package/target/impl/util/Lang.js.map +1 -1
  75. package/target/impl/xhrCore/EventData.js +2 -2
  76. package/target/impl/xhrCore/EventData.js.map +1 -1
  77. package/target/impl/xhrCore/ResponseProcessor.js +7 -9
  78. package/target/impl/xhrCore/ResponseProcessor.js.map +1 -1
  79. package/target/impl/xhrCore/XhrFormData.js +15 -29
  80. package/target/impl/xhrCore/XhrFormData.js.map +1 -1
  81. package/target/impl/xhrCore/XhrRequest.js +64 -43
  82. package/target/impl/xhrCore/XhrRequest.js.map +1 -1
  83. package/target/myfaces/OamSubmit.js +3 -5
  84. package/target/myfaces/OamSubmit.js.map +1 -1
  85. package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js +37 -138
  86. package/target/test/frameworkBase/_ext/monadish/DomQueryTest.spec.js.map +1 -1
  87. package/target/test/frameworkBase/_ext/monadish/MonadTest.spec.js +4 -4
  88. package/target/test/frameworkBase/_ext/monadish/MonadTest.spec.js.map +1 -1
  89. package/target/test/frameworkBase/_ext/shared/StandardInits.js +4 -5
  90. package/target/test/frameworkBase/_ext/shared/StandardInits.js.map +1 -1
  91. package/target/test/queue/AsynchronousQueueTest.spec.js +3 -3
  92. package/target/test/queue/AsynchronousQueueTest.spec.js.map +1 -1
  93. package/target/test/xhrCore/ClientWindow.spec.js +90 -0
  94. package/target/test/xhrCore/ClientWindow.spec.js.map +1 -0
  95. package/target/test/xhrCore/EventTests.spec.js +19 -26
  96. package/target/test/xhrCore/EventTests.spec.js.map +1 -1
  97. package/target/test/xhrCore/NamespacesRequestTest.spec.js +3 -3
  98. package/target/test/xhrCore/NamespacesRequestTest.spec.js.map +1 -1
  99. package/target/test/xhrCore/RequestParamsTest.spec.js +1 -1
  100. package/target/test/xhrCore/RequestParamsTest.spec.js.map +1 -1
  101. package/target/test/xhrCore/RequestTest.spec.js +4 -73
  102. package/target/test/xhrCore/RequestTest.spec.js.map +1 -1
  103. package/target/test/xhrCore/RequestTest_23.spec.js +0 -6
  104. package/target/test/xhrCore/RequestTest_23.spec.js.map +1 -1
  105. package/target/test/xhrCore/ResponseTest.spec.js +15 -22
  106. package/target/test/xhrCore/ResponseTest.spec.js.map +1 -1
  107. package/target/test/xhrCore/TobagoFileUploadTest.spec.js +5 -5
  108. package/target/test/xhrCore/TobagoFileUploadTest.spec.js.map +1 -1
  109. package/plans for 4.0.1.txt +0 -8
  110. package/src/main/typescript/impl/util/XhrQueueController.ts +0 -112
  111. package/src/main/typescript/test/frameworkBase/_ext/monadish/fixtures/blank.css +0 -0
  112. package/src/main/typescript/test/frameworkBase/_ext/monadish/markups/tobago-with-header.ts +0 -921
  113. package/src/main/typescript/test/frameworkBase/_ext/monadish/markups/tobago-without-header.ts +0 -108
  114. package/src/main/typescript/test/frameworkBase/_ext/shared/fixtures/jakarta.faces.resource/faces.js.jsf +0 -0
  115. package/src/main/typescript/test/myfaces/OnLoadSpec.ts +0 -52
@@ -2,540 +2,6 @@
2
2
  /******/ "use strict";
3
3
  /******/ var __webpack_modules__ = ({
4
4
 
5
- /***/ "./node_modules/mona-dish/src/main/typescript/AssocArray.ts":
6
- /*!******************************************************************!*\
7
- !*** ./node_modules/mona-dish/src/main/typescript/AssocArray.ts ***!
8
- \******************************************************************/
9
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
10
-
11
-
12
- /*!
13
- * Licensed to the Apache Software Foundation (ASF) under one or more
14
- * contributor license agreements. See the NOTICE file distributed with
15
- * this work for additional information regarding copyright ownership.
16
- * The ASF licenses this file to you under the Apache License, Version 2.0
17
- * (the "License"); you may not use this file except in compliance with
18
- * the License. You may obtain a copy of the License at
19
- *
20
- * http://www.apache.org/licenses/LICENSE-2.0
21
- *
22
- * Unless required by applicable law or agreed to in writing, software
23
- * distributed under the License is distributed on an "AS IS" BASIS,
24
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
25
- * See the License for the specific language governing permissions and
26
- * limitations under the License.
27
- */
28
- Object.defineProperty(exports, "__esModule", ({ value: true }));
29
- exports.shallowMerge = exports.simpleShallowMerge = exports.deepCopy = exports.buildPath = exports.resolve = exports.appendIf = exports.assignIf = exports.append = exports.assign = void 0;
30
- const Es2019Array_1 = __webpack_require__(/*! ./Es2019Array */ "./node_modules/mona-dish/src/main/typescript/Es2019Array.ts");
31
- /**
32
- * A nop as assign functionality (aka ignore assign)
33
- */
34
- class IgnoreAssign {
35
- constructor(parent) {
36
- this.parent = parent;
37
- }
38
- set value(value) {
39
- }
40
- get value() {
41
- return this.parent;
42
- }
43
- }
44
- ;
45
- /**
46
- * uses the known pattern from config
47
- * assign(target, key1, key2, key3).value = value;
48
- * @param target
49
- * @param keys
50
- */
51
- function assign(target, ...accessPath) {
52
- if (accessPath.length < 1) {
53
- return new IgnoreAssign(target);
54
- }
55
- const lastPathItem = buildPath(target, ...accessPath);
56
- let assigner = new (class {
57
- set value(value) {
58
- lastPathItem.target[lastPathItem.key] = value;
59
- }
60
- get value() {
61
- return lastPathItem.target[lastPathItem.key];
62
- }
63
- })();
64
- return assigner;
65
- }
66
- exports.assign = assign;
67
- function append(target, ...accessPath) {
68
- if (accessPath.length < 1) {
69
- return new IgnoreAssign(target);
70
- }
71
- const lastPathItem = buildPath(target, ...accessPath);
72
- let appender = new (class {
73
- set value(value) {
74
- if (!Array.isArray(value)) {
75
- value = [value];
76
- }
77
- if (!lastPathItem.target[lastPathItem.key]) {
78
- lastPathItem.target[lastPathItem.key] = value;
79
- }
80
- else {
81
- if (!Array.isArray(lastPathItem.target[lastPathItem.key])) {
82
- lastPathItem.target[lastPathItem.key] = [lastPathItem.target[lastPathItem.key]];
83
- }
84
- lastPathItem.target[lastPathItem.key].push(...value);
85
- }
86
- }
87
- })();
88
- return appender;
89
- }
90
- exports.append = append;
91
- /**
92
- * uses the known pattern from config
93
- * assign(target, key1, key2, key3).value = value;
94
- * @param target
95
- * @param keys
96
- */
97
- function assignIf(condition, target, ...accessPath) {
98
- if ((!condition) || accessPath.length < 1) {
99
- return new IgnoreAssign(target);
100
- }
101
- return assign(target, ...accessPath);
102
- }
103
- exports.assignIf = assignIf;
104
- /**
105
- * uses the known pattern from config
106
- * assign(target, key1, key2, key3).value = value;
107
- * @param target
108
- * @param keys
109
- */
110
- function appendIf(condition, target, ...accessPath) {
111
- if ((!condition) || accessPath.length < 1) {
112
- return new IgnoreAssign(target);
113
- }
114
- return append(target, ...accessPath);
115
- }
116
- exports.appendIf = appendIf;
117
- function resolve(target, ...accessPath) {
118
- let ret = null;
119
- accessPath = flattenAccessPath(accessPath);
120
- let currPtr = target;
121
- for (let cnt = 0; cnt < accessPath.length; cnt++) {
122
- let accessKeyIndex = accessPath[cnt];
123
- accessKeyIndex = arrayIndex(accessKeyIndex) != -1 ? arrayIndex(accessKeyIndex) : accessKeyIndex;
124
- currPtr = currPtr === null || currPtr === void 0 ? void 0 : currPtr[accessKeyIndex];
125
- if ('undefined' == typeof currPtr) {
126
- return null;
127
- }
128
- ret = currPtr;
129
- }
130
- return currPtr;
131
- }
132
- exports.resolve = resolve;
133
- function keyVal(key) {
134
- let start = key.indexOf("[");
135
- if (start >= 0) {
136
- return key.substring(0, start);
137
- }
138
- else {
139
- return key;
140
- }
141
- }
142
- function arrayIndex(key) {
143
- let start = key.indexOf("[");
144
- let end = key.indexOf("]");
145
- if (start >= 0 && end > 0 && start < end) {
146
- return parseInt(key.substring(start + 1, end));
147
- }
148
- else {
149
- return -1;
150
- }
151
- }
152
- function isArrayPos(currKey, arrPos) {
153
- return currKey === "" && arrPos >= 0;
154
- }
155
- function isNoArray(arrPos) {
156
- return arrPos == -1;
157
- }
158
- function alloc(arr, length, defaultVal = {}) {
159
- let toAdd = [];
160
- toAdd.length = length;
161
- toAdd[length - 1] = defaultVal;
162
- arr.push(...toAdd);
163
- }
164
- function flattenAccessPath(accessPath) {
165
- return accessPath.flatMap(path => path.split("["))
166
- .map(path => path.indexOf("]") != -1 ? "[" + path : path)
167
- .filter(path => path != "");
168
- }
169
- /**
170
- * builds up a path, only done if no data is present!
171
- * @param target
172
- * @param accessPath
173
- * @returns the last assignable entry
174
- */
175
- function buildPath(target, ...accessPath) {
176
- accessPath = flattenAccessPath(accessPath);
177
- //we now have a pattern of having the array accessors always in separate items
178
- let parentPtr = target;
179
- let parKeyArrPos = null;
180
- let currKey = null;
181
- let arrPos = -1;
182
- for (let cnt = 0; cnt < accessPath.length; cnt++) {
183
- currKey = keyVal(accessPath[cnt]);
184
- arrPos = arrayIndex(accessPath[cnt]);
185
- //it now is either key or arrPos
186
- if (arrPos != -1) {
187
- //case root(array)[5] -> root must be array and allocate 5 elements
188
- //case root.item[5] root.item must be array and of 5 elements
189
- if (!Array.isArray(parentPtr)) {
190
- throw Error("Associative array referenced as index array in path reference");
191
- }
192
- //we need to look ahead for proper allocation
193
- //not end reached
194
- let nextArrPos = -1;
195
- if (cnt < accessPath.length - 1) {
196
- nextArrPos = arrayIndex(accessPath[cnt + 1]);
197
- }
198
- let dataPresent = 'undefined' != typeof (parentPtr === null || parentPtr === void 0 ? void 0 : parentPtr[arrPos]);
199
- //no data present check here is needed, because alloc only reserves if not present
200
- alloc(parentPtr, arrPos + 1, nextArrPos != -1 ? [] : {});
201
- parKeyArrPos = arrPos;
202
- //we now go to the reserved element
203
- if (cnt == accessPath.length - 1) {
204
- parentPtr[arrPos] = (dataPresent) ? parentPtr[arrPos] : null;
205
- }
206
- else {
207
- parentPtr = parentPtr[arrPos];
208
- }
209
- }
210
- else {
211
- if (Array.isArray(parentPtr)) {
212
- throw Error("Index array referenced as associative array in path reference");
213
- }
214
- //again look ahead whether the next value is an array or assoc array
215
- let nextArrPos = -1;
216
- if (cnt < accessPath.length - 1) {
217
- nextArrPos = arrayIndex(accessPath[cnt + 1]);
218
- }
219
- parKeyArrPos = currKey;
220
- let dataPresent = 'undefined' != typeof (parentPtr === null || parentPtr === void 0 ? void 0 : parentPtr[currKey]);
221
- if (cnt == accessPath.length - 1) {
222
- if (!dataPresent) {
223
- parentPtr[currKey] = null;
224
- }
225
- }
226
- else {
227
- if (!dataPresent) {
228
- parentPtr[currKey] = nextArrPos == -1 ? {} : [];
229
- }
230
- parentPtr = parentPtr[currKey];
231
- }
232
- }
233
- }
234
- return { target: parentPtr, key: parKeyArrPos };
235
- }
236
- exports.buildPath = buildPath;
237
- function deepCopy(fromAssoc) {
238
- return JSON.parse(JSON.stringify(fromAssoc));
239
- }
240
- exports.deepCopy = deepCopy;
241
- /**
242
- * simple left to right merge
243
- *
244
- * @param assocArrays
245
- */
246
- function simpleShallowMerge(...assocArrays) {
247
- return shallowMerge(true, false, ...assocArrays);
248
- }
249
- exports.simpleShallowMerge = simpleShallowMerge;
250
- /**
251
- * Shallow merge as in config
252
- *
253
- * @param overwrite
254
- * @param withAppend
255
- * @param assocArrays
256
- */
257
- function shallowMerge(overwrite = true, withAppend = false, ...assocArrays) {
258
- let target = {};
259
- assocArrays.map(arr => {
260
- return { arr, keys: Object.keys(arr) };
261
- }).forEach(({ arr, keys }) => {
262
- keys.forEach(key => {
263
- let toAssign = arr[key];
264
- if (!Array.isArray(toAssign) && withAppend) {
265
- toAssign = new Es2019Array_1.Es2019Array(...[toAssign]);
266
- }
267
- if (overwrite || !(target === null || target === void 0 ? void 0 : target[key])) {
268
- if (!withAppend) {
269
- target[key] = arr[key];
270
- }
271
- else {
272
- if ('undefined' == typeof (target === null || target === void 0 ? void 0 : target[key])) {
273
- target[key] = toAssign;
274
- }
275
- else if (!Array.isArray(target[key])) {
276
- let oldVal = target[key];
277
- target[key] = new Es2019Array_1.Es2019Array(...[]);
278
- target[key].push(oldVal);
279
- target[key].push(...toAssign);
280
- }
281
- else {
282
- target[key].push(...toAssign);
283
- }
284
- }
285
- }
286
- });
287
- });
288
- return target;
289
- }
290
- exports.shallowMerge = shallowMerge;
291
-
292
-
293
- /***/ }),
294
-
295
- /***/ "./node_modules/mona-dish/src/main/typescript/Config.ts":
296
- /*!**************************************************************!*\
297
- !*** ./node_modules/mona-dish/src/main/typescript/Config.ts ***!
298
- \**************************************************************/
299
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
300
-
301
-
302
- Object.defineProperty(exports, "__esModule", ({ value: true }));
303
- exports.Config = exports.CONFIG_ANY = exports.CONFIG_VALUE = void 0;
304
- const Es2019Array_1 = __webpack_require__(/*! ./Es2019Array */ "./node_modules/mona-dish/src/main/typescript/Es2019Array.ts");
305
- const Monad_1 = __webpack_require__(/*! ./Monad */ "./node_modules/mona-dish/src/main/typescript/Monad.ts");
306
- const Lang_1 = __webpack_require__(/*! ./Lang */ "./node_modules/mona-dish/src/main/typescript/Lang.ts");
307
- var objAssign = Lang_1.Lang.objAssign;
308
- const AssocArray_1 = __webpack_require__(/*! ./AssocArray */ "./node_modules/mona-dish/src/main/typescript/AssocArray.ts");
309
- /**
310
- * specialized value embedder
311
- * for our Configuration
312
- */
313
- class ConfigEntry extends Monad_1.ValueEmbedder {
314
- constructor(rootElem, key, arrPos) {
315
- super(rootElem, key);
316
- this.arrPos = arrPos !== null && arrPos !== void 0 ? arrPos : -1;
317
- }
318
- get value() {
319
- if (this.key == "" && this.arrPos >= 0) {
320
- return this._value[this.arrPos];
321
- }
322
- else if (this.key && this.arrPos >= 0) {
323
- return this._value[this.key][this.arrPos];
324
- }
325
- return this._value[this.key];
326
- }
327
- set value(val) {
328
- if (this.key == "" && this.arrPos >= 0) {
329
- this._value[this.arrPos] = val;
330
- return;
331
- }
332
- else if (this.key && this.arrPos >= 0) {
333
- this._value[this.key][this.arrPos] = val;
334
- return;
335
- }
336
- this._value[this.key] = val;
337
- }
338
- }
339
- /*default value for absent*/
340
- ConfigEntry.absent = ConfigEntry.fromNullable(null);
341
- exports.CONFIG_VALUE = "__END_POINT__";
342
- exports.CONFIG_ANY = "__ANY_POINT__";
343
- /**
344
- * Config, basically an optional wrapper for a json structure
345
- * (not Side - effect free, since we can alter the internal config state
346
- * without generating a new config), not sure if we should make it side - effect free
347
- * since this would swallow a lot of performance and ram
348
- */
349
- class Config extends Monad_1.Optional {
350
- constructor(root, configDef) {
351
- super(root);
352
- this.configDef = configDef;
353
- }
354
- /**
355
- * shallow copy getter, copies only the first level, references the deeper nodes
356
- * in a shared manner
357
- */
358
- get shallowCopy() {
359
- return this.shallowCopy$();
360
- }
361
- shallowCopy$() {
362
- let ret = new Config({});
363
- ret.shallowMerge(this.value);
364
- return ret;
365
- }
366
- /**
367
- * deep copy, copies all config nodes
368
- */
369
- get deepCopy() {
370
- return this.deepCopy$();
371
- }
372
- deepCopy$() {
373
- return new Config(objAssign({}, this.value));
374
- }
375
- /**
376
- * creates a config from an initial value or null
377
- * @param value
378
- */
379
- static fromNullable(value) {
380
- return new Config(value);
381
- }
382
- /**
383
- * simple merge for the root configs
384
- */
385
- shallowMerge(other, overwrite = true, withAppend = false) {
386
- //shallow merge must be mutable so we have to remap
387
- let newThis = (0, AssocArray_1.shallowMerge)(overwrite, withAppend, this.value, other.value);
388
- if (Array.isArray(this._value)) {
389
- this._value.length = 0;
390
- this._value.push(...newThis);
391
- }
392
- else {
393
- Object.getOwnPropertyNames(this._value).forEach(key => delete this._value[key]);
394
- Object.getOwnPropertyNames(newThis).forEach(key => this._value[key] = newThis[key]);
395
- }
396
- }
397
- /**
398
- * assigns a single value as array, or appends it
399
- * to an existing value mapping a single value to array
400
- *
401
- *
402
- * usage myConfig.append("foobaz").value = "newValue"
403
- * myConfig.append("foobaz").value = "newValue2"
404
- *
405
- * resulting in myConfig.foobaz == ["newValue, newValue2"]
406
- *
407
- * @param {string[]} accessPath
408
- */
409
- append(...accessPath) {
410
- return (0, AssocArray_1.append)(this._value, ...accessPath);
411
- }
412
- /**
413
- * appends to an existing entry (or extends into an array and appends)
414
- * if the condition is met
415
- * @param {boolean} condition
416
- * @param {string[]} accessPath
417
- */
418
- appendIf(condition, ...accessPath) {
419
- return (0, AssocArray_1.appendIf)(condition, this._value, ...accessPath);
420
- }
421
- /**
422
- * assigns a new value on the given access path
423
- * @param accessPath
424
- */
425
- assign(...accessPath) {
426
- return (0, AssocArray_1.assign)(this.value, ...accessPath);
427
- }
428
- /**
429
- * assign a value if the condition is set to true, otherwise skip it
430
- *
431
- * @param condition the condition, the access accessPath into the config
432
- * @param accessPath
433
- */
434
- assignIf(condition, ...accessPath) {
435
- return (0, AssocArray_1.assignIf)(condition, this._value, ...accessPath);
436
- }
437
- /**
438
- * get if the access path is present (get is reserved as getter with a default, on the current path)
439
- * TODO will be renamed to something more meaningful and deprecated, the name is ambiguous
440
- * @param accessPath the access path
441
- */
442
- getIf(...accessPath) {
443
- this.assertAccessPath(...accessPath);
444
- return this.getClass().fromNullable((0, AssocArray_1.resolve)(this.value, ...accessPath));
445
- }
446
- /**
447
- * gets the current node and if none is present returns a config with a default value
448
- * @param defaultVal
449
- */
450
- get(defaultVal) {
451
- return this.getClass().fromNullable(super.get(defaultVal).value);
452
- }
453
- //empties the current config entry
454
- delete(key) {
455
- if (key in this.value) {
456
- delete this.value[key];
457
- }
458
- return this;
459
- }
460
- /**
461
- * converts the entire config into a json object
462
- */
463
- toJson() {
464
- return JSON.stringify(this.value);
465
- }
466
- getClass() {
467
- return Config;
468
- }
469
- setVal(val) {
470
- this._value = val;
471
- }
472
- /**
473
- * asserts the access path for a semi typed access
474
- * @param accessPath
475
- * @private
476
- */
477
- assertAccessPath(...accessPath) {
478
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
479
- accessPath = this.preprocessKeys(...accessPath);
480
- if (!this.configDef) {
481
- //untyped
482
- return;
483
- }
484
- const ERR_ACCESS_PATH = "Access Path to config invalid";
485
- let currAccessPos = Monad_1.Optional.fromNullable(Object.keys(this.configDef).map(key => {
486
- let ret = {};
487
- ret[key] = this.configDef[key];
488
- return ret;
489
- }));
490
- for (let cnt = 0; cnt < accessPath.length; cnt++) {
491
- let currKey = this.keyVal(accessPath[cnt]);
492
- let arrPos = this.arrayIndex(accessPath[cnt]);
493
- //key index
494
- if (this.isArray(arrPos)) {
495
- if (currKey != "") {
496
- currAccessPos = Array.isArray(currAccessPos.value) ?
497
- Monad_1.Optional.fromNullable((_b = (_a = new Es2019Array_1.Es2019Array(...currAccessPos.value)
498
- .find(item => {
499
- var _a;
500
- return !!((_a = item === null || item === void 0 ? void 0 : item[currKey]) !== null && _a !== void 0 ? _a : false);
501
- })) === null || _a === void 0 ? void 0 : _a[currKey]) === null || _b === void 0 ? void 0 : _b[arrPos]) :
502
- Monad_1.Optional.fromNullable((_e = (_d = (_c = currAccessPos.value) === null || _c === void 0 ? void 0 : _c[currKey]) === null || _d === void 0 ? void 0 : _d[arrPos]) !== null && _e !== void 0 ? _e : null);
503
- }
504
- else {
505
- currAccessPos = (Array.isArray(currAccessPos.value)) ?
506
- Monad_1.Optional.fromNullable((_f = currAccessPos.value) === null || _f === void 0 ? void 0 : _f[arrPos]) : Monad_1.Optional.absent;
507
- }
508
- //we noe store either the current array or the filtered look ahead to go further
509
- }
510
- else {
511
- //we now have an array and go further with a singular key
512
- currAccessPos = (Array.isArray(currAccessPos.value)) ? Monad_1.Optional.fromNullable((_g = new Es2019Array_1.Es2019Array(...currAccessPos.value)
513
- .find(item => {
514
- var _a;
515
- return !!((_a = item === null || item === void 0 ? void 0 : item[currKey]) !== null && _a !== void 0 ? _a : false);
516
- })) === null || _g === void 0 ? void 0 : _g[currKey]) :
517
- Monad_1.Optional.fromNullable((_j = (_h = currAccessPos.value) === null || _h === void 0 ? void 0 : _h[currKey]) !== null && _j !== void 0 ? _j : null);
518
- }
519
- if (!currAccessPos.isPresent()) {
520
- throw Error(ERR_ACCESS_PATH);
521
- }
522
- if (currAccessPos.value == exports.CONFIG_ANY) {
523
- return;
524
- }
525
- }
526
- }
527
- isNoArray(arrPos) {
528
- return arrPos == -1;
529
- }
530
- isArray(arrPos) {
531
- return !this.isNoArray(arrPos);
532
- }
533
- }
534
- exports.Config = Config;
535
-
536
-
537
- /***/ }),
538
-
539
5
  /***/ "./node_modules/mona-dish/src/main/typescript/DomQuery.ts":
540
6
  /*!****************************************************************!*\
541
7
  !*** ./node_modules/mona-dish/src/main/typescript/DomQuery.ts ***!
@@ -571,15 +37,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
571
37
  Object.defineProperty(exports, "__esModule", ({ value: true }));
572
38
  exports.DQ$ = exports.DQ = exports.DomQueryCollector = exports.DomQuery = exports.Style = exports.ElementAttribute = void 0;
573
39
  const Monad_1 = __webpack_require__(/*! ./Monad */ "./node_modules/mona-dish/src/main/typescript/Monad.ts");
40
+ const Stream_1 = __webpack_require__(/*! ./Stream */ "./node_modules/mona-dish/src/main/typescript/Stream.ts");
574
41
  const SourcesCollectors_1 = __webpack_require__(/*! ./SourcesCollectors */ "./node_modules/mona-dish/src/main/typescript/SourcesCollectors.ts");
575
42
  const Lang_1 = __webpack_require__(/*! ./Lang */ "./node_modules/mona-dish/src/main/typescript/Lang.ts");
576
- const Global_1 = __webpack_require__(/*! ./Global */ "./node_modules/mona-dish/src/main/typescript/Global.ts");
577
- const Es2019Array_1 = __webpack_require__(/*! ./Es2019Array */ "./node_modules/mona-dish/src/main/typescript/Es2019Array.ts");
578
43
  var trim = Lang_1.Lang.trim;
579
44
  var isString = Lang_1.Lang.isString;
580
45
  var eqi = Lang_1.Lang.equalsIgnoreCase;
46
+ const Global_1 = __webpack_require__(/*! ./Global */ "./node_modules/mona-dish/src/main/typescript/Global.ts");
581
47
  var objToArray = Lang_1.Lang.objToArray;
582
- const AssocArray_1 = __webpack_require__(/*! ./AssocArray */ "./node_modules/mona-dish/src/main/typescript/AssocArray.ts");
583
48
  /**
584
49
  *
585
50
  * // - submit checkboxes and radio inputs only if checked
@@ -806,12 +271,6 @@ class DomQuery {
806
271
  get global() {
807
272
  return Global_1._global$;
808
273
  }
809
- get stream() {
810
- throw Error("Not implemented, include Stream.ts for this to work");
811
- }
812
- get lazyStream() {
813
- throw Error("Not implemented, include Stream.ts for this to work");
814
- }
815
274
  /**
816
275
  * returns the id of the first element
817
276
  */
@@ -888,7 +347,7 @@ class DomQuery {
888
347
  this.id.value = value;
889
348
  }
890
349
  get checked() {
891
- return new Es2019Array_1.Es2019Array(...this.values).every(el => !!el.checked);
350
+ return Stream_1.Stream.of(...this.values).allMatch(el => !!el.checked);
892
351
  }
893
352
  set checked(newChecked) {
894
353
  this.eachElem(el => el.checked = newChecked);
@@ -946,41 +405,58 @@ class DomQuery {
946
405
  });
947
406
  return new DomQuery(...childNodeArr);
948
407
  }
408
+ /**
409
+ * binding into stream
410
+ */
411
+ get stream() {
412
+ return new Stream_1.Stream(...this.asArray);
413
+ }
414
+ /**
415
+ * fetches a lazy stream representation
416
+ * lazy should be applied if you have some filters etc.
417
+ * in between, this can reduce the number of post filter operations
418
+ * and ram usage
419
+ * significantly because the operations are done lazily and stop
420
+ * once they hit a dead end.
421
+ */
422
+ get lazyStream() {
423
+ return Stream_1.LazyStream.of(...this.asArray);
424
+ }
949
425
  get asArray() {
950
426
  // filter not supported by IE11
951
- let items = new Es2019Array_1.Es2019Array(...this.rootNode).filter(item => {
427
+ return [].concat(Stream_1.LazyStream.of(...this.rootNode).filter(item => {
952
428
  return item != null;
953
- }).map(item => {
429
+ })
430
+ .map(item => {
954
431
  return DomQuery.byId(item);
955
- });
956
- return items;
432
+ }).collect(new SourcesCollectors_1.ArrayCollector()));
957
433
  }
958
434
  get offsetWidth() {
959
- return new Es2019Array_1.Es2019Array(...this.rootNode)
435
+ return Stream_1.LazyStream.of(...this.rootNode)
960
436
  .filter(item => item != null)
961
437
  .map(elem => elem.offsetWidth)
962
- .reduce((accumulate, incoming) => accumulate + incoming, 0);
438
+ .reduce((accumulate, incoming) => accumulate + incoming, 0).value;
963
439
  }
964
440
  get offsetHeight() {
965
- return new Es2019Array_1.Es2019Array(...this.rootNode)
441
+ return Stream_1.LazyStream.of(...this.rootNode)
966
442
  .filter(item => item != null)
967
443
  .map(elem => elem.offsetHeight)
968
- .reduce((accumulate, incoming) => accumulate + incoming, 0);
444
+ .reduce((accumulate, incoming) => accumulate + incoming, 0).value;
969
445
  }
970
446
  get offsetLeft() {
971
- return new Es2019Array_1.Es2019Array(...this.rootNode)
447
+ return Stream_1.LazyStream.of(...this.rootNode)
972
448
  .filter(item => item != null)
973
449
  .map(elem => elem.offsetLeft)
974
- .reduce((accumulate, incoming) => accumulate + incoming, 0);
450
+ .reduce((accumulate, incoming) => accumulate + incoming, 0).value;
975
451
  }
976
452
  get offsetTop() {
977
- return new Es2019Array_1.Es2019Array(this.rootNode)
453
+ return Stream_1.LazyStream.of(...this.rootNode)
978
454
  .filter(item => item != null)
979
455
  .map(elem => elem.offsetTop)
980
- .reduce((accumulate, incoming) => accumulate + incoming, 0);
456
+ .reduce((accumulate, incoming) => accumulate + incoming, 0).value;
981
457
  }
982
458
  get asNodeArray() {
983
- return new Es2019Array_1.Es2019Array(...this.rootNode.filter(item => item != null));
459
+ return [].concat(Stream_1.Stream.of(...this.rootNode).filter(item => item != null).collect(new SourcesCollectors_1.ArrayCollector()));
984
460
  }
985
461
  static querySelectorAllDeep(selector) {
986
462
  return new DomQuery(document).querySelectorAllDeep(selector);
@@ -1044,10 +520,10 @@ class DomQuery {
1044
520
  const doc = document.implementation.createHTMLDocument("");
1045
521
  markup = trim(markup);
1046
522
  let lowerMarkup = markup.toLowerCase();
1047
- if (lowerMarkup.search(/<!doctype[^\w\-]+/gi) != -1 ||
1048
- lowerMarkup.search(/<html[^\w\-]+/gi) != -1 ||
1049
- lowerMarkup.search(/<head[^\w\-]+/gi) != -1 ||
1050
- lowerMarkup.search(/<body[^\w\-]+/gi) != -1) {
523
+ if (lowerMarkup.search(/\<\!doctype[^\w\-]+/gi) != -1 ||
524
+ lowerMarkup.search(/\<html[^\w\-]+/gi) != -1 ||
525
+ lowerMarkup.search(/\<head[^\w\-]+/gi) != -1 ||
526
+ lowerMarkup.search(/\<body[^\w\-]+/gi) != -1) {
1051
527
  doc.documentElement.innerHTML = markup;
1052
528
  return new DomQuery(doc.documentElement);
1053
529
  }
@@ -1179,9 +655,10 @@ class DomQuery {
1179
655
  byId(id, includeRoot) {
1180
656
  let res = [];
1181
657
  if (includeRoot) {
1182
- res = res.concat(...new Es2019Array_1.Es2019Array(...((this === null || this === void 0 ? void 0 : this.rootNode) || []))
1183
- .filter(((item) => id == item.id))
1184
- .map(item => new DomQuery(item)));
658
+ res = res.concat(Stream_1.LazyStream.of(...((this === null || this === void 0 ? void 0 : this.rootNode) || []))
659
+ .filter(item => id == item.id)
660
+ .map(item => new DomQuery(item))
661
+ .collect(new SourcesCollectors_1.ArrayCollector()));
1185
662
  }
1186
663
  // for some strange kind of reason the # selector fails
1187
664
  // on hidden elements we use the attributes match selector
@@ -1192,9 +669,10 @@ class DomQuery {
1192
669
  byIdDeep(id, includeRoot) {
1193
670
  let res = [];
1194
671
  if (includeRoot) {
1195
- res = res.concat(new Es2019Array_1.Es2019Array(...((this === null || this === void 0 ? void 0 : this.rootNode) || []))
672
+ res = res.concat(Stream_1.LazyStream.of(...((this === null || this === void 0 ? void 0 : this.rootNode) || []))
1196
673
  .filter(item => id == item.id)
1197
- .map(item => new DomQuery(item)));
674
+ .map(item => new DomQuery(item))
675
+ .collect(new SourcesCollectors_1.ArrayCollector()));
1198
676
  }
1199
677
  let subItems = this.querySelectorAllDeep(`[id="${id}"]`);
1200
678
  if (subItems.length) {
@@ -1212,9 +690,10 @@ class DomQuery {
1212
690
  var _a;
1213
691
  let res = [];
1214
692
  if (includeRoot) {
1215
- res = new Es2019Array_1.Es2019Array(...((_a = this === null || this === void 0 ? void 0 : this.rootNode) !== null && _a !== void 0 ? _a : []))
693
+ res = Stream_1.LazyStream.of(...((_a = this === null || this === void 0 ? void 0 : this.rootNode) !== null && _a !== void 0 ? _a : []))
1216
694
  .filter(element => (element === null || element === void 0 ? void 0 : element.tagName) == tagName)
1217
- .reduce((reduction, item) => reduction.concat([item]), res);
695
+ .reduce((reduction, item) => reduction.concat([item]), res)
696
+ .orElse(res).value;
1218
697
  }
1219
698
  (deep) ? res.push(this.querySelectorAllDeep(tagName)) : res.push(this.querySelectorAll(tagName));
1220
699
  return new DomQuery(...res);
@@ -1347,8 +826,11 @@ class DomQuery {
1347
826
  * @param selector
1348
827
  */
1349
828
  matchesSelector(selector) {
1350
- return this.asArray
1351
- .some(item => this._mozMatchesSelector(item.getAsElem(0).value, selector));
829
+ const ret = this.lazyStream
830
+ .map(item => this._mozMatchesSelector(item.getAsElem(0).value, selector))
831
+ .filter(match => match)
832
+ .first();
833
+ return ret.isPresent();
1352
834
  }
1353
835
  /**
1354
836
  * easy node traversal, you can pass
@@ -1389,8 +871,8 @@ class DomQuery {
1389
871
  return this;
1390
872
  }
1391
873
  each(func) {
1392
- new Es2019Array_1.Es2019Array(...this.rootNode)
1393
- .forEach((item, cnt) => {
874
+ Stream_1.Stream.of(...this.rootNode)
875
+ .each((item, cnt) => {
1394
876
  // we could use a filter, but for the best performance we don´t
1395
877
  if (item == null) {
1396
878
  return;
@@ -1742,7 +1224,7 @@ class DomQuery {
1742
1224
  // scripts before we run the 'include' command
1743
1225
  // this.globalEval(finalScripts.join("\n"));
1744
1226
  let joinedScripts = [];
1745
- new Es2019Array_1.Es2019Array(...scriptsToProcess).forEach(item => {
1227
+ Stream_1.Stream.of(...scriptsToProcess).each(item => {
1746
1228
  if (!item.nonce) {
1747
1229
  joinedScripts.push(item.evalText);
1748
1230
  }
@@ -1828,10 +1310,10 @@ class DomQuery {
1828
1310
  try {
1829
1311
  let scriptElements = new DomQuery(this.filterSelector("script"), this.querySelectorAll("script"));
1830
1312
  // script execution order by relative pos in their dom tree
1831
- scriptElements.asArray
1832
- .flatMap(item => [...item.values])
1313
+ scriptElements.stream
1314
+ .flatMap(item => Stream_1.Stream.of(...item.values))
1833
1315
  .sort((node1, node2) => node1.compareDocumentPosition(node2) - 3) // preceding 2, following == 4)
1834
- .forEach(item => execScript(item));
1316
+ .each(item => execScript(item));
1835
1317
  evalCollectedScripts(finalScripts);
1836
1318
  }
1837
1319
  catch (e) {
@@ -1874,20 +1356,19 @@ class DomQuery {
1874
1356
  else if (tagName && eqi(tagName, "style")) {
1875
1357
  let innerText = _toReplace.innerHTML.replace(/\s+/gi, "");
1876
1358
  let styles = head.querySelectorAll("style");
1877
- let filteredStyles = styles.asArray.filter(style => {
1359
+ styles = styles.stream.filter(style => {
1878
1360
  return style.innerHTML.replace(/\s+/gi, "") == innerText;
1879
- });
1880
- styles = new DomQuery(...filteredStyles);
1361
+ }).collect(new DomQueryCollector());
1881
1362
  if (!styles.length) { //already present
1882
1363
  head.append(_toReplace);
1883
1364
  }
1884
1365
  }
1885
1366
  };
1886
1367
  const scriptElements = new DomQuery(this.filterSelector("link, style"), this.querySelectorAll("link, style"));
1887
- scriptElements.asArray
1888
- .flatMap(item => [...item.values])
1368
+ scriptElements.stream
1369
+ .flatMap(item => Stream_1.Stream.of(...item.values))
1889
1370
  .sort((node1, node2) => node1.compareDocumentPosition(node2) - 3)
1890
- .forEach(item => execCss(item));
1371
+ .each(item => execCss(item));
1891
1372
  return this;
1892
1373
  }
1893
1374
  /**
@@ -1910,10 +1391,9 @@ class DomQuery {
1910
1391
  */
1911
1392
  fireEvent(eventName, options = {}) {
1912
1393
  // merge with last one having the highest priority
1913
- let finalOptions = {
1394
+ let finalOptions = Stream_1.Stream.ofAssoc({
1914
1395
  bubbles: true, cancelable: true
1915
- };
1916
- finalOptions = (0, AssocArray_1.simpleShallowMerge)(finalOptions, options);
1396
+ }).concat(Stream_1.Stream.ofAssoc(options)).collect(new SourcesCollectors_1.AssocArrayCollector());
1917
1397
  this.eachElem((node) => {
1918
1398
  let doc;
1919
1399
  if (node.ownerDocument) {
@@ -1964,13 +1444,15 @@ class DomQuery {
1964
1444
  // IE-old school style, you can drop this if you don't need to support IE8 and lower
1965
1445
  let event = doc.createEventObject();
1966
1446
  event.synthetic = true; // allow detection of synthetic events
1967
- Object.keys(finalOptions).forEach(key => event[key] = finalOptions[key]);
1447
+ Stream_1.Stream.ofAssoc(finalOptions).each(([key, value]) => {
1448
+ event[key] = value;
1449
+ });
1968
1450
  node.fireEvent("on" + eventName, event);
1969
1451
  }
1970
1452
  });
1971
1453
  }
1972
1454
  textContent(joinString = "") {
1973
- return this.asArray
1455
+ return this.stream
1974
1456
  .map((value) => {
1975
1457
  let item = value.getAsElem(0).orElseLazy(() => {
1976
1458
  return {
@@ -1979,10 +1461,10 @@ class DomQuery {
1979
1461
  }).value;
1980
1462
  return item.textContent || "";
1981
1463
  })
1982
- .reduce((text1, text2) => [text1, joinString, text2].join(""), "");
1464
+ .reduce((text1, text2) => [text1, joinString, text2].join(""), "").value;
1983
1465
  }
1984
1466
  innerText(joinString = "") {
1985
- return this.asArray
1467
+ return this.stream
1986
1468
  .map((value) => {
1987
1469
  let item = value.getAsElem(0).orElseLazy(() => {
1988
1470
  return {
@@ -1991,9 +1473,7 @@ class DomQuery {
1991
1473
  }).value;
1992
1474
  return item.innerText || "";
1993
1475
  })
1994
- .reduce((text1, text2) => {
1995
- return [text1, text2].join(joinString);
1996
- }, "");
1476
+ .reduce((text1, text2) => [text1, text2].join(joinString), "").value;
1997
1477
  }
1998
1478
  /**
1999
1479
  * encodes all input elements properly into respective
@@ -2004,14 +1484,14 @@ class DomQuery {
2004
1484
  * @param toMerge optional config which can be merged in
2005
1485
  * @return a copy pf
2006
1486
  */
2007
- encodeFormElement(toMerge = {}) {
1487
+ encodeFormElement(toMerge = new Monad_1.Config({})) {
2008
1488
  // browser behavior no element name no encoding (normal submit fails in that case)
2009
1489
  // https:// issues.apache.org/jira/browse/MYFACES-2847
2010
1490
  if (this.name.isAbsent()) {
2011
1491
  return;
2012
1492
  }
2013
1493
  // let´s keep it side-effects free
2014
- let target = (0, AssocArray_1.simpleShallowMerge)(toMerge);
1494
+ let target = toMerge.shallowCopy;
2015
1495
  this.each((element) => {
2016
1496
  var _a, _b;
2017
1497
  if (element.name.isAbsent()) { // no name, no encoding
@@ -2046,7 +1526,7 @@ class DomQuery {
2046
1526
  // let subBuf = [];
2047
1527
  if (selectElem.options[u].selected) {
2048
1528
  let elementOption = selectElem.options[u];
2049
- (0, AssocArray_1.append)(target, name).value = (elementOption.getAttribute("value") != null) ?
1529
+ target.append(name).value = (elementOption.getAttribute("value") != null) ?
2050
1530
  elementOption.value : elementOption.text;
2051
1531
  }
2052
1532
  }
@@ -2066,14 +1546,14 @@ class DomQuery {
2066
1546
  let filesArr = uploadedFiles !== null && uploadedFiles !== void 0 ? uploadedFiles : [];
2067
1547
  if (filesArr === null || filesArr === void 0 ? void 0 : filesArr.length) { //files can be empty but set
2068
1548
  // xhr level2, single multiple must be passes as they are
2069
- (0, AssocArray_1.assign)(target, name).value = Array.from(filesArr);
1549
+ target.assign(name).value = Array.from(filesArr);
2070
1550
  }
2071
1551
  else {
2072
1552
  if (!!uploadedFiles) { //we skip empty file elements i
2073
1553
  return;
2074
1554
  }
2075
1555
  //checkboxes etc.. need to be appended
2076
- (0, AssocArray_1.append)(target, name).value = element.inputValue.value;
1556
+ target.append(name).value = element.inputValue.value;
2077
1557
  }
2078
1558
  }
2079
1559
  }
@@ -2082,27 +1562,16 @@ class DomQuery {
2082
1562
  }
2083
1563
  get cDATAAsString() {
2084
1564
  let TYPE_CDATA_BLOCK = 4;
2085
- let res = this.asArray
2086
- .flatMap(item => {
2087
- return item.childNodes.asArray;
2088
- })
2089
- .filter(item => {
1565
+ let res = this.lazyStream.flatMap(item => {
1566
+ return item.childNodes.stream;
1567
+ }).filter(item => {
2090
1568
  var _a, _b;
2091
1569
  return ((_b = (_a = item === null || item === void 0 ? void 0 : item.value) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.nodeType) == TYPE_CDATA_BLOCK;
2092
- })
2093
- .reduce((reduced, item) => {
1570
+ }).reduce((reduced, item) => {
2094
1571
  var _a, _b, _c;
2095
1572
  reduced.push((_c = (_b = (_a = item === null || item === void 0 ? void 0 : item.value) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.data) !== null && _c !== void 0 ? _c : "");
2096
1573
  return reduced;
2097
- }, []);
2098
- /*let res: any = this.lazyStream.flatMap(item => {
2099
- return item.childNodes.stream
2100
- }).filter(item => {
2101
- return item?.value?.value?.nodeType == TYPE_CDATA_BLOCK;
2102
- }).reduce((reduced: Array<any>, item: DomQuery) => {
2103
- reduced.push((<any>item?.value?.value)?.data ?? "");
2104
- return reduced;
2105
- }, []).value;*/
1574
+ }, []).value;
2106
1575
  // response may contain several blocks
2107
1576
  return res.join("");
2108
1577
  }
@@ -2259,18 +1728,17 @@ class DomQuery {
2259
1728
  * @param filterDoubles filter out possible double elements (aka same markup)
2260
1729
  */
2261
1730
  concat(toAttach, filterDoubles = true) {
2262
- let domQueries = this.asArray;
2263
- const ret = new DomQuery(...domQueries.concat(toAttach.asArray));
1731
+ const ret = this.lazyStream.concat(toAttach.lazyStream).collect(new DomQueryCollector());
2264
1732
  // we now filter the doubles out
2265
1733
  if (!filterDoubles) {
2266
1734
  return ret;
2267
1735
  }
2268
1736
  let idx = {}; // ie11 does not support sets, we have to fake it
2269
- return new DomQuery(...ret.asArray.filter(node => {
1737
+ return ret.lazyStream.filter(node => {
2270
1738
  const notFound = !(idx === null || idx === void 0 ? void 0 : idx[node.value.value.outerHTML]);
2271
1739
  idx[node.value.value.outerHTML] = true;
2272
1740
  return notFound;
2273
- }));
1741
+ }).collect(new DomQueryCollector());
2274
1742
  }
2275
1743
  append(elem) {
2276
1744
  this.each(item => elem.appendTo(item));
@@ -2305,7 +1773,7 @@ class DomQuery {
2305
1773
  continue;
2306
1774
  }
2307
1775
  let res = this.rootNode[cnt].querySelectorAll(selector);
2308
- nodes = nodes.concat(...objToArray(res));
1776
+ nodes = nodes.concat(objToArray(res));
2309
1777
  }
2310
1778
  return new DomQuery(...nodes);
2311
1779
  }
@@ -2502,148 +1970,22 @@ class DomQueryCollector {
2502
1970
  this.data = [];
2503
1971
  }
2504
1972
  collect(element) {
2505
- this.data.push(element);
2506
- }
2507
- get finalValue() {
2508
- return new DomQuery(...this.data);
2509
- }
2510
- }
2511
- exports.DomQueryCollector = DomQueryCollector;
2512
- /**
2513
- * abbreviation for DomQuery
2514
- */
2515
- exports.DQ = DomQuery;
2516
- // noinspection JSUnusedGlobalSymbols
2517
- /**
2518
- * replacement for the jquery $
2519
- */
2520
- exports.DQ$ = DomQuery.querySelectorAll;
2521
-
2522
-
2523
- /***/ }),
2524
-
2525
- /***/ "./node_modules/mona-dish/src/main/typescript/Es2019Array.ts":
2526
- /*!*******************************************************************!*\
2527
- !*** ./node_modules/mona-dish/src/main/typescript/Es2019Array.ts ***!
2528
- \*******************************************************************/
2529
- /***/ ((__unused_webpack_module, exports) => {
2530
-
2531
-
2532
- /**
2533
- * Extended array
2534
- */
2535
- Object.defineProperty(exports, "__esModule", ({ value: true }));
2536
- exports.Es2019Array = exports._Es2019Array = void 0;
2537
- /**
2538
- * Extended array which adds various es 2019 shim functions to the normal array
2539
- * We must remap all array producing functions in order to keep
2540
- * the delegation active, once we are in!
2541
- */
2542
- class Es2019Array_ extends Array {
2543
- constructor(...another) {
2544
- super(...another);
2545
- if (another._another) {
2546
- this._another = another._another;
2547
- }
2548
- else {
2549
- this._another = another;
2550
- }
2551
- //for testing it definitely runs into this branch because we are on es5 level
2552
- //if (!(<any>Array.prototype).flatMap) {
2553
- this.flatMap = (flatMapFun) => this._flatMap(flatMapFun);
2554
- //}
2555
- //if (!(<any>Array.prototype).flat) {
2556
- this.flat = (flatLevel = 1) => this._flat(flatLevel);
2557
- //}
2558
- }
2559
- map(callbackfn, thisArg) {
2560
- const ret = Array.prototype.map.call(this._another, callbackfn, thisArg);
2561
- return new _Es2019Array(...ret);
2562
- }
2563
- concat(...items) {
2564
- const ret = Array.prototype.concat.call(this._another, ...items);
2565
- return new _Es2019Array(...ret);
2566
- }
2567
- reverse() {
2568
- const ret = Array.prototype.reverse.call(this._another);
2569
- return new _Es2019Array(...ret);
2570
- }
2571
- slice(start, end) {
2572
- const ret = Array.prototype.slice.call(this._another, start, end);
2573
- return new _Es2019Array(...ret);
2574
- }
2575
- splice(start, deleteCount) {
2576
- const ret = Array.prototype.splice.call(this._another, start, deleteCount);
2577
- return new _Es2019Array(...ret);
2578
- }
2579
- filter(predicate, thisArg) {
2580
- const ret = Array.prototype.filter.call(this._another, predicate, thisArg);
2581
- return new _Es2019Array(...ret);
2582
- }
2583
- reduce(callbackfn, initialValue) {
2584
- const ret = Array.prototype.reduce.call(this._another, callbackfn, initialValue);
2585
- return ret;
2586
- }
2587
- /*reduceRight(callbackfn: (previousValue: T, currentValue: T, currentIndex: number, array: T[]) => T, initialValue: T): T {
2588
- const ret = Array.prototype.reduceRight.call(callbackfn, initialValue);
2589
- return ret;
2590
- }*/
2591
- _flat(flatDepth = 1) {
2592
- return this._flatResolve(this._another, flatDepth);
2593
- }
2594
- _flatResolve(arr, flatDepth = 1) {
2595
- //recursion break
2596
- if (flatDepth == 0) {
2597
- return arr;
2598
- }
2599
- let res = [];
2600
- let reFlat = item => {
2601
- item = Array.isArray(item) ? item : [item];
2602
- let mapped = this._flatResolve(item, flatDepth - 1);
2603
- res = res.concat(mapped);
2604
- };
2605
- arr.forEach(reFlat);
2606
- return new exports.Es2019Array(...res);
1973
+ this.data.push(element);
2607
1974
  }
2608
- _flatMap(mapperFunction) {
2609
- let res = this.map(item => mapperFunction(item));
2610
- return this._flatResolve(res);
1975
+ get finalValue() {
1976
+ return new DomQuery(...this.data);
2611
1977
  }
2612
1978
  }
2613
- //let _Es2019Array = function<T>(...data: T[]) {};
2614
- //let oldProto = Es2019Array.prototype;
2615
- function _Es2019Array(...data) {
2616
- let ret = new Es2019Array_(...data);
2617
- let proxied = new Proxy(ret, {
2618
- get(target, p, receiver) {
2619
- if ("symbol" == typeof p) {
2620
- return target._another[p];
2621
- }
2622
- if (!isNaN(parseInt(p))) {
2623
- return target._another[p];
2624
- }
2625
- else {
2626
- return target[p];
2627
- }
2628
- },
2629
- set(target, property, value) {
2630
- target[property] = value;
2631
- target._another[property] = value;
2632
- return true;
2633
- }
2634
- });
2635
- return proxied;
2636
- }
2637
- exports._Es2019Array = _Es2019Array;
2638
- ;
1979
+ exports.DomQueryCollector = DomQueryCollector;
1980
+ /**
1981
+ * abbreviation for DomQuery
1982
+ */
1983
+ exports.DQ = DomQuery;
1984
+ // noinspection JSUnusedGlobalSymbols
2639
1985
  /**
2640
- * this is the switch between normal array and our shim
2641
- * the shim is only provided in case the native browser
2642
- * does not yet have flatMap support on arrays
1986
+ * replacement for the jquery $
2643
1987
  */
2644
- exports.Es2019Array = (Array.prototype.flatMap) ? function (...data) {
2645
- return data;
2646
- } : _Es2019Array;
1988
+ exports.DQ$ = DomQuery.querySelectorAll;
2647
1989
 
2648
1990
 
2649
1991
  /***/ }),
@@ -2721,7 +2063,6 @@ exports._global$ = _global$;
2721
2063
  Object.defineProperty(exports, "__esModule", ({ value: true }));
2722
2064
  exports.Lang = void 0;
2723
2065
  const Monad_1 = __webpack_require__(/*! ./Monad */ "./node_modules/mona-dish/src/main/typescript/Monad.ts");
2724
- const Es2019Array_1 = __webpack_require__(/*! ./Es2019Array */ "./node_modules/mona-dish/src/main/typescript/Es2019Array.ts");
2725
2066
  /**
2726
2067
  * Lang helpers crossported from the apache myfaces project
2727
2068
  */
@@ -2729,7 +2070,7 @@ var Lang;
2729
2070
  (function (Lang) {
2730
2071
  //should be in lang, but for now here to avoid recursive imports, not sure if typescript still has a problem with those
2731
2072
  /**
2732
- * helper function to safely resolve anything
2073
+ * helper function to savely resolve anything
2733
2074
  * this is not an elvis operator, it resolves
2734
2075
  * a value without exception in a tree and if
2735
2076
  * it is not resolvable then an optional of
@@ -2755,12 +2096,6 @@ var Lang;
2755
2096
  }
2756
2097
  }
2757
2098
  Lang.saveResolve = saveResolve;
2758
- /**
2759
- * lazy resolve... aka the function is called on resolve and a default value also
2760
- * is a producing function (called only if the original producer does not produce any result)
2761
- * @param resolverProducer the producer for the resolve
2762
- * @param defaultValue the default value producer function
2763
- */
2764
2099
  function saveResolveLazy(resolverProducer, defaultValue = null) {
2765
2100
  try {
2766
2101
  let result = resolverProducer();
@@ -2815,11 +2150,11 @@ var Lang;
2815
2150
  //special condition array delivered no offset no pack
2816
2151
  if (obj instanceof Array && !offset && !pack)
2817
2152
  return obj;
2818
- return new Es2019Array_1.Es2019Array(...pack.concat(Array.prototype.slice.call(obj, offset)));
2153
+ return pack.concat(Array.prototype.slice.call(obj, offset));
2819
2154
  }
2820
2155
  Lang.objToArray = objToArray;
2821
2156
  /**
2822
- * equalsIgnoreCase, case-insensitive comparison of two strings
2157
+ * equalsIgnoreCase, case insensitive comparison of two strings
2823
2158
  *
2824
2159
  * @param source
2825
2160
  * @param destination
@@ -2842,7 +2177,7 @@ var Lang;
2842
2177
  }
2843
2178
  Lang.assertType = assertType;
2844
2179
  /**
2845
- * Back ported from Dojo
2180
+ * Backported from dojo
2846
2181
  * a failsafe string determination method
2847
2182
  * (since in javascript String != "" typeof alone fails!)
2848
2183
  * @param it {|Object|} the object to be checked for being a string
@@ -2854,10 +2189,6 @@ var Lang;
2854
2189
  return !!arguments.length && it != null && (typeof it == "string" || it instanceof String); // Boolean
2855
2190
  }
2856
2191
  Lang.isString = isString;
2857
- /**
2858
- * Back-ported, a failsafe determination code for checking whether an object is a function
2859
- * @param it the object to check for being a function
2860
- */
2861
2192
  function isFunc(it) {
2862
2193
  return it instanceof Function || typeof it === "function";
2863
2194
  }
@@ -2911,11 +2242,19 @@ var Lang;
2911
2242
  * limitations under the License.
2912
2243
  */
2913
2244
  Object.defineProperty(exports, "__esModule", ({ value: true }));
2914
- exports.ValueEmbedder = exports.Optional = exports.Monad = void 0;
2915
- const Es2019Array_1 = __webpack_require__(/*! ./Es2019Array */ "./node_modules/mona-dish/src/main/typescript/Es2019Array.ts");
2245
+ exports.Config = exports.CONFIG_ANY = exports.CONFIG_VALUE = exports.ValueEmbedder = exports.Optional = exports.Monad = void 0;
2246
+ /**
2247
+ * A module which keeps basic monadish like definitions in place without any sidedependencies to other modules.
2248
+ * Useful if you need the functions in another library to keep its dependencies down
2249
+ */
2250
+ /*IMonad definitions*/
2251
+ const Lang_1 = __webpack_require__(/*! ./Lang */ "./node_modules/mona-dish/src/main/typescript/Lang.ts");
2252
+ const SourcesCollectors_1 = __webpack_require__(/*! ./SourcesCollectors */ "./node_modules/mona-dish/src/main/typescript/SourcesCollectors.ts");
2253
+ const Stream_1 = __webpack_require__(/*! ./Stream */ "./node_modules/mona-dish/src/main/typescript/Stream.ts");
2254
+ var objAssign = Lang_1.Lang.objAssign;
2916
2255
  /**
2917
2256
  * Implementation of a monad
2918
- * (Side - effect free), no write allowed directly on the monads
2257
+ * (Sideffect free), no write allowed directly on the monads
2919
2258
  * value state
2920
2259
  */
2921
2260
  class Monad {
@@ -2927,7 +2266,7 @@ class Monad {
2927
2266
  }
2928
2267
  map(fn) {
2929
2268
  if (!fn) {
2930
- fn = (inVal) => inVal;
2269
+ fn = (inval) => inval;
2931
2270
  }
2932
2271
  let result = fn(this.value);
2933
2272
  return new Monad(result);
@@ -2944,7 +2283,7 @@ exports.Monad = Monad;
2944
2283
  /**
2945
2284
  * optional implementation, an optional is basically an implementation of a Monad with additional syntactic
2946
2285
  * sugar on top
2947
- * (Side - effect free, since value assignment is not allowed)
2286
+ * (Sideeffect free, since value assignment is not allowed)
2948
2287
  * */
2949
2288
  class Optional extends Monad {
2950
2289
  constructor(value) {
@@ -3004,8 +2343,8 @@ class Optional extends Monad {
3004
2343
  }
3005
2344
  }
3006
2345
  /*
3007
- * we need to implement it to fulfill the contract, although it is used only internally
3008
- * all values are flattened when accessed anyway, so there is no need to call this method
2346
+ * we need to implement it to fullfill the contract, although it is used only internally
2347
+ * all values are flattened when accessed anyway, so there is no need to call this methiod
3009
2348
  */
3010
2349
  flatMap(fn) {
3011
2350
  let val = super.flatMap(fn);
@@ -3016,7 +2355,7 @@ class Optional extends Monad {
3016
2355
  }
3017
2356
  /*
3018
2357
  * elvis operation, take care, if you use this you lose typesafety and refactoring
3019
- * capabilities, unfortunately typescript does not allow to have its own elvis operator
2358
+ * capabilites, unfortunately typesceript does not allow to have its own elvis operator
3020
2359
  * this is some syntactic sugar however which is quite useful*/
3021
2360
  getIf(...key) {
3022
2361
  key = this.preprocessKeys(...key);
@@ -3051,7 +2390,8 @@ class Optional extends Monad {
3051
2390
  currentPos = this.getClass().fromNullable(currentPos.value[arrPos]);
3052
2391
  }
3053
2392
  }
3054
- return currentPos;
2393
+ let retVal = currentPos;
2394
+ return retVal;
3055
2395
  }
3056
2396
  /**
3057
2397
  * simple match, if the first order function call returns
@@ -3087,7 +2427,7 @@ class Optional extends Monad {
3087
2427
  * by having a getClass operation we can avoid direct calls into the constructor or
3088
2428
  * static methods and do not have to implement several methods which rely on the type
3089
2429
  * of "this"
3090
- * @returns the type of Optional
2430
+ * @returns {Monadish.Optional}
3091
2431
  */
3092
2432
  getClass() {
3093
2433
  return Optional;
@@ -3148,9 +2488,9 @@ class Optional extends Monad {
3148
2488
  }
3149
2489
  }
3150
2490
  preprocessKeys(...keys) {
3151
- return new Es2019Array_1.Es2019Array(...keys)
2491
+ return Stream_1.Stream.of(...keys)
3152
2492
  .flatMap(item => {
3153
- return new Es2019Array_1.Es2019Array(...item.split(/]\s*\[/gi))
2493
+ return Stream_1.Stream.of(...item.split(/\]\s*\[/gi))
3154
2494
  .map(item => {
3155
2495
  item = item.replace(/^\s+|\s+$/g, "");
3156
2496
  if (item.indexOf("[") == -1 && item.indexOf("]") != -1) {
@@ -3161,16 +2501,17 @@ class Optional extends Monad {
3161
2501
  }
3162
2502
  return item;
3163
2503
  });
3164
- });
2504
+ })
2505
+ .collect(new SourcesCollectors_1.ArrayCollector());
3165
2506
  }
3166
2507
  }
3167
2508
  exports.Optional = Optional;
3168
2509
  /*default value for absent*/
3169
2510
  Optional.absent = Optional.fromNullable(null);
3170
- // --------------------- From here onwards we break out the side effect free limits ------------
2511
+ // --------------------- From here onwards we break out the sideffects free limits ------------
3171
2512
  /**
3172
2513
  * ValueEmbedder is the writeable version
3173
- * of optional, it basically is a wrapper
2514
+ * of optional, it basically is a wrappber
3174
2515
  * around a construct which has a state
3175
2516
  * and can be written to.
3176
2517
  *
@@ -3210,18 +2551,344 @@ class ValueEmbedder extends Optional {
3210
2551
  * by having a getClass operation we can avoid direct calls into the constructor or
3211
2552
  * static methods and do not have to implement several methods which rely on the type
3212
2553
  * of "this"
3213
- * @returns ValueEmbedder
2554
+ * @returns {Monadish.Optional}
3214
2555
  */
3215
2556
  getClass() {
3216
2557
  return ValueEmbedder;
3217
2558
  }
3218
- static fromNullable(value, valueKey = "value") {
3219
- return new ValueEmbedder(value, valueKey);
2559
+ static fromNullable(value, valueKey = "value") {
2560
+ return new ValueEmbedder(value, valueKey);
2561
+ }
2562
+ }
2563
+ exports.ValueEmbedder = ValueEmbedder;
2564
+ /*default value for absent*/
2565
+ ValueEmbedder.absent = ValueEmbedder.fromNullable(null);
2566
+ /**
2567
+ * specialized value embedder
2568
+ * for our Configuration
2569
+ */
2570
+ class ConfigEntry extends ValueEmbedder {
2571
+ constructor(rootElem, key, arrPos) {
2572
+ super(rootElem, key);
2573
+ this.arrPos = arrPos !== null && arrPos !== void 0 ? arrPos : -1;
2574
+ }
2575
+ get value() {
2576
+ if (this.key == "" && this.arrPos >= 0) {
2577
+ return this._value[this.arrPos];
2578
+ }
2579
+ else if (this.key && this.arrPos >= 0) {
2580
+ return this._value[this.key][this.arrPos];
2581
+ }
2582
+ return this._value[this.key];
2583
+ }
2584
+ set value(val) {
2585
+ if (this.key == "" && this.arrPos >= 0) {
2586
+ this._value[this.arrPos] = val;
2587
+ return;
2588
+ }
2589
+ else if (this.key && this.arrPos >= 0) {
2590
+ this._value[this.key][this.arrPos] = val;
2591
+ return;
2592
+ }
2593
+ this._value[this.key] = val;
2594
+ }
2595
+ }
2596
+ /*default value for absent*/
2597
+ ConfigEntry.absent = ConfigEntry.fromNullable(null);
2598
+ exports.CONFIG_VALUE = "__END_POINT__";
2599
+ exports.CONFIG_ANY = "__ANY_POINT__";
2600
+ const ALL_VALUES = "*";
2601
+ /**
2602
+ * Config, basically an optional wrapper for a json structure
2603
+ * (not sideeffect free, since we can alter the internal config state
2604
+ * without generating a new config), not sure if we should make it sideffect free
2605
+ * since this would swallow a lot of performane and ram
2606
+ */
2607
+ class Config extends Optional {
2608
+ constructor(root, configDef) {
2609
+ super(root);
2610
+ this.configDef = configDef;
2611
+ }
2612
+ /**
2613
+ * shallow copy getter, copies only the first level, references the deeper nodes
2614
+ * in a shared manner
2615
+ */
2616
+ get shallowCopy() {
2617
+ return this.shallowCopy$();
2618
+ }
2619
+ shallowCopy$() {
2620
+ return new Config(Stream_1.Stream.ofAssoc(this.value).collect(new SourcesCollectors_1.AssocArrayCollector()));
2621
+ }
2622
+ /**
2623
+ * deep copy, copies all config nodes
2624
+ */
2625
+ get deepCopy() {
2626
+ return this.deepCopy$();
2627
+ }
2628
+ deepCopy$() {
2629
+ return new Config(objAssign({}, this.value));
2630
+ }
2631
+ /**
2632
+ * creates a config from an initial value or null
2633
+ * @param value
2634
+ */
2635
+ static fromNullable(value) {
2636
+ return new Config(value);
2637
+ }
2638
+ /**
2639
+ * simple merge for the root configs
2640
+ */
2641
+ shallowMerge(other, overwrite = true, withAppend = false) {
2642
+ for (let key in other.value) {
2643
+ if ('undefined' == typeof key || null == key) {
2644
+ continue;
2645
+ }
2646
+ if (overwrite || !(key in this.value)) {
2647
+ if (!withAppend) {
2648
+ this.assign(key).value = other.getIf(key).value;
2649
+ }
2650
+ else {
2651
+ if (Array.isArray(other.getIf(key).value)) {
2652
+ Stream_1.Stream.of(...other.getIf(key).value).each(item => this.append(key).value = item);
2653
+ }
2654
+ else {
2655
+ this.append(key).value = other.getIf(key).value;
2656
+ }
2657
+ }
2658
+ }
2659
+ }
2660
+ }
2661
+ /**
2662
+ * assigns a single value as array, or appends it
2663
+ * to an existing value mapping a single value to array
2664
+ *
2665
+ *
2666
+ * usage myConfig.append("foobaz").value = "newValue"
2667
+ * myConfig.append("foobaz").value = "newValue2"
2668
+ *
2669
+ * resulting in myConfig.foobaz == ["newValue, newValue2"]
2670
+ *
2671
+ * @param {string[]} accessPath
2672
+ */
2673
+ append(...accessPath) {
2674
+ let noKeys = accessPath.length < 1;
2675
+ if (noKeys) {
2676
+ return;
2677
+ }
2678
+ this.assertAccessPath(...accessPath);
2679
+ let lastKey = accessPath[accessPath.length - 1];
2680
+ let currKey, finalKey = this.keyVal(lastKey);
2681
+ let pathExists = this.getIf(...accessPath).isPresent();
2682
+ this.buildPath(...accessPath);
2683
+ let finalKeyArrPos = this.arrayIndex(lastKey);
2684
+ if (finalKeyArrPos > -1) {
2685
+ throw Error("Append only possible on non array properties, use assign on indexed data");
2686
+ }
2687
+ let value = this.getIf(...accessPath).value;
2688
+ if (!Array.isArray(value)) {
2689
+ value = this.assign(...accessPath).value = [value];
2690
+ }
2691
+ if (pathExists) {
2692
+ value.push({});
2693
+ }
2694
+ finalKeyArrPos = value.length - 1;
2695
+ let retVal = new ConfigEntry(accessPath.length == 1 ? this.value : this.getIf.apply(this, accessPath.slice(0, accessPath.length - 1)).value, lastKey, finalKeyArrPos);
2696
+ return retVal;
2697
+ }
2698
+ /**
2699
+ * appends to an existing entry (or extends into an array and appends)
2700
+ * if the condition is met
2701
+ * @param {boolean} condition
2702
+ * @param {string[]} accessPath
2703
+ */
2704
+ appendIf(condition, ...accessPath) {
2705
+ if (!condition) {
2706
+ return { value: null };
2707
+ }
2708
+ return this.append(...accessPath);
2709
+ }
2710
+ /**
2711
+ * assings an new value on the given access path
2712
+ * @param accessPath
2713
+ */
2714
+ assign(...accessPath) {
2715
+ if (accessPath.length < 1) {
2716
+ return;
2717
+ }
2718
+ this.assertAccessPath(...accessPath);
2719
+ this.buildPath(...accessPath);
2720
+ let currKey = this.keyVal(accessPath[accessPath.length - 1]);
2721
+ let arrPos = this.arrayIndex(accessPath[accessPath.length - 1]);
2722
+ let retVal = new ConfigEntry(accessPath.length == 1 ? this.value : this.getIf.apply(this, accessPath.slice(0, accessPath.length - 1)).value, currKey, arrPos);
2723
+ return retVal;
2724
+ }
2725
+ /**
2726
+ * assign a value if the condition is set to true, otherwise skip it
2727
+ *
2728
+ * @param condition the condition, the access accessPath into the config
2729
+ * @param accessPath
2730
+ */
2731
+ assignIf(condition, ...accessPath) {
2732
+ return condition ? this.assign(...accessPath) : { value: null };
2733
+ }
2734
+ /**
2735
+ * get if the access path is present (get is reserved as getter with a default, on the current path)
2736
+ * TODO will be renamed to something more meaningful and deprecated, the name is ambigous
2737
+ * @param accessPath the access path
2738
+ */
2739
+ getIf(...accessPath) {
2740
+ this.assertAccessPath(...accessPath);
2741
+ return this.getClass().fromNullable(super.getIf.apply(this, accessPath).value);
2742
+ }
2743
+ /**
2744
+ * gets the current node and if none is present returns a config with a default value
2745
+ * @param defaultVal
2746
+ */
2747
+ get(defaultVal) {
2748
+ return this.getClass().fromNullable(super.get(defaultVal).value);
2749
+ }
2750
+ //empties the current config entry
2751
+ delete(key) {
2752
+ if (key in this.value) {
2753
+ delete this.value[key];
2754
+ }
2755
+ return this;
2756
+ }
2757
+ /**
2758
+ * converts the entire config into a json object
2759
+ */
2760
+ toJson() {
2761
+ return JSON.stringify(this.value);
2762
+ }
2763
+ /**
2764
+ * returns the first config level as streeam
2765
+ */
2766
+ get stream() {
2767
+ return Stream_1.Stream.of(...Object.keys(this.value)).map(key => [key, this.value[key]]);
2768
+ }
2769
+ getClass() {
2770
+ return Config;
2771
+ }
2772
+ setVal(val) {
2773
+ this._value = val;
2774
+ }
2775
+ /**
2776
+ * asserts the access path for a semy typed access
2777
+ * @param accessPath
2778
+ * @private
2779
+ */
2780
+ assertAccessPath(...accessPath) {
2781
+ var _a, _b;
2782
+ accessPath = this.preprocessKeys(...accessPath);
2783
+ if (!this.configDef) {
2784
+ //untyped
2785
+ return;
2786
+ }
2787
+ let currAccessPos = null;
2788
+ const ERR_ACCESS_PATH = "Access Path to config invalid";
2789
+ const ABSENT = "__ABSENT__";
2790
+ currAccessPos = this.configDef;
2791
+ for (let cnt = 0; cnt < accessPath.length; cnt++) {
2792
+ let currKey = this.keyVal(accessPath[cnt]);
2793
+ let arrPos = this.arrayIndex(accessPath[cnt]);
2794
+ //key index
2795
+ if (this.isArray(arrPos)) {
2796
+ if (currKey != "") {
2797
+ currAccessPos = (Array.isArray(currAccessPos)) ?
2798
+ Stream_1.Stream.of(...currAccessPos)
2799
+ .filter(item => { var _a; return !!((_a = item === null || item === void 0 ? void 0 : item[currKey]) !== null && _a !== void 0 ? _a : false); })
2800
+ .map(item => item === null || item === void 0 ? void 0 : item[currKey]).first() :
2801
+ Optional.fromNullable((_a = currAccessPos === null || currAccessPos === void 0 ? void 0 : currAccessPos[currKey]) !== null && _a !== void 0 ? _a : null);
2802
+ }
2803
+ else {
2804
+ currAccessPos = (Array.isArray(currAccessPos)) ?
2805
+ Stream_1.Stream.of(...currAccessPos)
2806
+ .filter(item => Array.isArray(item))
2807
+ .flatMap(item => Stream_1.Stream.of(...item)).first() : Optional.absent;
2808
+ }
2809
+ //we noe store either the current array or the filtered look ahead to go further
2810
+ }
2811
+ else {
2812
+ //we now have an array and go further with a singular key
2813
+ currAccessPos = (Array.isArray(currAccessPos)) ? Stream_1.Stream.of(...currAccessPos)
2814
+ .filter(item => { var _a; return !!((_a = item === null || item === void 0 ? void 0 : item[currKey]) !== null && _a !== void 0 ? _a : false); })
2815
+ .map(item => item === null || item === void 0 ? void 0 : item[currKey])
2816
+ .first() :
2817
+ Optional.fromNullable((_b = currAccessPos === null || currAccessPos === void 0 ? void 0 : currAccessPos[currKey]) !== null && _b !== void 0 ? _b : null);
2818
+ }
2819
+ if (!currAccessPos.isPresent()) {
2820
+ throw Error(ERR_ACCESS_PATH);
2821
+ }
2822
+ currAccessPos = currAccessPos.value;
2823
+ //no further testing needed, from this point onwards we are on our own
2824
+ if (currAccessPos == exports.CONFIG_ANY) {
2825
+ return;
2826
+ }
2827
+ }
2828
+ }
2829
+ /**
2830
+ * builds the config path
2831
+ *
2832
+ * @param accessPath a sequential array of accessPath containing either a key name or an array reference name[<index>]
2833
+ */
2834
+ buildPath(...accessPath) {
2835
+ accessPath = this.preprocessKeys(...accessPath);
2836
+ let val = this;
2837
+ let parentVal = this.getClass().fromNullable(null);
2838
+ let parentPos = -1;
2839
+ let alloc = function (arr, length) {
2840
+ let length1 = arr.length;
2841
+ let length2 = length1 + length;
2842
+ for (let cnt = length1; cnt < length2; cnt++) {
2843
+ arr.push({});
2844
+ }
2845
+ };
2846
+ for (let cnt = 0; cnt < accessPath.length; cnt++) {
2847
+ let currKey = this.keyVal(accessPath[cnt]);
2848
+ let arrPos = this.arrayIndex(accessPath[cnt]);
2849
+ if (this.isArrayPos(currKey, arrPos)) {
2850
+ val.setVal((val.value instanceof Array) ? val.value : []);
2851
+ alloc(val.value, arrPos + 1);
2852
+ if (parentPos >= 0) {
2853
+ parentVal.value[parentPos] = val.value;
2854
+ }
2855
+ parentVal = val;
2856
+ parentPos = arrPos;
2857
+ val = this.getClass().fromNullable(val.value[arrPos]);
2858
+ continue;
2859
+ }
2860
+ let tempVal = val.getIf(currKey);
2861
+ if (this.isNoArray(arrPos)) {
2862
+ if (tempVal.isAbsent()) {
2863
+ tempVal = this.getClass().fromNullable(val.value[currKey] = {});
2864
+ }
2865
+ else {
2866
+ val = tempVal;
2867
+ }
2868
+ }
2869
+ else {
2870
+ let arr = (tempVal.value instanceof Array) ? tempVal.value : [];
2871
+ alloc(arr, arrPos + 1);
2872
+ val.value[currKey] = arr;
2873
+ tempVal = this.getClass().fromNullable(arr[arrPos]);
2874
+ }
2875
+ parentVal = val;
2876
+ parentPos = arrPos;
2877
+ val = tempVal;
2878
+ }
2879
+ return this;
2880
+ }
2881
+ isNoArray(arrPos) {
2882
+ return arrPos == -1;
2883
+ }
2884
+ isArray(arrPos) {
2885
+ return !this.isNoArray(arrPos);
2886
+ }
2887
+ isArrayPos(currKey, arrPos) {
2888
+ return currKey === "" && arrPos >= 0;
3220
2889
  }
3221
2890
  }
3222
- exports.ValueEmbedder = ValueEmbedder;
3223
- /*default value for absent*/
3224
- ValueEmbedder.absent = ValueEmbedder.fromNullable(null);
2891
+ exports.Config = Config;
3225
2892
 
3226
2893
 
3227
2894
  /***/ }),
@@ -3250,17 +2917,17 @@ ValueEmbedder.absent = ValueEmbedder.fromNullable(null);
3250
2917
  * limitations under the License.
3251
2918
  */
3252
2919
  Object.defineProperty(exports, "__esModule", ({ value: true }));
3253
- exports.ArrayCollector = exports.QueryFormStringCollector = exports.QueryFormDataCollector = exports.FormDataCollector = exports.ConfigCollector = exports.AssocArrayCollector = exports.Run = exports.ArrayAssocArrayCollector = exports.InverseArrayCollector = exports.ShimArrayCollector = exports.MappedStreamDataSource = exports.FilteredStreamDatasource = exports.ArrayStreamDataSource = exports.SequenceDataSource = exports.MultiStreamDatasource = exports.calculateSkips = exports.ITERATION_STATUS = void 0;
3254
- const Es2019Array_1 = __webpack_require__(/*! ./Es2019Array */ "./node_modules/mona-dish/src/main/typescript/Es2019Array.ts");
3255
- const Config_1 = __webpack_require__(/*! ./Config */ "./node_modules/mona-dish/src/main/typescript/Config.ts");
2920
+ exports.QueryFormStringCollector = exports.QueryFormDataCollector = exports.FormDataCollector = exports.ConfigCollector = exports.AssocArrayCollector = exports.Run = exports.ArrayAssocArrayCollector = exports.InverseArrayCollector = exports.ArrayCollector = exports.FlatMapStreamDataSource = exports.MappedStreamDataSource = exports.FilteredStreamDatasource = exports.ArrayStreamDataSource = exports.SequenceDataSource = exports.MultiStreamDatasource = exports.ITERATION_STATUS = void 0;
2921
+ const Stream_1 = __webpack_require__(/*! ./Stream */ "./node_modules/mona-dish/src/main/typescript/Stream.ts");
2922
+ const Monad_1 = __webpack_require__(/*! ./Monad */ "./node_modules/mona-dish/src/main/typescript/Monad.ts");
3256
2923
  /**
3257
2924
  * special status of the datasource location pointer
3258
- * if an access, outside - of the possible data boundaries is happening
2925
+ * if an access, outside of the possible data boundaries is happening
3259
2926
  * (example for instance current without a first next call, or next
3260
2927
  * which goes over the last possible dataset), an iteration status return
3261
2928
  * value is returned marking this boundary instead of a classical element
3262
2929
  *
3263
- * Note this is only internally used but must be implemented to fulfill
2930
+ * Note this is only internally used but must be implemented to fullfill
3264
2931
  * internal contracts, the end user will never see those values if he uses
3265
2932
  * streams!
3266
2933
  */
@@ -3276,11 +2943,6 @@ function calculateSkips(next_strm) {
3276
2943
  }
3277
2944
  return --pos;
3278
2945
  }
3279
- exports.calculateSkips = calculateSkips;
3280
- /**
3281
- * A data source which combines multiple streams sequentially into one
3282
- * (this is used internally by flatmap, but also can be used externally)
3283
- */
3284
2946
  class MultiStreamDatasource {
3285
2947
  constructor(first, ...strms) {
3286
2948
  this.first = first;
@@ -3382,7 +3044,7 @@ class SequenceDataSource {
3382
3044
  }
3383
3045
  exports.SequenceDataSource = SequenceDataSource;
3384
3046
  /**
3385
- * implementation of a datasource on top of a standard array
3047
+ * implementation of iteratable on top of array
3386
3048
  */
3387
3049
  class ArrayStreamDataSource {
3388
3050
  constructor(...value) {
@@ -3469,15 +3131,6 @@ class FilteredStreamDatasource {
3469
3131
  this._current = found;
3470
3132
  return found;
3471
3133
  }
3472
- /**
3473
- * looks ahead cnt without changing the internal data "pointers" of the data source
3474
- * (this is mostly needed by LazyStreams, because they do not know by definition their
3475
- * boundaries)
3476
- *
3477
- * @param cnt the elements to look ahead
3478
- * @return either the element or ITERATION_STATUS.EO_STRM if we hit the end of the stream before
3479
- * finding the "cnt" element
3480
- */
3481
3134
  lookAhead(cnt = 1) {
3482
3135
  var _a;
3483
3136
  let lookupVal;
@@ -3528,13 +3181,105 @@ class MappedStreamDataSource {
3528
3181
  }
3529
3182
  }
3530
3183
  exports.MappedStreamDataSource = MappedStreamDataSource;
3184
+ /**
3185
+ * Same for flatmap to deal with element -> stream mappings
3186
+ */
3187
+ class FlatMapStreamDataSource {
3188
+ constructor(func, parent) {
3189
+ this.walkedDataSources = [];
3190
+ this._currPos = 0;
3191
+ this.mapFunc = func;
3192
+ this.inputDataSource = parent;
3193
+ }
3194
+ hasNext() {
3195
+ return this.resolveActiveHasNext() || this.resolveNextHasNext();
3196
+ }
3197
+ resolveActiveHasNext() {
3198
+ let next = false;
3199
+ if (this.activeDataSource) {
3200
+ next = this.activeDataSource.hasNext();
3201
+ }
3202
+ return next;
3203
+ }
3204
+ lookAhead(cnt = 1) {
3205
+ var _a;
3206
+ let lookAhead = (_a = this === null || this === void 0 ? void 0 : this.activeDataSource) === null || _a === void 0 ? void 0 : _a.lookAhead(cnt);
3207
+ if ((this === null || this === void 0 ? void 0 : this.activeDataSource) && lookAhead != ITERATION_STATUS.EO_STRM) {
3208
+ //this should cover 95% of all cases
3209
+ return lookAhead;
3210
+ }
3211
+ if (this.activeDataSource) {
3212
+ cnt -= calculateSkips(this.activeDataSource);
3213
+ }
3214
+ //the idea is basically to look into the streams sub-sequentially for a match
3215
+ //after each stream we have to take into consideration that the skipCnt is
3216
+ //reduced by the number of datasets we already have looked into in the previous stream/datasource
3217
+ //unfortunately for now we have to loop into them, so we introduce a small o2 here
3218
+ for (let dsLoop = 1; true; dsLoop++) {
3219
+ let datasourceData = this.inputDataSource.lookAhead(dsLoop);
3220
+ //we have looped out
3221
+ //no embedded data anymore? we are done, data
3222
+ //can either be a scalar an array or another datasource
3223
+ if (datasourceData === ITERATION_STATUS.EO_STRM) {
3224
+ return ITERATION_STATUS.EO_STRM;
3225
+ }
3226
+ let mappedData = this.mapFunc(datasourceData);
3227
+ //it either comes in as datasource or as array
3228
+ //both cases must be unified into a datasource
3229
+ let currentDataSource = this.toDatasource(mappedData);
3230
+ //we now run again a lookahead
3231
+ let ret = currentDataSource.lookAhead(cnt);
3232
+ //if the value is found then we are set
3233
+ if (ret != ITERATION_STATUS.EO_STRM) {
3234
+ return ret;
3235
+ }
3236
+ //reduce the next lookahead by the number of elements
3237
+ //we are now skipping in the current data source
3238
+ cnt -= calculateSkips(currentDataSource);
3239
+ }
3240
+ }
3241
+ toDatasource(mapped) {
3242
+ let ds = Array.isArray(mapped) ? new ArrayStreamDataSource(...mapped) : mapped;
3243
+ this.walkedDataSources.push(ds);
3244
+ return ds;
3245
+ }
3246
+ resolveNextHasNext() {
3247
+ let next = false;
3248
+ while (!next && this.inputDataSource.hasNext()) {
3249
+ let mapped = this.mapFunc(this.inputDataSource.next());
3250
+ this.activeDataSource = this.toDatasource(mapped);
3251
+ next = this.activeDataSource.hasNext();
3252
+ }
3253
+ return next;
3254
+ }
3255
+ next() {
3256
+ if (this.hasNext()) {
3257
+ this._currPos++;
3258
+ return this.activeDataSource.next();
3259
+ }
3260
+ }
3261
+ reset() {
3262
+ this.inputDataSource.reset();
3263
+ this.walkedDataSources.forEach(ds => ds.reset());
3264
+ this.walkedDataSources = [];
3265
+ this._currPos = 0;
3266
+ this.activeDataSource = null;
3267
+ }
3268
+ current() {
3269
+ if (!this.activeDataSource) {
3270
+ this.hasNext();
3271
+ }
3272
+ return this.activeDataSource.current();
3273
+ }
3274
+ }
3275
+ exports.FlatMapStreamDataSource = FlatMapStreamDataSource;
3531
3276
  /**
3532
3277
  * For the time being we only need one collector
3533
3278
  * a collector which collects a stream back into arrays
3534
3279
  */
3535
- class ShimArrayCollector {
3280
+ class ArrayCollector {
3536
3281
  constructor() {
3537
- this.data = new Es2019Array_1.Es2019Array(...[]);
3282
+ this.data = [];
3538
3283
  }
3539
3284
  collect(element) {
3540
3285
  this.data.push(element);
@@ -3543,7 +3288,7 @@ class ShimArrayCollector {
3543
3288
  return this.data;
3544
3289
  }
3545
3290
  }
3546
- exports.ShimArrayCollector = ShimArrayCollector;
3291
+ exports.ArrayCollector = ArrayCollector;
3547
3292
  /**
3548
3293
  * collects the values as inverse array
3549
3294
  */
@@ -3605,7 +3350,7 @@ exports.AssocArrayCollector = AssocArrayCollector;
3605
3350
  */
3606
3351
  class ConfigCollector {
3607
3352
  constructor() {
3608
- this.finalValue = new Config_1.Config({});
3353
+ this.finalValue = new Monad_1.Config({});
3609
3354
  }
3610
3355
  collect(element) {
3611
3356
  this.finalValue.append(element.key).value = element.value;
@@ -3646,35 +3391,469 @@ class QueryFormStringCollector {
3646
3391
  constructor() {
3647
3392
  this.formData = [];
3648
3393
  }
3649
- collect(element) {
3650
- let toMerge = element.encodeFormElement();
3651
- if (toMerge.isPresent()) {
3652
- this.formData.push([element.name.value, toMerge.get(element.name).value]);
3394
+ collect(element) {
3395
+ let toMerge = element.encodeFormElement();
3396
+ if (toMerge.isPresent()) {
3397
+ this.formData.push([element.name.value, toMerge.get(element.name).value]);
3398
+ }
3399
+ }
3400
+ get finalValue() {
3401
+ return Stream_1.Stream.of(...this.formData)
3402
+ .map(keyVal => keyVal.join("="))
3403
+ .reduce((item1, item2) => [item1, item2].join("&"))
3404
+ .orElse("").value;
3405
+ }
3406
+ }
3407
+ exports.QueryFormStringCollector = QueryFormStringCollector;
3408
+
3409
+
3410
+ /***/ }),
3411
+
3412
+ /***/ "./node_modules/mona-dish/src/main/typescript/Stream.ts":
3413
+ /*!**************************************************************!*\
3414
+ !*** ./node_modules/mona-dish/src/main/typescript/Stream.ts ***!
3415
+ \**************************************************************/
3416
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
3417
+
3418
+
3419
+ /*!
3420
+ * Licensed to the Apache Software Foundation (ASF) under one or more
3421
+ * contributor license agreements. See the NOTICE file distributed with
3422
+ * this work for additional information regarding copyright ownership.
3423
+ * The ASF licenses this file to you under the Apache License, Version 2.0
3424
+ * (the "License"); you may not use this file except in compliance with
3425
+ * the License. You may obtain a copy of the License at
3426
+ *
3427
+ * http://www.apache.org/licenses/LICENSE-2.0
3428
+ *
3429
+ * Unless required by applicable law or agreed to in writing, software
3430
+ * distributed under the License is distributed on an "AS IS" BASIS,
3431
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3432
+ * See the License for the specific language governing permissions and
3433
+ * limitations under the License.
3434
+ */
3435
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
3436
+ exports.LazyStream = exports.Stream = void 0;
3437
+ /*
3438
+ * A small stream implementation
3439
+ */
3440
+ const Monad_1 = __webpack_require__(/*! ./Monad */ "./node_modules/mona-dish/src/main/typescript/Monad.ts");
3441
+ const SourcesCollectors_1 = __webpack_require__(/*! ./SourcesCollectors */ "./node_modules/mona-dish/src/main/typescript/SourcesCollectors.ts");
3442
+ /**
3443
+ * A simple typescript based reimplementation of streams
3444
+ *
3445
+ * This is the early eval version
3446
+ * for a lazy eval version check, LazyStream, which is api compatible
3447
+ * to this implementation, however with the benefit of being able
3448
+ * to provide infinite data sources and generic data providers, the downside
3449
+ * is, it might be a tad slower in some situations
3450
+ */
3451
+ class Stream {
3452
+ constructor(...value) {
3453
+ this._limits = -1;
3454
+ this.pos = -1;
3455
+ this.value = value;
3456
+ }
3457
+ static of(...data) {
3458
+ return new Stream(...data);
3459
+ }
3460
+ static ofAssoc(data) {
3461
+ return this.of(...Object.keys(data)).map(key => [key, data[key]]);
3462
+ }
3463
+ static ofDataSource(dataSource) {
3464
+ let value = [];
3465
+ while (dataSource.hasNext()) {
3466
+ value.push(dataSource.next());
3467
+ }
3468
+ return new Stream(...value);
3469
+ }
3470
+ current() {
3471
+ if (this.pos == -1) {
3472
+ return SourcesCollectors_1.ITERATION_STATUS.BEF_STRM;
3473
+ }
3474
+ if (this.pos >= this.value.length) {
3475
+ return SourcesCollectors_1.ITERATION_STATUS.EO_STRM;
3476
+ }
3477
+ return this.value[this.pos];
3478
+ }
3479
+ limits(end) {
3480
+ this._limits = end;
3481
+ return this;
3482
+ }
3483
+ /**
3484
+ * concat for streams, so that you can concat two streams together
3485
+ * @param toAppend
3486
+ */
3487
+ concat(...toAppend) {
3488
+ let toConcat = [this].concat(toAppend);
3489
+ return Stream.of(...toConcat).flatMap(item => item);
3490
+ }
3491
+ onElem(fn) {
3492
+ for (let cnt = 0; cnt < this.value.length && (this._limits == -1 || cnt < this._limits); cnt++) {
3493
+ if (fn(this.value[cnt], cnt) === false) {
3494
+ break;
3495
+ }
3496
+ }
3497
+ return this;
3498
+ }
3499
+ each(fn) {
3500
+ this.onElem(fn);
3501
+ this.reset();
3502
+ }
3503
+ map(fn) {
3504
+ if (!fn) {
3505
+ fn = (inval) => inval;
3506
+ }
3507
+ let res = [];
3508
+ this.each((item) => {
3509
+ res.push(fn(item));
3510
+ });
3511
+ return new Stream(...res);
3512
+ }
3513
+ /*
3514
+ * we need to implement it to fullfill the contract, although it is used only internally
3515
+ * all values are flattened when accessed anyway, so there is no need to call this methiod
3516
+ */
3517
+ flatMap(fn) {
3518
+ let ret = [];
3519
+ this.each(item => {
3520
+ let strmR = fn(item);
3521
+ ret = Array.isArray(strmR) ? ret.concat(strmR) : ret.concat(strmR.value);
3522
+ });
3523
+ return Stream.of(...ret);
3524
+ }
3525
+ filter(fn) {
3526
+ let res = [];
3527
+ this.each((data) => {
3528
+ if (fn(data)) {
3529
+ res.push(data);
3530
+ }
3531
+ });
3532
+ return new Stream(...res);
3533
+ }
3534
+ reduce(fn, startVal = null) {
3535
+ let offset = startVal != null ? 0 : 1;
3536
+ let val1 = startVal != null ? startVal : this.value.length ? this.value[0] : null;
3537
+ for (let cnt = offset; cnt < this.value.length && (this._limits == -1 || cnt < this._limits); cnt++) {
3538
+ val1 = fn(val1, this.value[cnt]);
3539
+ }
3540
+ this.reset();
3541
+ return Monad_1.Optional.fromNullable(val1);
3542
+ }
3543
+ first() {
3544
+ this.reset();
3545
+ return this.value && this.value.length ? Monad_1.Optional.fromNullable(this.value[0]) : Monad_1.Optional.absent;
3546
+ }
3547
+ last() {
3548
+ //could be done via reduce, but is faster this way
3549
+ let length = this._limits > 0 ? Math.min(this._limits, this.value.length) : this.value.length;
3550
+ this.reset();
3551
+ return Monad_1.Optional.fromNullable(length ? this.value[length - 1] : null);
3552
+ }
3553
+ anyMatch(fn) {
3554
+ for (let cnt = 0; cnt < this.value.length && (this._limits == -1 || cnt < this._limits); cnt++) {
3555
+ if (fn(this.value[cnt])) {
3556
+ return true;
3557
+ }
3558
+ }
3559
+ this.reset();
3560
+ return false;
3561
+ }
3562
+ allMatch(fn) {
3563
+ if (!this.value.length) {
3564
+ return false;
3565
+ }
3566
+ let matches = 0;
3567
+ for (let cnt = 0; cnt < this.value.length; cnt++) {
3568
+ if (fn(this.value[cnt])) {
3569
+ matches++;
3570
+ }
3571
+ }
3572
+ this.reset();
3573
+ return matches == this.value.length;
3574
+ }
3575
+ noneMatch(fn) {
3576
+ let matches = 0;
3577
+ for (let cnt = 0; cnt < this.value.length; cnt++) {
3578
+ if (!fn(this.value[cnt])) {
3579
+ matches++;
3580
+ }
3581
+ }
3582
+ this.reset();
3583
+ return matches == this.value.length;
3584
+ }
3585
+ sort(comparator) {
3586
+ let newArr = this.value.slice().sort(comparator);
3587
+ return Stream.of(...newArr);
3588
+ }
3589
+ collect(collector) {
3590
+ this.each(data => collector.collect(data));
3591
+ this.reset();
3592
+ return collector.finalValue;
3593
+ }
3594
+ //-- internally exposed methods needed for the interconnectivity
3595
+ hasNext() {
3596
+ let isLimitsReached = this._limits != -1 && this.pos >= this._limits - 1;
3597
+ let isEndOfArray = this.pos >= this.value.length - 1;
3598
+ return !(isLimitsReached || isEndOfArray);
3599
+ }
3600
+ next() {
3601
+ if (!this.hasNext()) {
3602
+ return null;
3603
+ }
3604
+ this.pos++;
3605
+ return this.value[this.pos];
3606
+ }
3607
+ lookAhead(cnt = 1) {
3608
+ if ((this.pos + cnt) >= this.value.length) {
3609
+ return SourcesCollectors_1.ITERATION_STATUS.EO_STRM;
3610
+ }
3611
+ return this.value[this.pos + cnt];
3612
+ }
3613
+ [Symbol.iterator]() {
3614
+ return {
3615
+ next: () => {
3616
+ let done = !this.hasNext();
3617
+ let val = this.next();
3618
+ return {
3619
+ done: done,
3620
+ value: val
3621
+ };
3622
+ }
3623
+ };
3624
+ }
3625
+ /*get observable(): Observable<T> {
3626
+ return from(this);
3627
+ }*/
3628
+ reset() {
3629
+ this.pos = -1;
3630
+ }
3631
+ }
3632
+ exports.Stream = Stream;
3633
+ /**
3634
+ * Lazy implementation of a Stream
3635
+ * The idea is to connect the intermediate
3636
+ * streams as datasources like a linked list
3637
+ * with reverse referencing and for special
3638
+ * operations like filtering flatmapping
3639
+ * have intermediate datasources in the list
3640
+ * with specialized functions.
3641
+ *
3642
+ * Sort of a modified pipe valve pattern
3643
+ * the streams are the pipes the intermediate
3644
+ * data sources are the valves
3645
+ *
3646
+ * We then can use passed in functions to control
3647
+ * the flow in the valves
3648
+ *
3649
+ * That way we can have a lazy evaluating stream
3650
+ *
3651
+ * So if an endpoint requests data
3652
+ * a callback trace goes back the stream list
3653
+ * which triggers an operation upwards
3654
+ * which sends data down the drain which then is processed
3655
+ * and filtered until one element hits the endpoint.
3656
+ *
3657
+ * That is repeated, until all elements are processed
3658
+ * or an internal limit is hit.
3659
+ *
3660
+ */
3661
+ class LazyStream {
3662
+ static of(...values) {
3663
+ return new LazyStream(new SourcesCollectors_1.ArrayStreamDataSource(...values));
3664
+ }
3665
+ static ofAssoc(data) {
3666
+ return this.of(...Object.keys(data)).map(key => [key, data[key]]);
3667
+ }
3668
+ static ofStreamDataSource(value) {
3669
+ return new LazyStream(value);
3670
+ }
3671
+ constructor(parent) {
3672
+ this._limits = -1;
3673
+ /*
3674
+ * needed to have the limits check working
3675
+ * we need to keep track of the current position
3676
+ * in the stream
3677
+ */
3678
+ this.pos = -1;
3679
+ this.dataSource = parent;
3680
+ }
3681
+ hasNext() {
3682
+ if (this.isOverLimits()) {
3683
+ return false;
3684
+ }
3685
+ return this.dataSource.hasNext();
3686
+ }
3687
+ next() {
3688
+ let next = this.dataSource.next();
3689
+ // @ts-ignore
3690
+ this.pos++;
3691
+ return next;
3692
+ }
3693
+ lookAhead(cnt = 1) {
3694
+ return this.dataSource.lookAhead(cnt);
3695
+ }
3696
+ current() {
3697
+ return this.dataSource.current();
3698
+ }
3699
+ reset() {
3700
+ this.dataSource.reset();
3701
+ this.pos = -1;
3702
+ this._limits = -1;
3703
+ }
3704
+ /**
3705
+ * concat for streams, so that you can concat two streams together
3706
+ * @param toAppend
3707
+ */
3708
+ concat(...toAppend) {
3709
+ //this.dataSource = new MultiStreamDatasource<T>(this, ... toAppend);
3710
+ //return this;
3711
+ return LazyStream.ofStreamDataSource(new SourcesCollectors_1.MultiStreamDatasource(this, toAppend));
3712
+ //return LazyStream.of(<IStream<T>>this, ...toAppend).flatMap(item => item);
3713
+ }
3714
+ nextFilter(fn) {
3715
+ if (this.hasNext()) {
3716
+ let newVal = this.next();
3717
+ if (!fn(newVal)) {
3718
+ return this.nextFilter(fn);
3719
+ }
3720
+ return newVal;
3721
+ }
3722
+ return null;
3723
+ }
3724
+ limits(max) {
3725
+ this._limits = max;
3726
+ return this;
3727
+ }
3728
+ //main stream methods
3729
+ collect(collector) {
3730
+ while (this.hasNext()) {
3731
+ let t = this.next();
3732
+ collector.collect(t);
3733
+ }
3734
+ this.reset();
3735
+ return collector.finalValue;
3736
+ }
3737
+ onElem(fn) {
3738
+ return new LazyStream(new SourcesCollectors_1.MappedStreamDataSource((el) => {
3739
+ if (fn(el, this.pos) === false) {
3740
+ this.stop();
3741
+ }
3742
+ return el;
3743
+ }, this));
3744
+ }
3745
+ filter(fn) {
3746
+ return new LazyStream(new SourcesCollectors_1.FilteredStreamDatasource(fn, this));
3747
+ }
3748
+ map(fn) {
3749
+ return new LazyStream(new SourcesCollectors_1.MappedStreamDataSource(fn, this));
3750
+ }
3751
+ flatMap(fn) {
3752
+ return new LazyStream(new SourcesCollectors_1.FlatMapStreamDataSource(fn, this));
3753
+ }
3754
+ //endpoint
3755
+ each(fn) {
3756
+ while (this.hasNext()) {
3757
+ if (fn(this.next()) === false) {
3758
+ this.stop();
3759
+ }
3760
+ }
3761
+ this.reset();
3762
+ }
3763
+ reduce(fn, startVal = null) {
3764
+ if (!this.hasNext()) {
3765
+ return Monad_1.Optional.absent;
3766
+ }
3767
+ let value1;
3768
+ let value2 = null;
3769
+ if (startVal != null) {
3770
+ value1 = startVal;
3771
+ value2 = this.next();
3772
+ }
3773
+ else {
3774
+ value1 = this.next();
3775
+ if (!this.hasNext()) {
3776
+ return Monad_1.Optional.fromNullable(value1);
3777
+ }
3778
+ value2 = this.next();
3779
+ }
3780
+ value1 = fn(value1, value2);
3781
+ while (this.hasNext()) {
3782
+ value2 = this.next();
3783
+ value1 = fn(value1, value2);
3784
+ }
3785
+ this.reset();
3786
+ return Monad_1.Optional.fromNullable(value1);
3787
+ }
3788
+ last() {
3789
+ if (!this.hasNext()) {
3790
+ return Monad_1.Optional.absent;
3791
+ }
3792
+ return this.reduce((el1, el2) => el2);
3793
+ }
3794
+ first() {
3795
+ this.reset();
3796
+ if (!this.hasNext()) {
3797
+ return Monad_1.Optional.absent;
3798
+ }
3799
+ return Monad_1.Optional.fromNullable(this.next());
3800
+ }
3801
+ anyMatch(fn) {
3802
+ while (this.hasNext()) {
3803
+ if (fn(this.next())) {
3804
+ return true;
3805
+ }
3806
+ }
3807
+ return false;
3808
+ }
3809
+ allMatch(fn) {
3810
+ while (this.hasNext()) {
3811
+ if (!fn(this.next())) {
3812
+ return false;
3813
+ }
3814
+ }
3815
+ return true;
3816
+ }
3817
+ noneMatch(fn) {
3818
+ while (this.hasNext()) {
3819
+ if (fn(this.next())) {
3820
+ return false;
3821
+ }
3653
3822
  }
3823
+ return true;
3654
3824
  }
3655
- get finalValue() {
3656
- return new Es2019Array_1.Es2019Array(...this.formData)
3657
- .map(keyVal => keyVal.join("="))
3658
- .reduce((item1, item2) => [item1, item2].join("&"));
3825
+ sort(comparator) {
3826
+ let arr = this.collect(new SourcesCollectors_1.ArrayCollector());
3827
+ arr = arr.sort(comparator);
3828
+ return LazyStream.of(...arr);
3659
3829
  }
3660
- }
3661
- exports.QueryFormStringCollector = QueryFormStringCollector;
3662
- /**
3663
- * For the time being we only need one collector
3664
- * a collector which collects a stream back into arrays
3665
- */
3666
- class ArrayCollector {
3667
- constructor() {
3668
- this.data = [];
3830
+ get value() {
3831
+ return this.collect(new SourcesCollectors_1.ArrayCollector());
3669
3832
  }
3670
- collect(element) {
3671
- this.data.push(element);
3833
+ [Symbol.iterator]() {
3834
+ return {
3835
+ next: () => {
3836
+ let done = !this.hasNext();
3837
+ let val = this.next();
3838
+ return {
3839
+ done: done,
3840
+ value: val
3841
+ };
3842
+ }
3843
+ };
3672
3844
  }
3673
- get finalValue() {
3674
- return this.data;
3845
+ /*get observable(): Observable<T> {
3846
+ return from(this);
3847
+ }*/
3848
+ stop() {
3849
+ this.pos = this._limits + 1000000000;
3850
+ this._limits = 0;
3851
+ }
3852
+ isOverLimits() {
3853
+ return this._limits != -1 && this.pos >= this._limits - 1;
3675
3854
  }
3676
3855
  }
3677
- exports.ArrayCollector = ArrayCollector;
3856
+ exports.LazyStream = LazyStream;
3678
3857
 
3679
3858
 
3680
3859
  /***/ }),
@@ -3776,34 +3955,11 @@ exports.XQ = XMLQuery;
3776
3955
  /*!******************************************************************!*\
3777
3956
  !*** ./node_modules/mona-dish/src/main/typescript/index_core.ts ***!
3778
3957
  \******************************************************************/
3779
- /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
3958
+ /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
3780
3959
 
3781
3960
 
3782
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3783
- if (k2 === undefined) k2 = k;
3784
- var desc = Object.getOwnPropertyDescriptor(m, k);
3785
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
3786
- desc = { enumerable: true, get: function() { return m[k]; } };
3787
- }
3788
- Object.defineProperty(o, k2, desc);
3789
- }) : (function(o, m, k, k2) {
3790
- if (k2 === undefined) k2 = k;
3791
- o[k2] = m[k];
3792
- }));
3793
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
3794
- Object.defineProperty(o, "default", { enumerable: true, value: v });
3795
- }) : function(o, v) {
3796
- o["default"] = v;
3797
- });
3798
- var __importStar = (this && this.__importStar) || function (mod) {
3799
- if (mod && mod.__esModule) return mod;
3800
- var result = {};
3801
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
3802
- __setModuleDefault(result, mod);
3803
- return result;
3804
- };
3805
3961
  Object.defineProperty(exports, "__esModule", ({ value: true }));
3806
- exports.Assoc = exports.CONFIG_VALUE = exports.CONFIG_ANY = exports.Config = exports.shallowMerge = exports.simpleShallowMerge = exports.append = exports.assignIf = exports.assign = exports.XQ = exports.XMLQuery = exports.ValueEmbedder = exports.Optional = exports.Monad = exports.Lang = exports.DQ$ = exports.DQ = exports.DomQueryCollector = exports.ElementAttribute = exports.DomQuery = void 0;
3962
+ exports.QueryFormDataCollector = exports.FormDataCollector = exports.AssocArrayCollector = exports.ArrayCollector = exports.QueryFormStringCollector = exports.SequenceDataSource = exports.FlatMapStreamDataSource = exports.FilteredStreamDatasource = exports.MappedStreamDataSource = exports.ArrayStreamDataSource = exports.LazyStream = exports.Stream = exports.XQ = exports.XMLQuery = exports.ValueEmbedder = exports.Optional = exports.Monad = exports.CONFIG_ANY = exports.CONFIG_VALUE = exports.Config = exports.Lang = exports.DQ$ = exports.DQ = exports.DomQueryCollector = exports.ElementAttribute = exports.DomQuery = void 0;
3807
3963
  /*!
3808
3964
  * Licensed to the Apache Software Foundation (ASF) under one
3809
3965
  * or more contributor license agreements. See the NOTICE file
@@ -3831,25 +3987,29 @@ Object.defineProperty(exports, "DQ$", ({ enumerable: true, get: function () { re
3831
3987
  var Lang_1 = __webpack_require__(/*! ./Lang */ "./node_modules/mona-dish/src/main/typescript/Lang.ts");
3832
3988
  Object.defineProperty(exports, "Lang", ({ enumerable: true, get: function () { return Lang_1.Lang; } }));
3833
3989
  var Monad_1 = __webpack_require__(/*! ./Monad */ "./node_modules/mona-dish/src/main/typescript/Monad.ts");
3990
+ Object.defineProperty(exports, "Config", ({ enumerable: true, get: function () { return Monad_1.Config; } }));
3991
+ Object.defineProperty(exports, "CONFIG_VALUE", ({ enumerable: true, get: function () { return Monad_1.CONFIG_VALUE; } }));
3992
+ Object.defineProperty(exports, "CONFIG_ANY", ({ enumerable: true, get: function () { return Monad_1.CONFIG_ANY; } }));
3834
3993
  Object.defineProperty(exports, "Monad", ({ enumerable: true, get: function () { return Monad_1.Monad; } }));
3835
3994
  Object.defineProperty(exports, "Optional", ({ enumerable: true, get: function () { return Monad_1.Optional; } }));
3836
3995
  Object.defineProperty(exports, "ValueEmbedder", ({ enumerable: true, get: function () { return Monad_1.ValueEmbedder; } }));
3837
3996
  var XmlQuery_1 = __webpack_require__(/*! ./XmlQuery */ "./node_modules/mona-dish/src/main/typescript/XmlQuery.ts");
3838
3997
  Object.defineProperty(exports, "XMLQuery", ({ enumerable: true, get: function () { return XmlQuery_1.XMLQuery; } }));
3839
3998
  Object.defineProperty(exports, "XQ", ({ enumerable: true, get: function () { return XmlQuery_1.XQ; } }));
3840
- var AssocArray_1 = __webpack_require__(/*! ./AssocArray */ "./node_modules/mona-dish/src/main/typescript/AssocArray.ts");
3841
- Object.defineProperty(exports, "assign", ({ enumerable: true, get: function () { return AssocArray_1.assign; } }));
3842
- Object.defineProperty(exports, "assignIf", ({ enumerable: true, get: function () { return AssocArray_1.assignIf; } }));
3843
- Object.defineProperty(exports, "append", ({ enumerable: true, get: function () { return AssocArray_1.append; } }));
3844
- Object.defineProperty(exports, "simpleShallowMerge", ({ enumerable: true, get: function () { return AssocArray_1.simpleShallowMerge; } }));
3845
- Object.defineProperty(exports, "shallowMerge", ({ enumerable: true, get: function () { return AssocArray_1.shallowMerge; } }));
3846
- var Config_1 = __webpack_require__(/*! ./Config */ "./node_modules/mona-dish/src/main/typescript/Config.ts");
3847
- Object.defineProperty(exports, "Config", ({ enumerable: true, get: function () { return Config_1.Config; } }));
3848
- var Config_2 = __webpack_require__(/*! ./Config */ "./node_modules/mona-dish/src/main/typescript/Config.ts");
3849
- Object.defineProperty(exports, "CONFIG_ANY", ({ enumerable: true, get: function () { return Config_2.CONFIG_ANY; } }));
3850
- var Config_3 = __webpack_require__(/*! ./Config */ "./node_modules/mona-dish/src/main/typescript/Config.ts");
3851
- Object.defineProperty(exports, "CONFIG_VALUE", ({ enumerable: true, get: function () { return Config_3.CONFIG_VALUE; } }));
3852
- exports.Assoc = __importStar(__webpack_require__(/*! ./AssocArray */ "./node_modules/mona-dish/src/main/typescript/AssocArray.ts"));
3999
+ var Stream_1 = __webpack_require__(/*! ./Stream */ "./node_modules/mona-dish/src/main/typescript/Stream.ts");
4000
+ Object.defineProperty(exports, "Stream", ({ enumerable: true, get: function () { return Stream_1.Stream; } }));
4001
+ Object.defineProperty(exports, "LazyStream", ({ enumerable: true, get: function () { return Stream_1.LazyStream; } }));
4002
+ var SourcesCollectors_1 = __webpack_require__(/*! ./SourcesCollectors */ "./node_modules/mona-dish/src/main/typescript/SourcesCollectors.ts");
4003
+ Object.defineProperty(exports, "ArrayStreamDataSource", ({ enumerable: true, get: function () { return SourcesCollectors_1.ArrayStreamDataSource; } }));
4004
+ Object.defineProperty(exports, "MappedStreamDataSource", ({ enumerable: true, get: function () { return SourcesCollectors_1.MappedStreamDataSource; } }));
4005
+ Object.defineProperty(exports, "FilteredStreamDatasource", ({ enumerable: true, get: function () { return SourcesCollectors_1.FilteredStreamDatasource; } }));
4006
+ Object.defineProperty(exports, "FlatMapStreamDataSource", ({ enumerable: true, get: function () { return SourcesCollectors_1.FlatMapStreamDataSource; } }));
4007
+ Object.defineProperty(exports, "SequenceDataSource", ({ enumerable: true, get: function () { return SourcesCollectors_1.SequenceDataSource; } }));
4008
+ Object.defineProperty(exports, "QueryFormStringCollector", ({ enumerable: true, get: function () { return SourcesCollectors_1.QueryFormStringCollector; } }));
4009
+ Object.defineProperty(exports, "ArrayCollector", ({ enumerable: true, get: function () { return SourcesCollectors_1.ArrayCollector; } }));
4010
+ Object.defineProperty(exports, "AssocArrayCollector", ({ enumerable: true, get: function () { return SourcesCollectors_1.AssocArrayCollector; } }));
4011
+ Object.defineProperty(exports, "FormDataCollector", ({ enumerable: true, get: function () { return SourcesCollectors_1.FormDataCollector; } }));
4012
+ Object.defineProperty(exports, "QueryFormDataCollector", ({ enumerable: true, get: function () { return SourcesCollectors_1.QueryFormDataCollector; } }));
3853
4013
 
3854
4014
 
3855
4015
  /***/ }),
@@ -3971,12 +4131,12 @@ var faces;
3971
4131
  /**
3972
4132
  * this function has to send the ajax requests
3973
4133
  *
3974
- * following requestInternal conditions must be met:
4134
+ * following request conditions must be met:
3975
4135
  * <ul>
3976
- * <li> the requestInternal must be sent asynchronously! </li>
3977
- * <li> the requestInternal must be a POST!!! requestInternal </li>
3978
- * <li> the requestInternal url must be the form action attribute </li>
3979
- * <li> all requests must be queued with a client side requestInternal queue to ensure the requestInternal ordering!</li>
4136
+ * <li> the request must be sent asynchronously! </li>
4137
+ * <li> the request must be a POST!!! request </li>
4138
+ * <li> the request url must be the form action attribute </li>
4139
+ * <li> all requests must be queued with a client side request queue to ensure the request ordering!</li>
3980
4140
  * </ul>
3981
4141
  *
3982
4142
  * @param {String|Node} element: any dom element no matter being it html or jsf, from which the event is emitted
@@ -3992,7 +4152,6 @@ var faces;
3992
4152
  * @param request the request object having triggered this response
3993
4153
  * @param context the request context
3994
4154
  *
3995
- * TODO add info on what can be in the context
3996
4155
  */
3997
4156
  function response(request, context) {
3998
4157
  AjaxImpl_1.Implementation.response(request, context);
@@ -4007,10 +4166,10 @@ var faces;
4007
4166
  * <li> errorData.status : the error status message</li>
4008
4167
  * <li> errorData.serverErrorName : the server error name in case of a server error</li>
4009
4168
  * <li> errorData.serverErrorMessage : the server error message in case of a server error</li>
4010
- * <li> errorData.source : the issuing source element which triggered the requestInternal </li>
4011
- * <li> eventData.responseCode: the response code (aka http requestInternal response code, 401 etc...) </li>
4012
- * <li> eventData.responseText: the requestInternal response text </li>
4013
- * <li> eventData.responseXML: the requestInternal response xml </li>
4169
+ * <li> errorData.source : the issuing source element which triggered the request </li>
4170
+ * <li> eventData.responseCode: the response code (aka http request response code, 401 etc...) </li>
4171
+ * <li> eventData.responseText: the request response text </li>
4172
+ * <li> eventData.responseXML: the request response xml </li>
4014
4173
  * </ul>
4015
4174
  *
4016
4175
  * @param errorFunc error handler must be of the format <i>function errorListener(&lt;errorData&gt;)</i>
@@ -4124,7 +4283,7 @@ var myfaces;
4124
4283
  *
4125
4284
  * @param executionFunc the function to be executed upon ready
4126
4285
  */
4127
- function onDomReady(executionFunc) {
4286
+ function onOnDomReady(executionFunc) {
4128
4287
  if (document.readyState !== "complete") {
4129
4288
  onReadyChain.push(executionFunc);
4130
4289
  if (!readyStateListener) {
@@ -4149,7 +4308,7 @@ var myfaces;
4149
4308
  executionFunc();
4150
4309
  }
4151
4310
  }
4152
- myfaces.onDomReady = onDomReady;
4311
+ myfaces.onOnDomReady = onOnDomReady;
4153
4312
  /**
4154
4313
  * legacy oam functions
4155
4314
  */
@@ -4185,6 +4344,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
4185
4344
  exports.Implementation = void 0;
4186
4345
  const Response_1 = __webpack_require__(/*! ./xhrCore/Response */ "./src/main/typescript/impl/xhrCore/Response.ts");
4187
4346
  const XhrRequest_1 = __webpack_require__(/*! ./xhrCore/XhrRequest */ "./src/main/typescript/impl/xhrCore/XhrRequest.ts");
4347
+ const AsyncQueue_1 = __webpack_require__(/*! ./util/AsyncQueue */ "./src/main/typescript/impl/util/AsyncQueue.ts");
4188
4348
  const mona_dish_1 = __webpack_require__(/*! mona-dish */ "./node_modules/mona-dish/src/main/typescript/index_core.ts");
4189
4349
  const Assertions_1 = __webpack_require__(/*! ./util/Assertions */ "./src/main/typescript/impl/util/Assertions.ts");
4190
4350
  const ExtDomQuery_1 = __webpack_require__(/*! ./util/ExtDomQuery */ "./src/main/typescript/impl/util/ExtDomQuery.ts");
@@ -4193,7 +4353,6 @@ const Lang_1 = __webpack_require__(/*! ./util/Lang */ "./src/main/typescript/imp
4193
4353
  const Const_1 = __webpack_require__(/*! ./core/Const */ "./src/main/typescript/impl/core/Const.ts");
4194
4354
  const RequestDataResolver_1 = __webpack_require__(/*! ./xhrCore/RequestDataResolver */ "./src/main/typescript/impl/xhrCore/RequestDataResolver.ts");
4195
4355
  const FileUtils_1 = __webpack_require__(/*! ./util/FileUtils */ "./src/main/typescript/impl/util/FileUtils.ts");
4196
- const XhrQueueController_1 = __webpack_require__(/*! ./util/XhrQueueController */ "./src/main/typescript/impl/util/XhrQueueController.ts");
4197
4356
  /*
4198
4357
  * allowed project stages
4199
4358
  */
@@ -4241,7 +4400,17 @@ var Implementation;
4241
4400
  it provides following
4242
4401
 
4243
4402
  a) Monad like structures for querying because this keeps the code denser and adds abstractions
4244
- that always was the strong point of jQuery, and it still is better in this regard than what ecmascript provides
4403
+ that always was the strong point of jquery and it still is better in this regard than what ecmascript provides
4404
+
4405
+ b) Streams and lazy streams like java has, a pull stream construct, ecmascript does not have anything like it.
4406
+ (it has array filters and maps, but ES2015 does not support flatMap)
4407
+ Another option would have been rxjs but that would have introduced a code dependency and probably more code. We might
4408
+ move to RXJS if the need arises, however. But for now I would rather stick with my small self grown library which works
4409
+ quite well and where I can patch quickly (I have used it in several industrial projects, so it works well
4410
+ and is heavily fortified by unit tests (140 testcases as time of writing this))
4411
+ The long term plan is to eliminate the Stream usage as soon as we can move up to ES2019 (adding the missing
4412
+ functions as shims, is a no go, because we are a library, and absolutey do not Shim anything which can leak
4413
+ into the global namespace!)
4245
4414
 
4246
4415
  c) A neutral json like configuration which allows assignments of arbitrary values with reduce code which then can be
4247
4416
  transformed into different data representations
@@ -4277,8 +4446,6 @@ var Implementation;
4277
4446
  var getMessage = Lang_1.ExtLang.getMessage;
4278
4447
  var getGlobalConfig = Lang_1.ExtLang.getGlobalConfig;
4279
4448
  var assert = Assertions_1.Assertions.assert;
4280
- var ofAssoc = Lang_1.ExtLang.ofAssoc;
4281
- var collectAssoc = Lang_1.ExtLang.collectAssoc;
4282
4449
  let projectStage = null;
4283
4450
  let separator = null;
4284
4451
  let eventQueue = [];
@@ -4311,7 +4478,7 @@ var Implementation;
4311
4478
  /**
4312
4479
  * @return the project stage also emitted by the server:
4313
4480
  * it cannot be cached and must be delivered over the server
4314
- * The value for it comes from the requestInternal parameter of the faces.js script called "stage".
4481
+ * The value for it comes from the request parameter of the faces.js script called "stage".
4315
4482
  */
4316
4483
  function getProjectStage() {
4317
4484
  var _a, _b, _c;
@@ -4336,18 +4503,15 @@ var Implementation;
4336
4503
  * @param funcs
4337
4504
  */
4338
4505
  function chain(source, event, ...funcs) {
4339
- // we can use our lazy stream each functionality to run our chain here.
4506
+ // we can use our lazy stream each functionality to run our chain here..
4340
4507
  // by passing a boolean as return value into the onElem call
4341
4508
  // we can stop early at the first false, just like the spec requests
4342
- let ret;
4343
- funcs.every(func => {
4344
- let returnVal = resolveAndExecute(source, event, func);
4345
- if (returnVal !== false) {
4346
- ret = returnVal;
4347
- }
4348
- return returnVal !== false;
4349
- });
4350
- return ret;
4509
+ return mona_dish_1.LazyStream.of(...funcs)
4510
+ .map(func => resolveAndExecute(source, event, func))
4511
+ // we use the return false == stop as an early stop, onElem stops at the first false
4512
+ .onElem((opResult) => opResult)
4513
+ //last ensures we run until the first false is returned
4514
+ .last().value;
4351
4515
  }
4352
4516
  Implementation.chain = chain;
4353
4517
  /**
@@ -4369,7 +4533,7 @@ var Implementation;
4369
4533
  * b) passThrough handling with a map copy with a filter map block map
4370
4534
  */
4371
4535
  function request(el, event, opts) {
4372
- var _a, _b, _c, _d, _e;
4536
+ var _a, _b, _c;
4373
4537
  const { options, elem, elementId, windowId, isResetValues } = (0, RequestDataResolver_1.resolveDefaults)(event, opts, el);
4374
4538
  const requestCtx = new ExtDomQuery_1.ExtConfig({});
4375
4539
  const internalCtx = new ExtDomQuery_1.ExtConfig({});
@@ -4387,7 +4551,7 @@ var Implementation;
4387
4551
  const delay = (0, RequestDataResolver_1.resolveDelay)(options);
4388
4552
  const timeout = (0, RequestDataResolver_1.resolveTimeout)(options);
4389
4553
  requestCtx.assignIf(!!windowId, Const_1.P_WINDOW_ID).value = windowId;
4390
- // old non - spec behavior will be removed after it is clear whether the removal breaks any code
4554
+ // old non spec behavior will be removed after it is clear whether the removal breaks any code
4391
4555
  requestCtx.assign(Const_1.CTX_PARAM_REQ_PASS_THR).value = extractLegacyParams(options.value);
4392
4556
  // spec conform behavior, all passthrough params must be under "passthrough
4393
4557
  const params = remapArrayToAssocArr(options.getIf(Const_1.CTX_OPTIONS_PARAMS).orElse({}).value);
@@ -4413,13 +4577,13 @@ var Implementation;
4413
4577
  requestCtx.assign(Const_1.ON_EVENT).value = (_a = options.value) === null || _a === void 0 ? void 0 : _a.onevent;
4414
4578
  requestCtx.assign(Const_1.ON_ERROR).value = (_b = options.value) === null || _b === void 0 ? void 0 : _b.onerror;
4415
4579
  /**
4416
- * Fetch the myfaces config params
4580
+ * lets drag the myfaces config params also in
4417
4581
  */
4418
4582
  requestCtx.assign(Const_1.MYFACES).value = (_c = options.value) === null || _c === void 0 ? void 0 : _c.myfaces;
4419
4583
  /**
4420
4584
  * binding contract the jakarta.faces.source must be set
4421
4585
  */
4422
- requestCtx.assign(Const_1.CTX_PARAM_REQ_PASS_THR, Const_1.P_AJAX_SOURCE).value = elementId;
4586
+ requestCtx.assign(Const_1.CTX_PARAM_REQ_PASS_THR, Const_1.P_PARTIAL_SOURCE).value = elementId;
4423
4587
  /**
4424
4588
  * jakarta.faces.partial.ajax must be set to true
4425
4589
  */
@@ -4442,8 +4606,6 @@ var Implementation;
4442
4606
  // won't hurt but for the sake of compatibility we are going to add it
4443
4607
  requestCtx.assign(Const_1.CTX_PARAM_REQ_PASS_THR, formId).value = formId;
4444
4608
  internalCtx.assign(Const_1.CTX_PARAM_SRC_CTL_ID).value = elementId;
4445
- // reintroduction of PPS as per myfaces 2.3 (myfaces.pps = true, only the executes are submitted)
4446
- internalCtx.assign(Const_1.CTX_PARAM_PPS).value = (_e = (_d = extractMyFacesParams(options.value)) === null || _d === void 0 ? void 0 : _d[Const_1.MYFACES_OPTION_PPS]) !== null && _e !== void 0 ? _e : false;
4447
4609
  assignClientWindowId(form, requestCtx);
4448
4610
  assignExecute(options, requestCtx, form, elementId);
4449
4611
  assignRender(options, requestCtx, form, elementId);
@@ -4520,7 +4682,7 @@ var Implementation;
4520
4682
  }
4521
4683
  finally {
4522
4684
  if (clearRequestQueue) {
4523
- Implementation.requestQueue.clear();
4685
+ Implementation.requestQueue.cleanup();
4524
4686
  }
4525
4687
  }
4526
4688
  }
@@ -4561,11 +4723,26 @@ var Implementation;
4561
4723
  /*
4562
4724
  * the search root for the dom element search
4563
4725
  */
4564
- let searchRoot = new mona_dish_1.DQ(node || document.body).querySelectorAll(`form input [name='${Const_1.P_CLIENT_WINDOW}']`);
4726
+ let searchRoot = ((node) ? mona_dish_1.DQ.byId(node) : (0, mona_dish_1.DQ$)("form"));
4727
+ let inputs = searchRoot
4728
+ .filterSelector(`input[name='${(0, Const_1.$nsp)(Const_1.P_CLIENT_WINDOW)}']`)
4729
+ .orElseLazy(() => searchRoot.querySelectorAll(`input[name='${(0, Const_1.$nsp)(Const_1.P_CLIENT_WINDOW)}']`));
4730
+ /*
4731
+ * lazy helper to fetch the window id from the included faces.js
4732
+ */
4733
+ let fetchWindowIdFromJSFJS = () => ExtDomQuery_1.ExtDomQuery.searchJsfJsFor(/jfwid=([^&;]*)/).orElse(null).value;
4565
4734
  /*
4566
- * lazy helper to fetch the window id from the window url
4735
+ * fetch window id from the url
4567
4736
  */
4568
- let fetchWindowIdFromUrl = () => ExtDomQuery_1.ExtDomQuery.searchJsfJsFor(/jfwid=([^&;]*)/).orElse(null).value;
4737
+ let fetchWindowIdFromURL = function () {
4738
+ const href = window.location.href, windowId = "jfwid";
4739
+ const regex = new RegExp("[\\?&]" + windowId + "=([^&#\\;]*)");
4740
+ const results = regex.exec(href);
4741
+ //initial trial over the url and a regexp
4742
+ if (results != null)
4743
+ return results[1];
4744
+ return null;
4745
+ };
4569
4746
  /*
4570
4747
  * functional double check based on stream reduction
4571
4748
  * the values should be identical or on INIT value which is a premise to
@@ -4588,20 +4765,19 @@ var Implementation;
4588
4765
  *
4589
4766
  * @param item
4590
4767
  */
4591
- let getValue = (item) => item.attr("value").value;
4768
+ let getValue = (item) => item.val;
4592
4769
  /*
4593
4770
  * fetch the window id from the forms
4594
4771
  * window ids must be present in all forms
4595
4772
  * or non-existent. If they exist all of them must be the same
4596
4773
  */
4597
- let formWindowId = mona_dish_1.Optional.fromNullable(searchRoot.asArray
4598
- .map(getValue).reduce(differenceCheck, INIT));
4774
+ let formWindowId = inputs.stream.map(getValue).reduce(differenceCheck, INIT);
4599
4775
  //if the resulting window id is set on altered then we have an unresolvable problem
4600
4776
  assert(ALTERED != formWindowId.value, "Multiple different windowIds found in document");
4601
4777
  /*
4602
4778
  * return the window id or null
4603
4779
  */
4604
- return formWindowId.value != INIT ? formWindowId.value : fetchWindowIdFromUrl();
4780
+ return formWindowId.value != INIT ? formWindowId.value : (fetchWindowIdFromURL() || fetchWindowIdFromJSFJS());
4605
4781
  }
4606
4782
  Implementation.getClientWindow = getClientWindow;
4607
4783
  /**
@@ -4627,7 +4803,7 @@ var Implementation;
4627
4803
  // fetch all non file input form elements
4628
4804
  let formElements = element.deepElements.encodeFormElement();
4629
4805
  // encode them! (file inputs are handled differently and are not part of the viewstate)
4630
- return (0, FileUtils_1.encodeFormData)(new ExtDomQuery_1.ExtConfig(formElements), (0, RequestDataResolver_1.resoveNamingContainerMapper)(dummyContext));
4806
+ return (0, FileUtils_1.encodeFormData)(formElements, (0, RequestDataResolver_1.resoveNamingContainerMapper)(dummyContext));
4631
4807
  }
4632
4808
  Implementation.getViewState = getViewState;
4633
4809
  /**
@@ -4642,8 +4818,8 @@ var Implementation;
4642
4818
  * adds a new request to our queue for further processing
4643
4819
  */
4644
4820
  addRequestToQueue: function (elem, form, reqCtx, respPassThr, delay = 0, timeout = 0) {
4645
- Implementation.requestQueue = Implementation.requestQueue !== null && Implementation.requestQueue !== void 0 ? Implementation.requestQueue : new XhrQueueController_1.XhrQueueController();
4646
- Implementation.requestQueue.enqueue(new XhrRequest_1.XhrRequest(reqCtx, respPassThr, timeout), delay);
4821
+ Implementation.requestQueue = Implementation.requestQueue !== null && Implementation.requestQueue !== void 0 ? Implementation.requestQueue : new AsyncQueue_1.AsynchronousQueue();
4822
+ Implementation.requestQueue.enqueue(new XhrRequest_1.XhrRequest(elem, form, reqCtx, respPassThr, [], timeout), delay);
4647
4823
  }
4648
4824
  };
4649
4825
  //----------------------------------------------- Methods ---------------------------------------------------------------------
@@ -4743,7 +4919,7 @@ var Implementation;
4743
4919
  * can deal with them either prefixed ir not
4744
4920
  * also resolves the absolute id case (it was assumed the server does this, but
4745
4921
  * apparently the RI does not, so we have to follow the RI behavior here)
4746
- * @param componentIdToTransform the componentId which needs post-processing
4922
+ * @param componentIdToTransform the componentId which needs post processing
4747
4923
  */
4748
4924
  const remapNamingContainer = componentIdToTransform => {
4749
4925
  // pattern :<anything> must be prepended by viewRoot if there is one,
@@ -4757,7 +4933,7 @@ var Implementation;
4757
4933
  const hasLeadingSep = componentIdToTransform.indexOf(SEP) === 0;
4758
4934
  const isAbsolutSearchExpr = hasLeadingSep || (rootNamingContainerId.length
4759
4935
  && componentIdToTransform.indexOf(rootNamingContainerPrefix) == 0);
4760
- let finalIdentifier;
4936
+ let finalIdentifier = "";
4761
4937
  if (isAbsolutSearchExpr) {
4762
4938
  //we cut off the leading sep if there is one
4763
4939
  componentIdToTransform = hasLeadingSep ? componentIdToTransform.substring(1) : componentIdToTransform;
@@ -4776,13 +4952,13 @@ var Implementation;
4776
4952
  [rootNamingContainerPrefix, componentIdToTransform].join(Const_1.EMPTY_STR) :
4777
4953
  [nearestNamingContainerPrefix, componentIdToTransform].join(Const_1.EMPTY_STR);
4778
4954
  }
4779
- // We need to double-check because we have scenarios where we have a naming container
4955
+ // We need to double check because we have scenarios where we have a naming container
4780
4956
  // and no prepend (aka tobago testcase "must handle ':' in IDs properly", scenario 3,
4781
4957
  // in this case we return the component id, and be happy
4782
4958
  // we can roll a dom check here
4783
4959
  return (!!document.getElementById(finalIdentifier)) ? finalIdentifier : componentIdToTransform;
4784
4960
  };
4785
- // in this case we do not use lazy stream because it won´t bring any code reduction
4961
+ // in this case we do not use lazy stream because it wont bring any code reduction
4786
4962
  // or speedup
4787
4963
  for (let cnt = 0; cnt < iterValues.length; cnt++) {
4788
4964
  //avoid doubles
@@ -4822,36 +4998,23 @@ var Implementation;
4822
4998
  * the values required for params-through are processed in the ajax request
4823
4999
  *
4824
5000
  * Note this is a bug carried over from the old implementation
4825
- * the spec conform behavior is to use params for pass - through values
5001
+ * the spec conform behavior is to use params for passthrough values
4826
5002
  * this will be removed soon, after it is cleared up whether removing
4827
5003
  * it breaks any legacy code
4828
5004
  *
4829
5005
  * @param {Context} mappedOpts the options to be filtered
5006
+ * @deprecated
4830
5007
  */
4831
5008
  function extractLegacyParams(mappedOpts) {
4832
5009
  //we now can use the full code reduction given by our stream api
4833
5010
  //to filter
4834
- return ofAssoc(mappedOpts)
4835
- .filter((item => !(item[0] in BlockFilter)))
4836
- .reduce(collectAssoc, {});
4837
- }
4838
- /**
4839
- * extracts the myfaces config parameters which provide extra functionality
4840
- * on top of JSF
4841
- * @param mappedOpts
4842
- * @private
4843
- */
4844
- function extractMyFacesParams(mappedOpts) {
4845
- var _a;
4846
- //we now can use the full code reduction given by our stream api
4847
- //to filter
4848
- return (_a = ofAssoc(mappedOpts)
4849
- .filter((item => (item[0] == "myfaces")))
4850
- .reduce(collectAssoc, {})) === null || _a === void 0 ? void 0 : _a[Const_1.MYFACES];
5011
+ return mona_dish_1.Stream.ofAssoc(mappedOpts)
5012
+ .filter(item => !(item[0] in BlockFilter))
5013
+ .collect(new mona_dish_1.AssocArrayCollector());
4851
5014
  }
4852
5015
  function remapArrayToAssocArr(arrayedParams) {
4853
5016
  if (Array.isArray(arrayedParams)) {
4854
- return arrayedParams.reduce(collectAssoc, {});
5017
+ return mona_dish_1.Stream.of(...arrayedParams).collect(new mona_dish_1.AssocArrayCollector());
4855
5018
  }
4856
5019
  return arrayedParams;
4857
5020
  }
@@ -5179,16 +5342,16 @@ var PushImpl;
5179
5342
  * limitations under the License.
5180
5343
  */
5181
5344
  Object.defineProperty(exports, "__esModule", ({ value: true }));
5182
- exports.CTX_OPTIONS_PARAMS = exports.TIMEOUT_EVENT = exports.CLIENT_ERROR = exports.SERVER_ERROR = exports.MALFORMEDXML = exports.EMPTY_RESPONSE = exports.HTTPERROR = exports.RESPONSE_XML = exports.RESPONSE_TEXT = exports.ERROR_MESSAGE = exports.ERROR_NAME = exports.STATUS = exports.SOURCE = exports.SUCCESS = exports.COMPLETE = exports.BEGIN = exports.ON_EVENT = exports.ON_ERROR = exports.EVENT = exports.ERROR = exports.WINDOW_ID = exports.CTX_PARAM_RENDER = exports.P_BEHAVIOR_EVENT = exports.P_WINDOW_ID = exports.P_RESET_VALUES = exports.P_EVT = exports.P_RENDER_OVERRIDE = exports.P_RENDER = exports.P_EXECUTE = exports.P_AJAX = exports.IDENT_FORM = exports.IDENT_THIS = exports.IDENT_NONE = exports.IDENT_ALL = exports.HTML_CLIENT_WINDOW = exports.HTML_VIEWSTATE = exports.EMPTY_MAP = exports.EMPTY_STR = exports.EMPTY_FUNC = exports.P_RESOURCE = exports.P_VIEWBODY = exports.P_VIEWHEAD = exports.P_VIEWROOT = exports.P_CLIENT_WINDOW = exports.P_VIEWSTATE = exports.VIEW_ID = exports.NAMING_CONTAINER_ID = exports.P_AJAX_SOURCE = exports.NAMED_VIEWROOT = exports.XML_ATTR_NAMED_VIEWROOT = void 0;
5183
- exports.XML_TAG_REDIRECT = exports.XML_TAG_EXTENSION = exports.XML_TAG_ATTRIBUTES = exports.XML_TAG_ERROR = exports.XML_TAG_EVAL = exports.XML_TAG_INSERT = exports.XML_TAG_DELETE = exports.XML_TAG_UPDATE = exports.XML_TAG_CHANGES = exports.XML_TAG_PARTIAL_RESP = exports.ATTR_ID = exports.ATTR_VALUE = exports.ATTR_NAME = exports.ATTR_URL = exports.MYFACES_OPTION_PPS = exports.ERR_NO_PARTIAL_RESPONSE = exports.PHASE_PROCESS_RESPONSE = exports.SEL_RESPONSE_XML = exports.SEL_CLIENT_WINDOW_ELEM = exports.SEL_VIEWSTATE_ELEM = exports.HTML_TAG_STYLE = exports.HTML_TAG_SCRIPT = exports.HTML_TAG_LINK = exports.HTML_TAG_BODY = exports.HTML_TAG_FORM = exports.HTML_TAG_HEAD = exports.STD_ACCEPT = exports.NO_TIMEOUT = exports.MULTIPART = exports.URL_ENCODED = exports.STATE_EVT_COMPLETE = exports.STATE_EVT_TIMEOUT = exports.STATE_EVT_BEGIN = exports.REQ_TYPE_POST = exports.REQ_TYPE_GET = exports.ENCODED_URL = exports.VAL_AJAX = exports.REQ_ACCEPT = exports.HEAD_FACES_REQ = exports.CONTENT_TYPE = exports.CTX_PARAM_PPS = exports.CTX_PARAM_REQ_PASS_THR = exports.CTX_PARAM_SRC_CTL_ID = exports.CTX_PARAM_SRC_FRM_ID = exports.CTX_PARAM_MF_INTERNAL = exports.CTX_OPTIONS_EXECUTE = exports.CTX_OPTIONS_RESET = exports.CTX_OPTIONS_TIMEOUT = exports.DELAY_NONE = exports.CTX_OPTIONS_DELAY = void 0;
5184
- exports.$nsp = exports.$faces = exports.UNKNOWN = exports.MAX_RECONNECT_ATTEMPTS = exports.RECONNECT_INTERVAL = exports.APPLIED_CLIENT_WINDOW = exports.APPLIED_VST = exports.REASON_EXPIRED = exports.MF_NONE = exports.MYFACES = exports.DEFERRED_HEAD_INSERTS = exports.UPDATE_ELEMS = exports.UPDATE_FORMS = exports.XML_TAG_ATTR = exports.XML_TAG_AFTER = exports.XML_TAG_BEFORE = void 0;
5345
+ exports.CTX_OPTIONS_PARAMS = exports.TIMEOUT_EVENT = exports.CLIENT_ERROR = exports.SERVER_ERROR = exports.MALFORMEDXML = exports.EMPTY_RESPONSE = exports.HTTPERROR = exports.RESPONSE_XML = exports.RESPONSE_TEXT = exports.ERROR_MESSAGE = exports.ERROR_NAME = exports.STATUS = exports.SOURCE = exports.SUCCESS = exports.COMPLETE = exports.BEGIN = exports.ON_EVENT = exports.ON_ERROR = exports.EVENT = exports.ERROR = exports.WINDOW_ID = exports.CTX_PARAM_RENDER = exports.P_BEHAVIOR_EVENT = exports.P_WINDOW_ID = exports.P_RESET_VALUES = exports.P_EVT = exports.P_RENDER_OVERRIDE = exports.P_RENDER = exports.P_EXECUTE = exports.P_AJAX = exports.IDENT_FORM = exports.IDENT_THIS = exports.IDENT_NONE = exports.IDENT_ALL = exports.HTML_CLIENT_WINDOW = exports.HTML_VIEWSTATE = exports.EMPTY_MAP = exports.EMPTY_STR = exports.EMPTY_FUNC = exports.P_RESOURCE = exports.P_VIEWBODY = exports.P_VIEWHEAD = exports.P_VIEWROOT = exports.P_CLIENT_WINDOW = exports.P_VIEWSTATE = exports.VIEW_ID = exports.NAMING_CONTAINER_ID = exports.P_PARTIAL_SOURCE = exports.NAMED_VIEWROOT = exports.XML_ATTR_NAMED_VIEWROOT = void 0;
5346
+ exports.XML_TAG_AFTER = exports.XML_TAG_BEFORE = exports.XML_TAG_REDIRECT = exports.XML_TAG_EXTENSION = exports.XML_TAG_ATTRIBUTES = exports.XML_TAG_ERROR = exports.XML_TAG_EVAL = exports.XML_TAG_INSERT = exports.XML_TAG_DELETE = exports.XML_TAG_UPDATE = exports.XML_TAG_CHANGES = exports.XML_TAG_PARTIAL_RESP = exports.ATTR_ID = exports.ATTR_VALUE = exports.ATTR_NAME = exports.ATTR_URL = exports.ERR_NO_PARTIAL_RESPONSE = exports.PHASE_PROCESS_RESPONSE = exports.SEL_RESPONSE_XML = exports.SEL_CLIENT_WINDOW_ELEM = exports.SEL_VIEWSTATE_ELEM = exports.HTML_TAG_STYLE = exports.HTML_TAG_SCRIPT = exports.HTML_TAG_LINK = exports.HTML_TAG_BODY = exports.HTML_TAG_FORM = exports.HTML_TAG_HEAD = exports.STD_ACCEPT = exports.NO_TIMEOUT = exports.MULTIPART = exports.URL_ENCODED = exports.STATE_EVT_COMPLETE = exports.STATE_EVT_TIMEOUT = exports.STATE_EVT_BEGIN = exports.REQ_TYPE_POST = exports.REQ_TYPE_GET = exports.ENCODED_URL = exports.VAL_AJAX = exports.REQ_ACCEPT = exports.HEAD_FACES_REQ = exports.CONTENT_TYPE = exports.CTX_PARAM_REQ_PASS_THR = exports.CTX_PARAM_SRC_CTL_ID = exports.CTX_PARAM_SRC_FRM_ID = exports.CTX_PARAM_MF_INTERNAL = exports.CTX_OPTIONS_EXECUTE = exports.CTX_OPTIONS_RESET = exports.CTX_OPTIONS_TIMEOUT = exports.DELAY_NONE = exports.CTX_OPTIONS_DELAY = void 0;
5347
+ exports.$nsp = exports.$faces = exports.UNKNOWN = exports.MAX_RECONNECT_ATTEMPTS = exports.RECONNECT_INTERVAL = exports.APPLIED_CLIENT_WINDOW = exports.APPLIED_VST = exports.REASON_EXPIRED = exports.MF_NONE = exports.MYFACES = exports.DEFERRED_HEAD_INSERTS = exports.UPDATE_ELEMS = exports.UPDATE_FORMS = exports.XML_TAG_ATTR = void 0;
5185
5348
  /*
5186
5349
  * [export const] constants
5187
5350
  */
5188
5351
  exports.XML_ATTR_NAMED_VIEWROOT = "namedViewRoot";
5189
5352
  exports.NAMED_VIEWROOT = "namedViewRoot";
5190
- exports.P_AJAX_SOURCE = "jakarta.faces.source";
5191
- exports.NAMING_CONTAINER_ID = "myfaces.NamingContainerId";
5353
+ exports.P_PARTIAL_SOURCE = "jakarta.faces.source";
5354
+ exports.NAMING_CONTAINER_ID = "myfaces.partialId";
5192
5355
  exports.VIEW_ID = "myfaces.viewId";
5193
5356
  exports.P_VIEWSTATE = "jakarta.faces.ViewState";
5194
5357
  exports.P_CLIENT_WINDOW = "jakarta.faces.ClientWindow";
@@ -5251,7 +5414,6 @@ exports.CTX_PARAM_MF_INTERNAL = "myfaces.internal";
5251
5414
  exports.CTX_PARAM_SRC_FRM_ID = "myfaces.source.formId";
5252
5415
  exports.CTX_PARAM_SRC_CTL_ID = "myfaces.source.controlId";
5253
5416
  exports.CTX_PARAM_REQ_PASS_THR = "myfaces.request.passThrough";
5254
- exports.CTX_PARAM_PPS = "myfaces.request.pps";
5255
5417
  exports.CONTENT_TYPE = "Content-Type";
5256
5418
  exports.HEAD_FACES_REQ = "Faces-Request";
5257
5419
  exports.REQ_ACCEPT = "Accept";
@@ -5277,7 +5439,6 @@ exports.SEL_CLIENT_WINDOW_ELEM = "[name='" + exports.P_CLIENT_WINDOW + "']";
5277
5439
  exports.SEL_RESPONSE_XML = "responseXML";
5278
5440
  exports.PHASE_PROCESS_RESPONSE = "processResponse";
5279
5441
  exports.ERR_NO_PARTIAL_RESPONSE = "Partial response not set";
5280
- exports.MYFACES_OPTION_PPS = "pps";
5281
5442
  exports.ATTR_URL = "url";
5282
5443
  exports.ATTR_NAME = "name";
5283
5444
  exports.ATTR_VALUE = "value";
@@ -5613,89 +5774,120 @@ var Assertions;
5613
5774
 
5614
5775
  /***/ }),
5615
5776
 
5616
- /***/ "./src/main/typescript/impl/util/AsyncRunnable.ts":
5617
- /*!********************************************************!*\
5618
- !*** ./src/main/typescript/impl/util/AsyncRunnable.ts ***!
5619
- \********************************************************/
5777
+ /***/ "./src/main/typescript/impl/util/AsyncQueue.ts":
5778
+ /*!*****************************************************!*\
5779
+ !*** ./src/main/typescript/impl/util/AsyncQueue.ts ***!
5780
+ \*****************************************************/
5620
5781
  /***/ ((__unused_webpack_module, exports) => {
5621
5782
 
5622
5783
 
5623
- /*! Licensed to the Apache Software Foundation (ASF) under one or more
5624
- * contributor license agreements. See the NOTICE file distributed with
5625
- * this work for additional information regarding copyright ownership.
5626
- * The ASF licenses this file to you under the Apache License, Version 2.0
5627
- * (the "License"); you may not use this file except in compliance with
5628
- * the License. You may obtain a copy of the License at
5629
- *
5630
- * http://www.apache.org/licenses/LICENSE-2.0
5631
- *
5632
- * Unless required by applicable law or agreed to in writing, software
5633
- * distributed under the License is distributed on an "AS IS" BASIS,
5634
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5635
- * See the License for the specific language governing permissions and
5636
- * limitations under the License.
5637
- */
5638
5784
  Object.defineProperty(exports, "__esModule", ({ value: true }));
5639
- exports.AsyncRunnable = void 0;
5785
+ exports.AsynchronousQueue = void 0;
5640
5786
  /**
5641
- * pretty much the same as cancellable Promise, but given
5642
- * we do not have that on browser level yet this is sort
5643
- * of a non - intrusive Shim!
5787
+ * Asynchronous queue which starts to work
5788
+ * through the callbacks until the queue is empty
5789
+ *
5790
+ * Every callback must be of async runnable
5791
+ * which is sort of an extended promise which has
5792
+ * added a dedicated cancel and start point
5793
+ *
5794
+ * This interface can be used as wrapper contract
5795
+ * for normal promises if needed.
5644
5796
  */
5645
- class AsyncRunnable {
5797
+ class AsynchronousQueue {
5646
5798
  constructor() {
5647
- /**
5648
- * helper support so that we do not have to drag in Promise shims
5649
- */
5650
- this.catchFunctions = [];
5651
- this.thenFunctions = [];
5799
+ this.runnableQueue = [];
5652
5800
  }
5653
5801
  /**
5654
- * resolve handler function which calls the then chain
5655
- * and after that finally
5656
- * @param data
5802
+ * simple is empty accessor, returns true if queue is empty atm
5657
5803
  */
5658
- resolve(data) {
5659
- this.thenFunctions.reduce((inputVal, thenFunc) => {
5660
- return thenFunc(inputVal);
5661
- }, data);
5804
+ get isEmpty() {
5805
+ return !this.runnableQueue.length;
5662
5806
  }
5663
5807
  /**
5664
- * reject handler function which triggers the catch chain
5665
- * @param data
5808
+ * enqueues an element and starts the
5809
+ * asynchronous work loop if not already running
5810
+ *
5811
+ * @param element the element to be queued and processed
5812
+ * @param delay possible delay after our usual process or drop if something newer is incoming algorithm
5666
5813
  */
5667
- reject(data) {
5668
- this.catchFunctions.reduce((inputVal, catchFunc) => {
5669
- return catchFunc(inputVal);
5670
- }, data);
5814
+ enqueue(element, delay = 0) {
5815
+ if (this.delayTimeout) {
5816
+ clearTimeout(this.delayTimeout);
5817
+ this.delayTimeout = null;
5818
+ }
5819
+ if (delay) {
5820
+ this.delayTimeout = setTimeout(() => {
5821
+ this.appendElement(element);
5822
+ });
5823
+ }
5824
+ else {
5825
+ this.appendElement(element);
5826
+ }
5671
5827
  }
5672
5828
  /**
5673
- * register a catch functor
5674
- * @param func the functor for the catch monad
5829
+ * fetches the next element from the queue (first in first out order)
5675
5830
  */
5676
- catch(func) {
5677
- this.catchFunctions.push(func);
5678
- return this;
5831
+ dequeue() {
5832
+ return this.runnableQueue.shift();
5679
5833
  }
5680
5834
  /**
5681
- * registers a finally functor
5682
- * @param func the functor for the finally handling chanin
5835
+ * clears up all elements from the queue
5683
5836
  */
5684
- finally(func) {
5685
- // no ie11 support we probably are going to revert to shims for that one
5686
- this.catchFunctions.push(func);
5687
- this.thenFunctions.push(func);
5688
- return this;
5837
+ cleanup() {
5838
+ this.currentlyRunning = null;
5839
+ this.runnableQueue.length = 0;
5689
5840
  }
5690
5841
  /**
5691
- * @param func then functor similar to promise
5842
+ * cancels the currently running element and then cleans up the queue
5843
+ * aka cancel the queue entirely
5692
5844
  */
5693
- then(func) {
5694
- this.thenFunctions.push(func);
5695
- return this;
5845
+ cancel() {
5846
+ try {
5847
+ if (this.currentlyRunning) {
5848
+ this.currentlyRunning.cancel();
5849
+ }
5850
+ }
5851
+ finally {
5852
+ this.cleanup();
5853
+ }
5854
+ }
5855
+ callForNextElementToProcess() {
5856
+ this.runEntry();
5857
+ }
5858
+ appendElement(element) {
5859
+ //only if the first element is added we start with a trigger
5860
+ //otherwise a process already is running and not finished yet at that
5861
+ //time
5862
+ this.runnableQueue.push(element);
5863
+ if (!this.currentlyRunning) {
5864
+ this.runEntry();
5865
+ }
5866
+ }
5867
+ runEntry() {
5868
+ if (this.isEmpty) {
5869
+ this.currentlyRunning = null;
5870
+ return;
5871
+ }
5872
+ this.currentlyRunning = this.dequeue();
5873
+ this.currentlyRunning
5874
+ .catch((e) => {
5875
+ //in case of an error we always clean up the remaining calls
5876
+ //to allow a clean recovery of the application
5877
+ this.cleanup();
5878
+ throw e;
5879
+ })
5880
+ .then(
5881
+ //the idea is to trigger the next over an event to reduce
5882
+ //the number of recursive calls (stacks might be limited
5883
+ //compared to ram)
5884
+ //naturally give we have a DOM, the DOM is the natural event dispatch system
5885
+ //which we can use, to decouple the calls from a recursive stack call
5886
+ //(the browser engine will take care of that)
5887
+ () => this.callForNextElementToProcess()).start();
5696
5888
  }
5697
5889
  }
5698
- exports.AsyncRunnable = AsyncRunnable;
5890
+ exports.AsynchronousQueue = AsynchronousQueue;
5699
5891
 
5700
5892
 
5701
5893
  /***/ }),
@@ -5804,7 +5996,6 @@ class ExtDomQuery extends mona_dish_1.DQ {
5804
5996
  * this is done once and only lazily
5805
5997
  */
5806
5998
  get nonce() {
5807
- var _a;
5808
5999
  //already processed
5809
6000
  let myfacesConfig = new ExtConfig(window.myfaces);
5810
6001
  let nonce = myfacesConfig.getIf("config", "cspMeta", "nonce");
@@ -5819,10 +6010,12 @@ class ExtDomQuery extends mona_dish_1.DQ {
5819
6010
  }
5820
6011
  // fallback if the currentScript method fails, we just search the jsf tags for nonce, this is
5821
6012
  // the last possibility
5822
- let nonceScript = mona_dish_1.Optional.fromNullable((_a = mona_dish_1.DQ
5823
- .querySelectorAll("script[src], link[src]").asArray
6013
+ let nonceScript = mona_dish_1.DQ
6014
+ .querySelectorAll("script[src], link[src]")
6015
+ .lazyStream
5824
6016
  .filter((item) => this.extractNonce(item) && item.attr(ATTR_SRC) != null)
5825
- .filter(item => IS_FACES_SOURCE(item.attr(ATTR_SRC).value))) === null || _a === void 0 ? void 0 : _a[0]);
6017
+ .filter(item => IS_FACES_SOURCE(item.attr(ATTR_SRC).value))
6018
+ .first();
5826
6019
  if (nonceScript.isPresent()) {
5827
6020
  return this.extractNonce(nonceScript.value);
5828
6021
  }
@@ -5837,15 +6030,14 @@ class ExtDomQuery extends mona_dish_1.DQ {
5837
6030
  * @param regExp
5838
6031
  */
5839
6032
  searchJsfJsFor(regExp) {
5840
- var _a;
5841
6033
  //perfect application for lazy stream
5842
- return mona_dish_1.Optional.fromNullable((_a = mona_dish_1.DQ.querySelectorAll("script[src], link[src]").asArray
6034
+ return mona_dish_1.DQ.querySelectorAll("script[src], link[src]").lazyStream
5843
6035
  .filter(item => IS_FACES_SOURCE(item.attr(ATTR_SRC).value))
5844
6036
  .map(item => item.attr(ATTR_SRC).value.match(regExp))
5845
6037
  .filter(item => item != null && item.length > 1)
5846
6038
  .map((result) => {
5847
6039
  return decodeURIComponent(result[1]);
5848
- })) === null || _a === void 0 ? void 0 : _a[0]);
6040
+ }).first();
5849
6041
  }
5850
6042
  globalEval(code, nonce) {
5851
6043
  return new ExtDomQuery(super.globalEval(code, nonce !== null && nonce !== void 0 ? nonce : this.nonce));
@@ -6004,7 +6196,7 @@ class ExtConfig extends mona_dish_1.Config {
6004
6196
  if (!this.$nspEnabled) {
6005
6197
  return accessPath;
6006
6198
  }
6007
- return [...accessPath].map(key => (0, Const_1.$nsp)(key));
6199
+ return mona_dish_1.Stream.of(...accessPath).map(key => (0, Const_1.$nsp)(key)).collect(new mona_dish_1.ArrayCollector());
6008
6200
  }
6009
6201
  }
6010
6202
  exports.ExtConfig = ExtConfig;
@@ -6020,7 +6212,8 @@ exports.ExtConfig = ExtConfig;
6020
6212
 
6021
6213
 
6022
6214
  Object.defineProperty(exports, "__esModule", ({ value: true }));
6023
- exports.getFormInputsAsArr = exports.fixEmptyParameters = exports.resolveFiles = exports.decodeEncodedValues = exports.encodeFormData = void 0;
6215
+ exports.getFormInputsAsStream = exports.fixEmmptyParameters = exports.resolveFiles = exports.decodeEncodedValues = exports.encodeFormData = void 0;
6216
+ const mona_dish_1 = __webpack_require__(/*! mona-dish */ "./node_modules/mona-dish/src/main/typescript/index_core.ts");
6024
6217
  const ExtDomQuery_1 = __webpack_require__(/*! ./ExtDomQuery */ "./src/main/typescript/impl/util/ExtDomQuery.ts");
6025
6218
  const Const_1 = __webpack_require__(/*! ../core/Const */ "./src/main/typescript/impl/core/Const.ts");
6026
6219
  /*
@@ -6038,16 +6231,18 @@ function encodeFormData(formData, paramsMapper = (inStr, inVal) => [inStr, inVal
6038
6231
  return defaultStr;
6039
6232
  }
6040
6233
  const assocValues = formData.value;
6041
- const expandValueArrAndRename = key => assocValues[key].map(val => paramsMapper(key, val));
6234
+ const expandValueArrAndRename = key => mona_dish_1.Stream.of(...assocValues[key]).map(val => paramsMapper(key, val));
6042
6235
  const isPropertyKey = key => assocValues.hasOwnProperty(key);
6043
6236
  const isNotFile = ([, value]) => !(value instanceof ExtDomQuery_1.ExtDomQuery.global().File);
6044
6237
  const mapIntoUrlParam = keyVal => `${encodeURIComponent(keyVal[0])}=${encodeURIComponent(keyVal[1])}`;
6045
- return Object.keys(assocValues)
6238
+ const entries = mona_dish_1.LazyStream.of(...Object.keys(assocValues))
6046
6239
  .filter(isPropertyKey)
6047
6240
  .flatMap(expandValueArrAndRename)
6241
+ //we cannot encode file elements that is handled by multipart requests anyway
6048
6242
  .filter(isNotFile)
6049
6243
  .map(mapIntoUrlParam)
6050
- .join("&");
6244
+ .collect(new mona_dish_1.ArrayCollector());
6245
+ return entries.join("&");
6051
6246
  }
6052
6247
  exports.encodeFormData = encodeFormData;
6053
6248
  /**
@@ -6064,7 +6259,9 @@ function decodeEncodedValues(encoded) {
6064
6259
  return [line.substring(0, index), line.substring(index + 1)];
6065
6260
  };
6066
6261
  let requestParamEntries = decodeURIComponent(encoded).split(/&/gi);
6067
- return requestParamEntries.filter(filterBlanks).map(splitKeyValuePair);
6262
+ return mona_dish_1.Stream.of(...requestParamEntries)
6263
+ .filter(filterBlanks)
6264
+ .map(splitKeyValuePair);
6068
6265
  }
6069
6266
  exports.decodeEncodedValues = decodeEncodedValues;
6070
6267
  /**
@@ -6072,26 +6269,20 @@ exports.decodeEncodedValues = decodeEncodedValues;
6072
6269
  * @param dataSource
6073
6270
  */
6074
6271
  function resolveFiles(dataSource) {
6075
- const expandFilesArr = ([key, files]) => {
6076
- return [...files].map(file => [key, file]);
6077
- };
6078
- const remapFileInput = fileInput => {
6079
- return [fileInput.name.value || fileInput.id.value, fileInput.filesFromElem(0)];
6080
- };
6081
- const files = dataSource
6272
+ const expandFilesArr = ([key, files]) => mona_dish_1.Stream.of(...files).map(file => [key, file]);
6273
+ const remapFileInput = fileInput => [fileInput.name.value || fileInput.id.value, fileInput.filesFromElem(0)];
6274
+ return dataSource
6082
6275
  .querySelectorAllDeep("input[type='file']")
6083
- .asArray;
6084
- const ret = files
6276
+ .stream
6085
6277
  .map(remapFileInput)
6086
6278
  .flatMap(expandFilesArr);
6087
- return ret;
6088
6279
  }
6089
6280
  exports.resolveFiles = resolveFiles;
6090
- function fixEmptyParameters(keyVal) {
6281
+ function fixEmmptyParameters(keyVal) {
6091
6282
  var _a, _b;
6092
6283
  return (keyVal.length < 3 ? [(_a = keyVal === null || keyVal === void 0 ? void 0 : keyVal[0]) !== null && _a !== void 0 ? _a : [], (_b = keyVal === null || keyVal === void 0 ? void 0 : keyVal[1]) !== null && _b !== void 0 ? _b : []] : keyVal);
6093
6284
  }
6094
- exports.fixEmptyParameters = fixEmptyParameters;
6285
+ exports.fixEmmptyParameters = fixEmmptyParameters;
6095
6286
  /**
6096
6287
  * returns the decoded viewState from parentItem
6097
6288
  * @param parentItem
@@ -6105,15 +6296,15 @@ function resolveViewState(parentItem) {
6105
6296
  }
6106
6297
  /**
6107
6298
  * gets all the inputs under the form parentItem
6108
- * as array
6299
+ * as stream
6109
6300
  * @param parentItem
6110
6301
  */
6111
- function getFormInputsAsArr(parentItem) {
6302
+ function getFormInputsAsStream(parentItem) {
6112
6303
  const standardInputs = resolveViewState(parentItem);
6113
6304
  const fileInputs = resolveFiles(parentItem);
6114
- return standardInputs.concat(...fileInputs);
6305
+ return standardInputs.concat(fileInputs);
6115
6306
  }
6116
- exports.getFormInputsAsArr = getFormInputsAsArr;
6307
+ exports.getFormInputsAsStream = getFormInputsAsStream;
6117
6308
 
6118
6309
 
6119
6310
  /***/ }),
@@ -6176,17 +6367,13 @@ class HiddenInputBuilder {
6176
6367
  var _a, _b, _c;
6177
6368
  const SEP = (0, Const_1.$faces)().separatorchar;
6178
6369
  let existingStates = (0, mona_dish_1.DQ$)(`[name*='${(0, Const_1.$nsp)(this.name)}']`);
6179
- let cnt = existingStates.asArray.map(state => {
6370
+ let cnt = existingStates.stream.map(state => {
6180
6371
  let ident = state.id.orElse("-1").value;
6181
6372
  ident = ident.substring(ident.lastIndexOf(SEP) + 1);
6182
6373
  return parseInt(ident);
6183
6374
  })
6184
- .filter(item => {
6185
- return !isNaN(item);
6186
- })
6187
- .reduce((item1, item2) => {
6188
- return Math.max(item1, item2);
6189
- }, -1);
6375
+ .filter(item => !isNaN(item))
6376
+ .reduce((item1, item2) => Math.max(item1, item2), -1).value;
6190
6377
  //the maximum new ident is the current max + 1
6191
6378
  cnt++;
6192
6379
  const newElement = mona_dish_1.DQ.fromMarkup((0, Const_1.$nsp)(this.template));
@@ -6302,7 +6489,7 @@ var ExtLang;
6302
6489
  var _a, _b;
6303
6490
  installedLocale = installedLocale !== null && installedLocale !== void 0 ? installedLocale : new Messages_1.Messages();
6304
6491
  let msg = (_b = (_a = installedLocale[key]) !== null && _a !== void 0 ? _a : defaultMessage) !== null && _b !== void 0 ? _b : key;
6305
- templateParams.forEach((param, cnt) => {
6492
+ mona_dish_1.Stream.of(...templateParams).each((param, cnt) => {
6306
6493
  msg = msg.replace(new RegExp(["\\{", cnt, "\\}"].join(Const_1.EMPTY_STR), "g"), param);
6307
6494
  });
6308
6495
  return msg;
@@ -6410,57 +6597,6 @@ var ExtLang;
6410
6597
  return (_g = (_d = (_c = (_b = (_a = localOptions.value) === null || _a === void 0 ? void 0 : _a.myfaces) === null || _b === void 0 ? void 0 : _b.config) === null || _c === void 0 ? void 0 : _c[configName]) !== null && _d !== void 0 ? _d : (_f = (_e = window === null || window === void 0 ? void 0 : window.myfaces) === null || _e === void 0 ? void 0 : _e.config) === null || _f === void 0 ? void 0 : _f[configName]) !== null && _g !== void 0 ? _g : defaultValue;
6411
6598
  }
6412
6599
  ExtLang.getLocalOrGlobalConfig = getLocalOrGlobalConfig;
6413
- /**
6414
- * expands an associative array into an array of key value tuples
6415
- * @param value
6416
- */
6417
- function ofAssoc(value) {
6418
- return Object.keys(value)
6419
- .map(key => [key, value[key]]);
6420
- }
6421
- ExtLang.ofAssoc = ofAssoc;
6422
- function collectAssoc(target, item) {
6423
- target[item[0]] = item[1];
6424
- return target;
6425
- }
6426
- ExtLang.collectAssoc = collectAssoc;
6427
- /**
6428
- * The active timeout for the "debounce".
6429
- * Since we only use it in the XhrController
6430
- * we can use a local module variable here
6431
- */
6432
- let activeTimeouts = {};
6433
- /**
6434
- * a simple debounce function
6435
- * which waits until a timeout is reached and
6436
- * if something comes in in between debounces
6437
- *
6438
- * @param runnable a runnable which should go under debounce control
6439
- * @param timeout a timeout for the debounce window
6440
- */
6441
- function debounce(key, runnable, timeout) {
6442
- function clearActiveTimeout() {
6443
- clearTimeout(activeTimeouts[key]);
6444
- delete activeTimeouts[key];
6445
- }
6446
- if (!!(activeTimeouts === null || activeTimeouts === void 0 ? void 0 : activeTimeouts[key])) {
6447
- clearActiveTimeout();
6448
- }
6449
- if (timeout > 0) {
6450
- activeTimeouts[key] = setTimeout(() => {
6451
- try {
6452
- runnable();
6453
- }
6454
- finally {
6455
- clearActiveTimeout();
6456
- }
6457
- }, timeout);
6458
- }
6459
- else {
6460
- runnable();
6461
- }
6462
- }
6463
- ExtLang.debounce = debounce;
6464
6600
  /**
6465
6601
  * assert that the form exists and throw an exception in the case it does not
6466
6602
  *
@@ -6474,122 +6610,6 @@ var ExtLang;
6474
6610
  })(ExtLang = exports.ExtLang || (exports.ExtLang = {}));
6475
6611
 
6476
6612
 
6477
- /***/ }),
6478
-
6479
- /***/ "./src/main/typescript/impl/util/XhrQueueController.ts":
6480
- /*!*************************************************************!*\
6481
- !*** ./src/main/typescript/impl/util/XhrQueueController.ts ***!
6482
- \*************************************************************/
6483
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6484
-
6485
-
6486
- Object.defineProperty(exports, "__esModule", ({ value: true }));
6487
- exports.XhrQueueController = void 0;
6488
- const Lang_1 = __webpack_require__(/*! ./Lang */ "./src/main/typescript/impl/util/Lang.ts");
6489
- var debounce = Lang_1.ExtLang.debounce;
6490
- /**
6491
- * A simple XHR queue controller
6492
- * following the async op -> next pattern
6493
- * Faces enforces for the XHR handling
6494
- */
6495
- class XhrQueueController {
6496
- constructor() {
6497
- this.queue = [];
6498
- this.taskRunning = false;
6499
- }
6500
- /**
6501
- * executes or enqueues an element
6502
- * @param runnable the runnable (request) to be enqueued
6503
- * @param timeOut timeout if > 0 which defers the execution
6504
- * until the debounce window for the timeout is closed.
6505
- */
6506
- enqueue(runnable, timeOut = 0) {
6507
- debounce("xhrQueue", () => {
6508
- const requestHandler = this.enrichRunnable(runnable);
6509
- if (!this.taskRunning) {
6510
- this.signalTaskRunning();
6511
- requestHandler.start();
6512
- }
6513
- else {
6514
- this.queue.push(requestHandler);
6515
- }
6516
- }, timeOut);
6517
- }
6518
- /**
6519
- * trigger the next element in the queue
6520
- * to be started!
6521
- */
6522
- next() {
6523
- this.updateTaskRunning();
6524
- const next = this.queue.shift();
6525
- next === null || next === void 0 ? void 0 : next.start();
6526
- }
6527
- /**
6528
- * clears and resets the queue
6529
- */
6530
- clear() {
6531
- this.queue.length = 0;
6532
- this.updateTaskRunning();
6533
- }
6534
- /**
6535
- * true if queue is empty
6536
- */
6537
- get isEmpty() {
6538
- return !this.queue.length;
6539
- }
6540
- /**
6541
- * Enriches the incoming async asyncRunnable
6542
- * with the error and next handling
6543
- * (aka: asyncRunnable is done -> next
6544
- * error -> clear queue
6545
- * @param asyncRunnable the async runnable which needs enrichment
6546
- * @private
6547
- */
6548
- enrichRunnable(asyncRunnable) {
6549
- /**
6550
- * we can use the Promise pattern asyncrunnable uses
6551
- * to trigger queue control callbacks of next element
6552
- * and clear the queue (theoretically this
6553
- * would work with any promise)
6554
- */
6555
- try {
6556
- return asyncRunnable
6557
- .then(() => this.next())
6558
- .catch((e) => this.handleError(e));
6559
- }
6560
- catch (e) {
6561
- this.handleError(e);
6562
- }
6563
- }
6564
- /**
6565
- * alerts the queue that a task is running
6566
- *
6567
- * @private
6568
- */
6569
- signalTaskRunning() {
6570
- this.taskRunning = true;
6571
- }
6572
- /**
6573
- * updates the task running status according to the current queue
6574
- * @private
6575
- */
6576
- updateTaskRunning() {
6577
- this.taskRunning = !this.isEmpty;
6578
- }
6579
- /**
6580
- * standard error handling
6581
- * we clear the queue and then bomb out
6582
- * @param e
6583
- * @private
6584
- */
6585
- handleError(e) {
6586
- this.clear();
6587
- throw e;
6588
- }
6589
- }
6590
- exports.XhrQueueController = XhrQueueController;
6591
-
6592
-
6593
6613
  /***/ }),
6594
6614
 
6595
6615
  /***/ "./src/main/typescript/impl/xhrCore/ErrorData.ts":
@@ -6717,8 +6737,8 @@ class EventData {
6717
6737
  eventData.type = Const_1.EVENT;
6718
6738
  eventData.status = name;
6719
6739
  let sourceId = context.getIf(Const_1.SOURCE)
6720
- .orElseLazy(() => context.getIf(Const_1.P_AJAX_SOURCE).value)
6721
- .orElseLazy(() => context.getIf(Const_1.CTX_PARAM_REQ_PASS_THR, Const_1.P_AJAX_SOURCE).value)
6740
+ .orElseLazy(() => context.getIf(Const_1.P_PARTIAL_SOURCE).value)
6741
+ .orElseLazy(() => context.getIf(Const_1.CTX_PARAM_REQ_PASS_THR, Const_1.P_PARTIAL_SOURCE).value)
6722
6742
  .value;
6723
6743
  if (sourceId) {
6724
6744
  eventData.source = mona_dish_1.DQ.byId(sourceId, true).first().value.value;
@@ -7275,8 +7295,6 @@ const Const_1 = __webpack_require__(/*! ../core/Const */ "./src/main/typescript/
7275
7295
  const ExtDomQuery_1 = __webpack_require__(/*! ../util/ExtDomQuery */ "./src/main/typescript/impl/util/ExtDomQuery.ts");
7276
7296
  const HiddenInputBuilder_1 = __webpack_require__(/*! ../util/HiddenInputBuilder */ "./src/main/typescript/impl/util/HiddenInputBuilder.ts");
7277
7297
  var trim = mona_dish_1.Lang.trim;
7278
- const Lang_1 = __webpack_require__(/*! ../util/Lang */ "./src/main/typescript/impl/util/Lang.ts");
7279
- var ofAssoc = Lang_1.ExtLang.ofAssoc;
7280
7298
  /**
7281
7299
  * Response processor
7282
7300
  *
@@ -7374,7 +7392,7 @@ class ResponseProcessor {
7374
7392
  * <error>
7375
7393
  */
7376
7394
  const mergedErrorData = new ExtDomQuery_1.ExtConfig({});
7377
- mergedErrorData.assign(Const_1.SOURCE).value = this.externalContext.getIf(Const_1.P_AJAX_SOURCE).get(0).value;
7395
+ mergedErrorData.assign(Const_1.SOURCE).value = this.externalContext.getIf(Const_1.P_PARTIAL_SOURCE).get(0).value;
7378
7396
  mergedErrorData.assign(Const_1.ERROR_NAME).value = node.querySelectorAll(Const_1.ERROR_NAME).textContent(Const_1.EMPTY_STR);
7379
7397
  mergedErrorData.assign(Const_1.ERROR_MESSAGE).value = node.querySelectorAll(Const_1.ERROR_MESSAGE).cDATAAsString;
7380
7398
  const hasResponseXML = this.internalContext.get(Const_1.RESPONSE_XML).isPresent();
@@ -7522,8 +7540,8 @@ class ResponseProcessor {
7522
7540
  * as last lifecycle step, before going into the next request.
7523
7541
  */
7524
7542
  fixViewStates() {
7525
- ofAssoc(this.internalContext.getIf(Const_1.APPLIED_VST).orElse({}).value)
7526
- .forEach(([, value]) => {
7543
+ mona_dish_1.Stream.ofAssoc(this.internalContext.getIf(Const_1.APPLIED_VST).orElse({}).value)
7544
+ .each(([, value]) => {
7527
7545
  const namingContainerId = this.internalContext.getIf(Const_1.NAMING_CONTAINER_ID);
7528
7546
  const namedViewRoot = !!this.internalContext.getIf(Const_1.NAMED_VIEWROOT).value;
7529
7547
  const affectedForms = this.getContainerForms(namingContainerId)
@@ -7536,8 +7554,8 @@ class ResponseProcessor {
7536
7554
  * is done.
7537
7555
  */
7538
7556
  fixClientWindow() {
7539
- ofAssoc(this.internalContext.getIf(Const_1.APPLIED_CLIENT_WINDOW).orElse({}).value)
7540
- .forEach(([, value]) => {
7557
+ mona_dish_1.Stream.ofAssoc(this.internalContext.getIf(Const_1.APPLIED_CLIENT_WINDOW).orElse({}).value)
7558
+ .each(([, value]) => {
7541
7559
  const namingContainerId = this.internalContext.getIf(Const_1.NAMING_CONTAINER_ID);
7542
7560
  const namedViewRoot = !!this.internalContext.getIf(Const_1.NAMED_VIEWROOT).value;
7543
7561
  const affectedForms = this.getContainerForms(namingContainerId)
@@ -7680,7 +7698,7 @@ class ResponseProcessor {
7680
7698
  .orElseLazy(() => this.externalContext.getIf((0, Const_1.$nsp)(Const_1.P_RENDER)).value)
7681
7699
  .orElse(Const_1.IDENT_NONE).value.split(/\s+/gi);
7682
7700
  const executeAndRenders = executes.concat(...renders);
7683
- return [...executeAndRenders].filter(nameOrId => {
7701
+ return mona_dish_1.LazyStream.of(...executeAndRenders).filter(nameOrId => {
7684
7702
  if ([Const_1.IDENT_ALL, Const_1.IDENT_NONE].indexOf(nameOrId) != -1) {
7685
7703
  return true;
7686
7704
  }
@@ -7689,7 +7707,7 @@ class ResponseProcessor {
7689
7707
  return affectedForm.matchesSelector(NAME_OR_ID) ||
7690
7708
  affectedForm.querySelectorAll(NAME_OR_ID).isPresent() ||
7691
7709
  affectedForm.firstParent(NAME_OR_ID).isPresent();
7692
- }).length > 0;
7710
+ }).first().isPresent();
7693
7711
  }
7694
7712
  /**
7695
7713
  * gets all forms under a single naming container id
@@ -7745,8 +7763,6 @@ exports.XhrFormData = void 0;
7745
7763
  const mona_dish_1 = __webpack_require__(/*! mona-dish */ "./node_modules/mona-dish/src/main/typescript/index_core.ts");
7746
7764
  const Const_1 = __webpack_require__(/*! ../core/Const */ "./src/main/typescript/impl/core/Const.ts");
7747
7765
  const FileUtils_1 = __webpack_require__(/*! ../util/FileUtils */ "./src/main/typescript/impl/util/FileUtils.ts");
7748
- const Lang_1 = __webpack_require__(/*! ../util/Lang */ "./src/main/typescript/impl/util/Lang.ts");
7749
- var ofAssoc = Lang_1.ExtLang.ofAssoc;
7750
7766
  const defaultParamsMapper = (key, item) => [key, item];
7751
7767
  /**
7752
7768
  * A unified form data class
@@ -7799,17 +7815,12 @@ class XhrFormData extends mona_dish_1.Config {
7799
7815
  */
7800
7816
  toFormData() {
7801
7817
  /*
7802
- * expands key: [item1, item2]
7803
- * to: [{key: key, value: item1}, {key: key, value: item2}]
7804
- */
7805
- let expandValueArrays = ([key, item]) => {
7806
- if (Array.isArray(item)) {
7807
- return item.map(value => {
7808
- return { key, value };
7809
- });
7810
- }
7811
- return [{ key, value: item }];
7812
- };
7818
+ * expands key: [item1, item2]
7819
+ * to: [{key: key, value: item1}, {key: key, value: item2}]
7820
+ */
7821
+ let expandAssocArray = ([key, item]) => mona_dish_1.Stream.of(...item).map(value => {
7822
+ return { key, value };
7823
+ });
7813
7824
  /*
7814
7825
  * remaps the incoming {key, value} tuples
7815
7826
  * to naming container prefixed keys and values
@@ -7821,13 +7832,10 @@ class XhrFormData extends mona_dish_1.Config {
7821
7832
  /*
7822
7833
  * collects everything into a FormData object
7823
7834
  */
7824
- return ofAssoc(this.value)
7825
- .flatMap(expandValueArrays)
7835
+ return mona_dish_1.Stream.ofAssoc(this.value)
7836
+ .flatMap(expandAssocArray)
7826
7837
  .map(remapForNamingContainer)
7827
- .reduce((formData, { key, value }) => {
7828
- formData.append(key, value);
7829
- return formData;
7830
- }, new FormData());
7838
+ .collect(new mona_dish_1.FormDataCollector());
7831
7839
  }
7832
7840
  /**
7833
7841
  * returns an encoded string representation of our xhr form data
@@ -7839,7 +7847,6 @@ class XhrFormData extends mona_dish_1.Config {
7839
7847
  }
7840
7848
  /**
7841
7849
  * generic post init code, for now, this performs some post assign data post-processing
7842
- * @param rootElement the root element which knows the request type (usually a form)
7843
7850
  * @param executes the executable dom nodes which need to be processed into the form data, which we can send
7844
7851
  * in our ajax request
7845
7852
  */
@@ -7864,21 +7871,18 @@ class XhrFormData extends mona_dish_1.Config {
7864
7871
  }
7865
7872
  /**
7866
7873
  * determines fields to submit
7874
+ * @param {Object} targetBuf - the target form buffer receiving the data
7867
7875
  * @param {Node} parentItem - form element item is nested in
7868
7876
  * @param {Array} partialIds - ids fo PPS
7869
7877
  */
7870
- encodeSubmittableFields(parentItem, partialIds = []) {
7878
+ encodeSubmittableFields(parentItem, partialIds) {
7879
+ const formInputs = (0, FileUtils_1.getFormInputsAsStream)(parentItem);
7871
7880
  const mergeIntoThis = ([key, value]) => this.append(key).value = value;
7872
7881
  const namingContainerRemap = ([key, value]) => this.paramsMapper(key, value);
7873
- const remappedPartialIds = partialIds.map(partialId => this.remapKeyForNamingContainer(partialId));
7874
- const partialIdsFilter = ([key, value]) => (!remappedPartialIds.length || key.indexOf("@") == 0) ? true :
7875
- remappedPartialIds.indexOf(key) != -1;
7876
- let inputs = (0, FileUtils_1.getFormInputsAsArr)(parentItem);
7877
- inputs
7878
- .map(FileUtils_1.fixEmptyParameters)
7882
+ formInputs
7883
+ .map(FileUtils_1.fixEmmptyParameters)
7879
7884
  .map(namingContainerRemap)
7880
- .filter(partialIdsFilter)
7881
- .forEach(mergeIntoThis);
7885
+ .each(mergeIntoThis);
7882
7886
  }
7883
7887
  remapKeyForNamingContainer(key) {
7884
7888
  return this.paramsMapper(key, "")[0];
@@ -7913,7 +7917,6 @@ exports.XhrFormData = XhrFormData;
7913
7917
  */
7914
7918
  Object.defineProperty(exports, "__esModule", ({ value: true }));
7915
7919
  exports.XhrRequest = void 0;
7916
- const AsyncRunnable_1 = __webpack_require__(/*! ../util/AsyncRunnable */ "./src/main/typescript/impl/util/AsyncRunnable.ts");
7917
7920
  const mona_dish_1 = __webpack_require__(/*! mona-dish */ "./node_modules/mona-dish/src/main/typescript/index_core.ts");
7918
7921
  const AjaxImpl_1 = __webpack_require__(/*! ../AjaxImpl */ "./src/main/typescript/impl/AjaxImpl.ts");
7919
7922
  const XhrFormData_1 = __webpack_require__(/*! ./XhrFormData */ "./src/main/typescript/impl/xhrCore/XhrFormData.ts");
@@ -7926,10 +7929,6 @@ var failSaveExecute = Lang_1.ExtLang.failSaveExecute;
7926
7929
  /**
7927
7930
  * Faces XHR Request Wrapper
7928
7931
  * as AsyncRunnable for our Asynchronous queue
7929
- * This means from the outside the
7930
- * xhr request is similar to a Promise in a way
7931
- * that you can add then and catch and finally callbacks.
7932
- *
7933
7932
  *
7934
7933
  * The idea is that we basically just enqueue
7935
7934
  * a single ajax request into our queue
@@ -7937,35 +7936,51 @@ var failSaveExecute = Lang_1.ExtLang.failSaveExecute;
7937
7936
  *
7938
7937
  *
7939
7938
  */
7940
- class XhrRequest extends AsyncRunnable_1.AsyncRunnable {
7939
+ class XhrRequest {
7941
7940
  /**
7942
7941
  * Required Parameters
7943
7942
  *
7943
+ * @param source the issuing element
7944
+ * @param sourceForm the form which is related to the issuing element
7944
7945
  * @param requestContext the request context with all pass through values
7945
- * @param internalContext internal context with internal info which is passed through, not used by the user
7946
+ *
7946
7947
  * Optional Parameters
7948
+ *
7949
+ * @param internalContext internal context with internal info which is passed through, not used by the user
7950
+ * @param partialIdsArray an optional restricting partial ids array for encoding
7947
7951
  * @param timeout optional xhr timeout
7948
7952
  * @param ajaxType optional request type, default "POST"
7949
7953
  * @param contentType optional content type, default "application/x-www-form-urlencoded"
7954
+ * @param xhrObject optional xhr object which must fulfill the XMLHTTPRequest api, default XMLHttpRequest
7950
7955
  */
7951
- constructor(requestContext, internalContext, timeout = Const_1.NO_TIMEOUT, ajaxType = Const_1.REQ_TYPE_POST, contentType = Const_1.URL_ENCODED) {
7952
- super();
7956
+ constructor(source, sourceForm, requestContext, internalContext, partialIdsArray = [], timeout = Const_1.NO_TIMEOUT, ajaxType = Const_1.REQ_TYPE_POST, contentType = Const_1.URL_ENCODED, xhrObject = new XMLHttpRequest()) {
7957
+ this.source = source;
7958
+ this.sourceForm = sourceForm;
7953
7959
  this.requestContext = requestContext;
7954
7960
  this.internalContext = internalContext;
7961
+ this.partialIdsArray = partialIdsArray;
7955
7962
  this.timeout = timeout;
7956
7963
  this.ajaxType = ajaxType;
7957
7964
  this.contentType = contentType;
7965
+ this.xhrObject = xhrObject;
7958
7966
  this.stopProgress = false;
7959
- this.xhrObject = new XMLHttpRequest();
7967
+ /**
7968
+ * helper support so that we do not have to drag in Promise shims
7969
+ */
7970
+ this.catchFunctions = [];
7971
+ this.thenFunctions = [];
7960
7972
  // we omit promises here because we have to deal with cancel functionality,
7961
7973
  // and promises to not provide that (yet) instead we have our async queue
7962
7974
  // which uses an api internally, which is very close to promises
7963
- this.registerXhrCallbacks((data) => this.resolve(data), (data) => this.reject(data));
7975
+ this.registerXhrCallbacks((data) => {
7976
+ this.resolve(data);
7977
+ }, (data) => {
7978
+ this.reject(data);
7979
+ });
7964
7980
  }
7965
7981
  start() {
7966
7982
  let ignoreErr = failSaveExecute;
7967
7983
  let xhrObject = this.xhrObject;
7968
- let sourceForm = mona_dish_1.DQ.byId(this.internalContext.getIf(Const_1.CTX_PARAM_SRC_FRM_ID).value);
7969
7984
  let executesArr = () => {
7970
7985
  return this.requestContext.getIf(Const_1.CTX_PARAM_REQ_PASS_THR, Const_1.P_EXECUTE).get(Const_1.IDENT_NONE).value.split(/\s+/gi);
7971
7986
  };
@@ -7978,14 +7993,13 @@ class XhrRequest extends AsyncRunnable_1.AsyncRunnable {
7978
7993
  // whatever the formData object delivers
7979
7994
  // the partialIdsArray arr is almost deprecated legacy code where we allowed to send a separate list of partial
7980
7995
  // ids for reduced load and server processing, this will be removed soon, we can handle the same via execute
7981
- const executes = executesArr();
7982
- const partialIdsArray = this.internalContext.getIf(Const_1.CTX_PARAM_PPS).value === true ? executes : [];
7983
- const formData = new XhrFormData_1.XhrFormData(sourceForm, (0, RequestDataResolver_1.resoveNamingContainerMapper)(this.internalContext), executes, partialIdsArray);
7996
+ // anyway TODO reimplement the partial ids array, we still do not have it in jsf the way we need it
7997
+ let formData = new XhrFormData_1.XhrFormData(this.sourceForm, (0, RequestDataResolver_1.resoveNamingContainerMapper)(this.internalContext), executesArr(), this.partialIdsArray);
7984
7998
  this.contentType = formData.isMultipartRequest ? "undefined" : this.contentType;
7985
7999
  // next step the pass through parameters are merged in for post params
7986
8000
  this.requestContext.$nspEnabled = false;
7987
- const requestContext = this.requestContext;
7988
- const requestPassThroughParams = requestContext.getIf(Const_1.CTX_PARAM_REQ_PASS_THR);
8001
+ let requestContext = this.requestContext;
8002
+ let requestPassThroughParams = requestContext.getIf(Const_1.CTX_PARAM_REQ_PASS_THR);
7989
8003
  // we are turning off here the jsf, faces remapping because we are now dealing with
7990
8004
  // pass-through parameters
7991
8005
  requestPassThroughParams.$nspEnabled = false;
@@ -7996,20 +8010,17 @@ class XhrRequest extends AsyncRunnable_1.AsyncRunnable {
7996
8010
  formData.shallowMerge(requestPassThroughParams, true, true);
7997
8011
  }
7998
8012
  finally {
7999
- // unfortunately as long as we support
8000
- // both namespaces we have to keep manual control
8001
- // on the key renaming before doing ops like deep copy
8002
8013
  this.requestContext.$nspEnabled = true;
8003
8014
  requestPassThroughParams.$nspEnabled = true;
8004
8015
  }
8005
8016
  this.responseContext = requestPassThroughParams.deepCopy;
8006
8017
  // we have to shift the internal passthroughs around to build up our response context
8007
- const responseContext = this.responseContext;
8018
+ let responseContext = this.responseContext;
8008
8019
  responseContext.assign(Const_1.CTX_PARAM_MF_INTERNAL).value = this.internalContext.value;
8009
- // per spec the onEvent and onError handlers must be passed through to the response
8020
+ // per spec the onevent and onerror handlers must be passed through to the response
8010
8021
  responseContext.assign(Const_1.ON_EVENT).value = requestContext.getIf(Const_1.ON_EVENT).value;
8011
8022
  responseContext.assign(Const_1.ON_ERROR).value = requestContext.getIf(Const_1.ON_ERROR).value;
8012
- xhrObject.open(this.ajaxType, (0, RequestDataResolver_1.resolveFinalUrl)(sourceForm, formData, this.ajaxType), true);
8023
+ xhrObject.open(this.ajaxType, (0, RequestDataResolver_1.resolveFinalUrl)(this.sourceForm, formData, this.ajaxType), true);
8013
8024
  // adding timeout
8014
8025
  this.timeout ? xhrObject.timeout = this.timeout : null;
8015
8026
  // a bug in the xhr stub library prevents the setRequestHeader to be properly executed on fake xhr objects
@@ -8034,14 +8045,36 @@ class XhrRequest extends AsyncRunnable_1.AsyncRunnable {
8034
8045
  }
8035
8046
  cancel() {
8036
8047
  try {
8037
- // this causes onError to be called where the error
8038
- // handling takes over
8039
8048
  this.xhrObject.abort();
8040
8049
  }
8041
8050
  catch (e) {
8042
8051
  this.handleError(e);
8043
8052
  }
8044
8053
  }
8054
+ resolve(data) {
8055
+ mona_dish_1.Stream.of(...this.thenFunctions).reduce((inputVal, thenFunc) => {
8056
+ return thenFunc(inputVal);
8057
+ }, data);
8058
+ }
8059
+ reject(data) {
8060
+ mona_dish_1.Stream.of(...this.catchFunctions).reduce((inputVal, catchFunc) => {
8061
+ return catchFunc(inputVal);
8062
+ }, data);
8063
+ }
8064
+ catch(func) {
8065
+ this.catchFunctions.push(func);
8066
+ return this;
8067
+ }
8068
+ finally(func) {
8069
+ // no ie11 support we probably are going to revert to shims for that one
8070
+ this.catchFunctions.push(func);
8071
+ this.thenFunctions.push(func);
8072
+ return this;
8073
+ }
8074
+ then(func) {
8075
+ this.thenFunctions.push(func);
8076
+ return this;
8077
+ }
8045
8078
  /**
8046
8079
  * attaches the internal event and processing
8047
8080
  * callback within the promise to our xhr object
@@ -8050,7 +8083,7 @@ class XhrRequest extends AsyncRunnable_1.AsyncRunnable {
8050
8083
  * @param reject
8051
8084
  */
8052
8085
  registerXhrCallbacks(resolve, reject) {
8053
- const xhrObject = this.xhrObject;
8086
+ let xhrObject = this.xhrObject;
8054
8087
  xhrObject.onabort = () => {
8055
8088
  this.onAbort(reject);
8056
8089
  };
@@ -8064,17 +8097,13 @@ class XhrRequest extends AsyncRunnable_1.AsyncRunnable {
8064
8097
  this.onDone(this.xhrObject, resolve);
8065
8098
  };
8066
8099
  xhrObject.onerror = (errorData) => {
8067
- // some browsers trigger an error when cancelling a request internally, or when
8068
- // cancel is called from outside
8100
+ // some browsers trigger an error when cancelling a request internally
8069
8101
  // in this case we simply ignore the request and clear up the queue, because
8070
8102
  // it is not safe anymore to proceed with the current queue
8071
8103
  // This bypasses a Safari issue where it keeps requests hanging after page unload
8072
8104
  // and then triggers a cancel error on then instead of just stopping
8073
8105
  // and clearing the code
8074
8106
  if (this.isCancelledResponse(this.xhrObject)) {
8075
- /*
8076
- * this triggers the catch chain and after that finally
8077
- */
8078
8107
  reject();
8079
8108
  this.stopProgress = true;
8080
8109
  return;
@@ -8115,12 +8144,14 @@ class XhrRequest extends AsyncRunnable_1.AsyncRunnable {
8115
8144
  handleMalFormedXML(resolve) {
8116
8145
  var _a;
8117
8146
  this.stopProgress = true;
8118
- const errorData = {
8147
+ let errorData = {
8119
8148
  type: Const_1.ERROR,
8120
8149
  status: Const_1.MALFORMEDXML,
8121
8150
  responseCode: 200,
8122
8151
  responseText: (_a = this.xhrObject) === null || _a === void 0 ? void 0 : _a.responseText,
8123
- source: this.internalContext.getIf(Const_1.CTX_PARAM_SRC_CTL_ID).value
8152
+ // we remap the element just in case it gets replaced
8153
+ // it will be unremapped
8154
+ source: this.source.id.value
8124
8155
  };
8125
8156
  try {
8126
8157
  this.handleError(errorData, true);
@@ -8137,20 +8168,14 @@ class XhrRequest extends AsyncRunnable_1.AsyncRunnable {
8137
8168
  if (this.stopProgress) {
8138
8169
  return;
8139
8170
  }
8140
- /**
8141
- * now call the then chain
8142
- */
8143
8171
  resolve(data);
8144
8172
  }
8145
8173
  onError(errorData, reject) {
8146
8174
  this.handleError(errorData);
8147
- /*
8148
- * this triggers the catch chain and after that finally
8149
- */
8150
8175
  reject();
8151
8176
  }
8152
8177
  sendRequest(formData) {
8153
- const isPost = this.ajaxType != Const_1.REQ_TYPE_GET;
8178
+ let isPost = this.ajaxType != Const_1.REQ_TYPE_GET;
8154
8179
  if (formData.isMultipartRequest) {
8155
8180
  // in case of a multipart request we send in a formData object as body
8156
8181
  this.xhrObject.send((isPost) ? formData.toFormData() : null);
@@ -8165,7 +8190,7 @@ class XhrRequest extends AsyncRunnable_1.AsyncRunnable {
8165
8190
  */
8166
8191
  sendEvent(evtType) {
8167
8192
  var _a;
8168
- const eventData = EventData_1.EventData.createFromRequest(this.xhrObject, this.requestContext, evtType);
8193
+ let eventData = EventData_1.EventData.createFromRequest(this.xhrObject, this.requestContext, evtType);
8169
8194
  try {
8170
8195
  // User code error, we might cover
8171
8196
  // this in onError, but also we cannot swallow it.
@@ -8181,8 +8206,8 @@ class XhrRequest extends AsyncRunnable_1.AsyncRunnable {
8181
8206
  }
8182
8207
  }
8183
8208
  handleError(exception, responseFormatError = false) {
8184
- const errorData = (responseFormatError) ? ErrorData_1.ErrorData.fromHttpConnection(exception.source, exception.type, exception.status, exception.responseText, exception.responseCode, exception.status) : ErrorData_1.ErrorData.fromClient(exception);
8185
- const eventHandler = (0, RequestDataResolver_1.resolveHandlerFunc)(this.requestContext, this.responseContext, Const_1.ON_ERROR);
8209
+ let errorData = (responseFormatError) ? ErrorData_1.ErrorData.fromHttpConnection(exception.source, exception.type, exception.status, exception.responseText, exception.responseCode, exception.status) : ErrorData_1.ErrorData.fromClient(exception);
8210
+ let eventHandler = (0, RequestDataResolver_1.resolveHandlerFunc)(this.requestContext, this.responseContext, Const_1.ON_ERROR);
8186
8211
  AjaxImpl_1.Implementation.sendError(errorData, eventHandler);
8187
8212
  }
8188
8213
  }
@@ -8216,7 +8241,6 @@ exports.XhrRequest = XhrRequest;
8216
8241
  Object.defineProperty(exports, "__esModule", ({ value: true }));
8217
8242
  exports.oam = void 0;
8218
8243
  const mona_dish_1 = __webpack_require__(/*! mona-dish */ "./node_modules/mona-dish/src/main/typescript/index_core.ts");
8219
- const Lang_1 = __webpack_require__(/*! ../impl/util/Lang */ "./src/main/typescript/impl/util/Lang.ts");
8220
8244
  /**
8221
8245
  * legacy code to enable various aspects
8222
8246
  * of myfaces, used to be rendered inline
@@ -8230,7 +8254,6 @@ const Lang_1 = __webpack_require__(/*! ../impl/util/Lang */ "./src/main/typescri
8230
8254
  */
8231
8255
  var oam;
8232
8256
  (function (oam) {
8233
- var ofAssoc = Lang_1.ExtLang.ofAssoc;
8234
8257
  /**
8235
8258
  * sets a hidden input field
8236
8259
  * @param formName the formName
@@ -8286,8 +8309,8 @@ var oam;
8286
8309
  if (((_d = (_c = (_b = window === null || window === void 0 ? void 0 : window.myfaces) === null || _b === void 0 ? void 0 : _b.core) === null || _c === void 0 ? void 0 : _c.config) === null || _d === void 0 ? void 0 : _d.autoScroll) && (window === null || window === void 0 ? void 0 : window.getScrolling)) {
8287
8310
  myfaces.oam.setHiddenInput(formName, 'autoScroll', window === null || window === void 0 ? void 0 : window.getScrolling());
8288
8311
  }
8289
- let paramsStream = Array.isArray(params) ? [...params] : ofAssoc(params);
8290
- paramsStream.forEach(([key, data]) => myfaces.oam.setHiddenInput(formName, key, data));
8312
+ let paramsStream = Array.isArray(params) ? mona_dish_1.Stream.of(...params) : mona_dish_1.Stream.ofAssoc(params);
8313
+ paramsStream.each(([key, data]) => myfaces.oam.setHiddenInput(formName, key, data));
8291
8314
  //we call the namespaced function, to allow decoration, via a direct call we would
8292
8315
  myfaces.oam.setHiddenInput(formName, `${formName}:_idcl`, linkId !== null && linkId !== void 0 ? linkId : '');
8293
8316
  mona_dish_1.DQ.byId((_f = (_e = document.forms) === null || _e === void 0 ? void 0 : _e[formName]) !== null && _f !== void 0 ? _f : document.getElementById(formName)).each(form => {
@@ -8315,7 +8338,7 @@ var oam;
8315
8338
  form.getAsElem(0).value.setAttribute("target", oldTarget);
8316
8339
  }
8317
8340
  // noinspection JSUnusedLocalSymbols
8318
- paramsStream.forEach(([key, data]) => {
8341
+ paramsStream.each(([key, data]) => {
8319
8342
  myfaces.oam.clearHiddenInput(formName, key);
8320
8343
  });
8321
8344
  myfaces.oam.clearHiddenInput(formName, `${formName}:_idcl`);