@kontur.candy/generator 4.277.0-fs-7292-normalization-fixes.2 → 4.277.0-fs-7292-normalization-fixes.5

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 (2) hide show
  1. package/dist/index.js +214 -170
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -112395,7 +112395,7 @@ class KCLangRuntimeUtils {
112395
112395
  }
112396
112396
 
112397
112397
  dateNow() {
112398
- return new Date().toLocaleString("en-GB").replace(",", "");
112398
+ return new Date().toLocaleDateString("ru-RU");
112399
112399
  }
112400
112400
 
112401
112401
  }
@@ -112412,8 +112412,7 @@ KCLangRuntimeUtils.kcLangUtilsName = "kcLangUtils";
112412
112412
  "use strict";
112413
112413
  __webpack_require__.r(__webpack_exports__);
112414
112414
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
112415
- /* harmony export */ "buildIterationSequence": () => (/* binding */ buildIterationSequence),
112416
- /* harmony export */ "removeLastPartAfterMultiplicity": () => (/* binding */ removeLastPartAfterMultiplicity)
112415
+ /* harmony export */ "buildIterationSequence": () => (/* binding */ buildIterationSequence)
112417
112416
  /* harmony export */ });
112418
112417
  /* harmony import */ var _ModelPath__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ModelPath */ "./Common/ModelPath/ModelPath.ts");
112419
112418
 
@@ -112432,11 +112431,6 @@ function buildIterationSequence(modelPath) {
112432
112431
 
112433
112432
  return result;
112434
112433
  }
112435
- function removeLastPartAfterMultiplicity(modelPath) {
112436
- const tokens = modelPath.getPathPartsAsArray();
112437
- const lastIndex = Math.max(tokens.lastIndexOf(_ModelPath__WEBPACK_IMPORTED_MODULE_0__.PathTokens.each), tokens.lastIndexOf(_ModelPath__WEBPACK_IMPORTED_MODULE_0__.PathTokens.current));
112438
- return lastIndex > 0 ? (0,_ModelPath__WEBPACK_IMPORTED_MODULE_0__.createAbsoluteFromTokens)(tokens.slice(0, lastIndex)) : modelPath;
112439
- }
112440
112434
 
112441
112435
  /***/ }),
112442
112436
 
@@ -112630,9 +112624,11 @@ __webpack_require__.r(__webpack_exports__);
112630
112624
  /* harmony export */ });
112631
112625
  /* harmony import */ var _IterableUtils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../IterableUtils */ "./Common/IterableUtils.ts");
112632
112626
  /* harmony import */ var _TypingUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../TypingUtils */ "./Common/TypingUtils.ts");
112633
- /* harmony import */ var _EachCurrentCollision__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./EachCurrentCollision */ "./Common/ModelPath/EachCurrentCollision.ts");
112634
- /* harmony import */ var _ModelPathBuilder__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./ModelPathBuilder */ "./Common/ModelPath/ModelPathBuilder.ts");
112635
- /* harmony import */ var _PathMatcher__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./PathMatcher */ "./Common/ModelPath/PathMatcher.ts");
112627
+ /* harmony import */ var _hashUtils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../hashUtils */ "./Common/hashUtils.ts");
112628
+ /* harmony import */ var _EachCurrentCollision__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./EachCurrentCollision */ "./Common/ModelPath/EachCurrentCollision.ts");
112629
+ /* harmony import */ var _ModelPathBuilder__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ModelPathBuilder */ "./Common/ModelPath/ModelPathBuilder.ts");
112630
+ /* harmony import */ var _PathMatcher__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./PathMatcher */ "./Common/ModelPath/PathMatcher.ts");
112631
+
112636
112632
 
112637
112633
 
112638
112634
 
@@ -112778,7 +112774,11 @@ class AbsoluteModelFieldPath {
112778
112774
  this.field = fieldName;
112779
112775
  }
112780
112776
 
112781
- isEquals(modelPath, eachCurrentCollision = _EachCurrentCollision__WEBPACK_IMPORTED_MODULE_2__.EachCurrentCollision.AreSame) {
112777
+ getHash() {
112778
+ return this.path.getHash() + (0,_hashUtils__WEBPACK_IMPORTED_MODULE_2__.getSimpleHashByString)(this.field);
112779
+ }
112780
+
112781
+ isEquals(modelPath, eachCurrentCollision = _EachCurrentCollision__WEBPACK_IMPORTED_MODULE_3__.EachCurrentCollision.AreSame) {
112782
112782
  return this.path.isEquals(modelPath.path, eachCurrentCollision) && this.field === modelPath.field;
112783
112783
  }
112784
112784
 
@@ -112923,8 +112923,8 @@ class ModelPathImpl {
112923
112923
  return (_this$legacyPath = this.legacyPath) !== null && _this$legacyPath !== void 0 ? _this$legacyPath : this.legacyPath = this.tokens.map(x => this.pathPartToString(x)).join("/");
112924
112924
  }
112925
112925
 
112926
- isEquals(modelPath, eachCurrentCollision = _EachCurrentCollision__WEBPACK_IMPORTED_MODULE_2__.EachCurrentCollision.AreSame) {
112927
- if (eachCurrentCollision === _EachCurrentCollision__WEBPACK_IMPORTED_MODULE_2__.EachCurrentCollision.AreSame) {
112926
+ isEquals(modelPath, eachCurrentCollision = _EachCurrentCollision__WEBPACK_IMPORTED_MODULE_3__.EachCurrentCollision.AreSame) {
112927
+ if (eachCurrentCollision === _EachCurrentCollision__WEBPACK_IMPORTED_MODULE_3__.EachCurrentCollision.AreSame) {
112928
112928
  return this.toLegacyPath() === modelPath.toLegacyPath();
112929
112929
  } else {
112930
112930
  return this.isAbsolute() === modelPath.isAbsolute() && Iterator.from(_IterableUtils__WEBPACK_IMPORTED_MODULE_0__.IterUtils.zip(this.getPathParts(), modelPath.getPathParts())).every(([t1, t2]) => t1 === t2);
@@ -112935,7 +112935,7 @@ class ModelPathImpl {
112935
112935
  */
112936
112936
 
112937
112937
 
112938
- getHash(eachCurrentCollision = _EachCurrentCollision__WEBPACK_IMPORTED_MODULE_2__.EachCurrentCollision.AreSame) {
112938
+ getHash(eachCurrentCollision = _EachCurrentCollision__WEBPACK_IMPORTED_MODULE_3__.EachCurrentCollision.AreSame) {
112939
112939
  let hash = 5381;
112940
112940
 
112941
112941
  for (const token of (0,_IterableUtils__WEBPACK_IMPORTED_MODULE_0__.reverseArray)(this.tokens)) {
@@ -112944,7 +112944,7 @@ class ModelPathImpl {
112944
112944
  if (PathTokens.isSimpleToken(token)) {
112945
112945
  currentStr = token;
112946
112946
  } else {
112947
- if (eachCurrentCollision === _EachCurrentCollision__WEBPACK_IMPORTED_MODULE_2__.EachCurrentCollision.AreDifferent) {
112947
+ if (eachCurrentCollision === _EachCurrentCollision__WEBPACK_IMPORTED_MODULE_3__.EachCurrentCollision.AreDifferent) {
112948
112948
  currentStr = token === PathTokens.each ? "*" : "!";
112949
112949
  } else {
112950
112950
  currentStr = "*";
@@ -113027,11 +113027,11 @@ class ModelPathImpl {
113027
113027
  throw new Error(`Cannot match non absolute path '${modelPath.toString()}'`);
113028
113028
  }
113029
113029
 
113030
- return _PathMatcher__WEBPACK_IMPORTED_MODULE_4__.PathMatcher.match(this.tokens, modelPath.getPathPartsAsArray());
113030
+ return _PathMatcher__WEBPACK_IMPORTED_MODULE_5__.PathMatcher.match(this.tokens, modelPath.getPathPartsAsArray());
113031
113031
  }
113032
113032
 
113033
113033
  *splitByMultiplicity() {
113034
- let lastSimpleParts = new _ModelPathBuilder__WEBPACK_IMPORTED_MODULE_3__.ModelPathBuilder(this.isAbsolute());
113034
+ let lastSimpleParts = new _ModelPathBuilder__WEBPACK_IMPORTED_MODULE_4__.ModelPathBuilder(this.isAbsolute());
113035
113035
 
113036
113036
  for (const token of this.tokens) {
113037
113037
  if (PathTokens.isSimpleToken(token)) {
@@ -113039,7 +113039,7 @@ class ModelPathImpl {
113039
113039
  } else {
113040
113040
  if (!lastSimpleParts.empty) {
113041
113041
  yield lastSimpleParts.toResolvedPath();
113042
- lastSimpleParts = new _ModelPathBuilder__WEBPACK_IMPORTED_MODULE_3__.ModelPathBuilder(false);
113042
+ lastSimpleParts = new _ModelPathBuilder__WEBPACK_IMPORTED_MODULE_4__.ModelPathBuilder(false);
113043
113043
  }
113044
113044
 
113045
113045
  yield token;
@@ -113112,7 +113112,7 @@ class ModelPathImpl {
113112
113112
  }
113113
113113
 
113114
113114
  *getAllParentPaths() {
113115
- const result = new _ModelPathBuilder__WEBPACK_IMPORTED_MODULE_3__.ModelPathBuilder(this.isAbsolute());
113115
+ const result = new _ModelPathBuilder__WEBPACK_IMPORTED_MODULE_4__.ModelPathBuilder(this.isAbsolute());
113116
113116
 
113117
113117
  for (const token of _IterableUtils__WEBPACK_IMPORTED_MODULE_0__.IterUtils.skipLast(this.getPathParts(), 1)) {
113118
113118
  result.append(token);
@@ -113131,7 +113131,7 @@ class ModelPathImpl {
113131
113131
  }
113132
113132
 
113133
113133
  getParentPath() {
113134
- const result = new _ModelPathBuilder__WEBPACK_IMPORTED_MODULE_3__.ModelPathBuilder(this.absolute);
113134
+ const result = new _ModelPathBuilder__WEBPACK_IMPORTED_MODULE_4__.ModelPathBuilder(this.absolute);
113135
113135
 
113136
113136
  for (const token of _IterableUtils__WEBPACK_IMPORTED_MODULE_0__.IterUtils.skipLast(this.getPathParts(), 1)) {
113137
113137
  result.append(token);
@@ -113148,7 +113148,7 @@ class ModelPathImpl {
113148
113148
  }
113149
113149
 
113150
113150
  let instanceCounter = 0;
113151
- const result = new _ModelPathBuilder__WEBPACK_IMPORTED_MODULE_3__.ModelPathBuilder(true);
113151
+ const result = new _ModelPathBuilder__WEBPACK_IMPORTED_MODULE_4__.ModelPathBuilder(true);
113152
113152
 
113153
113153
  for (const token of this.getPathParts()) {
113154
113154
  if (PathTokens.isMultiToken(token) && instanceCounter < instances.length) {
@@ -113648,6 +113648,29 @@ function assertIs(value) {// noop
113648
113648
 
113649
113649
  /***/ }),
113650
113650
 
113651
+ /***/ "./Common/hashUtils.ts":
113652
+ /*!*****************************!*\
113653
+ !*** ./Common/hashUtils.ts ***!
113654
+ \*****************************/
113655
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
113656
+
113657
+ "use strict";
113658
+ __webpack_require__.r(__webpack_exports__);
113659
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
113660
+ /* harmony export */ "getSimpleHashByString": () => (/* binding */ getSimpleHashByString)
113661
+ /* harmony export */ });
113662
+ function getSimpleHashByString(source) {
113663
+ let result = 0;
113664
+
113665
+ for (let index = 0; index < source.length; index++) {
113666
+ result = (result << 5) - result + source.charCodeAt(index) | 0;
113667
+ }
113668
+
113669
+ return result;
113670
+ }
113671
+
113672
+ /***/ }),
113673
+
113651
113674
  /***/ "./Engine/src/Controls/FormParts/Unit/UnitId/UnitId.ts":
113652
113675
  /*!*************************************************************!*\
113653
113676
  !*** ./Engine/src/Controls/FormParts/Unit/UnitId/UnitId.ts ***!
@@ -127264,9 +127287,8 @@ class FormulaProcessor {
127264
127287
 
127265
127288
  afterDateNowExpression(expression) {
127266
127289
  const createDate = _babel_types__WEBPACK_IMPORTED_MODULE_0__.newExpression(_babel_types__WEBPACK_IMPORTED_MODULE_0__.identifier("Date"), []);
127267
- const date = _babel_types__WEBPACK_IMPORTED_MODULE_0__.callExpression(_babel_types__WEBPACK_IMPORTED_MODULE_0__.memberExpression(createDate, _babel_types__WEBPACK_IMPORTED_MODULE_0__.identifier("toLocaleString")), [_babel_types__WEBPACK_IMPORTED_MODULE_0__.stringLiteral("en-GB")]);
127268
- const formatDate = _babel_types__WEBPACK_IMPORTED_MODULE_0__.callExpression(_babel_types__WEBPACK_IMPORTED_MODULE_0__.memberExpression(date, _babel_types__WEBPACK_IMPORTED_MODULE_0__.identifier("replace")), [_babel_types__WEBPACK_IMPORTED_MODULE_0__.stringLiteral(","), _babel_types__WEBPACK_IMPORTED_MODULE_0__.stringLiteral("")]);
127269
- this.returnExpression(formatDate);
127290
+ const date = _babel_types__WEBPACK_IMPORTED_MODULE_0__.callExpression(_babel_types__WEBPACK_IMPORTED_MODULE_0__.memberExpression(createDate, _babel_types__WEBPACK_IMPORTED_MODULE_0__.identifier("toLocaleDateString")), [_babel_types__WEBPACK_IMPORTED_MODULE_0__.stringLiteral("ru-RU")]);
127291
+ this.returnExpression(date);
127270
127292
  }
127271
127293
 
127272
127294
  beforeGtExpression(expression) {
@@ -128337,7 +128359,7 @@ let FormulaCastExpression = (_dec63 = (0,_markupGenerator_Serializer_SugarSerial
128337
128359
  writable: true,
128338
128360
  initializer: null
128339
128361
  })), _class81)) || _class80);
128340
- let FormulaDateNowExpression = (_dec66 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.sugarNode)("datenow", `Дата в формате: {dd/mm/yyyy hh:mm:ss} (время серверное)`), _dec66(_class83 = class FormulaDateNowExpression extends FormulaExpression {}) || _class83);
128362
+ let FormulaDateNowExpression = (_dec66 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.sugarNode)("datenow", `Дата в формате: {dd/mm/yyyy}`), _dec66(_class83 = class FormulaDateNowExpression extends FormulaExpression {}) || _class83);
128341
128363
  let FormulaArgumentExpression = (_dec67 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.sugarNode)("argument", `TODO`), _dec68 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("select", _markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.string.required, ``), _dec69 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attr)("type", typeArgumentValueParser, `Тип атрибута: string или decimal (по умолчанию)`), _dec67(_class84 = (_class85 = class FormulaArgumentExpression extends FormulaExpression {
128342
128364
  constructor(...args) {
128343
128365
  super(...args);
@@ -129317,9 +129339,7 @@ class DataDeclarationGenerationTimeHelper {
129317
129339
 
129318
129340
  const path = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_0__.createAbsoluteFromMask)(current[0], _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_0__.PathTokens.each);
129319
129341
  const pathData = current[1];
129320
- const allSections = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_1__.IterUtils.distinctBy(((_pathData$section = pathData.section) !== null && _pathData$section !== void 0 ? _pathData$section : [] // eslint-disable-next-line no-warning-comments
129321
- // TODO: Обработать вариант с множественностью
129322
- ).map(section => typeof section === "string" || Array.isArray(section) ? section : typeof section === "object" && "fn" in section && typeof section.fn === "string" ? unpackSectionNameFromFn(section.fn) : undefined).flat(1).filter(_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.isNotNullOrUndefined).map(x => ({
129342
+ const allSections = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_1__.IterUtils.distinctBy(((_pathData$section = pathData.section) !== null && _pathData$section !== void 0 ? _pathData$section : []).map(section => typeof section === "string" || Array.isArray(section) ? section : typeof section === "object" && "fn" in section && typeof section.fn === "string" ? unpackSectionNameFromFn(section.fn) : undefined).flat(1).filter(_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.isNotNullOrUndefined).map(x => ({
129323
129343
  section: x,
129324
129344
  path: path
129325
129345
  })), x => x.section);
@@ -132291,22 +132311,22 @@ class ReduceCallExpression extends CallExpression {
132291
132311
 
132292
132312
  }
132293
132313
  class ReduceMultipleCallExpression extends CallExpression {
132294
- constructor(baseModelPath, reduceModelPath, reduceFunction, initialValue) {
132314
+ constructor(fixedModelPath, restModelPath, reduceFunction, initialValue) {
132295
132315
  super("reduce", []);
132296
132316
  this.modelPath = void 0;
132297
- this.reduceModelPath = void 0;
132317
+ this.restModelPath = void 0;
132298
132318
  this.reduceFunction = void 0;
132299
132319
  this.initialValue = void 0;
132300
- this.reduceModelPath = reduceModelPath;
132320
+ this.modelPath = fixedModelPath;
132321
+ this.restModelPath = restModelPath;
132301
132322
  this.initialValue = initialValue;
132302
- this.modelPath = baseModelPath;
132303
132323
  this.reduceFunction = reduceFunction;
132304
132324
  }
132305
132325
 
132306
132326
  convertToString() {
132307
132327
  const basePath = toFLangString(this.modelPath);
132308
- const iterationPathPart = toFLangIterString(this.reduceModelPath);
132309
- return `reduce(${basePath}/#iter/${iterationPathPart}/#iter, ${this.reduceFunction.convertToString()}, ${this.initialValue.convertToString()})`;
132328
+ const iterationPathPart = toFLangIterString(this.restModelPath);
132329
+ return `reduce(${basePath}/${iterationPathPart}/#iter, ${this.reduceFunction.convertToString()}, ${this.initialValue.convertToString()})`;
132310
132330
  }
132311
132331
 
132312
132332
  }
@@ -132708,9 +132728,11 @@ __webpack_require__.r(__webpack_exports__);
132708
132728
  /* harmony import */ var _Common_ModelPath_Map_AbsoluteModelPathMap__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../../Common/ModelPath/Map/AbsoluteModelPathMap */ "./Common/ModelPath/Map/AbsoluteModelPathMap.ts");
132709
132729
  /* harmony import */ var _Common_ModelPath_PathSplitHelper__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../../Common/ModelPath/PathSplitHelper */ "./Common/ModelPath/PathSplitHelper.ts");
132710
132730
  /* harmony import */ var _Engine_src_Engine_Core_PathUtils_PathUtils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../../../Engine/src/Engine/Core/PathUtils/PathUtils */ "./Engine/src/Engine/Core/PathUtils/PathUtils.ts");
132711
- /* harmony import */ var _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./FLang/FLangCodeDom */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FLangCodeDom.ts");
132712
- /* harmony import */ var _FLangValidationBuildContext__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./FLangValidationBuildContext */ "./Generator/src/generators/ServerSideFLangNormalization/FLangValidationBuildContext.ts");
132713
- /* harmony import */ var _FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./FLang/FlangUtils */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FlangUtils.ts");
132731
+ /* harmony import */ var _Common_ModelPath_Set_Set2__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../../Common/ModelPath/Set/Set2 */ "./Common/ModelPath/Set/Set2.ts");
132732
+ /* harmony import */ var _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./FLang/FLangCodeDom */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FLangCodeDom.ts");
132733
+ /* harmony import */ var _FLangValidationBuildContext__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./FLangValidationBuildContext */ "./Generator/src/generators/ServerSideFLangNormalization/FLangValidationBuildContext.ts");
132734
+ /* harmony import */ var _FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./FLang/FlangUtils */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FlangUtils.ts");
132735
+
132714
132736
 
132715
132737
 
132716
132738
 
@@ -132753,43 +132775,45 @@ class NormalizationRulesGenerator {
132753
132775
  generateRules(resourcesHash) {
132754
132776
  const formRoot = (0,_markupGenerator_getRootPath__WEBPACK_IMPORTED_MODULE_4__.getRootPath)(this.sugarRoot);
132755
132777
  const initializeRules = this.buildInitializeRules(formRoot, resourcesHash);
132756
- let dataDeclarationRules = [...this.buildSugarFLangRules()];
132757
132778
  const formulaFLangRules = [...this.buildFormulaFLangRules()];
132758
132779
  const optionalSectionRules = this.buildOptionalSectionsRules();
132759
132780
  const sugarValidationRules = this.buildSugarValidationRules();
132760
- const autocalculatedValuePaths = formulaFLangRules.map(x => x instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.SetStatement ? new _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.AbsoluteModelFieldPath(x.left.modePath, x.left.valueName) : undefined).filter(_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_9__.isNotNullOrUndefined);
132761
- dataDeclarationRules = dataDeclarationRules.filter(ddp => {
132762
- const ddpTarget = ddp instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.SetStatement ? new _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.AbsoluteModelFieldPath(ddp.left.modePath, ddp.left.valueName) : undefined;
132763
- return ddpTarget == undefined || !autocalculatedValuePaths.some(x => x.isEquals(ddpTarget));
132781
+ const autocalculatedValuePathsSet = formulaFLangRules.map(x => x instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.SetStatement ? new _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.AbsoluteModelFieldPath(x.left.modePath, x.left.valueName) : undefined).filter(_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_9__.isNotNullOrUndefined).reduce((result, pathAndValue) => {
132782
+ result.add(pathAndValue);
132783
+ return result;
132784
+ }, new _Common_ModelPath_Set_Set2__WEBPACK_IMPORTED_MODULE_14__.Set2());
132785
+ const dataDeclarationRules = [...this.buildSugarFLangRules()].filter(ddp => {
132786
+ const ddpTarget = ddp instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.SetStatement ? new _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.AbsoluteModelFieldPath(ddp.left.modePath, ddp.left.valueName) : undefined;
132787
+ return ddpTarget == undefined || !autocalculatedValuePathsSet.has(ddpTarget);
132764
132788
  });
132765
132789
  const allRules = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_0__.IterUtils.concat(initializeRules, optionalSectionRules, dataDeclarationRules, formulaFLangRules, sugarValidationRules);
132766
- const allUniqueRules = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_0__.IterUtils.distinctBy(allRules, x => x instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.SetStatement ? x.left.convertToString() : x.convertToString());
132767
- const allUniqueRulesWithOptionalChecks = Iterator.from(this.rewriteRulesWithOptionalPageCheck(allUniqueRules)).map(x => x.convertToString()).reduce((x, y) => x + (x ? "\n" : "") + y, "");
132790
+ const allUniqueRules = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_0__.IterUtils.distinctBy(allRules, x => x instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.SetStatement ? x.left.convertToString() : x.convertToString());
132791
+ const allUniqueRulesWithOptionalChecks = Iterator.from(this.wrapRulesWithOptionalPageCheck(allUniqueRules)).map(x => x.convertToString()).reduce((x, y) => x + (x ? "\n" : "") + y, "");
132768
132792
  return allUniqueRulesWithOptionalChecks;
132769
132793
  }
132770
132794
 
132771
- rewriteRulesWithOptionalPageCheck(rules) {
132772
- const allOptionalSections = (0,_Common_IterableUtils__WEBPACK_IMPORTED_MODULE_0__.reverseArray)(_Common_IterableUtils__WEBPACK_IMPORTED_MODULE_0__.IterUtils.sortBy(this.dataDeclarationHelper.getOptionalSections().map(x => ({
132773
- path: (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createAbsoluteFromMask)(x.path, _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each),
132774
- sectionId: x.id
132775
- })), x => x.path.toLegacyPath())).toArray();
132776
- const wrappedRules = Iterator.from(rules).map(rule => {
132777
- if (rule instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.SetStatement && rule.left.valueName != "children") {
132778
- const targetPath = rule.left.modePath;
132779
- const targetOptionalSection = allOptionalSections.find(x => _Engine_src_Engine_Core_PathUtils_PathUtils__WEBPACK_IMPORTED_MODULE_13__.PathUtils.isPrefix(x.path.toLegacyPath(), targetPath.toLegacyPath()));
132795
+ wrapSetStatementWithOptionalPageCheckIfNeeded(rule, orderedOptionalSections) {
132796
+ const targetPath = rule.left.modePath;
132797
+ const targetOptionalSection = orderedOptionalSections.find(x => _Engine_src_Engine_Core_PathUtils_PathUtils__WEBPACK_IMPORTED_MODULE_13__.PathUtils.isPrefix(x.path.toLegacyPath(), targetPath.toLegacyPath()));
132780
132798
 
132781
- if (targetOptionalSection != undefined) {
132782
- const targetIsFilledPath = targetOptionalSection.path.joinWith(NormalizationRulesGenerator.optionalSectionFilledFieldName);
132799
+ if (targetOptionalSection != undefined) {
132800
+ const targetIsFilledPath = targetOptionalSection.path.joinWith(NormalizationRulesGenerator.optionalSectionFilledFieldName);
132783
132801
 
132784
- if (!targetIsFilledPath.isEquals(targetPath)) {
132785
- const targetIsFilledValueRef = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ValueReferenceExpression(targetIsFilledPath.toCurrentIteration(), "value");
132786
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.SetStatement(rule.left, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.EqExpression(targetIsFilledValueRef, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.StringLiteralExpression("1")), rule.right, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.NullLiteralExpression()));
132787
- }
132788
- }
132802
+ if (!targetIsFilledPath.isEquals(targetPath)) {
132803
+ const targetIsFilledValueRef = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ValueReferenceExpression(targetIsFilledPath.toCurrentIteration(), "value");
132804
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.SetStatement(rule.left, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.EqExpression(targetIsFilledValueRef, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.StringLiteralExpression("1")), rule.right, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.NullLiteralExpression()));
132789
132805
  }
132806
+ }
132790
132807
 
132791
- return rule;
132792
- });
132808
+ return rule;
132809
+ }
132810
+
132811
+ wrapRulesWithOptionalPageCheck(rules) {
132812
+ const allOptionalSections = (0,_Common_IterableUtils__WEBPACK_IMPORTED_MODULE_0__.reverseArray)(_Common_IterableUtils__WEBPACK_IMPORTED_MODULE_0__.IterUtils.sortBy(this.dataDeclarationHelper.getOptionalSections().map(x => ({
132813
+ path: (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createAbsoluteFromMask)(x.path, _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each),
132814
+ sectionId: x.id
132815
+ })), x => x.path.toLegacyPath())).toArray();
132816
+ const wrappedRules = Iterator.from(rules).map(rule => rule instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.SetStatement && rule.left.valueName != "children" ? this.wrapSetStatementWithOptionalPageCheckIfNeeded(rule, allOptionalSections) : rule);
132793
132817
  return wrappedRules;
132794
132818
  }
132795
132819
 
@@ -132813,8 +132837,8 @@ class NormalizationRulesGenerator {
132813
132837
 
132814
132838
  const path = current.target.toLegacyPath();
132815
132839
  const targetCtx = current.errorLevel === "Warning" ? ctx.warnings : ctx.errors;
132816
- const currentExpression = (_targetCtx$path = targetCtx[path]) !== null && _targetCtx$path !== void 0 ? _targetCtx$path : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.NullLiteralExpression();
132817
- const condition = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.NegateUnaryExpression(current.checkExpression), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.StringLiteralExpression("[" + JSON.stringify(current.message) + "]"), currentExpression);
132840
+ const currentExpression = (_targetCtx$path = targetCtx[path]) !== null && _targetCtx$path !== void 0 ? _targetCtx$path : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.NullLiteralExpression();
132841
+ const condition = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.NegateUnaryExpression(current.checkExpression), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.StringLiteralExpression("[" + JSON.stringify(current.message) + "]"), currentExpression);
132818
132842
  targetCtx[path] = condition;
132819
132843
  return ctx;
132820
132844
  }, {
@@ -132825,7 +132849,7 @@ class NormalizationRulesGenerator {
132825
132849
  }
132826
132850
 
132827
132851
  buildInitializeRules(formRoot, resourcesHash) {
132828
- const mandatoryRules = [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ValueReferenceExpression((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createAbsolute)(formRoot), "resourcesHash"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.StringLiteralExpression(resourcesHash)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ValueReferenceExpression((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createAbsolute)(formRoot), "normalizationSource"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.StringLiteralExpression("server"))];
132852
+ const mandatoryRules = [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ValueReferenceExpression((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createAbsolute)(formRoot), "resourcesHash"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.StringLiteralExpression(resourcesHash)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ValueReferenceExpression((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createAbsolute)(formRoot), "normalizationSource"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.StringLiteralExpression("server"))];
132829
132853
  const thresholdEntry = Object.entries(this.lazyLoadingDeclaration).find(x => x[1].thresholdValue != undefined);
132830
132854
 
132831
132855
  if (thresholdEntry != undefined) {
@@ -132833,8 +132857,8 @@ class NormalizationRulesGenerator {
132833
132857
 
132834
132858
  const thresholdEntryPath = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createFromMask)(`/${thresholdEntry[0]}`, true, _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each);
132835
132859
  const thresholdValue = (_thresholdEntry$1$thr = (_thresholdEntry$ = thresholdEntry[1]) === null || _thresholdEntry$ === void 0 ? void 0 : _thresholdEntry$.thresholdValue) !== null && _thresholdEntry$1$thr !== void 0 ? _thresholdEntry$1$thr : 0;
132836
- const lazyLoadingEnabledRef = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ValueReferenceExpression((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createAbsolute)(formRoot).joinWith("LazyLoadingEnabled"), "value");
132837
- const statement = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.SetStatement(lazyLoadingEnabledRef, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.GeExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ReduceCallExpression(thresholdEntryPath.trimLastStarIfLastToken().toCurrentIteration(), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.AnonymousFunctionDeclarationExpression(_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.BuildInTypeExpression.decimal, [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ArgumentDeclarationExpression("result", _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.BuildInTypeExpression.decimal)], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.SumBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ArgumentReferenceExpression("result"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.DecimalLiteralExpression(1))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.DecimalLiteralExpression(0)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.DecimalLiteralExpression(thresholdValue)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.StringLiteralExpression("true"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.StringLiteralExpression("false")));
132860
+ const lazyLoadingEnabledRef = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ValueReferenceExpression((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createAbsolute)(formRoot).joinWith("LazyLoadingEnabled"), "value");
132861
+ const statement = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.SetStatement(lazyLoadingEnabledRef, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.GeExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ReduceCallExpression(thresholdEntryPath.trimLastStarIfLastToken().toCurrentIteration(), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.AnonymousFunctionDeclarationExpression(_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.BuildInTypeExpression.decimal, [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ArgumentDeclarationExpression("result", _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.BuildInTypeExpression.decimal)], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.SumBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ArgumentReferenceExpression("result"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.DecimalLiteralExpression(1))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.DecimalLiteralExpression(0)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.DecimalLiteralExpression(thresholdValue)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.StringLiteralExpression("true"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.StringLiteralExpression("false")));
132838
132862
  return mandatoryRules.concat([statement]);
132839
132863
  }
132840
132864
 
@@ -132842,23 +132866,37 @@ class NormalizationRulesGenerator {
132842
132866
  }
132843
132867
 
132844
132868
  buildOptionalSectionIsFilledCheckRule(targetPath, pathsBySection) {
132845
- const targetValueRef = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ValueReferenceExpression(targetPath.joinWith(NormalizationRulesGenerator.optionalSectionFilledFieldName), "value");
132846
- const pathTestRules = Iterator.from(pathsBySection).map(path => {
132847
- const splitInfo = (0,_Common_ModelPath_PathSplitHelper__WEBPACK_IMPORTED_MODULE_12__.getMatchedAndDifferentModelPaths)(targetPath, path);
132848
- const restPathPart = splitInfo.differentPath;
132869
+ const createDecimalCondExpr = checkExpt => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ConditionalExpression(checkExpt, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.DecimalLiteralExpression(1), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.DecimalLiteralExpression(0));
132849
132870
 
132850
- if (!restPathPart.isContainIteration()) {
132851
- const pathValueRef = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.NoDepsExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ValueReferenceExpression(path.toCurrentIteration(), "value"));
132852
- const checkExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.AndBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.NotEqExpression(pathValueRef, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.NullLiteralExpression()), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.NotEqExpression(pathValueRef, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.StringLiteralExpression("")));
132871
+ const targetValueRef = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ValueReferenceExpression(targetPath.joinWith(NormalizationRulesGenerator.optionalSectionFilledFieldName), "value");
132872
+ const pathInfos = Iterator.from(pathsBySection).map(path => {
132873
+ const splitInfo = (0,_Common_ModelPath_PathSplitHelper__WEBPACK_IMPORTED_MODULE_12__.getMatchedAndDifferentModelPaths)(targetPath, path);
132874
+ const iterationEntries = (0,_Common_ModelPath_BuildIterationSequence__WEBPACK_IMPORTED_MODULE_10__.buildIterationSequence)(splitInfo.differentPath);
132875
+ return {
132876
+ path: path,
132877
+ lastIterationEntry: (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_9__.isLengthGreaterThenOrEqual)(iterationEntries, 1) ? _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_0__.IterUtils.last(iterationEntries) : undefined
132878
+ };
132879
+ });
132880
+ const pathGroups = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_0__.IterUtils.groupBy(pathInfos, pathInfo => pathInfo.lastIterationEntry != undefined ? pathInfo.lastIterationEntry.iterable.toLegacyPath() : targetPath.toLegacyPath());
132881
+ const pathTestRules = Iterator.from(pathGroups.values()).map(pathGroup => {
132882
+ var _pathGroup$, _pathGroup$map$reduce;
132883
+
132884
+ const iterationEntry = (_pathGroup$ = pathGroup[0]) === null || _pathGroup$ === void 0 ? void 0 : _pathGroup$.lastIterationEntry;
132885
+ const pathCheckExpr = (_pathGroup$map$reduce = pathGroup.map(pathInfo => {
132886
+ const pathValueRef = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.NoDepsExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ValueReferenceExpression(pathInfo.path.toCurrentIteration(), "value"));
132887
+ const checkExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.NotEqExpression(pathValueRef, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.NullLiteralExpression());
132853
132888
  return checkExpression;
132854
- } // eslint-disable-next-line no-warning-comments
132855
- //TODO: сюда допилить редьюс по вложенным элементам
132889
+ }).reduce((acc, current) => acc == undefined ? current : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.OrBinaryExpression(acc, current), undefined)) !== null && _pathGroup$map$reduce !== void 0 ? _pathGroup$map$reduce : (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_9__.reject)();
132856
132890
 
132891
+ const createSingleReduceCheckExpression = localIterationEntry => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.GtExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ReduceCallExpression(targetPath.joinWith(...localIterationEntry.iterable.getPathPartsAsArray()).toCurrentIteration(), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.AnonymousFunctionDeclarationExpression(_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.BuildInTypeExpression.decimal, [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ArgumentDeclarationExpression("result", _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.BuildInTypeExpression.decimal)], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.SumBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ArgumentReferenceExpression("result"), createDecimalCondExpr(pathCheckExpr))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.DecimalLiteralExpression(0)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.DecimalLiteralExpression(0));
132857
132892
 
132858
- return undefined;
132859
- }).filter(_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_9__.isNotNullOrUndefined);
132860
- const allChecksExpressions = pathTestRules.reduce((acc, current) => acc == undefined ? current : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.OrBinaryExpression(acc, current), undefined);
132861
- return allChecksExpressions != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.SetStatement(targetValueRef, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ConditionalExpression(allChecksExpressions, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.StringLiteralExpression("1"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.StringLiteralExpression("0"))) : undefined;
132893
+ const createMultipleReduceCheckExpression = localIterationEntry => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.GtExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ReduceMultipleCallExpression(targetPath.toCurrentIteration(), (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createRelativeFromTokens)(localIterationEntry.iterable.getPathPartsAsArray()), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.AnonymousFunctionDeclarationExpression(_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.BuildInTypeExpression.decimal, [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ArgumentDeclarationExpression("result", _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.BuildInTypeExpression.decimal)], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.SumBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ArgumentReferenceExpression("result"), createDecimalCondExpr(pathCheckExpr))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.DecimalLiteralExpression(0)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.DecimalLiteralExpression(0));
132894
+
132895
+ const pathCheckWithReduceIfRequiredExpr = iterationEntry != undefined ? !iterationEntry.iterable.isContainIteration() ? createSingleReduceCheckExpression(iterationEntry) : createMultipleReduceCheckExpression(iterationEntry) : pathCheckExpr;
132896
+ return pathCheckWithReduceIfRequiredExpr;
132897
+ });
132898
+ const allChecksExpressions = pathTestRules.reduce((acc, current) => acc == undefined ? current : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.OrBinaryExpression(acc, current), undefined);
132899
+ return allChecksExpressions != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.SetStatement(targetValueRef, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ConditionalExpression(allChecksExpressions, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.StringLiteralExpression("1"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.StringLiteralExpression("0"))) : undefined;
132862
132900
  }
132863
132901
 
132864
132902
  buildOptionalSectionsRules() {
@@ -132869,7 +132907,7 @@ class NormalizationRulesGenerator {
132869
132907
 
132870
132908
  const sectionId = x.id;
132871
132909
  const targetPath = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createAbsoluteFromMask)(x.path, _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each);
132872
- const pathsBySection = (_section2PathsMap$get = (_section2PathsMap$get2 = section2PathsMap.get(sectionId)) === null || _section2PathsMap$get2 === void 0 ? void 0 : _section2PathsMap$get2.values()) !== null && _section2PathsMap$get !== void 0 ? _section2PathsMap$get : Iterator.from([]);
132910
+ const pathsBySection = (_section2PathsMap$get = (_section2PathsMap$get2 = section2PathsMap.get(sectionId)) === null || _section2PathsMap$get2 === void 0 ? void 0 : _section2PathsMap$get2.values()) !== null && _section2PathsMap$get !== void 0 ? _section2PathsMap$get : [];
132873
132911
  return this.buildOptionalSectionIsFilledCheckRule(targetPath, pathsBySection);
132874
132912
  }).filter(_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_9__.isNotNullOrUndefined);
132875
132913
  return allRules;
@@ -132899,10 +132937,10 @@ class NormalizationRulesGenerator {
132899
132937
  const result = [];
132900
132938
 
132901
132939
  if (isTargetAutoField) {
132902
- result.push(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ValueReferenceExpression(fullTarget, "autoValue"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.NullCoalesceExpression(this.compileExpressionToFlashExpression(formula.expression, prefix, fullTarget, x => precalculationRules.push(x)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.StringLiteralExpression(defaultValue))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ValueReferenceExpression(fullTarget, "autoFlag"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.CastExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.IsEqualsBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "value"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "autoValue")), "string")));
132940
+ result.push(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ValueReferenceExpression(fullTarget, "autoValue"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.NullCoalesceExpression(this.compileExpressionToFlashExpression(formula.expression, prefix, fullTarget, x => precalculationRules.push(x)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.StringLiteralExpression(defaultValue))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ValueReferenceExpression(fullTarget, "autoFlag"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.CastExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.IsEqualsBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "value"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "autoValue")), "string")));
132903
132941
  result.push(...precalculationRules);
132904
132942
  } else {
132905
- result.push(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ValueReferenceExpression(fullTarget, "value"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.NullCoalesceExpression(this.compileExpressionToFlashExpression(formula.expression, prefix, fullTarget, x => precalculationRules.push(x)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.StringLiteralExpression(defaultValue))));
132943
+ result.push(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ValueReferenceExpression(fullTarget, "value"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.NullCoalesceExpression(this.compileExpressionToFlashExpression(formula.expression, prefix, fullTarget, x => precalculationRules.push(x)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.StringLiteralExpression(defaultValue))));
132906
132944
  result.push(...precalculationRules);
132907
132945
  }
132908
132946
 
@@ -132919,28 +132957,28 @@ class NormalizationRulesGenerator {
132919
132957
  }
132920
132958
 
132921
132959
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_3__.FormulaAbsExpression) {
132922
- return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_16__.castOperandToStringIfNeed)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.AbsExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_16__.castOperandToDecimalIfNeed)(this.compileExpressionToFlashExpression(expression.expression, prefix, target, addPrecalculationRule))));
132960
+ return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_17__.castOperandToStringIfNeed)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.AbsExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_17__.castOperandToDecimalIfNeed)(this.compileExpressionToFlashExpression(expression.expression, prefix, target, addPrecalculationRule))));
132923
132961
  }
132924
132962
 
132925
132963
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_3__.FormulaXAbsExpression) {
132926
- const expr = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_16__.castOperandToDecimalIfNeed)(this.compileExpressionToFlashExpression(expression.expression, prefix, target, addPrecalculationRule));
132927
- return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_16__.castOperandToStringIfNeed)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.LtExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_16__.castOperandToDecimalIfNeed)(expr), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.DecimalLiteralExpression(0)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.DecimalLiteralExpression(0), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.AbsExpression(expr)));
132964
+ const expr = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_17__.castOperandToDecimalIfNeed)(this.compileExpressionToFlashExpression(expression.expression, prefix, target, addPrecalculationRule));
132965
+ return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_17__.castOperandToStringIfNeed)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.LtExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_17__.castOperandToDecimalIfNeed)(expr), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.DecimalLiteralExpression(0)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.DecimalLiteralExpression(0), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.AbsExpression(expr)));
132928
132966
  }
132929
132967
 
132930
132968
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_3__.FormulaRoundExpression) {
132931
- return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_16__.castOperandToStringIfNeed)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.RoundExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_16__.castOperandToDecimalIfNeed)(this.compileExpressionToFlashExpression(expression.expression, prefix, target, addPrecalculationRule)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.IntegerLiteralExpression(expression.fractionalDigits)));
132969
+ return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_17__.castOperandToStringIfNeed)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.RoundExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_17__.castOperandToDecimalIfNeed)(this.compileExpressionToFlashExpression(expression.expression, prefix, target, addPrecalculationRule)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.IntegerLiteralExpression(expression.fractionalDigits)));
132932
132970
  }
132933
132971
 
132934
132972
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_3__.FormulaFloorExpression) {
132935
- return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_16__.castOperandToStringIfNeed)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.FloorExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_16__.castOperandToDecimalIfNeed)(this.compileExpressionToFlashExpression(expression.expression, prefix, target, addPrecalculationRule))));
132973
+ return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_17__.castOperandToStringIfNeed)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.FloorExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_17__.castOperandToDecimalIfNeed)(this.compileExpressionToFlashExpression(expression.expression, prefix, target, addPrecalculationRule))));
132936
132974
  }
132937
132975
 
132938
132976
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_3__.FormulaChooseExpression) {
132939
- return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_16__.castOperandToStringIfNeed)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ConditionalExpression(this.compileExpressionToFlashExpression(expression.ifNode.condition, prefix, target, addPrecalculationRule), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_16__.castOperandToStringIfNeed)(this.compileExpressionToFlashExpression(expression.thenNode.expression, prefix, target, addPrecalculationRule)), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_16__.castOperandToStringIfNeed)(this.compileExpressionToFlashExpression(expression.elseNode.expression, prefix, target, addPrecalculationRule))));
132977
+ return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_17__.castOperandToStringIfNeed)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ConditionalExpression(this.compileExpressionToFlashExpression(expression.ifNode.condition, prefix, target, addPrecalculationRule), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_17__.castOperandToStringIfNeed)(this.compileExpressionToFlashExpression(expression.thenNode.expression, prefix, target, addPrecalculationRule)), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_17__.castOperandToStringIfNeed)(this.compileExpressionToFlashExpression(expression.elseNode.expression, prefix, target, addPrecalculationRule))));
132940
132978
  }
132941
132979
 
132942
132980
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_3__.FormulaMultiplyExpression) {
132943
- return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_16__.castOperandToStringIfNeed)(this.compileMultiplyExpression(expression, prefix, target, addPrecalculationRule));
132981
+ return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_17__.castOperandToStringIfNeed)(this.compileMultiplyExpression(expression, prefix, target, addPrecalculationRule));
132944
132982
  }
132945
132983
 
132946
132984
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_3__.FormulaOrExpression) {
@@ -132952,16 +132990,16 @@ class NormalizationRulesGenerator {
132952
132990
  }
132953
132991
 
132954
132992
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_3__.FormulaNotExpression) {
132955
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.NegateUnaryExpression(this.compileExpressionToFlashExpression(expression.argument, prefix, target, addPrecalculationRule));
132993
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.NegateUnaryExpression(this.compileExpressionToFlashExpression(expression.argument, prefix, target, addPrecalculationRule));
132956
132994
  }
132957
132995
 
132958
132996
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_3__.FormulaConstExpression) {
132959
132997
  switch (expression.type) {
132960
132998
  case "string":
132961
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.StringLiteralExpression(expression.value);
132999
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.StringLiteralExpression(expression.value);
132962
133000
 
132963
133001
  case "decimal":
132964
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.DecimalLiteralExpression(expression.value);
133002
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.DecimalLiteralExpression(expression.value);
132965
133003
 
132966
133004
  default:
132967
133005
  throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_7__.NotSupportedError("Unknown constant type!");
@@ -132973,55 +133011,58 @@ class NormalizationRulesGenerator {
132973
133011
  }
132974
133012
 
132975
133013
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_3__.FormulaMinusExpression) {
132976
- return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_16__.castOperandToStringIfNeed)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.MinusUnaryExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_16__.castOperandToDecimalIfNeed)(this.compileExpressionToFlashExpression(expression.expression, prefix, target, addPrecalculationRule))));
133014
+ return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_17__.castOperandToStringIfNeed)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.MinusUnaryExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_17__.castOperandToDecimalIfNeed)(this.compileExpressionToFlashExpression(expression.expression, prefix, target, addPrecalculationRule))));
132977
133015
  }
132978
133016
 
132979
133017
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_3__.FormulaGtExpression) {
132980
- const left = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_16__.castOperandToDecimalIfNeed)(this.compileExpressionToFlashExpression(expression.arguments[0], prefix, target, addPrecalculationRule));
132981
- const right = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_16__.castOperandToDecimalIfNeed)(this.compileExpressionToFlashExpression(expression.arguments[1], prefix, target, addPrecalculationRule));
132982
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.GtExpression(left, right);
133018
+ const left = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_17__.castOperandToDecimalIfNeed)(this.compileExpressionToFlashExpression(expression.arguments[0], prefix, target, addPrecalculationRule));
133019
+ const right = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_17__.castOperandToDecimalIfNeed)(this.compileExpressionToFlashExpression(expression.arguments[1], prefix, target, addPrecalculationRule));
133020
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.GtExpression(left, right);
132983
133021
  }
132984
133022
 
132985
133023
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_3__.FormulaLtExpression) {
132986
- const left = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_16__.castOperandToDecimalIfNeed)(this.compileExpressionToFlashExpression(expression.arguments[0], prefix, target, addPrecalculationRule));
132987
- const right = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_16__.castOperandToDecimalIfNeed)(this.compileExpressionToFlashExpression(expression.arguments[1], prefix, target, addPrecalculationRule));
132988
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.LtExpression(left, right);
133024
+ const left = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_17__.castOperandToDecimalIfNeed)(this.compileExpressionToFlashExpression(expression.arguments[0], prefix, target, addPrecalculationRule));
133025
+ const right = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_17__.castOperandToDecimalIfNeed)(this.compileExpressionToFlashExpression(expression.arguments[1], prefix, target, addPrecalculationRule));
133026
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.LtExpression(left, right);
132989
133027
  }
132990
133028
 
132991
133029
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_3__.FormulaGeExpression) {
132992
- const left = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_16__.castOperandToDecimalIfNeed)(this.compileExpressionToFlashExpression(expression.arguments[0], prefix, target, addPrecalculationRule));
132993
- const right = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_16__.castOperandToDecimalIfNeed)(this.compileExpressionToFlashExpression(expression.arguments[1], prefix, target, addPrecalculationRule));
132994
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.GeExpression(left, right);
133030
+ const left = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_17__.castOperandToDecimalIfNeed)(this.compileExpressionToFlashExpression(expression.arguments[0], prefix, target, addPrecalculationRule));
133031
+ const right = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_17__.castOperandToDecimalIfNeed)(this.compileExpressionToFlashExpression(expression.arguments[1], prefix, target, addPrecalculationRule));
133032
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.GeExpression(left, right);
132995
133033
  }
132996
133034
 
132997
133035
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_3__.FormulaLeExpression) {
132998
- const left = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_16__.castOperandToDecimalIfNeed)(this.compileExpressionToFlashExpression(expression.arguments[0], prefix, target, addPrecalculationRule));
132999
- const right = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_16__.castOperandToDecimalIfNeed)(this.compileExpressionToFlashExpression(expression.arguments[1], prefix, target, addPrecalculationRule));
133000
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.LeExpression(left, right);
133036
+ const left = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_17__.castOperandToDecimalIfNeed)(this.compileExpressionToFlashExpression(expression.arguments[0], prefix, target, addPrecalculationRule));
133037
+ const right = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_17__.castOperandToDecimalIfNeed)(this.compileExpressionToFlashExpression(expression.arguments[1], prefix, target, addPrecalculationRule));
133038
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.LeExpression(left, right);
133001
133039
  }
133002
133040
 
133003
133041
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_3__.FormulaEqExpression) {
133004
- const left = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_16__.castOperandToStringIfNeed)(this.compileExpressionToFlashExpression(expression.arguments[0], prefix, target, addPrecalculationRule));
133005
- const right = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_16__.castOperandToStringIfNeed)(this.compileExpressionToFlashExpression(expression.arguments[1], prefix, target, addPrecalculationRule));
133006
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.EqExpression(left, right);
133042
+ const left = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_17__.castOperandToStringIfNeed)(this.compileExpressionToFlashExpression(expression.arguments[0], prefix, target, addPrecalculationRule));
133043
+ const right = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_17__.castOperandToStringIfNeed)(this.compileExpressionToFlashExpression(expression.arguments[1], prefix, target, addPrecalculationRule));
133044
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.EqExpression(left, right);
133007
133045
  }
133008
133046
 
133009
133047
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_3__.FormulaExistsExpression) {
133010
- // eslint-disable-next-line no-warning-comments
133048
+ /* eslint-disable no-warning-comments */
133011
133049
  // TODO: тут необходимо учесть, что exists может смотреть на множественность
133050
+ // TODO: реализовать в рамках задачи https://yt.skbkontur.ru/issue/FS-7385
133051
+
133052
+ /* eslint-enable no-warning-comments */
133012
133053
  const arg = this.compiledArgumentExpression(prefix, target, expression, addPrecalculationRule);
133013
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.NegateUnaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.OrBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.EqExpression(arg, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.StringLiteralExpression("")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.EqExpression(arg, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.NullLiteralExpression())));
133054
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.NegateUnaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.OrBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.EqExpression(arg, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.StringLiteralExpression("")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.EqExpression(arg, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.NullLiteralExpression())));
133014
133055
  }
133015
133056
 
133016
133057
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_3__.FormulaWhenExpression) {
133017
133058
  const condition = this.compileExpressionToFlashExpression(expression.expressions[0], prefix, target, addPrecalculationRule);
133018
133059
  const thenExpression = this.compileExpressionToFlashExpression(expression.expressions[1], prefix, target, addPrecalculationRule);
133019
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ConditionalExpression(condition, thenExpression, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.EqExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.IntegerLiteralExpression(1), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.IntegerLiteralExpression(1)));
133060
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ConditionalExpression(condition, thenExpression, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.EqExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.IntegerLiteralExpression(1), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.IntegerLiteralExpression(1)));
133020
133061
  }
133021
133062
 
133022
133063
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_3__.FormulaRegexMatchExpression) {
133023
133064
  const arg = this.compileExpressionToFlashExpression(expression.argument, prefix, target, addPrecalculationRule);
133024
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.CallExpression("regexMatch", [arg, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.StringLiteralExpression(expression.pattern)]);
133065
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.CallExpression("regexMatch", [arg, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.StringLiteralExpression(expression.pattern)]);
133025
133066
  }
133026
133067
 
133027
133068
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_3__.FormulaCountExpression) {
@@ -133029,7 +133070,7 @@ class NormalizationRulesGenerator {
133029
133070
  }
133030
133071
 
133031
133072
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_3__.FormulaLengthExpression) {
133032
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.LenExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_16__.castOperandToStringIfNeed)(this.compileExpressionToFlashExpression(expression.argument, prefix, target, addPrecalculationRule)));
133073
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.LenExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_17__.castOperandToStringIfNeed)(this.compileExpressionToFlashExpression(expression.argument, prefix, target, addPrecalculationRule)));
133033
133074
  }
133034
133075
 
133035
133076
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_3__.FormulaConcatExpression) {
@@ -133038,15 +133079,15 @@ class NormalizationRulesGenerator {
133038
133079
 
133039
133080
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_3__.FormulaSubstringExpression) {
133040
133081
  const arg = this.compileExpressionToFlashExpression(expression.expression, prefix, target, addPrecalculationRule);
133041
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.CallExpression("substring", [arg, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.DecimalLiteralExpression(expression.start), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.DecimalLiteralExpression(expression.length)]);
133082
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.CallExpression("substring", [arg, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.DecimalLiteralExpression(expression.start), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.DecimalLiteralExpression(expression.length)]);
133042
133083
  }
133043
133084
 
133044
133085
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_3__.FormulaNewLineExpression) {
133045
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.StringLiteralExpression("\r\n");
133086
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.StringLiteralExpression("\r\n");
133046
133087
  }
133047
133088
 
133048
133089
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_3__.FormulaDateNowExpression) {
133049
- return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_16__.castOperandToStringIfNeed)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.DateNowExpression());
133090
+ return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_17__.castOperandToStringIfNeed)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.DateNowExpression());
133050
133091
  }
133051
133092
 
133052
133093
  if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_3__.FormulaGroupSumExpression) {
@@ -133061,18 +133102,18 @@ class NormalizationRulesGenerator {
133061
133102
  const sourceKeyPath = this.preparePathAndAdjustMultiplicity(prefix, expression.sourceKeyPath);
133062
133103
  const sourceValuePath = this.preparePathAndAdjustMultiplicity(prefix, expression.sourceValuePath);
133063
133104
  const iterationEntries = [...(0,_Common_IterableUtils__WEBPACK_IMPORTED_MODULE_0__.reverseArray)((0,_Common_ModelPath_BuildIterationSequence__WEBPACK_IMPORTED_MODULE_10__.buildIterationSequence)(sourceKeyPath))];
133064
- const finalAnonymousFunction = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.AnonymousFunctionDeclarationExpression(_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.BuildInTypeExpression.dict, [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ArgumentDeclarationExpression("result", _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.BuildInTypeExpression.dict)], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.AddSumExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ArgumentReferenceExpression("result"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ValueReferenceExpression(sourceKeyPath.toCurrentIteration(), "value"), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_16__.castOperandToDecimalIfNeed)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ValueReferenceExpression(sourceValuePath.toCurrentIteration(), "value"))));
133105
+ const finalAnonymousFunction = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.AnonymousFunctionDeclarationExpression(_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.BuildInTypeExpression.dict, [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ArgumentDeclarationExpression("result", _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.BuildInTypeExpression.dict)], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.AddSumExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ArgumentReferenceExpression("result"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ValueReferenceExpression(sourceKeyPath.toCurrentIteration(), "value"), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_17__.castOperandToDecimalIfNeed)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ValueReferenceExpression(sourceValuePath.toCurrentIteration(), "value"))));
133065
133106
 
133066
- const getWrapReduceFunction = innerReduceCall => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.AnonymousFunctionDeclarationExpression(_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.BuildInTypeExpression.dict, [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ArgumentDeclarationExpression("result", _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.BuildInTypeExpression.dict)], innerReduceCall);
133107
+ const getWrapReduceFunction = innerReduceCall => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.AnonymousFunctionDeclarationExpression(_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.BuildInTypeExpression.dict, [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ArgumentDeclarationExpression("result", _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.BuildInTypeExpression.dict)], innerReduceCall);
133067
133108
 
133068
133109
  const createReduceExpression = (iterablePath, initialValue, innerReduce) => {
133069
133110
  const reduceBody = innerReduce != undefined ? getWrapReduceFunction(innerReduce) : finalAnonymousFunction;
133070
- const reduceExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ReduceCallExpression(iterablePath.toCurrentIteration(), reduceBody, initialValue);
133111
+ const reduceExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ReduceCallExpression(iterablePath.toCurrentIteration(), reduceBody, initialValue);
133071
133112
  return reduceExpression;
133072
133113
  };
133073
133114
 
133074
133115
  const reduceExpression = iterationEntries.reduce((prevReduceExpr, curr, index) => {
133075
- const initialValue = index === iterationEntries.length - 1 ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.DictLiteralExpression() : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ArgumentReferenceExpression("result");
133116
+ const initialValue = index === iterationEntries.length - 1 ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.DictLiteralExpression() : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ArgumentReferenceExpression("result");
133076
133117
  const reduceExpr = createReduceExpression(curr.iterable, initialValue, prevReduceExpr);
133077
133118
  return reduceExpr;
133078
133119
  }, undefined);
@@ -133081,7 +133122,7 @@ class NormalizationRulesGenerator {
133081
133122
  throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_7__.NotSupportedError("Target and source must be in different collections! " + "\n" + `Target: ${target}` + "\n" + `SourceKey: ${sourceKeyPath}`);
133082
133123
  }
133083
133124
 
133084
- const finalValueExpression = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_16__.castOperandToStringIfNeed)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.GetExpression(reduceExpression, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ValueReferenceExpression(targetKeyPath.toCurrentIteration(), "value")));
133125
+ const finalValueExpression = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_17__.castOperandToStringIfNeed)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.GetExpression(reduceExpression, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ValueReferenceExpression(targetKeyPath.toCurrentIteration(), "value")));
133085
133126
  return finalValueExpression;
133086
133127
  }
133087
133128
 
@@ -133091,22 +133132,22 @@ class NormalizationRulesGenerator {
133091
133132
  const baseSelectPath = splitInfo.matchedPath;
133092
133133
 
133093
133134
  if (!splitInfo.differentPath.isContainIteration()) {
133094
- const valueRefExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ValueReferenceExpression(adjustedSelectPath.toCurrentIteration().normalize(), "value");
133095
- return splitInfo.differentPath.isEmpty() ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.NoDepsExpression(valueRefExpression) : valueRefExpression;
133135
+ const valueRefExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ValueReferenceExpression(adjustedSelectPath.toCurrentIteration().normalize(), "value");
133136
+ return splitInfo.differentPath.isEmpty() ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.NoDepsExpression(valueRefExpression) : valueRefExpression;
133096
133137
  } else {
133097
- let resultValueExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ValueReferenceExpression(adjustedSelectPath.toCurrentIteration().normalize(), "value");
133138
+ let resultValueExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ValueReferenceExpression(adjustedSelectPath.toCurrentIteration().normalize(), "value");
133098
133139
  let countValueExpression = undefined;
133099
133140
  const iterationEntries = [...(0,_Common_IterableUtils__WEBPACK_IMPORTED_MODULE_0__.reverseArray)((0,_Common_ModelPath_BuildIterationSequence__WEBPACK_IMPORTED_MODULE_10__.buildIterationSequence)(splitInfo.differentPath))];
133100
133141
 
133101
133142
  for (const iterationEntry of iterationEntries) {
133102
133143
  const iterablePath = baseSelectPath.joinWith((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createRelativeFromTokens)(iterationEntry.iterable.getPathPartsAsArray()));
133103
133144
  const suffixWithoutMultiple = iterationEntry.suffix.getPathPartsAsArray().filter(x => _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.isSimpleToken(x));
133104
- const nextResultValueExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ValueReferenceExpression(iterablePath.joinWith((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createRelativeFromTokens)(suffixWithoutMultiple)).joinWith("Sum").normalize(), "value");
133105
- const currentSumExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ValueReferenceExpression(iterablePath.joinWith((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createRelativeFromTokens)(suffixWithoutMultiple)).joinWith("Sum").toCurrentIteration().normalize(), "value");
133106
- const countResultValueExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ValueReferenceExpression(iterablePath.joinWith((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createRelativeFromTokens)(suffixWithoutMultiple)).joinWith("Count").normalize(), "value");
133107
- const currenCountExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ValueReferenceExpression(iterablePath.joinWith((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createRelativeFromTokens)(suffixWithoutMultiple)).joinWith("Count").toCurrentIteration().normalize(), "value");
133108
- addPrecalculationRule(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.SetStatement(nextResultValueExpression, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.CastExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ReduceCallExpression(iterablePath.toCurrentIteration(), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.AnonymousFunctionDeclarationExpression(_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.BuildInTypeExpression.decimal, [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ArgumentDeclarationExpression("result", _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.BuildInTypeExpression.decimal)], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.OrBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.NotEqExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ArgumentReferenceExpression("result"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.NullLiteralExpression()), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.NotEqExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.CastExpression(resultValueExpression, "decimal"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.NullLiteralExpression())), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.SumBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.NullCoalesceExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ArgumentReferenceExpression("result"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.DecimalLiteralExpression(0)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.CastExpression(resultValueExpression, "decimal", new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.DecimalLiteralExpression(0))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.NullLiteralExpression())), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_16__.castOperandToDecimalIfNeed)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.NullLiteralExpression())), "string", new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.StringLiteralExpression("G29"))));
133109
- addPrecalculationRule(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.SetStatement(countResultValueExpression, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.CastExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ReduceCallExpression(iterablePath.toCurrentIteration(), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.AnonymousFunctionDeclarationExpression(_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.BuildInTypeExpression.decimal, [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ArgumentDeclarationExpression("result", _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.BuildInTypeExpression.decimal)], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.SumBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ArgumentReferenceExpression("result"), countValueExpression == undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.NotEqExpression(resultValueExpression, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.StringLiteralExpression("")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.DecimalLiteralExpression(1), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.DecimalLiteralExpression(0)) : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.CastExpression(countValueExpression, "decimal", new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.DecimalLiteralExpression(0)))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.DecimalLiteralExpression(0)), "string", new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.StringLiteralExpression("G29"))));
133145
+ const nextResultValueExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ValueReferenceExpression(iterablePath.joinWith((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createRelativeFromTokens)(suffixWithoutMultiple)).joinWith("Sum").normalize(), "value");
133146
+ const currentSumExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ValueReferenceExpression(iterablePath.joinWith((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createRelativeFromTokens)(suffixWithoutMultiple)).joinWith("Sum").toCurrentIteration().normalize(), "value");
133147
+ const countResultValueExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ValueReferenceExpression(iterablePath.joinWith((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createRelativeFromTokens)(suffixWithoutMultiple)).joinWith("Count").normalize(), "value");
133148
+ const currenCountExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ValueReferenceExpression(iterablePath.joinWith((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createRelativeFromTokens)(suffixWithoutMultiple)).joinWith("Count").toCurrentIteration().normalize(), "value");
133149
+ addPrecalculationRule(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.SetStatement(nextResultValueExpression, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.CastExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ReduceCallExpression(iterablePath.toCurrentIteration(), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.AnonymousFunctionDeclarationExpression(_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.BuildInTypeExpression.decimal, [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ArgumentDeclarationExpression("result", _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.BuildInTypeExpression.decimal)], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.OrBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.NotEqExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ArgumentReferenceExpression("result"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.NullLiteralExpression()), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.NotEqExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.CastExpression(resultValueExpression, "decimal"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.NullLiteralExpression())), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.SumBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.NullCoalesceExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ArgumentReferenceExpression("result"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.DecimalLiteralExpression(0)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.CastExpression(resultValueExpression, "decimal", new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.DecimalLiteralExpression(0))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.NullLiteralExpression())), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_17__.castOperandToDecimalIfNeed)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.NullLiteralExpression())), "string", new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.StringLiteralExpression("G29"))));
133150
+ addPrecalculationRule(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.SetStatement(countResultValueExpression, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.CastExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ReduceCallExpression(iterablePath.toCurrentIteration(), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.AnonymousFunctionDeclarationExpression(_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.BuildInTypeExpression.decimal, [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ArgumentDeclarationExpression("result", _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.BuildInTypeExpression.decimal)], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.SumBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ArgumentReferenceExpression("result"), countValueExpression == undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.NotEqExpression(resultValueExpression, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.StringLiteralExpression("")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.DecimalLiteralExpression(1), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.DecimalLiteralExpression(0)) : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.CastExpression(countValueExpression, "decimal", new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.DecimalLiteralExpression(0)))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.DecimalLiteralExpression(0)), "string", new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.StringLiteralExpression("G29"))));
133110
133151
  resultValueExpression = currentSumExpression;
133111
133152
  countValueExpression = currenCountExpression;
133112
133153
  }
@@ -133116,42 +133157,42 @@ class NormalizationRulesGenerator {
133116
133157
  }
133117
133158
 
133118
133159
  compileSumExpression(expression, prefix, target, addPrecalculationRule) {
133119
- const args = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_16__.getFlatArgumentExpressions)(expression.arguments);
133160
+ const args = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_17__.getFlatArgumentExpressions)(expression.arguments);
133120
133161
  const conditionExpression = args.reduce((acc, curr) => {
133121
- const currExpr = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.AndBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.NotEqExpression(this.compileExpressionToFlashExpression(curr, prefix, target, addPrecalculationRule), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.NullLiteralExpression()), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.NotEqExpression(this.compileExpressionToFlashExpression(curr, prefix, target, addPrecalculationRule), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.StringLiteralExpression("")));
133122
- return acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.OrBinaryExpression(acc, currExpr) : currExpr;
133162
+ const currExpr = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.AndBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.NotEqExpression(this.compileExpressionToFlashExpression(curr, prefix, target, addPrecalculationRule), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.NullLiteralExpression()), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.NotEqExpression(this.compileExpressionToFlashExpression(curr, prefix, target, addPrecalculationRule), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.StringLiteralExpression("")));
133163
+ return acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.OrBinaryExpression(acc, currExpr) : currExpr;
133123
133164
  }, undefined);
133124
133165
 
133125
133166
  if (conditionExpression == undefined) {
133126
133167
  const result = expression.arguments.reduce((acc, curr) => {
133127
- const currExpr = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_16__.castOperandToDecimalIfNeed)(this.compileExpressionToFlashExpression(curr, prefix, target, addPrecalculationRule));
133128
- return acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.SumBinaryExpression(acc, currExpr) : currExpr;
133168
+ const currExpr = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_17__.castOperandToDecimalIfNeed)(this.compileExpressionToFlashExpression(curr, prefix, target, addPrecalculationRule));
133169
+ return acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.SumBinaryExpression(acc, currExpr) : currExpr;
133129
133170
  }, undefined);
133130
133171
 
133131
133172
  if (result == undefined) {
133132
133173
  throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_7__.InvalidProgramStateError();
133133
133174
  }
133134
133175
 
133135
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.CastExpression(result, "string");
133176
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.CastExpression(result, "string");
133136
133177
  }
133137
133178
 
133138
133179
  const trueResultExpression = expression.arguments.reduce((acc, curr) => {
133139
- const currExpr = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_16__.castOperandToDecimalIfNeed)(this.compileExpressionToFlashExpression(curr, prefix, target, addPrecalculationRule), 0);
133140
- return acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.SumBinaryExpression(acc, currExpr) : currExpr;
133180
+ const currExpr = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_17__.castOperandToDecimalIfNeed)(this.compileExpressionToFlashExpression(curr, prefix, target, addPrecalculationRule), 0);
133181
+ return acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.SumBinaryExpression(acc, currExpr) : currExpr;
133141
133182
  }, undefined);
133142
133183
 
133143
133184
  if (trueResultExpression == undefined) {
133144
133185
  throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_7__.InvalidProgramStateError();
133145
133186
  }
133146
133187
 
133147
- const result = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ConditionalExpression(conditionExpression, trueResultExpression, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.NullLiteralExpression());
133148
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.CastExpression(result, "string");
133188
+ const result = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ConditionalExpression(conditionExpression, trueResultExpression, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.NullLiteralExpression());
133189
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.CastExpression(result, "string");
133149
133190
  }
133150
133191
 
133151
133192
  compileConcatExpression(expression, prefix, target, addPrecalculationRule) {
133152
133193
  const result = expression.arguments.reduce((acc, curr) => {
133153
- const currExpr = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_16__.castOperandToStringIfNeed)(this.compileExpressionToFlashExpression(curr, prefix, target, addPrecalculationRule));
133154
- return acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.SumBinaryExpression(acc, currExpr) : currExpr;
133194
+ const currExpr = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_17__.castOperandToStringIfNeed)(this.compileExpressionToFlashExpression(curr, prefix, target, addPrecalculationRule));
133195
+ return acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.SumBinaryExpression(acc, currExpr) : currExpr;
133155
133196
  }, undefined);
133156
133197
 
133157
133198
  if (result == undefined) {
@@ -133164,7 +133205,7 @@ class NormalizationRulesGenerator {
133164
133205
  compileOrExpression(expression, prefix, target, addPrecalculationRule) {
133165
133206
  const result = expression.arguments.reduce((acc, curr) => {
133166
133207
  const currExpr = this.compileExpressionToFlashExpression(curr, prefix, target, addPrecalculationRule);
133167
- return acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.OrBinaryExpression(acc, currExpr) : currExpr;
133208
+ return acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.OrBinaryExpression(acc, currExpr) : currExpr;
133168
133209
  }, undefined);
133169
133210
 
133170
133211
  if (result == undefined) {
@@ -133177,7 +133218,7 @@ class NormalizationRulesGenerator {
133177
133218
  compileAndExpression(expression, prefix, target, addPrecalculationRule) {
133178
133219
  const result = expression.arguments.reduce((acc, curr) => {
133179
133220
  const currExpr = this.compileExpressionToFlashExpression(curr, prefix, target, addPrecalculationRule);
133180
- return acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.AndBinaryExpression(acc, currExpr) : currExpr;
133221
+ return acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.AndBinaryExpression(acc, currExpr) : currExpr;
133181
133222
  }, undefined);
133182
133223
 
133183
133224
  if (result == undefined) {
@@ -133189,51 +133230,51 @@ class NormalizationRulesGenerator {
133189
133230
 
133190
133231
  compileMultiplyExpression(expression, prefix, target, addPrecalculationRule) {
133191
133232
  const result = expression.arguments.reduce((acc, curr) => {
133192
- const expr = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_16__.castOperandToDecimalIfNeed)(this.compileExpressionToFlashExpression(curr, prefix, target, addPrecalculationRule));
133193
- const currExpr = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.EqExpression(expr, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.NullLiteralExpression()), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.IntegerLiteralExpression(0), expr);
133194
- return acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.MultiplyBinaryExpression(acc, currExpr) : currExpr;
133233
+ const expr = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_17__.castOperandToDecimalIfNeed)(this.compileExpressionToFlashExpression(curr, prefix, target, addPrecalculationRule));
133234
+ const currExpr = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.EqExpression(expr, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.NullLiteralExpression()), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.IntegerLiteralExpression(0), expr);
133235
+ return acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.MultiplyBinaryExpression(acc, currExpr) : currExpr;
133195
133236
  }, undefined);
133196
133237
 
133197
133238
  if (result == undefined) {
133198
133239
  throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_7__.InvalidProgramStateError();
133199
133240
  }
133200
133241
 
133201
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.CastExpression(result, "string");
133242
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.CastExpression(result, "string");
133202
133243
  }
133203
133244
 
133204
133245
  compileDivisionExpression(expression, prefix, target, addPrecalculationRule) {
133205
133246
  const result = expression.arguments.reduce((acc, curr) => {
133206
- const currExpr = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_16__.castOperandToDecimalIfNeed)(this.compileExpressionToFlashExpression(curr, prefix, target, addPrecalculationRule));
133207
- return acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.DivisionBinaryExpression(acc, currExpr) : currExpr;
133247
+ const currExpr = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_17__.castOperandToDecimalIfNeed)(this.compileExpressionToFlashExpression(curr, prefix, target, addPrecalculationRule));
133248
+ return acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.DivisionBinaryExpression(acc, currExpr) : currExpr;
133208
133249
  }, undefined);
133209
133250
 
133210
133251
  if (result == undefined) {
133211
133252
  throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_7__.InvalidProgramStateError();
133212
133253
  }
133213
133254
 
133214
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.CastExpression(result, "string");
133255
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.CastExpression(result, "string");
133215
133256
  }
133216
133257
 
133217
133258
  *buildSugarValidationRules() {
133218
133259
  const converter = new _markupGenerator_ElementProcessors_FormParts_Form_FormConverter__WEBPACK_IMPORTED_MODULE_2__.FormConverter(this.sugarRoot);
133219
- const context = new _FLangValidationBuildContext__WEBPACK_IMPORTED_MODULE_15__.FLangValidationBuildContext(this.typesRegistry, this.formSchemaRng, this.useSchemaValidations);
133260
+ const context = new _FLangValidationBuildContext__WEBPACK_IMPORTED_MODULE_16__.FLangValidationBuildContext(this.typesRegistry, this.formSchemaRng, this.useSchemaValidations);
133220
133261
  const kcRules = this.buildKcValidationRules();
133221
133262
  const allRules = Iterator.from(converter.buildFLangValidations(context, this.formSchemaRng)).reduce((ctx, current) => {
133222
133263
  const statement = current.statement;
133223
133264
 
133224
- if (!(statement instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.SetStatement)) {
133265
+ if (!(statement instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.SetStatement)) {
133225
133266
  throw new Error("This type of node is not supported!");
133226
133267
  }
133227
133268
 
133228
133269
  const targetCtx = current.checkType === "warning" ? ctx.warnings : ctx.errors;
133229
133270
  const path = statement.left.modePath.toLegacyPath();
133230
133271
  const existing = targetCtx[path];
133231
- const expression = existing != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.NotEqExpression(statement.right, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.NullLiteralExpression()), statement.right, existing) : statement.right;
133272
+ const expression = existing != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.NotEqExpression(statement.right, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.NullLiteralExpression()), statement.right, existing) : statement.right;
133232
133273
  targetCtx[path] = expression;
133233
133274
  return ctx;
133234
133275
  }, kcRules);
133235
133276
 
133236
- const createRule = (rules, path, checkType) => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ValueReferenceExpression((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createFromMask)(path, true, _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each), checkType), rules[path]);
133277
+ const createRule = (rules, path, checkType) => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ValueReferenceExpression((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createFromMask)(path, true, _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each), checkType), rules[path]);
133237
133278
 
133238
133279
  const rules = Object.keys(allRules.errors).map(path => createRule(allRules.errors, path, "error")).concat(Object.keys(allRules.warnings).map(path => createRule(allRules.warnings, path, "warning")));
133239
133280
 
@@ -133260,7 +133301,7 @@ class NormalizationRulesGenerator {
133260
133301
 
133261
133302
  *buildErrorWarningCountRules(allPathsWithValidations, fieldName) {
133262
133303
  const countFieldName = `${fieldName}sCount`;
133263
- const zeroExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.DecimalLiteralExpression(0);
133304
+ const zeroExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.DecimalLiteralExpression(0);
133264
133305
  const totalErrorCountExpressions = new _Common_ModelPath_Map_AbsoluteModelPathMap__WEBPACK_IMPORTED_MODULE_11__.AbsoluteModelPathMap(_Common_ModelPath_EachCurrentCollision__WEBPACK_IMPORTED_MODULE_5__.EachCurrentCollision.AreDifferent);
133265
133306
  const errorCountByTarget = new _Common_ModelPath_Map_AbsoluteModelPathMap__WEBPACK_IMPORTED_MODULE_11__.AbsoluteModelPathMap(_Common_ModelPath_EachCurrentCollision__WEBPACK_IMPORTED_MODULE_5__.EachCurrentCollision.AreDifferent);
133266
133307
 
@@ -133274,11 +133315,11 @@ class NormalizationRulesGenerator {
133274
133315
  if (this.dataDeclarationHelper.isErrorsAndWarningsCountRequired(iterationPath) && this.dataDeclarationHelper.isNodeHasChildrenEntry(iterationPath)) {
133275
133316
  const multipleTarget = iterationPath.joinWith(_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each);
133276
133317
  errorCountByTarget.getOrSet(multipleTarget, () => []).push(resultCountExpression);
133277
- resultCountExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.CastExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ValueReferenceExpression(multipleTarget.toCurrentIteration(), countFieldName), "decimal", new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.DecimalLiteralExpression(0));
133318
+ resultCountExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.CastExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ValueReferenceExpression(multipleTarget.toCurrentIteration(), countFieldName), "decimal", new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.DecimalLiteralExpression(0));
133278
133319
  }
133279
133320
 
133280
133321
  errorCountByTarget.getOrSet(iterationPath, () => []).push(resultCountExpression);
133281
- resultCountExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.CastExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ValueReferenceExpression(iterationPath.toCurrentIteration(), countFieldName), "decimal", new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.DecimalLiteralExpression(0));
133322
+ resultCountExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.CastExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ValueReferenceExpression(iterationPath.toCurrentIteration(), countFieldName), "decimal", new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.DecimalLiteralExpression(0));
133282
133323
  }
133283
133324
 
133284
133325
  totalErrorCountExpressions.set((_IterUtils$last = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_0__.IterUtils.last(iterationSequence)) !== null && _IterUtils$last !== void 0 ? _IterUtils$last : path, resultCountExpression);
@@ -133287,23 +133328,23 @@ class NormalizationRulesGenerator {
133287
133328
  for (const entry of errorCountByTarget.entries()) {
133288
133329
  const iterable = entry[0];
133289
133330
  const items = [..._Common_IterableUtils__WEBPACK_IMPORTED_MODULE_0__.IterUtils.distinctBy(entry[1], x => x.convertToString())];
133290
- const firstEmptyExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.NullLiteralExpression();
133291
- const allItemsSumExpression = items.reduce((x, y) => x == firstEmptyExpression ? y : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.SumBinaryExpression(x, y), firstEmptyExpression);
133292
- const nextErrorCountPrecalculation = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ValueReferenceExpression(iterable, countFieldName);
133331
+ const firstEmptyExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.NullLiteralExpression();
133332
+ const allItemsSumExpression = items.reduce((x, y) => x == firstEmptyExpression ? y : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.SumBinaryExpression(x, y), firstEmptyExpression);
133333
+ const nextErrorCountPrecalculation = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ValueReferenceExpression(iterable, countFieldName);
133293
133334
 
133294
133335
  if (_Common_IterableUtils__WEBPACK_IMPORTED_MODULE_0__.IterUtils.last(iterable.getPathParts()) === _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each || !this.dataDeclarationHelper.isNodeHasChildrenEntry(iterable)) {
133295
- yield new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.SetStatement(nextErrorCountPrecalculation, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.CastExpression(allItemsSumExpression, "string", new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.StringLiteralExpression("G29")));
133336
+ yield new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.SetStatement(nextErrorCountPrecalculation, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.CastExpression(allItemsSumExpression, "string", new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.StringLiteralExpression("G29")));
133296
133337
  } else {
133297
- yield new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.SetStatement(nextErrorCountPrecalculation, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.CastExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ReduceCallExpression(iterable.toCurrentIteration(), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.AnonymousFunctionDeclarationExpression(_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.BuildInTypeExpression.decimal, [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ArgumentDeclarationExpression("result", _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.BuildInTypeExpression.decimal)], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.SumBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ArgumentReferenceExpression("result"), allItemsSumExpression)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.DecimalLiteralExpression(0)), "string", new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.StringLiteralExpression("G29")));
133338
+ yield new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.SetStatement(nextErrorCountPrecalculation, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.CastExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ReduceCallExpression(iterable.toCurrentIteration(), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.AnonymousFunctionDeclarationExpression(_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.BuildInTypeExpression.decimal, [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ArgumentDeclarationExpression("result", _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.BuildInTypeExpression.decimal)], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.SumBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ArgumentReferenceExpression("result"), allItemsSumExpression)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.DecimalLiteralExpression(0)), "string", new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.StringLiteralExpression("G29")));
133298
133339
  }
133299
133340
  }
133300
133341
 
133301
- const allRules = Iterator.from(totalErrorCountExpressions.values()).reduce((result, expression) => result === zeroExpression ? expression : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.SumBinaryExpression(result, expression), zeroExpression);
133302
- yield new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ValueReferenceExpression((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createAbsolute)((0,_markupGenerator_getRootPath__WEBPACK_IMPORTED_MODULE_4__.getRootPath)(this.sugarRoot)), countFieldName), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.CastExpression(allRules, "string", new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.StringLiteralExpression("G29")));
133342
+ const allRules = Iterator.from(totalErrorCountExpressions.values()).reduce((result, expression) => result === zeroExpression ? expression : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.SumBinaryExpression(result, expression), zeroExpression);
133343
+ yield new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ValueReferenceExpression((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createAbsolute)((0,_markupGenerator_getRootPath__WEBPACK_IMPORTED_MODULE_4__.getRootPath)(this.sugarRoot)), countFieldName), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.CastExpression(allRules, "string", new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.StringLiteralExpression("G29")));
133303
133344
  }
133304
133345
 
133305
133346
  getErrorWarningCountExpression(path, fieldName) {
133306
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.OrBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.IsEqualsBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ValueReferenceExpression(path, fieldName), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.StringLiteralExpression(`[]`)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.IsEqualsBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ValueReferenceExpression(path, fieldName), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.NullLiteralExpression())), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.DecimalLiteralExpression(0), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.DecimalLiteralExpression(1));
133347
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.OrBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.IsEqualsBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ValueReferenceExpression(path, fieldName), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.StringLiteralExpression(`[]`)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.IsEqualsBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.ValueReferenceExpression(path, fieldName), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.NullLiteralExpression())), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.DecimalLiteralExpression(0), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_15__.DecimalLiteralExpression(1));
133307
133348
  }
133308
133349
 
133309
133350
  preparePathAndAdjustMultiplicity(prefix, path) {
@@ -157672,8 +157713,10 @@ class TextConverter extends _SugarNodeConverter__WEBPACK_IMPORTED_MODULE_3__.Sug
157672
157713
  }
157673
157714
 
157674
157715
  doBuildNormalizeRules() {
157716
+ var _node$dataBinding$def, _node$dataBinding;
157717
+
157675
157718
  const node = this.getCurrentNodeAs(_TextNode__WEBPACK_IMPORTED_MODULE_7__.TextNode);
157676
- const defaultValue = "";
157719
+ const defaultValue = (_node$dataBinding$def = (_node$dataBinding = node.dataBinding) === null || _node$dataBinding === void 0 ? void 0 : _node$dataBinding.defaultValue) !== null && _node$dataBinding$def !== void 0 ? _node$dataBinding$def : "";
157677
157720
  const targetValueReference = new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression(node.getFullPath().toEachIteration(), "value");
157678
157721
  const currentValueReference = new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.NoDepsExpression(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression(node.getFullPath().toCurrentIteration(), "value"));
157679
157722
  let valueExpression = new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.StringLiteralExpression(defaultValue);
@@ -162825,7 +162868,7 @@ class ValidationGenerator {
162825
162868
  return [true, []];
162826
162869
  } else if (!dependenciesRequiredValidator.hasOptionalParent) {
162827
162870
  return [false, []];
162828
- } else if (dependenciesRequiredValidator.dependencies.length > 0 && dependenciesRequiredValidator.dependencies.length < 16) {
162871
+ } else if (dependenciesRequiredValidator.dependencies.length > 0 && dependenciesRequiredValidator.dependencies.length <= ValidationGenerator.MAX_OPTIONAL_CHILDREN_LIMIT) {
162829
162872
  return [true, dependenciesRequiredValidator.dependencies];
162830
162873
  }
162831
162874
 
@@ -162906,6 +162949,7 @@ class ValidationGenerator {
162906
162949
  }
162907
162950
 
162908
162951
  }
162952
+ ValidationGenerator.MAX_OPTIONAL_CHILDREN_LIMIT = 18;
162909
162953
 
162910
162954
  function absoluteModelPathGenerator(path) {
162911
162955
  return `ap([${path.getPathPartsAsArray().map(x => x === _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_8__.PathTokens.each ? "each" : x === _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_8__.PathTokens.current ? "current" : JSON.stringify(x)).join(", ")}])`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kontur.candy/generator",
3
- "version": "4.277.0-fs-7292-normalization-fixes.2",
3
+ "version": "4.277.0-fs-7292-normalization-fixes.5",
4
4
  "description": "Candy forms generator",
5
5
  "author": "SKBKontur Candy Team",
6
6
  "private": false,