@kontur.candy/generator 5.46.0-incremental-dictionaries.1 → 5.46.0-incremental-dictionaries.4

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 +429 -276
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -49790,6 +49790,12 @@ class KCLangAntlrVisitor {
49790
49790
  case "string":
49791
49791
  dataType = "string";
49792
49792
  break;
49793
+ case "dict":
49794
+ dataType = "dict";
49795
+ break;
49796
+ case "array":
49797
+ dataType = "array";
49798
+ break;
49793
49799
  default:
49794
49800
  throw Error("visitType syntax incorrect");
49795
49801
  }
@@ -63762,7 +63768,7 @@ class FormulaExpression extends _markupGenerator_Serializer_SugarSerializer__WEB
63762
63768
  throw new Error(`${this.constructor} does not decorated with sugarNode() properly`);
63763
63769
  }
63764
63770
  }
63765
- const typeArgumentValueParser = _markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.enum("decimal", "string");
63771
+ const typeArgumentValueParser = _markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.attrType.enum("decimal", "string", "dict", "array");
63766
63772
  let FormulaWhenExpression = (_dec = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.sugarNode)("when", `TODO`), _dec2 = (0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_5__.children)(), _dec(_class = (_class2 = class FormulaWhenExpression extends FormulaExpression {
63767
63773
  constructor(...args) {
63768
63774
  super(...args);
@@ -67233,7 +67239,7 @@ class LazyLoadDeclarationGenerator {
67233
67239
  thresholdValue: lazyLoadingNodeDeclaration.thresholdValue
67234
67240
  };
67235
67241
  }
67236
- const result = this.replaceHolder(`
67242
+ const result = LazyLoadDeclarationGenerator.replaceHolder(`
67237
67243
  export default function lazyLoadDeclaration() {
67238
67244
  return ${serialize_javascript__WEBPACK_IMPORTED_MODULE_0___default()(declaration, {
67239
67245
  space: " "
@@ -67245,6 +67251,16 @@ class LazyLoadDeclarationGenerator {
67245
67251
  declaration: declaration
67246
67252
  };
67247
67253
  }
67254
+ static convertDeclarationToContent(declaration) {
67255
+ const result = LazyLoadDeclarationGenerator.replaceHolder(`
67256
+ export default function lazyLoadDeclaration() {
67257
+ return ${serialize_javascript__WEBPACK_IMPORTED_MODULE_0___default()(declaration, {
67258
+ space: " "
67259
+ })};
67260
+ };`);
67261
+ const content = unescape(result.replace(/(\\)(u[\dA-Fa-f]{4})/g, "%$2"));
67262
+ return content;
67263
+ }
67248
67264
  *extractLazyLoadingDeclarationFromSugar(sugarRoot) {
67249
67265
  const controlConverterClass = (0,_markupGenerator_AllConverters__WEBPACK_IMPORTED_MODULE_5__.getConverterByNodeClass)((0,_markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_4__.getNodeClass)(sugarRoot));
67250
67266
  if (controlConverterClass != undefined) {
@@ -67323,7 +67339,7 @@ class LazyLoadDeclarationGenerator {
67323
67339
  yield* this.processElement(nextPath, child);
67324
67340
  }
67325
67341
  }
67326
- replaceHolder(decl) {
67342
+ static replaceHolder(decl) {
67327
67343
  let replacedDecl = decl;
67328
67344
  for (const [placeholderName, placeHoldersFunction] of (0,_Common_IterableUtils__WEBPACK_IMPORTED_MODULE_1__.iterateEntries)(_DataDeclarationGenerator_placeholders__WEBPACK_IMPORTED_MODULE_2__.placeHolders)) {
67329
67345
  const checkName = `"#(${placeholderName})(\\('[\\w]*'\\))?#"`;
@@ -67499,14 +67515,15 @@ function processSugar(formSugarContent, additionalContent, generationOptions) {
67499
67515
  markupGenerator.generate(sugarRoot, builder);
67500
67516
  builder.addResource("settings.js", (0,_markupGenerator_getSettings__WEBPACK_IMPORTED_MODULE_9__.getSettings)(sugarRoot, additionalContent.gfv, additionalSettings, additionalContent.formJsonSettings));
67501
67517
  builder.addResource("requisiteList.js", (0,_RequisiteLIst_requisiteList__WEBPACK_IMPORTED_MODULE_24__.getRequisiteList)(sugarRoot, fetchFunctions));
67502
- builder.addResource("lazyLoadDeclaration.js", lazyLoadGeneratorResult.content);
67503
67518
  const autocalcGenerator = new _AutoCalculationsGenerator_AutoCalculationsGenerator__WEBPACK_IMPORTED_MODULE_18__.AutoCalculationsGenerator(dataDeclarationHelper, schemaRng);
67504
67519
  const formulasForCalculator = useOldCalculator ? formulas : [];
67505
67520
  builder.addResource("calculationFunctions.js", autocalcGenerator.generate(sugarRoot, additionalContent.autocalcsContent, formulasForCalculator));
67506
67521
  builder.addResource("dataDeclaration.js", dataDeclarationContent);
67522
+ let finalLazyLoadDeclaration = lazyLoadGeneratorResult.declaration;
67507
67523
  if ((_additionalContent$fo5 = (_additionalContent$fo6 = additionalContent.formJsonSettings) === null || _additionalContent$fo6 === void 0 ? void 0 : _additionalContent$fo6.useServerSideFLangNormalization) !== null && _additionalContent$fo5 !== void 0 ? _additionalContent$fo5 : false) {
67508
67524
  var _additionalContent$fo7, _additionalContent$fo8, _additionalContent$fo9;
67509
67525
  const defaultNormalizationRules = normalizationRulesGenerator.generateRules();
67526
+ finalLazyLoadDeclaration = mixLazyLoadingDeclarationWithServerOnlyPaths(lazyLoadGeneratorResult.declaration, defaultNormalizationRules.serverOnlyPaths);
67510
67527
  const customNormalizers = [{
67511
67528
  normalizerId: "formulas",
67512
67529
  content: (_additionalContent$fo7 = additionalContent.formJsonSettings) !== null && _additionalContent$fo7 !== void 0 && _additionalContent$fo7.disableFlangRulesForEnableAutoFieldFeature ? "" : formulaOnlyNormalizationRulesGenerator.generateRules()
@@ -67539,9 +67556,10 @@ function processSugar(formSugarContent, additionalContent, generationOptions) {
67539
67556
  throw new Error(`Cannot transform normalization file with ${additionalNormalizer.extension} extension`);
67540
67557
  }
67541
67558
  }) : [];
67542
- const resultRules = combineFlangRules(defaultNormalizationRules, ...additionalNormalizationRules, ...customNormalizers);
67559
+ const resultRules = combineFlangRules(defaultNormalizationRules.content, ...additionalNormalizationRules, ...customNormalizers);
67543
67560
  builder.addServerSideResource("ServerSide.normalize", resultRules);
67544
67561
  }
67562
+ builder.addResource("lazyLoadDeclaration.js", _LazyLoadDeclarationGenerator_LazyLoadDeclarationGenerator__WEBPACK_IMPORTED_MODULE_29__.LazyLoadDeclarationGenerator.convertDeclarationToContent(finalLazyLoadDeclaration));
67545
67563
  const attachmentPathsGenerator = new _AttachmentPaths_AttachmentPathsGenerator__WEBPACK_IMPORTED_MODULE_27__.AttachmentPathsGenerator();
67546
67564
  const attachmentPaths = attachmentPathsGenerator.generate(sugarRoot);
67547
67565
  builder.addServerSideResource(`AttachmentPaths.json`, JSON.stringify(attachmentPaths));
@@ -67582,6 +67600,17 @@ function processSugar(formSugarContent, additionalContent, generationOptions) {
67582
67600
  return (0,_common_Errors_ProcessSugarErrors__WEBPACK_IMPORTED_MODULE_1__.processSugarErrors)(e, additionalContent.gfv);
67583
67601
  }
67584
67602
  }
67603
+ function mixLazyLoadingDeclarationWithServerOnlyPaths(declaration, paths) {
67604
+ const updateDeclaration = {
67605
+ ...declaration
67606
+ };
67607
+ for (const path of paths) {
67608
+ updateDeclaration[path.toString()] = {
67609
+ lazyLoadMode: "serverOnly"
67610
+ };
67611
+ }
67612
+ return updateDeclaration;
67613
+ }
67585
67614
  function combineFlangRules(baseRules, ...rules) {
67586
67615
  const customNormalizeRules = rules.filter(r => r.normalizerId).map(x => `--${x.normalizerId}--\n${x.content}`);
67587
67616
  const additionalBaseRules = rules.filter(r => !r.normalizerId).map(r => r.content);
@@ -68070,7 +68099,7 @@ class CustomKCLangToFlangRuleGenerator {
68070
68099
  const result = [];
68071
68100
  const getFormulaExpression = field => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.NullCoalesceExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_5__.wrapWithArgumentsCondition)((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_5__.castOperandToStringIfNeed)(this.formulaExprConverter.compileExpressionToFlangExpression(formula.expression, prefix, new _Common_ModelPath_AbsoluteModelFieldPath__WEBPACK_IMPORTED_MODULE_4__.AbsoluteModelFieldPath(fullTarget, field), x => precalculationRules.push(x)), "G29")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.StringLiteralExpression(defaultValue));
68072
68101
  if (isTargetAutoField) {
68073
- result.push(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.ValueReferenceExpression(fullTarget, "autoValue"), getFormulaExpression("autoValue")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.ValueReferenceExpression(fullTarget, "value"), getFormulaExpression("value")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.ValueReferenceExpression(fullTarget, "autoFlag"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.CastExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.IsEqualsBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "value"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "autoValue")), _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.BuildInTypeExpression.string)));
68102
+ result.push(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.ValueReferenceExpression(fullTarget, "autoValue"), getFormulaExpression("autoValue")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.ValueReferenceExpression(fullTarget, "value"), getFormulaExpression("value")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.ValueReferenceExpression(fullTarget, "autoFlag"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.CastExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.IsEqualsBinaryExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_5__.makeStringValueReference)(fullTarget.toCurrentIteration(), "value"), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_5__.makeStringValueReference)(fullTarget.toCurrentIteration(), "autoValue")), _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.BuildInTypeExpression.string)));
68074
68103
  } else {
68075
68104
  result.push(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_6__.ValueReferenceExpression(fullTarget, "value"), getFormulaExpression("value")));
68076
68105
  }
@@ -68160,8 +68189,8 @@ class FLangValidationBuildContext {
68160
68189
  buildBasicValidations(targetPath, typeNode, schemaTypeNode, optional, highOrderDescription, nodeGId) {
68161
68190
  var _typeNode$base, _typeNode$description;
68162
68191
  const validations = [];
68163
- const valueReference = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ValueReferenceExpression(targetPath.toCurrentIteration(), "value");
68164
- const autoValueReference = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ValueReferenceExpression(targetPath.toCurrentIteration(), "autoValue");
68192
+ const valueReference = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_13__.makeStringValueReference)(targetPath.toCurrentIteration(), "value");
68193
+ const autoValueReference = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_13__.makeStringValueReference)(targetPath.toCurrentIteration(), "autoValue");
68165
68194
  const baseName = (_typeNode$base = typeNode === null || typeNode === void 0 ? void 0 : typeNode.base) !== null && _typeNode$base !== void 0 ? _typeNode$base : schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.baseType;
68166
68195
  const baseDescription = (_typeNode$description = typeNode === null || typeNode === void 0 ? void 0 : typeNode.description) !== null && _typeNode$description !== void 0 ? _typeNode$description : schemaTypeNode === null || schemaTypeNode === void 0 ? void 0 : schemaTypeNode.description;
68167
68196
  if (baseName != undefined) {
@@ -68184,7 +68213,7 @@ class FLangValidationBuildContext {
68184
68213
  const schemaNode = this.schemaRng.getElementByPath(targetPath);
68185
68214
  const parentNode = schemaNode != undefined ? this.getFirstAcceptedParent(schemaNode) : undefined;
68186
68215
  const allChildrenPaths = parentNode instanceof _common_SchemaRng_FormSchemaRng__WEBPACK_IMPORTED_MODULE_2__.FormSchemaRngElement ? this.schemaRng.getAllChildValueNodes(parentNode).map(x => this.schemaRng.getPath(x, _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each)).filter(x => !(0,_Common_ModelPath_PathSplitHelper__WEBPACK_IMPORTED_MODULE_4__.getMatchedAndDifferentModelPaths)(targetPath, x).differentPath.isContainIteration()) : undefined;
68187
- const restChecks = allChildrenPaths === null || allChildrenPaths === void 0 ? void 0 : allChildrenPaths.map(childPath => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.EqExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ValueReferenceExpression(childPath.toCurrentIteration(), "value"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.StringLiteralExpression(""))).reduce(_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_13__.combineByAndFlangExpr, undefined);
68216
+ const restChecks = allChildrenPaths === null || allChildrenPaths === void 0 ? void 0 : allChildrenPaths.map(childPath => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.EqExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_13__.makeStringValueReference)(childPath.toCurrentIteration(), "value"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.StringLiteralExpression(""))).reduce(_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_13__.combineByAndFlangExpr, undefined);
68188
68217
  const errorValidations = validations.filter(x => !x.checkType || x.checkType === "error");
68189
68218
  const errorExpression = this.createFlangExpression((0,_Common_IterableUtils__WEBPACK_IMPORTED_MODULE_5__.reverseArray)(errorValidations), targetPath, valueReference, "error", highOrderDescription !== null && highOrderDescription !== void 0 ? highOrderDescription : typeNode === null || typeNode === void 0 ? void 0 : typeNode.requiredDescription, optional, parentNode, restChecks);
68190
68219
  const result = [];
@@ -68279,7 +68308,7 @@ class FLangValidationBuildContext {
68279
68308
  const value = match === null || match === void 0 || (_match$3 = match[0]) === null || _match$3 === void 0 ? void 0 : _match$3[3];
68280
68309
  if (path != undefined && sign != undefined && value != undefined) {
68281
68310
  const fullPath = this.schemaRng.adjustPathMultiplicity(prefix.joinWith((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createModelPath)(path, false)).normalize()).trimLastStarIfLastToken().toCurrentIteration();
68282
- const valueRef = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.ValueReferenceExpression(fullPath, "children");
68311
+ const valueRef = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_13__.makeStringValueReference)(fullPath, "children");
68283
68312
  const len = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.LenExpression(valueRef);
68284
68313
  const argument = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_14__.DecimalLiteralExpression(value);
68285
68314
  const getOperation = () => {
@@ -68582,6 +68611,7 @@ __webpack_require__.r(__webpack_exports__);
68582
68611
  /* harmony export */ DifferenceInMonthsExpression: () => (/* binding */ DifferenceInMonthsExpression),
68583
68612
  /* harmony export */ DivisionBinaryExpression: () => (/* binding */ DivisionBinaryExpression),
68584
68613
  /* harmony export */ EqExpression: () => (/* binding */ EqExpression),
68614
+ /* harmony export */ ExistsExpression: () => (/* binding */ ExistsExpression),
68585
68615
  /* harmony export */ FLangBoolExpression: () => (/* binding */ FLangBoolExpression),
68586
68616
  /* harmony export */ FLangDecimalExpression: () => (/* binding */ FLangDecimalExpression),
68587
68617
  /* harmony export */ FLangDictExpression: () => (/* binding */ FLangDictExpression),
@@ -68733,7 +68763,7 @@ class ValueReferenceExpression extends FLangExpression {
68733
68763
  return [];
68734
68764
  }
68735
68765
  getType() {
68736
- return BuildInTypeExpression.string;
68766
+ return BuildInTypeExpression.object;
68737
68767
  }
68738
68768
  convertToString() {
68739
68769
  return `${toFLangString(this.modePath)}.${this.valueName}`;
@@ -68931,6 +68961,7 @@ class BuildInTypeExpression extends TypeReferenceExpression {
68931
68961
  }
68932
68962
  }
68933
68963
  _BuildInTypeExpression = BuildInTypeExpression;
68964
+ BuildInTypeExpression.object = new _BuildInTypeExpression("object");
68934
68965
  BuildInTypeExpression.decimal = new _BuildInTypeExpression("decimal");
68935
68966
  BuildInTypeExpression.string = new _BuildInTypeExpression("string");
68936
68967
  BuildInTypeExpression.dict = new _BuildInTypeExpression("dict");
@@ -69187,7 +69218,7 @@ class StringLiteralExpression extends ConstExpression {
69187
69218
  return JSON.stringify(this.stringValue);
69188
69219
  }
69189
69220
  }
69190
- class DecimalLiteralExpression extends FLangDecimalExpression {
69221
+ class DecimalLiteralExpression extends ConstExpression {
69191
69222
  constructor(value) {
69192
69223
  super();
69193
69224
  this.value = void 0;
@@ -69764,7 +69795,23 @@ class ArrayExpression extends FLangExpression {
69764
69795
  }
69765
69796
  convertToString() {
69766
69797
  const items = this.items.map(x => x.convertToString()).join(", ");
69767
- return `array(${items})`;
69798
+ return `makeArray(${items})`;
69799
+ }
69800
+ }
69801
+ class ExistsExpression extends FLangExpression {
69802
+ constructor(source) {
69803
+ super();
69804
+ this.source = void 0;
69805
+ this.source = source;
69806
+ }
69807
+ getType() {
69808
+ return BuildInTypeExpression.bool;
69809
+ }
69810
+ *getChildNodes() {
69811
+ yield this.source;
69812
+ }
69813
+ convertToString() {
69814
+ return `exists(${this.source.convertToString()})`;
69768
69815
  }
69769
69816
  }
69770
69817
  class NullCoalesceExpression extends FLangExpression {
@@ -69900,7 +69947,7 @@ class GetOldExpression extends FLangExpression {
69900
69947
  return [];
69901
69948
  }
69902
69949
  getType() {
69903
- return BuildInTypeExpression.bool;
69950
+ return this.expression.getType();
69904
69951
  }
69905
69952
  convertToString() {
69906
69953
  return `old(${this.expression.convertToString()})`;
@@ -69935,6 +69982,7 @@ class SetStatement extends FLangStatement {
69935
69982
  "use strict";
69936
69983
  __webpack_require__.r(__webpack_exports__);
69937
69984
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
69985
+ /* harmony export */ castOperandIfNeed: () => (/* binding */ castOperandIfNeed),
69938
69986
  /* harmony export */ castOperandToBoolIfNeed: () => (/* binding */ castOperandToBoolIfNeed),
69939
69987
  /* harmony export */ castOperandToDateTimeIfNeed: () => (/* binding */ castOperandToDateTimeIfNeed),
69940
69988
  /* harmony export */ castOperandToDecimalIfNeed: () => (/* binding */ castOperandToDecimalIfNeed),
@@ -69944,15 +69992,22 @@ __webpack_require__.r(__webpack_exports__);
69944
69992
  /* harmony export */ combineRulesWithOptionalSectionChecking: () => (/* binding */ combineRulesWithOptionalSectionChecking),
69945
69993
  /* harmony export */ decimalWrapper: () => (/* binding */ decimalWrapper),
69946
69994
  /* harmony export */ ensureOperandsOfTypeOrNull: () => (/* binding */ ensureOperandsOfTypeOrNull),
69995
+ /* harmony export */ extractValueReferenceFromCast: () => (/* binding */ extractValueReferenceFromCast),
69947
69996
  /* harmony export */ getAllExpressionChildren: () => (/* binding */ getAllExpressionChildren),
69997
+ /* harmony export */ makeGetOld: () => (/* binding */ makeGetOld),
69998
+ /* harmony export */ makeNoDeps: () => (/* binding */ makeNoDeps),
69999
+ /* harmony export */ makeStringValueReference: () => (/* binding */ makeStringValueReference),
69948
70000
  /* harmony export */ nullCoalesceWithTypeCheck: () => (/* binding */ nullCoalesceWithTypeCheck),
69949
70001
  /* harmony export */ tryExtractValueReferenceAsStringFromDecimal: () => (/* binding */ tryExtractValueReferenceAsStringFromDecimal),
69950
70002
  /* harmony export */ wrapWithArgumentsCondition: () => (/* binding */ wrapWithArgumentsCondition),
69951
70003
  /* harmony export */ wrapWithDisableValueAutoInitFlagCheckIfRequired: () => (/* binding */ wrapWithDisableValueAutoInitFlagCheckIfRequired)
69952
70004
  /* harmony export */ });
69953
- /* harmony import */ var _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../Common/IterableUtils */ "./Common/IterableUtils.ts");
69954
- /* harmony import */ var _Common_TypingUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../../Common/TypingUtils */ "./Common/TypingUtils.ts");
69955
- /* harmony import */ var _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./FLangCodeDom */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FLangCodeDom.ts");
70005
+ /* harmony import */ var util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! util */ "util");
70006
+ /* harmony import */ var util__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(util__WEBPACK_IMPORTED_MODULE_0__);
70007
+ /* harmony import */ var _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../../Common/IterableUtils */ "./Common/IterableUtils.ts");
70008
+ /* harmony import */ var _Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../../Common/TypingUtils */ "./Common/TypingUtils.ts");
70009
+ /* harmony import */ var _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./FLangCodeDom */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FLangCodeDom.ts");
70010
+
69956
70011
 
69957
70012
 
69958
70013
 
@@ -69966,75 +70021,114 @@ function* getAllExpressionChildren(node, descendantsFilter) {
69966
70021
  }
69967
70022
  }
69968
70023
  function createValueRuleWithDisableValueAutoInitCheck(path, originalExpression) {
69969
- return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.SetStatement(new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.ValueReferenceExpression(path, "value"), new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.ConditionalExpression(new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.EqExpression(new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.ValueReferenceExpression(path.toCurrentIteration(), "disableValueAutoInit"), new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.StringLiteralExpression("true")), new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.NoDepsExpression(new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.ValueReferenceExpression(path.toCurrentIteration(), "value")), originalExpression));
70024
+ return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.SetStatement(new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.ValueReferenceExpression(path, "value"), new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.ConditionalExpression(new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.EqExpression(makeStringValueReference(path.toCurrentIteration(), "disableValueAutoInit"), new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.StringLiteralExpression("true")), new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.NoDepsExpression(castOperandIfNeed(new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.ValueReferenceExpression(path.toCurrentIteration(), "value"), originalExpression.getType())), originalExpression));
69970
70025
  }
69971
70026
  function wrapWithDisableValueAutoInitFlagCheckIfRequired(formSchemaRng, x) {
69972
70027
  var _formSchemaRng$getEle;
69973
- return x instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.SetStatement && x.left.valueName === "value" && (_formSchemaRng$getEle = formSchemaRng.getElementByPath(x.left.modePath)) !== null && _formSchemaRng$getEle !== void 0 && _formSchemaRng$getEle.isIgnoreForcedValueSet() ? [createValueRuleWithDisableValueAutoInitCheck(x.left.modePath, x.right)] : [x];
70028
+ return x instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.SetStatement && x.left.valueName === "value" && (_formSchemaRng$getEle = formSchemaRng.getElementByPath(x.left.modePath)) !== null && _formSchemaRng$getEle !== void 0 && _formSchemaRng$getEle.isIgnoreForcedValueSet() ? [createValueRuleWithDisableValueAutoInitCheck(x.left.modePath, x.right)] : [x];
69974
70029
  }
69975
70030
  function wrapWithArgumentsCondition(expression) {
69976
- const childFilter = node => !(node instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.ReduceCallExpression || node instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.GetSumByKeysExpression || node instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.NoDepsExpression);
69977
- const allValueRefNodes = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_0__.IterUtils.concat([expression], getAllExpressionChildren(expression, childFilter)).map(x => x instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.ValueReferenceExpression ? x : undefined).filter(_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_1__.isNotNullOrUndefined);
69978
- const uniquePaths = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_0__.IterUtils.distinctBy(allValueRefNodes, x => x.convertToString());
69979
- const conditionExpression = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_0__.IterUtils.reduce(uniquePaths, (acc, curr) => {
69980
- const currExpr = new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.AndBinaryExpression(new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.NotEqExpression(new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.ValueReferenceExpression(curr.modePath, curr.valueName), new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.NullLiteralExpression()), new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.NotEqExpression(new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.ValueReferenceExpression(curr.modePath, curr.valueName), new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.StringLiteralExpression("")));
69981
- return acc != undefined ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.OrBinaryExpression(acc, currExpr) : currExpr;
70031
+ const childFilter = node => !(node instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.ReduceCallExpression || node instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.GetSumByKeysExpression || node instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.NoDepsExpression);
70032
+ const allValueRefNodes = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_1__.IterUtils.concat([expression], getAllExpressionChildren(expression, childFilter)).map(x => x instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.ValueReferenceExpression ? x : undefined).filter(_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.isNotNullOrUndefined);
70033
+ const uniquePaths = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_1__.IterUtils.distinctBy(allValueRefNodes, x => x.convertToString());
70034
+ const conditionExpression = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_1__.IterUtils.reduce(uniquePaths, (acc, curr) => {
70035
+ const currExpr = new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.AndBinaryExpression(new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.NotEqExpression(new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.ValueReferenceExpression(curr.modePath, curr.valueName), new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.NullLiteralExpression()), new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.NotEqExpression(new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.ValueReferenceExpression(curr.modePath, curr.valueName), new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.StringLiteralExpression("")));
70036
+ return acc != undefined ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.OrBinaryExpression(acc, currExpr) : currExpr;
69982
70037
  }, undefined);
69983
70038
  if (conditionExpression == undefined) {
69984
70039
  return expression;
69985
70040
  }
69986
- return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.ConditionalExpression(conditionExpression, expression, new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.NullLiteralExpression());
70041
+ return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.ConditionalExpression(conditionExpression, expression, new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.NullLiteralExpression());
69987
70042
  }
69988
70043
  function combineRulesWithOptionalSectionChecking(allRules, optionalSectionRulesBuilder) {
69989
- const allUniqueRules = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_0__.IterUtils.distinctBy(allRules, x => x instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.SetStatement ? x.left.convertToString() : x.convertToString());
70044
+ const allUniqueRules = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_1__.IterUtils.distinctBy(allRules, x => x instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.SetStatement ? x.left.convertToString() : x.convertToString());
69990
70045
  const allUniqueRulesWithOptionalChecks = Iterator.from(optionalSectionRulesBuilder.wrapRulesWithOptionalPageCheck(allUniqueRules)).map(x => x.convertToString()).reduce((x, y) => x + (x ? "\n" : "") + y, "");
69991
70046
  return allUniqueRulesWithOptionalChecks;
69992
70047
  }
69993
70048
  function tryExtractValueReferenceAsStringFromDecimal(expression) {
69994
- if (expression.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.BuildInTypeExpression.decimal && expression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.CastExpression && expression.targetExpression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.ValueReferenceExpression) {
70049
+ if (expression.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.BuildInTypeExpression.decimal && expression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.CastExpression && expression.targetExpression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.ValueReferenceExpression) {
69995
70050
  return expression.targetExpression;
69996
70051
  }
69997
70052
  return expression;
69998
70053
  }
69999
70054
  function castOperandToStringIfNeed(operandExpression, decimalFormat = "G29") {
70000
- if (operandExpression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.DateTimeExpression || operandExpression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.DateNowExpression) {
70001
- return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.DateToStringExpression(operandExpression, new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.StringLiteralExpression("dd.MM.yyyy"));
70055
+ if (operandExpression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.DateTimeExpression || operandExpression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.DateNowExpression) {
70056
+ return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.DateToStringExpression(operandExpression, new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.StringLiteralExpression("dd.MM.yyyy"));
70057
+ }
70058
+ if (operandExpression.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.BuildInTypeExpression.dict || operandExpression.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.BuildInTypeExpression.array || operandExpression.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.BuildInTypeExpression.hashSet) {
70059
+ return operandExpression;
70002
70060
  }
70003
- if (operandExpression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.HashSetExpression) {
70004
- return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.SerializeEnumerationExpression(operandExpression);
70061
+ return operandExpression.getType() != _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.BuildInTypeExpression.string ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.CastExpression(operandExpression, _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.BuildInTypeExpression.string, decimalFormat != undefined && operandExpression.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.BuildInTypeExpression.decimal ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.StringLiteralExpression(decimalFormat) : undefined) : operandExpression;
70062
+ }
70063
+ function castOperandIfNeed(operandExpression, type) {
70064
+ if (type instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.BuildInTypeExpression) {
70065
+ return operandExpression.getType() != type ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.CastExpression(operandExpression, type) : operandExpression;
70005
70066
  }
70006
- return operandExpression.getType() != _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.BuildInTypeExpression.string ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.CastExpression(operandExpression, _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.BuildInTypeExpression.string, decimalFormat != undefined && operandExpression.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.BuildInTypeExpression.decimal ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.StringLiteralExpression(decimalFormat) : undefined) : operandExpression;
70067
+ return (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.reject)(`Invalid type for cast: ${type}`);
70007
70068
  }
70008
70069
  function castOperandToBoolIfNeed(operandExpression) {
70009
- return operandExpression.getType() != _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.BuildInTypeExpression.bool ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.CastExpression(operandExpression, _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.BuildInTypeExpression.bool) : operandExpression;
70070
+ return operandExpression.getType() != _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.BuildInTypeExpression.bool ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.CastExpression(operandExpression, _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.BuildInTypeExpression.bool) : operandExpression;
70010
70071
  }
70011
70072
  function castOperandToDecimalIfNeed(operandExpression, defaultValue) {
70012
- return operandExpression.getType() !== _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.BuildInTypeExpression.decimal ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.CastExpression(operandExpression, _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.BuildInTypeExpression.decimal, defaultValue != undefined ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.DecimalLiteralExpression(defaultValue) : undefined) : operandExpression;
70073
+ return operandExpression.getType() !== _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.BuildInTypeExpression.decimal ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.CastExpression(operandExpression, _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.BuildInTypeExpression.decimal, defaultValue != undefined ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.DecimalLiteralExpression(defaultValue) : undefined) : operandExpression;
70013
70074
  }
70014
- const decimalWrapper = (ex, needWrapped) => needWrapped ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.CastExpression(ex, _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.BuildInTypeExpression.decimal) : ex;
70075
+ const decimalWrapper = (ex, needWrapped) => needWrapped ? castOperandToDecimalIfNeed(ex) : ex;
70015
70076
  function castOperandToDateTimeIfNeed(operandExpression) {
70016
- return operandExpression.getType() != _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.BuildInTypeExpression.dateTime ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.CastExpression(operandExpression, _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.BuildInTypeExpression.dateTime) : operandExpression;
70077
+ return operandExpression.getType() != _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.BuildInTypeExpression.dateTime ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.CastExpression(operandExpression, _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.BuildInTypeExpression.dateTime) : operandExpression;
70017
70078
  }
70018
70079
  function nullCoalesceWithTypeCheck(argument, replacement) {
70019
- const isValid = argument.getType() === replacement.getType() || argument.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.BuildInTypeExpression.null || replacement.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.BuildInTypeExpression.null;
70080
+ const isValid = argument.getType() === replacement.getType() || argument.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.BuildInTypeExpression.null || replacement.getType() === _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.BuildInTypeExpression.null;
70020
70081
  if (!isValid) {
70021
70082
  throw new Error("Couldn't build null coalesce expression: types not match");
70022
70083
  }
70023
- return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.NullCoalesceExpression(argument, replacement);
70084
+ return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.NullCoalesceExpression(argument, replacement);
70024
70085
  }
70025
70086
  function ensureOperandsOfTypeOrNull(type, ...operands) {
70026
70087
  for (const operand of operands) {
70027
70088
  const operandType = operand.getType();
70028
- if (operandType !== _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.BuildInTypeExpression.null && operandType !== type) {
70089
+ if (operandType !== _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.BuildInTypeExpression.null && operandType !== type) {
70029
70090
  throw new Error(`Invalid operand type: required [${type}] but got ${operandType}`);
70030
70091
  }
70031
70092
  }
70032
70093
  }
70033
70094
  function combineByOrFlangExpr(acc, current) {
70034
- return acc != undefined ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.OrBinaryExpression(acc, current) : current;
70095
+ return acc != undefined ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.OrBinaryExpression(acc, current) : current;
70035
70096
  }
70036
70097
  function combineByAndFlangExpr(acc, current) {
70037
- return acc != undefined ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.AndBinaryExpression(acc, current) : current;
70098
+ return acc != undefined ? new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.AndBinaryExpression(acc, current) : current;
70099
+ }
70100
+ function makeNoDeps(expression) {
70101
+ if (expression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.ValueReferenceExpression) {
70102
+ return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.NoDepsExpression(expression);
70103
+ }
70104
+ if (expression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.CastExpression && expression.targetExpression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.ValueReferenceExpression) {
70105
+ return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.CastExpression(new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.NoDepsExpression(expression.targetExpression), expression.targetType, expression.defaultValue);
70106
+ }
70107
+ return (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.reject)(`Invalid NoDeps usage: argument must be native ValueReferenceExpression or wrapped to CastExpression!`);
70108
+ }
70109
+ function makeGetOld(expression) {
70110
+ if (expression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.ValueReferenceExpression) {
70111
+ return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.GetOldExpression(expression);
70112
+ }
70113
+ if (expression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.CastExpression && expression.targetExpression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.ValueReferenceExpression) {
70114
+ return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.CastExpression(new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.GetOldExpression(expression.targetExpression), expression.targetType, expression.defaultValue);
70115
+ }
70116
+ return (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.reject)(`Invalid GetOld usage: argument must be native ValueReferenceExpression or wrapped to CastExpression!`);
70117
+ }
70118
+ function makeStringValueReference(modePath, valueName) {
70119
+ return new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.CastExpression(new _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.ValueReferenceExpression(modePath, valueName), _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.BuildInTypeExpression.string);
70120
+ }
70121
+ function extractValueReferenceFromCast(expression) {
70122
+ if (expression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.ValueReferenceExpression) {
70123
+ return expression;
70124
+ }
70125
+ if (expression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.CastExpression && expression.targetExpression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.ValueReferenceExpression) {
70126
+ return expression.targetExpression;
70127
+ }
70128
+ if (expression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.CastExpression && expression.targetExpression instanceof _FLangCodeDom__WEBPACK_IMPORTED_MODULE_3__.NoDepsExpression) {
70129
+ return expression.targetExpression;
70130
+ }
70131
+ return (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.reject)(`Cannot extract ValueReferenceExpression! ${(0,util__WEBPACK_IMPORTED_MODULE_0__.inspect)(expression)}`);
70038
70132
  }
70039
70133
 
70040
70134
  /***/ }),
@@ -70203,16 +70297,19 @@ __webpack_require__.r(__webpack_exports__);
70203
70297
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
70204
70298
  /* harmony export */ FormulaExpressionToFlangExpressionConverter: () => (/* binding */ FormulaExpressionToFlangExpressionConverter)
70205
70299
  /* harmony export */ });
70206
- /* harmony import */ var _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../AutoCalculationsGenerator/AutoCalculationsFromFormulas/KCXmlContract/Formula */ "./Generator/src/generators/AutoCalculationsGenerator/AutoCalculationsFromFormulas/KCXmlContract/Formula.ts");
70207
- /* harmony import */ var _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../Common/ModelPath/ModelPath */ "./Common/ModelPath/ModelPath.ts");
70208
- /* harmony import */ var _Common_Errors__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../Common/Errors */ "./Common/Errors.ts");
70209
- /* harmony import */ var _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../Common/IterableUtils */ "./Common/IterableUtils.ts");
70210
- /* harmony import */ var _Common_ModelPath_BuildIterationSequence__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../../Common/ModelPath/BuildIterationSequence */ "./Common/ModelPath/BuildIterationSequence.ts");
70211
- /* harmony import */ var _Common_ModelPath_PathSplitHelper__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../../Common/ModelPath/PathSplitHelper */ "./Common/ModelPath/PathSplitHelper.ts");
70212
- /* harmony import */ var _Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../../Common/TypingUtils */ "./Common/TypingUtils.ts");
70213
- /* harmony import */ var _Common_ModelPath_AbsoluteModelFieldPath__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../../Common/ModelPath/AbsoluteModelFieldPath */ "./Common/ModelPath/AbsoluteModelFieldPath.ts");
70214
- /* harmony import */ var _FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./FLang/FlangUtils */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FlangUtils.ts");
70215
- /* harmony import */ var _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./FLang/FLangCodeDom */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FLangCodeDom.ts");
70300
+ /* harmony import */ var util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! util */ "util");
70301
+ /* harmony import */ var util__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(util__WEBPACK_IMPORTED_MODULE_0__);
70302
+ /* harmony import */ var _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../AutoCalculationsGenerator/AutoCalculationsFromFormulas/KCXmlContract/Formula */ "./Generator/src/generators/AutoCalculationsGenerator/AutoCalculationsFromFormulas/KCXmlContract/Formula.ts");
70303
+ /* harmony import */ var _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../Common/ModelPath/ModelPath */ "./Common/ModelPath/ModelPath.ts");
70304
+ /* harmony import */ var _Common_Errors__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../Common/Errors */ "./Common/Errors.ts");
70305
+ /* harmony import */ var _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../../Common/IterableUtils */ "./Common/IterableUtils.ts");
70306
+ /* harmony import */ var _Common_ModelPath_BuildIterationSequence__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../../Common/ModelPath/BuildIterationSequence */ "./Common/ModelPath/BuildIterationSequence.ts");
70307
+ /* harmony import */ var _Common_ModelPath_PathSplitHelper__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../../Common/ModelPath/PathSplitHelper */ "./Common/ModelPath/PathSplitHelper.ts");
70308
+ /* harmony import */ var _Common_TypingUtils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../../Common/TypingUtils */ "./Common/TypingUtils.ts");
70309
+ /* harmony import */ var _Common_ModelPath_AbsoluteModelFieldPath__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../../Common/ModelPath/AbsoluteModelFieldPath */ "./Common/ModelPath/AbsoluteModelFieldPath.ts");
70310
+ /* harmony import */ var _FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./FLang/FlangUtils */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FlangUtils.ts");
70311
+ /* harmony import */ var _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./FLang/FLangCodeDom */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FLangCodeDom.ts");
70312
+
70216
70313
 
70217
70314
 
70218
70315
 
@@ -70231,269 +70328,275 @@ class FormulaExpressionToFlangExpressionConverter {
70231
70328
  compileExpressionToFlangExpression(expression, prefix, target, addPrecalculationRule) {
70232
70329
  const resultExpr = this.compileExpressionToFlangExpressionInternal(expression, prefix, target, addPrecalculationRule);
70233
70330
  // Если формула это только прямое обращение к значене, то трактовать его как строку
70234
- if (resultExpr instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.CastExpression && resultExpr.targetType === _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.decimal && resultExpr.targetExpression instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression) {
70331
+ if (resultExpr instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.CastExpression && resultExpr.targetType === _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.BuildInTypeExpression.decimal && resultExpr.targetExpression instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.ValueReferenceExpression) {
70235
70332
  return resultExpr.targetExpression;
70236
70333
  }
70237
70334
  return resultExpr;
70238
70335
  }
70239
70336
  compileExpressionToFlangExpressionInternal(expression, prefix, target, addPrecalculationRule) {
70240
- if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaSumExpression) {
70337
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaSumExpression) {
70241
70338
  return this.compileSumExpression(expression, prefix, target, addPrecalculationRule);
70242
70339
  }
70243
- if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaArgumentExpression) {
70340
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaArgumentExpression) {
70244
70341
  var _expression$type;
70245
70342
  return this.compiledArgumentExpression(prefix, target, expression.select, (_expression$type = expression.type) !== null && _expression$type !== void 0 ? _expression$type : "decimal", addPrecalculationRule);
70246
70343
  }
70247
- if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaMultySumExpression) {
70344
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaMultySumExpression) {
70248
70345
  return this.compiledArgumentExpression(prefix, target, expression.select, "decimal", addPrecalculationRule);
70249
70346
  }
70250
- if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaAbsExpression) {
70251
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.AbsExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)));
70347
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaAbsExpression) {
70348
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.AbsExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.castOperandToDecimalIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)));
70252
70349
  }
70253
- if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaXAbsExpression) {
70254
- const expr = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule));
70255
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.LtExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(expr), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(0)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(0), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.AbsExpression(expr));
70350
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaXAbsExpression) {
70351
+ const expr = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.castOperandToDecimalIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule));
70352
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.LtExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.castOperandToDecimalIfNeed)(expr), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.DecimalLiteralExpression(0)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.DecimalLiteralExpression(0), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.AbsExpression(expr));
70256
70353
  }
70257
- if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaRoundExpression) {
70258
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.RoundExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.IntegerLiteralExpression(expression.fractionalDigits));
70354
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaRoundExpression) {
70355
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.RoundExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.castOperandToDecimalIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.IntegerLiteralExpression(expression.fractionalDigits));
70259
70356
  }
70260
- if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaFloorExpression) {
70261
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.FloorExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)));
70357
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaFloorExpression) {
70358
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.FloorExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.castOperandToDecimalIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)));
70262
70359
  }
70263
- if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaChooseExpression) {
70360
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaChooseExpression) {
70264
70361
  const condExpr = this.compileExpressionToFlangExpressionInternal(expression.ifNode.condition, prefix, target, addPrecalculationRule);
70265
70362
  const thenExpr = this.compileExpressionToFlangExpressionInternal(expression.thenNode.expression, prefix, target, addPrecalculationRule);
70266
70363
  const elseExpr = this.compileExpressionToFlangExpressionInternal(expression.elseNode.expression, prefix, target, addPrecalculationRule);
70267
- const castToStringRequired = thenExpr.getType() === _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.string || elseExpr.getType() === _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.string;
70268
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ConditionalExpression(condExpr, castToStringRequired ? (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(thenExpr) : thenExpr, castToStringRequired ? (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(elseExpr) : elseExpr);
70364
+ const castToStringRequired = thenExpr.getType() === _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.BuildInTypeExpression.string || elseExpr.getType() === _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.BuildInTypeExpression.string;
70365
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.ConditionalExpression(condExpr, castToStringRequired ? (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.castOperandToStringIfNeed)(thenExpr) : thenExpr, castToStringRequired ? (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.castOperandToStringIfNeed)(elseExpr) : elseExpr);
70269
70366
  }
70270
- if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaMultiplyExpression) {
70367
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaMultiplyExpression) {
70271
70368
  return this.compileMultiplyExpression(expression, prefix, target, addPrecalculationRule);
70272
70369
  }
70273
- if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaOrExpression) {
70370
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaOrExpression) {
70274
70371
  return this.compileOrExpression(expression, prefix, target, addPrecalculationRule);
70275
70372
  }
70276
- if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaAndExpression) {
70373
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaAndExpression) {
70277
70374
  return this.compileAndExpression(expression, prefix, target, addPrecalculationRule);
70278
70375
  }
70279
- if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaNotExpression) {
70280
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NegateUnaryExpression(this.compileExpressionToFlangExpressionInternal(expression.argument, prefix, target, addPrecalculationRule));
70376
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaNotExpression) {
70377
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.NegateUnaryExpression(this.compileExpressionToFlangExpressionInternal(expression.argument, prefix, target, addPrecalculationRule));
70281
70378
  }
70282
- if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaConstExpression) {
70379
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaConstExpression) {
70283
70380
  switch (expression.type) {
70284
70381
  case "string":
70285
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.StringLiteralExpression(expression.value);
70382
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.StringLiteralExpression(expression.value);
70286
70383
  case "decimal":
70287
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(expression.value);
70384
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.DecimalLiteralExpression(expression.value);
70288
70385
  default:
70289
- throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_2__.NotSupportedError("Unknown constant type!");
70386
+ throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_3__.NotSupportedError("Unknown constant type!");
70290
70387
  }
70291
70388
  }
70292
- if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaDivisionExpression) {
70389
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaDivisionExpression) {
70293
70390
  return this.compileDivisionExpression(expression, prefix, target, addPrecalculationRule);
70294
70391
  }
70295
- if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaMinusExpression) {
70296
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.MinusUnaryExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)));
70392
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaMinusExpression) {
70393
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.MinusUnaryExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.castOperandToDecimalIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)));
70297
70394
  }
70298
- if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaGtExpression) {
70395
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaGtExpression) {
70299
70396
  const leftOperandExpression = this.compileExpressionToFlangExpressionInternal(expression.arguments[0], prefix, target, addPrecalculationRule);
70300
70397
  const left = this.castOperandForComparisonExpression(expression.arguments[0], leftOperandExpression);
70301
70398
  const rightOperandExpression = this.compileExpressionToFlangExpressionInternal(expression.arguments[1], prefix, target, addPrecalculationRule);
70302
70399
  const right = this.castOperandForComparisonExpression(expression.arguments[1], rightOperandExpression);
70303
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.GtExpression(left, right);
70400
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.GtExpression(left, right);
70304
70401
  }
70305
- if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaLtExpression) {
70402
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaLtExpression) {
70306
70403
  const leftOperandExpression = this.compileExpressionToFlangExpressionInternal(expression.arguments[0], prefix, target, addPrecalculationRule);
70307
70404
  const left = this.castOperandForComparisonExpression(expression.arguments[0], leftOperandExpression);
70308
70405
  const rightOperandExpression = this.compileExpressionToFlangExpressionInternal(expression.arguments[1], prefix, target, addPrecalculationRule);
70309
70406
  const right = this.castOperandForComparisonExpression(expression.arguments[1], rightOperandExpression);
70310
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.LtExpression(left, right);
70407
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.LtExpression(left, right);
70311
70408
  }
70312
- if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaGeExpression) {
70409
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaGeExpression) {
70313
70410
  const leftOperandExpression = this.compileExpressionToFlangExpressionInternal(expression.arguments[0], prefix, target, addPrecalculationRule);
70314
70411
  const left = this.castOperandForComparisonExpression(expression.arguments[0], leftOperandExpression);
70315
70412
  const rightOperandExpression = this.compileExpressionToFlangExpressionInternal(expression.arguments[1], prefix, target, addPrecalculationRule);
70316
70413
  const right = this.castOperandForComparisonExpression(expression.arguments[1], rightOperandExpression);
70317
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.GeExpression(left, right);
70414
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.GeExpression(left, right);
70318
70415
  }
70319
- if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaLeExpression) {
70416
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaLeExpression) {
70320
70417
  const leftOperandExpression = this.compileExpressionToFlangExpressionInternal(expression.arguments[0], prefix, target, addPrecalculationRule);
70321
70418
  const left = this.castOperandForComparisonExpression(expression.arguments[0], leftOperandExpression);
70322
70419
  const rightOperandExpression = this.compileExpressionToFlangExpressionInternal(expression.arguments[1], prefix, target, addPrecalculationRule);
70323
70420
  const right = this.castOperandForComparisonExpression(expression.arguments[1], rightOperandExpression);
70324
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.LeExpression(left, right);
70421
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.LeExpression(left, right);
70325
70422
  }
70326
- if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaEqExpression) {
70423
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaEqExpression) {
70327
70424
  return this.compileEqExpression(prefix, target, expression, addPrecalculationRule);
70328
70425
  }
70329
- if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaExistsExpression) {
70426
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaExistsExpression) {
70330
70427
  /* eslint-disable no-warning-comments */
70331
70428
  // TODO: тут необходимо учесть, что exists может смотреть на множественность
70332
70429
  // TODO: реализовать в рамках задачи https://yt.skbkontur.ru/issue/FS-7385
70333
70430
  /* eslint-enable no-warning-comments */
70334
- const arg = this.compiledArgumentExpression(prefix, target, expression.select, "string", addPrecalculationRule);
70335
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NegateUnaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.OrBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.EqExpression(arg, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.StringLiteralExpression("")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.EqExpression(arg, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NullLiteralExpression())));
70431
+ const arg = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.extractValueReferenceFromCast)(this.compiledArgumentExpression(prefix, target, expression.select, "string", addPrecalculationRule));
70432
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.ExistsExpression(arg);
70336
70433
  }
70337
- if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaWhenExpression) {
70434
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaWhenExpression) {
70338
70435
  const condition = this.compileExpressionToFlangExpressionInternal(expression.expressions[0], prefix, target, addPrecalculationRule);
70339
70436
  const thenExpression = this.compileExpressionToFlangExpressionInternal(expression.expressions[1], prefix, target, addPrecalculationRule);
70340
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ConditionalExpression(condition, thenExpression, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.EqExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.IntegerLiteralExpression(1), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.IntegerLiteralExpression(1)));
70437
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.ConditionalExpression(condition, thenExpression, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.EqExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.IntegerLiteralExpression(1), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.IntegerLiteralExpression(1)));
70341
70438
  }
70342
- if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaRegexMatchExpression) {
70439
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaRegexMatchExpression) {
70343
70440
  const arg = this.compileExpressionToFlangExpressionInternal(expression.argument, prefix, target, addPrecalculationRule);
70344
- const correctedArg = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.tryExtractValueReferenceAsStringFromDecimal)(arg);
70345
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.RegexMatchExpression(correctedArg, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.StringLiteralExpression(expression.pattern));
70441
+ const correctedArg = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.tryExtractValueReferenceAsStringFromDecimal)(arg);
70442
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.RegexMatchExpression(correctedArg, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.StringLiteralExpression(expression.pattern));
70346
70443
  }
70347
- if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaCountExpression) {
70348
- return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(this.compiledArgumentExpression(prefix, target, expression.select, "string", addPrecalculationRule, "Count"), 0);
70444
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaCountExpression) {
70445
+ return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.castOperandToDecimalIfNeed)(this.compiledArgumentExpression(prefix, target, expression.select, "string", addPrecalculationRule, "Count"), 0);
70349
70446
  }
70350
- if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaLengthExpression) {
70351
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.LenExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.argument, prefix, target, addPrecalculationRule)));
70447
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaLengthExpression) {
70448
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.LenExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.castOperandToStringIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.argument, prefix, target, addPrecalculationRule)));
70352
70449
  }
70353
- if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaConcatExpression) {
70450
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaConcatExpression) {
70354
70451
  return this.compileConcatExpression(expression, prefix, target, addPrecalculationRule);
70355
70452
  }
70356
- if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaSubstringExpression) {
70453
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaSubstringExpression) {
70357
70454
  const arg = this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule);
70358
- const argAsString = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(arg, arg.getType() === _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.decimal ? "G29" : undefined);
70359
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.SubstringExpression(argAsString, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(expression.start), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(expression.length));
70455
+ const argAsString = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.castOperandToStringIfNeed)(arg, arg.getType() === _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.BuildInTypeExpression.decimal ? "G29" : undefined);
70456
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.SubstringExpression(argAsString, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.DecimalLiteralExpression(expression.start), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.DecimalLiteralExpression(expression.length));
70360
70457
  }
70361
- if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaNewLineExpression) {
70362
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.StringLiteralExpression("\r\n");
70458
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaNewLineExpression) {
70459
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.StringLiteralExpression("\r\n");
70363
70460
  }
70364
- if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaNoDepsNode) {
70461
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaNoDepsNode) {
70365
70462
  const noDepsExpression = this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule);
70366
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NoDepsExpression(noDepsExpression);
70463
+ return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.makeNoDeps)(noDepsExpression);
70367
70464
  }
70368
- if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaDateNowExpression) {
70369
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DateNowExpression();
70465
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaDateNowExpression) {
70466
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.DateNowExpression();
70370
70467
  }
70371
- if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaGetDaysInMonthExpression) {
70372
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.GetDaysInMonthExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDateTimeIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)));
70468
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaGetDaysInMonthExpression) {
70469
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.GetDaysInMonthExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.castOperandToDateTimeIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)));
70373
70470
  }
70374
- if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaGetDayExpression) {
70375
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.GetDayExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDateTimeIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)));
70471
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaGetDayExpression) {
70472
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.GetDayExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.castOperandToDateTimeIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)));
70376
70473
  }
70377
- if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaGetMonthExpression) {
70378
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.GetMonthExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDateTimeIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)));
70474
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaGetMonthExpression) {
70475
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.GetMonthExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.castOperandToDateTimeIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)));
70379
70476
  }
70380
- if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaGetYearExpression) {
70381
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.GetYearExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDateTimeIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)));
70477
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaGetYearExpression) {
70478
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.GetYearExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.castOperandToDateTimeIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)));
70382
70479
  }
70383
- if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaIsDateExpression) {
70384
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.IsDateExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)));
70480
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaIsDateExpression) {
70481
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.IsDateExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.castOperandToStringIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)));
70385
70482
  }
70386
- if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaDifferenceInMonthsExpression) {
70387
- const expressions = expression.arguments.map(x => (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDateTimeIfNeed)(this.compileExpressionToFlangExpressionInternal(x, prefix, target, addPrecalculationRule)));
70388
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DifferenceInMonthsExpression(expressions);
70483
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaDifferenceInMonthsExpression) {
70484
+ const expressions = expression.arguments.map(x => (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.castOperandToDateTimeIfNeed)(this.compileExpressionToFlangExpressionInternal(x, prefix, target, addPrecalculationRule)));
70485
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.DifferenceInMonthsExpression(expressions);
70389
70486
  }
70390
- if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaDifferenceInDaysExpression) {
70391
- const expressions = expression.arguments.map(x => (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDateTimeIfNeed)(this.compileExpressionToFlangExpressionInternal(x, prefix, target, addPrecalculationRule)));
70392
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DifferenceInDaysExpression(expressions);
70487
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaDifferenceInDaysExpression) {
70488
+ const expressions = expression.arguments.map(x => (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.castOperandToDateTimeIfNeed)(this.compileExpressionToFlangExpressionInternal(x, prefix, target, addPrecalculationRule)));
70489
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.DifferenceInDaysExpression(expressions);
70393
70490
  }
70394
- if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaAddDaysExpression) {
70395
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.AddDaysExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDateTimeIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(expression.amount));
70491
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaAddDaysExpression) {
70492
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.AddDaysExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.castOperandToDateTimeIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.DecimalLiteralExpression(expression.amount));
70396
70493
  }
70397
- if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaAddMonthsExpression) {
70398
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.AddMonthsExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDateTimeIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(expression.amount));
70494
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaAddMonthsExpression) {
70495
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.AddMonthsExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.castOperandToDateTimeIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.DecimalLiteralExpression(expression.amount));
70399
70496
  }
70400
- if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaAddYearsExpression) {
70401
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.AddYearsExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDateTimeIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(expression.amount));
70497
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaAddYearsExpression) {
70498
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.AddYearsExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.castOperandToDateTimeIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.DecimalLiteralExpression(expression.amount));
70402
70499
  }
70403
- if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaDateToStringExpression) {
70500
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaDateToStringExpression) {
70404
70501
  var _expression$format;
70405
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DateToStringExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDateTimeIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.StringLiteralExpression((_expression$format = expression.format) !== null && _expression$format !== void 0 ? _expression$format : "dd.MM.yyyy"));
70502
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.DateToStringExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.castOperandToDateTimeIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.StringLiteralExpression((_expression$format = expression.format) !== null && _expression$format !== void 0 ? _expression$format : "dd.MM.yyyy"));
70406
70503
  }
70407
- if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaDateTimeExpression) {
70408
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.CastExpression(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule), _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.dateTime);
70504
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaDateTimeExpression) {
70505
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.CastExpression(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule), _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.BuildInTypeExpression.dateTime);
70409
70506
  }
70410
- if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaIsSnilsExpression) {
70507
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaIsSnilsExpression) {
70411
70508
  const arg = this.compiledArgumentExpression(prefix, target, expression.select, "string", addPrecalculationRule);
70412
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.IsSnilsExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(arg));
70509
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.IsSnilsExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.castOperandToStringIfNeed)(arg));
70413
70510
  }
70414
- if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaIsRegNumSfrExpression) {
70511
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaIsRegNumSfrExpression) {
70415
70512
  const arg = this.compiledArgumentExpression(prefix, target, expression.select, "string", addPrecalculationRule);
70416
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.IsRegNumSfrExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(arg));
70513
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.IsRegNumSfrExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.castOperandToStringIfNeed)(arg));
70417
70514
  }
70418
- if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaIsInnExpression) {
70515
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaIsInnExpression) {
70419
70516
  const arg = this.compiledArgumentExpression(prefix, target, expression.select, "string", addPrecalculationRule);
70420
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.IsInnExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(arg));
70517
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.IsInnExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.castOperandToStringIfNeed)(arg));
70421
70518
  }
70422
- if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaIsValidMirCardNumberExpression) {
70519
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaIsValidMirCardNumberExpression) {
70423
70520
  const arg = this.compiledArgumentExpression(prefix, target, expression.select, "string", addPrecalculationRule);
70424
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.IsValidMirCardNumberExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(arg));
70521
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.IsValidMirCardNumberExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.castOperandToStringIfNeed)(arg));
70425
70522
  }
70426
- if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaArrayExpression) {
70523
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaArrayExpression) {
70427
70524
  const items = expression.items.map(arg => this.compileEnumerationItem(arg, prefix, target, addPrecalculationRule));
70428
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ArrayExpression(items);
70525
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.ArrayExpression(items);
70429
70526
  }
70430
- if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaFirstOrDefaultExpression) {
70527
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaFirstOrDefaultExpression) {
70431
70528
  const firstOrDefaultExpression = this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule);
70432
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.FirstOrDefaultExpression(firstOrDefaultExpression);
70529
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.FirstOrDefaultExpression(firstOrDefaultExpression);
70433
70530
  }
70434
- if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaHashSetExpression) {
70435
- if (expression.expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaArgumentExpression) {
70531
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaHashSetExpression) {
70532
+ if (expression.expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaArgumentExpression) {
70436
70533
  const adjustedSelectPath = this.preparePathAndAdjustMultiplicity(prefix, expression.expression.select);
70437
- const splitInfo = (0,_Common_ModelPath_PathSplitHelper__WEBPACK_IMPORTED_MODULE_5__.getMatchedAndDifferentModelPaths)(target.path, adjustedSelectPath);
70534
+ const splitInfo = (0,_Common_ModelPath_PathSplitHelper__WEBPACK_IMPORTED_MODULE_6__.getMatchedAndDifferentModelPaths)(target.path, adjustedSelectPath);
70438
70535
  const diffSelectPath = splitInfo.differentPath;
70439
70536
  const hasMultiplicity = diffSelectPath.getIterationRank() > 0;
70440
70537
  if (hasMultiplicity) {
70441
70538
  const sourceKeyParts = adjustedSelectPath.getPathPartsAsArray();
70442
70539
  const firstPart = splitInfo.matchedPath.toCurrentIteration();
70443
- const firstPartLength = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_3__.IterUtils.count(firstPart.getPathParts());
70444
- const secondPartParts = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createRelativeFromTokens)(sourceKeyParts.slice(firstPartLength)).getPathPartsAsArray();
70445
- const lastStarIndexSecondPart = secondPartParts.lastIndexOf(_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each);
70540
+ const firstPartLength = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_4__.IterUtils.count(firstPart.getPathParts());
70541
+ const secondPartParts = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_2__.createRelativeFromTokens)(sourceKeyParts.slice(firstPartLength)).getPathPartsAsArray();
70542
+ const lastStarIndexSecondPart = secondPartParts.lastIndexOf(_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_2__.PathTokens.each);
70446
70543
  const secondPartFinalParts = secondPartParts.slice(0, lastStarIndexSecondPart);
70447
- const finalIterPath = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createAbsoluteFromTokens)([...firstPart.getPathParts(), ...secondPartFinalParts]).trimLastStarIfLastToken();
70448
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ReduceCallExpression(finalIterPath, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.AnonymousFunctionDeclarationExpression(_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.hashSet, [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ArgumentDeclarationExpression("result", _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.hashSet)], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.AddArrayExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ArgumentReferenceExpression("result"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.HashSetExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression(adjustedSelectPath.toCurrentIteration(), "value")))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.HashSetExpression());
70544
+ const finalIterPath = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_2__.createAbsoluteFromTokens)([...firstPart.getPathParts(), ...secondPartFinalParts]).trimLastStarIfLastToken();
70545
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.ReduceCallExpression(finalIterPath, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.AnonymousFunctionDeclarationExpression(_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.BuildInTypeExpression.hashSet, [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.ArgumentDeclarationExpression("result", _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.BuildInTypeExpression.hashSet)], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.AddArrayExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.ArgumentReferenceExpression("result"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.HashSetExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.ValueReferenceExpression(adjustedSelectPath.toCurrentIteration(), "value")))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.HashSetExpression());
70449
70546
  }
70450
70547
  }
70451
70548
  const hashSetExpression = this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule);
70452
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.HashSetExpression(hashSetExpression);
70549
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.HashSetExpression(hashSetExpression);
70453
70550
  }
70454
- if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaGetPicklistValuesExpression) {
70551
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaGetPicklistValuesExpression) {
70455
70552
  const filterColumn = this.compileExpressionToFlangExpressionInternal(expression.filterColumn.filterColumn, prefix, target, addPrecalculationRule);
70456
70553
  const filterKey = this.compileExpressionToFlangExpressionInternal(expression.filterKey.filterKey, prefix, target, addPrecalculationRule);
70457
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.GetPicklistValuesExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.StringLiteralExpression(expression.gId), filterColumn, filterKey, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.StringLiteralExpression(expression.resultColumn));
70554
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.GetPicklistValuesExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.StringLiteralExpression(expression.gId), filterColumn, filterKey, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.StringLiteralExpression(expression.resultColumn));
70458
70555
  }
70459
- if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaIsValidAccountNumberExpression) {
70556
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaIsValidAccountNumberExpression) {
70460
70557
  const bik = this.compiledArgumentExpression(prefix, target, expression.bik, "string", addPrecalculationRule);
70461
70558
  const account = this.compiledArgumentExpression(prefix, target, expression.account, "string", addPrecalculationRule);
70462
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.IsValidAccountNumberExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(bik), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(account));
70559
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.IsValidAccountNumberExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.castOperandToStringIfNeed)(bik), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.castOperandToStringIfNeed)(account));
70463
70560
  }
70464
- if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaGroupSumExpression) {
70561
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaGroupSumExpression) {
70465
70562
  return this.compileGroupSumExpression(prefix, target, expression, addPrecalculationRule);
70466
70563
  }
70467
- if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaGroupCountExpression) {
70564
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaGroupCountExpression) {
70468
70565
  return this.compileGroupCountExpression(prefix, target, expression, addPrecalculationRule);
70469
70566
  }
70470
- if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaMakeDictExpression) {
70567
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaMakeDictExpression) {
70471
70568
  return this.compileMakeDictExpression(prefix, target, expression, addPrecalculationRule);
70472
70569
  }
70473
- if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaGetSumByKeysExpression) {
70570
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaGetSumByKeysExpression) {
70474
70571
  return this.compileGetSumByKeysExpression(prefix, target, expression, addPrecalculationRule);
70475
70572
  }
70476
- if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaOneOfExpression) {
70477
- const arg = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.argument, prefix, target, addPrecalculationRule));
70478
- const items = expression.items.expressions.map(item => (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(this.compileExpressionToFlangExpressionInternal(item, prefix, target, addPrecalculationRule)));
70479
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.OneOfExpression(arg, items);
70573
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaOneOfExpression) {
70574
+ const arg = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.castOperandToStringIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.argument, prefix, target, addPrecalculationRule));
70575
+ const items = expression.items.expressions.map(item => (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.castOperandToStringIfNeed)(this.compileExpressionToFlangExpressionInternal(item, prefix, target, addPrecalculationRule)));
70576
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.OneOfExpression(arg, items);
70480
70577
  }
70481
- if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaHasAutoFlagExpression) {
70482
- const arg = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule));
70483
- const valueRefExpression = arg instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression ? arg : undefined;
70484
- if (valueRefExpression == undefined) {
70485
- throw new Error("hasAutoFlag supports only Argument expression (ValueReferenceExpression) as parameter.");
70486
- }
70487
- const expr = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.OrBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.EqExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NoDepsExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression(valueRefExpression.modePath, "value")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NullLiteralExpression()), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.EqExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NoDepsExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression(valueRefExpression.modePath, "autoFlag")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.StringLiteralExpression("true")));
70578
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaHasAutoFlagExpression) {
70579
+ const arg = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.castOperandToStringIfNeed)(this.compileExpressionToFlangExpressionInternal(expression.expression, prefix, target, addPrecalculationRule));
70580
+ const getValueReferenceExpression = () => {
70581
+ if (arg instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.ValueReferenceExpression) {
70582
+ return arg;
70583
+ }
70584
+ if (arg instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.CastExpression && arg.targetExpression instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.ValueReferenceExpression) {
70585
+ return arg.targetExpression;
70586
+ }
70587
+ return (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_7__.reject)("hasAutoFlag supports only Argument expression (ValueReferenceExpression) as parameter.");
70588
+ };
70589
+ const valueRefExpression = getValueReferenceExpression();
70590
+ const expr = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.OrBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.EqExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.makeNoDeps)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.ValueReferenceExpression(valueRefExpression.modePath, "value")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.NullLiteralExpression()), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.EqExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.makeNoDeps)((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.makeStringValueReference)(valueRefExpression.modePath, "autoFlag")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.StringLiteralExpression("true")));
70488
70591
  return expr;
70489
70592
  }
70490
70593
  throw new Error(`Unsupported type of node: ${expression.constructor.name}, ${expression.sourceXmlNode.name}`);
70491
70594
  }
70492
70595
  castOperandForComparisonExpression(formulaExpression, flangExpression) {
70493
- if (formulaExpression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaDateTimeExpression || formulaExpression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaDateNowExpression) {
70596
+ if (formulaExpression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaDateTimeExpression || formulaExpression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaDateNowExpression) {
70494
70597
  return flangExpression;
70495
70598
  }
70496
- return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(flangExpression);
70599
+ return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.castOperandToDecimalIfNeed)(flangExpression);
70497
70600
  }
70498
70601
  compileEqExpression(prefix, target, expression, addPrecalculationRule) {
70499
70602
  const left = this.compileExpressionToFlangExpressionInternal(expression.arguments[0], prefix, target, addPrecalculationRule);
@@ -70501,72 +70604,86 @@ class FormulaExpressionToFlangExpressionConverter {
70501
70604
 
70502
70605
  // Сейчас в АР иногда проверку на decimal значение делаем через [Значение != "Какая-то строка"]
70503
70606
  // Поэтому при такой проверке вычитываем поле "Значение" как строку
70504
- if (left.getType() === _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.decimal && right.getType() === _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.string && left instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.CastExpression && left.targetExpression instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression) {
70505
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.EqExpression(left.targetExpression, right);
70607
+ if (left.getType() === _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.BuildInTypeExpression.decimal && right.getType() === _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.BuildInTypeExpression.string && left instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.CastExpression && left.targetExpression instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.ValueReferenceExpression) {
70608
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.EqExpression(left.targetExpression, right);
70506
70609
  }
70507
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.EqExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(left), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(right));
70610
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.EqExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.castOperandToStringIfNeed)(left), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.castOperandToStringIfNeed)(right));
70508
70611
  }
70509
70612
  compileMakeDictExpression(prefix, target, expression, addPrecalculationRule) {
70510
70613
  const sourceKeyPath = this.preparePathAndAdjustMultiplicity(prefix, expression.sourceKeyPath);
70511
- const sourceValueExpression = this.compileExpressionToFlangExpressionInternal(expression.sourceValueExpression, prefix, new _Common_ModelPath_AbsoluteModelFieldPath__WEBPACK_IMPORTED_MODULE_7__.AbsoluteModelFieldPath(sourceKeyPath, "value"), addPrecalculationRule);
70614
+ const sourceValueExpression = this.compileExpressionToFlangExpressionInternal(expression.sourceValueExpression, prefix, new _Common_ModelPath_AbsoluteModelFieldPath__WEBPACK_IMPORTED_MODULE_8__.AbsoluteModelFieldPath(sourceKeyPath, "value"), addPrecalculationRule);
70512
70615
  const getOldSourceValueExpression = () => {
70513
- if (sourceValueExpression instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression) {
70514
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.GetOldExpression(sourceValueExpression);
70616
+ if (sourceValueExpression instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.ValueReferenceExpression) {
70617
+ return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.makeGetOld)(sourceValueExpression);
70515
70618
  }
70516
- if (sourceValueExpression instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.CastExpression && sourceValueExpression.targetExpression instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression) {
70517
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.CastExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.GetOldExpression(sourceValueExpression.targetExpression), sourceValueExpression.targetType, sourceValueExpression.defaultValue);
70619
+ if (sourceValueExpression instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.CastExpression && sourceValueExpression.targetExpression instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.ValueReferenceExpression) {
70620
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.CastExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.makeGetOld)(sourceValueExpression.targetExpression), sourceValueExpression.targetType, sourceValueExpression.defaultValue);
70518
70621
  }
70519
- if (sourceValueExpression instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ConstExpression) {
70622
+ if (sourceValueExpression instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.ConstExpression) {
70520
70623
  return sourceValueExpression;
70521
70624
  }
70522
- return (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__.reject)("SourceValueExpression for makeDict must be reference to value or constant. " + JSON.stringify(sourceValueExpression));
70625
+ return (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_7__.reject)(`SourceValueExpression for makeDict must be reference to value or constant.
70626
+ Converted Object: ${JSON.stringify(sourceValueExpression)}
70627
+ Source Object: ${(0,util__WEBPACK_IMPORTED_MODULE_0__.inspect)(expression.sourceValueExpression)}`);
70523
70628
  };
70524
70629
  const oldSourceValueExpression = getOldSourceValueExpression();
70525
- const matchedPaths = (0,_Common_ModelPath_PathSplitHelper__WEBPACK_IMPORTED_MODULE_5__.getMatchedAndDifferentModelPaths)(target.path, sourceKeyPath);
70630
+ const matchedPaths = (0,_Common_ModelPath_PathSplitHelper__WEBPACK_IMPORTED_MODULE_6__.getMatchedAndDifferentModelPaths)(target.path, sourceKeyPath);
70526
70631
  const firstPart = matchedPaths.matchedPath.toCurrentIteration();
70527
70632
  const secondPart = matchedPaths.differentPath;
70528
- const finalIterPath = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createAbsoluteFromTokens)(firstPart.joinWith(secondPart).getLastListPath());
70529
- const keys = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DeserializeEnumerationExpression([new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression(sourceKeyPath.toCurrentIteration(), "value")], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BoolLiteralExpression(true));
70530
- const oldKeys = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DeserializeEnumerationExpression([new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.GetOldExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression(sourceKeyPath.toCurrentIteration(), "value"))], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BoolLiteralExpression(true));
70531
- const reduceExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ReduceCallExpression(finalIterPath, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.AnonymousFunctionDeclarationExpression(_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.dict, [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ArgumentDeclarationExpression("result", _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.dict)], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.IncrementalFlagExpression(), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.AddSumByKeysExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.AddSumByKeysExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ArgumentReferenceExpression("result"), keys, (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(sourceValueExpression)), oldKeys, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.MinusUnaryExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(oldSourceValueExpression))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.AddSumByKeysExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ArgumentReferenceExpression("result"), keys, (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(sourceValueExpression)))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.IncrementalFlagExpression(), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DictLiteralExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NoDepsExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression(target.path.toCurrentIteration(), "value"))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DictLiteralExpression()));
70633
+ const finalIterPath = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_2__.createAbsoluteFromTokens)(firstPart.joinWith(secondPart).getLastListPath());
70634
+ const keys = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.DeserializeEnumerationExpression([new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.ValueReferenceExpression(sourceKeyPath.toCurrentIteration(), "value")], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.BoolLiteralExpression(true));
70635
+ const oldKeys = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.DeserializeEnumerationExpression([(0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.makeGetOld)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.ValueReferenceExpression(sourceKeyPath.toCurrentIteration(), "value"))], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.BoolLiteralExpression(true));
70636
+ const reduceExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.ReduceCallExpression(finalIterPath, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.AnonymousFunctionDeclarationExpression(_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.BuildInTypeExpression.dict, [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.ArgumentDeclarationExpression("result", _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.BuildInTypeExpression.dict)], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.IncrementalFlagExpression(), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.AddSumByKeysExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.AddSumByKeysExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.ArgumentReferenceExpression("result"), keys, (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.castOperandToDecimalIfNeed)(sourceValueExpression)), oldKeys, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.MinusUnaryExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.castOperandToDecimalIfNeed)(oldSourceValueExpression))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.AddSumByKeysExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.ArgumentReferenceExpression("result"), keys, (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.castOperandToDecimalIfNeed)(sourceValueExpression)))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.IncrementalFlagExpression(), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.DictLiteralExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.makeNoDeps)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.ValueReferenceExpression(target.path.toCurrentIteration(), "value"))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.DictLiteralExpression()));
70532
70637
  return reduceExpression;
70533
70638
  }
70534
70639
  compileGetSumByKeysExpression(prefix, target, expression, addPrecalculationRule) {
70535
70640
  const dictPath = this.preparePathAndAdjustMultiplicity(prefix, expression.dictPath);
70536
70641
  const targetKeys = expression.targetKeys;
70537
- const deserializedKeys = targetKeys.items[0] instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaGetPicklistValuesExpression ? this.compileExpressionToFlangExpressionInternal(targetKeys.items[0], prefix, target, addPrecalculationRule) : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DeserializeEnumerationExpression(targetKeys.items.map(i => this.compileEnumerationItem(i, prefix, target, addPrecalculationRule)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BoolLiteralExpression(true));
70538
- const finalValueExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.GetSumByKeysExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DictLiteralExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression(dictPath, "value")), deserializedKeys !== null && deserializedKeys !== void 0 ? deserializedKeys : (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__.reject)());
70642
+ const deserializedKeys = targetKeys.items[0] instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaGetPicklistValuesExpression ? this.compileExpressionToFlangExpressionInternal(targetKeys.items[0], prefix, target, addPrecalculationRule) : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.DeserializeEnumerationExpression(targetKeys.items.map(i => {
70643
+ const item = this.compileEnumerationItem(i, prefix, target, addPrecalculationRule);
70644
+ if (item instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.ConstExpression) {
70645
+ return item;
70646
+ }
70647
+ return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.extractValueReferenceFromCast)(item);
70648
+ }), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.BoolLiteralExpression(true));
70649
+ const finalValueExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.GetSumByKeysExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.DictLiteralExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.ValueReferenceExpression(dictPath, "value")), deserializedKeys !== null && deserializedKeys !== void 0 ? deserializedKeys : (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_7__.reject)());
70539
70650
  return finalValueExpression;
70540
70651
  }
70541
70652
  compileGroupSumExpressionWithCustomValueExpression(prefix, target, targetKeys, sourceKeyPath, sourceValueExpression, addPrecalculationRule) {
70542
- const matchPaths = (0,_Common_ModelPath_PathSplitHelper__WEBPACK_IMPORTED_MODULE_5__.getMatchedAndDifferentModelPaths)(target.path, sourceKeyPath);
70653
+ const matchPaths = (0,_Common_ModelPath_PathSplitHelper__WEBPACK_IMPORTED_MODULE_6__.getMatchedAndDifferentModelPaths)(target.path, sourceKeyPath);
70543
70654
  const sourceKeyParts = sourceKeyPath.getPathPartsAsArray();
70544
70655
  const firstPart = matchPaths.matchedPath.toCurrentIteration();
70545
- const firstPartLength = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_3__.IterUtils.count(firstPart.getPathParts());
70546
- const secondParts = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createRelativeFromTokens)(sourceKeyParts.slice(firstPartLength));
70656
+ const firstPartLength = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_4__.IterUtils.count(firstPart.getPathParts());
70657
+ const secondParts = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_2__.createRelativeFromTokens)(sourceKeyParts.slice(firstPartLength));
70547
70658
  const getIterationPathWithNestedMultiplicity = () => {
70548
- const secondPartParts = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createRelativeFromTokens)(sourceKeyParts.slice(firstPartLength)).getPathPartsAsArray();
70549
- const lastStarIndexSecondPart = secondPartParts.lastIndexOf(_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each);
70659
+ const secondPartParts = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_2__.createRelativeFromTokens)(sourceKeyParts.slice(firstPartLength)).getPathPartsAsArray();
70660
+ const lastStarIndexSecondPart = secondPartParts.lastIndexOf(_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_2__.PathTokens.each);
70550
70661
  const secondPartFinalParts = secondPartParts.slice(0, lastStarIndexSecondPart);
70551
- return (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createAbsoluteFromTokens)([...firstPart.getPathParts(), ...secondPartFinalParts]).trimLastStarIfLastToken();
70662
+ return (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_2__.createAbsoluteFromTokens)([...firstPart.getPathParts(), ...secondPartFinalParts]).trimLastStarIfLastToken();
70552
70663
  };
70553
70664
  const getIterationPathWithoutNestedMultiplicity = () => {
70554
70665
  const firstPartParts = matchPaths.matchedPath.getPathPartsAsArray();
70555
- const lastStarIndexSecondPart = firstPartParts.lastIndexOf(_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each);
70556
- return (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createAbsoluteFromTokens)(sourceKeyParts.slice(0, lastStarIndexSecondPart)).toCurrentIteration().trimLastStarIfLastToken();
70666
+ const lastStarIndexSecondPart = firstPartParts.lastIndexOf(_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_2__.PathTokens.each);
70667
+ return (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_2__.createAbsoluteFromTokens)(sourceKeyParts.slice(0, lastStarIndexSecondPart)).toCurrentIteration().trimLastStarIfLastToken();
70557
70668
  };
70558
70669
  const finalIterPath = secondParts.isContainCurrentOrEachIteration() ? getIterationPathWithNestedMultiplicity() : getIterationPathWithoutNestedMultiplicity();
70559
70670
  if (finalIterPath.isEmpty()) {
70560
70671
  throw new Error("Error occurred while trying parse path for reduce: " + firstPart.toLegacyPath());
70561
70672
  }
70562
- const keys = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DeserializeEnumerationExpression([new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression(sourceKeyPath.toCurrentIteration(), "value")], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BoolLiteralExpression(true));
70563
- const reduceExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ReduceCallExpression(finalIterPath, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.AnonymousFunctionDeclarationExpression(_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.dict, [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ArgumentDeclarationExpression("result", _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.dict)], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.AddSumByKeysExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ArgumentReferenceExpression("result"), keys, (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(sourceValueExpression))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DictLiteralExpression());
70564
- const deserializedKeys = targetKeys.items[0] instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaGetPicklistValuesExpression ? this.compileExpressionToFlangExpressionInternal(targetKeys.items[0], prefix, target, addPrecalculationRule) : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DeserializeEnumerationExpression(targetKeys.items.map(i => this.compileEnumerationItem(i, prefix, target, addPrecalculationRule)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BoolLiteralExpression(true));
70565
- const finalValueExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.GetSumByKeysExpression(reduceExpression, deserializedKeys !== null && deserializedKeys !== void 0 ? deserializedKeys : (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__.reject)());
70673
+ const keys = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.DeserializeEnumerationExpression([new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.ValueReferenceExpression(sourceKeyPath.toCurrentIteration(), "value")], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.BoolLiteralExpression(true));
70674
+ const reduceExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.ReduceCallExpression(finalIterPath, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.AnonymousFunctionDeclarationExpression(_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.BuildInTypeExpression.dict, [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.ArgumentDeclarationExpression("result", _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.BuildInTypeExpression.dict)], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.AddSumByKeysExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.ArgumentReferenceExpression("result"), keys, (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.castOperandToDecimalIfNeed)(sourceValueExpression))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.DictLiteralExpression());
70675
+ const deserializedKeys = targetKeys.items[0] instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaGetPicklistValuesExpression ? this.compileExpressionToFlangExpressionInternal(targetKeys.items[0], prefix, target, addPrecalculationRule) : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.DeserializeEnumerationExpression(targetKeys.items.map(i => {
70676
+ const item = this.compileEnumerationItem(i, prefix, target, addPrecalculationRule);
70677
+ if (item instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.ConstExpression) {
70678
+ return item;
70679
+ }
70680
+ return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.extractValueReferenceFromCast)(item);
70681
+ }), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.BoolLiteralExpression(true));
70682
+ const finalValueExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.GetSumByKeysExpression(reduceExpression, deserializedKeys !== null && deserializedKeys !== void 0 ? deserializedKeys : (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_7__.reject)());
70566
70683
  return finalValueExpression;
70567
70684
  }
70568
70685
  compileEnumerationItem(expression, prefix, target, addPrecalculationRule) {
70569
- if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_0__.FormulaArgumentExpression) {
70686
+ if (expression instanceof _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_Formula__WEBPACK_IMPORTED_MODULE_1__.FormulaArgumentExpression) {
70570
70687
  return this.compiledArgumentExpression(prefix, target, expression.select, "string", addPrecalculationRule);
70571
70688
  }
70572
70689
  return this.compileExpressionToFlangExpressionInternal(expression, prefix, target, addPrecalculationRule);
@@ -70574,108 +70691,123 @@ class FormulaExpressionToFlangExpressionConverter {
70574
70691
  compileGroupSumExpression(prefix, target, expression, addPrecalculationRule) {
70575
70692
  const sourceKeyPath = this.preparePathAndAdjustMultiplicity(prefix, expression.sourceKeyPath);
70576
70693
  const sourceValuePath = this.preparePathAndAdjustMultiplicity(prefix, expression.sourceValuePath);
70577
- const sourceValueExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression(sourceValuePath.toCurrentIteration(), "value");
70694
+ const sourceValueExpression = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.makeStringValueReference)(sourceValuePath.toCurrentIteration(), "value");
70578
70695
  return this.compileGroupSumExpressionWithCustomValueExpression(prefix, target, expression.targetKeys, sourceKeyPath, sourceValueExpression, addPrecalculationRule);
70579
70696
  }
70580
70697
  compileGroupCountExpression(prefix, target, expression, addPrecalculationRule) {
70581
70698
  const sourceKeyPath = this.preparePathAndAdjustMultiplicity(prefix, expression.sourceKeyPath);
70582
- const sourceValueExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(1);
70699
+ const sourceValueExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.DecimalLiteralExpression(1);
70583
70700
  return this.compileGroupSumExpressionWithCustomValueExpression(prefix, target, expression.targetKeys, sourceKeyPath, sourceValueExpression, addPrecalculationRule);
70584
70701
  }
70702
+ convertExpressionTypePropertyToFLangType(type) {
70703
+ switch (type) {
70704
+ case "string":
70705
+ return _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.BuildInTypeExpression.string;
70706
+ case "array":
70707
+ return _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.BuildInTypeExpression.array;
70708
+ case "decimal":
70709
+ return _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.BuildInTypeExpression.decimal;
70710
+ case "dict":
70711
+ return _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.BuildInTypeExpression.dict;
70712
+ default:
70713
+ return (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_7__.reject)(`Unknown ExpressionTypeProperty [${type}]`);
70714
+ }
70715
+ }
70585
70716
  compiledArgumentExpression(prefix, target, selectPath, selectType, addPrecalculationRule, aggregationFunction = "Sum") {
70717
+ const builtInType = this.convertExpressionTypePropertyToFLangType(selectType !== null && selectType !== void 0 ? selectType : "string");
70586
70718
  const adjustedSelectPath = this.preparePathAndAdjustMultiplicity(prefix, selectPath);
70587
- const splitInfo = (0,_Common_ModelPath_PathSplitHelper__WEBPACK_IMPORTED_MODULE_5__.getMatchedAndDifferentModelPaths)(target.path, adjustedSelectPath);
70719
+ const splitInfo = (0,_Common_ModelPath_PathSplitHelper__WEBPACK_IMPORTED_MODULE_6__.getMatchedAndDifferentModelPaths)(target.path, adjustedSelectPath);
70588
70720
  const baseSelectPath = splitInfo.matchedPath;
70589
70721
  if (!splitInfo.differentPath.isContainIteration()) {
70590
- const valueRefExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression(adjustedSelectPath.toCurrentIteration().normalize(), "value");
70591
- const finalValue = splitInfo.differentPath.isEmpty() && target.field === "value" ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NoDepsExpression(valueRefExpression) : valueRefExpression;
70592
- return selectType === "decimal" ? (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(finalValue) : finalValue;
70722
+ const valueRefExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.ValueReferenceExpression(adjustedSelectPath.toCurrentIteration().normalize(), "value");
70723
+ const finalValue = splitInfo.differentPath.isEmpty() && target.field === "value" ? (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.makeNoDeps)(valueRefExpression) : valueRefExpression;
70724
+ return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.castOperandIfNeed)(finalValue, builtInType);
70593
70725
  } else {
70594
70726
  var _countValueExpression;
70595
- let resultValueExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression(adjustedSelectPath.toCurrentIteration().normalize(), "value");
70727
+ let resultValueExpression = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.makeStringValueReference)(adjustedSelectPath.toCurrentIteration().normalize(), "value");
70596
70728
  let countValueExpression = undefined;
70597
- const iterationEntries = [...(0,_Common_IterableUtils__WEBPACK_IMPORTED_MODULE_3__.reverseArray)((0,_Common_ModelPath_BuildIterationSequence__WEBPACK_IMPORTED_MODULE_4__.buildIterationSequence)(splitInfo.differentPath))];
70729
+ const iterationEntries = [...(0,_Common_IterableUtils__WEBPACK_IMPORTED_MODULE_4__.reverseArray)((0,_Common_ModelPath_BuildIterationSequence__WEBPACK_IMPORTED_MODULE_5__.buildIterationSequence)(splitInfo.differentPath))];
70598
70730
  for (const iterationEntry of iterationEntries) {
70599
- const iterablePath = baseSelectPath.joinWith((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createRelativeFromTokens)(iterationEntry.iterable.getPathPartsAsArray()));
70600
- const suffixWithoutMultiple = iterationEntry.suffix.getPathPartsAsArray().filter(x => _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.isSimpleToken(x));
70601
- const nextResultValueExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression(iterablePath.joinWith((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createRelativeFromTokens)(suffixWithoutMultiple)).joinWith("Sum").normalize(), "value");
70602
- const currentSumExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression(iterablePath.joinWith((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createRelativeFromTokens)(suffixWithoutMultiple)).joinWith("Sum").toCurrentIteration().normalize(), "value");
70603
- const countResultValueExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression(iterablePath.joinWith((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createRelativeFromTokens)(suffixWithoutMultiple)).joinWith("Count").normalize(), "value");
70604
- const currenCountExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression(iterablePath.joinWith((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createRelativeFromTokens)(suffixWithoutMultiple)).joinWith("Count").toCurrentIteration().normalize(), "value");
70605
- const sumReduceExpr = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ReduceCallExpression(iterablePath.toCurrentIteration(), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.AnonymousFunctionDeclarationExpression(_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.decimal, [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ArgumentDeclarationExpression("result", _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.decimal)], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.OrBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NotEqExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ArgumentReferenceExpression("result"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NullLiteralExpression()), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NotEqExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.CastExpression(resultValueExpression, _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.decimal), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NullLiteralExpression())), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.MinusBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.SumBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NullCoalesceExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ArgumentReferenceExpression("result"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(0)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.CastExpression(resultValueExpression, _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.decimal, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(0))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.IncrementalFlagExpression(), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.CastExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.GetOldExpression(resultValueExpression), _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.decimal, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(0)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(0))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NullLiteralExpression())), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.IncrementalFlagExpression(), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NoDepsExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression(nextResultValueExpression.modePath.toCurrentIteration(), nextResultValueExpression.valueName))), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NullLiteralExpression())));
70606
- addPrecalculationRule(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.SetStatement(nextResultValueExpression, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NullCoalesceExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.CastExpression(sumReduceExpr, _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.string, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.StringLiteralExpression("G29")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.StringLiteralExpression(""))));
70607
- const countReduceExpr = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ReduceCallExpression(iterablePath.toCurrentIteration(), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.AnonymousFunctionDeclarationExpression(_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.decimal, [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ArgumentDeclarationExpression("result", _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.decimal)], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.MinusBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.SumBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NullCoalesceExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ArgumentReferenceExpression("result"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(0)), countValueExpression == undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.AndBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NotEqExpression(resultValueExpression, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.StringLiteralExpression("")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NotEqExpression(resultValueExpression, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NullLiteralExpression())), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(1), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(0)) : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.CastExpression(countValueExpression, _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.decimal, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(0))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.IncrementalFlagExpression(), countValueExpression == undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.AndBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NotEqExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.GetOldExpression(resultValueExpression), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.StringLiteralExpression("")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NotEqExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.GetOldExpression(resultValueExpression), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NullLiteralExpression())), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(1), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(0)) : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.CastExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.GetOldExpression(countValueExpression), _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.decimal, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(0)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(0)))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.IncrementalFlagExpression(), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NoDepsExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ValueReferenceExpression(countResultValueExpression.modePath.toCurrentIteration(), countResultValueExpression.valueName))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(0)));
70608
- addPrecalculationRule(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.SetStatement(countResultValueExpression, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.CastExpression(countReduceExpr, _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.BuildInTypeExpression.string, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.StringLiteralExpression("G29"))));
70731
+ const iterablePath = baseSelectPath.joinWith((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_2__.createRelativeFromTokens)(iterationEntry.iterable.getPathPartsAsArray()));
70732
+ const suffixWithoutMultiple = iterationEntry.suffix.getPathPartsAsArray().filter(x => _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_2__.PathTokens.isSimpleToken(x));
70733
+ const nextResultValueExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.ValueReferenceExpression(iterablePath.joinWith((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_2__.createRelativeFromTokens)(suffixWithoutMultiple)).joinWith("Sum").normalize(), "value");
70734
+ const currentSumExpression = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.makeStringValueReference)(iterablePath.joinWith((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_2__.createRelativeFromTokens)(suffixWithoutMultiple)).joinWith("Sum").toCurrentIteration().normalize(), "value");
70735
+ const countResultValueExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.ValueReferenceExpression(iterablePath.joinWith((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_2__.createRelativeFromTokens)(suffixWithoutMultiple)).joinWith("Count").normalize(), "value");
70736
+ const currenCountExpression = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.makeStringValueReference)(iterablePath.joinWith((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_2__.createRelativeFromTokens)(suffixWithoutMultiple)).joinWith("Count").toCurrentIteration().normalize(), "value");
70737
+ const sumReduceExpr = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.ReduceCallExpression(iterablePath.toCurrentIteration(), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.AnonymousFunctionDeclarationExpression(_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.BuildInTypeExpression.decimal, [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.ArgumentDeclarationExpression("result", _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.BuildInTypeExpression.decimal)], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.OrBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.NotEqExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.ArgumentReferenceExpression("result"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.NullLiteralExpression()), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.NotEqExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.CastExpression(resultValueExpression, _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.BuildInTypeExpression.decimal), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.NullLiteralExpression())), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.MinusBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.SumBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.NullCoalesceExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.ArgumentReferenceExpression("result"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.DecimalLiteralExpression(0)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.CastExpression(resultValueExpression, _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.BuildInTypeExpression.decimal, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.DecimalLiteralExpression(0))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.IncrementalFlagExpression(), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.CastExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.makeGetOld)(resultValueExpression), _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.BuildInTypeExpression.decimal, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.DecimalLiteralExpression(0)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.DecimalLiteralExpression(0))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.NullLiteralExpression())), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.IncrementalFlagExpression(), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.castOperandToDecimalIfNeed)((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.makeNoDeps)((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.makeStringValueReference)(nextResultValueExpression.modePath.toCurrentIteration(), nextResultValueExpression.valueName))), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.castOperandToDecimalIfNeed)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.NullLiteralExpression())));
70738
+ addPrecalculationRule(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.SetStatement(nextResultValueExpression, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.NullCoalesceExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.CastExpression(sumReduceExpr, _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.BuildInTypeExpression.string, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.StringLiteralExpression("G29")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.StringLiteralExpression(""))));
70739
+ const countReduceExpr = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.ReduceCallExpression(iterablePath.toCurrentIteration(), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.AnonymousFunctionDeclarationExpression(_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.BuildInTypeExpression.decimal, [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.ArgumentDeclarationExpression("result", _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.BuildInTypeExpression.decimal)], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.MinusBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.SumBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.NullCoalesceExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.ArgumentReferenceExpression("result"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.DecimalLiteralExpression(0)), countValueExpression == undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.AndBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.NotEqExpression(resultValueExpression, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.StringLiteralExpression("")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.NotEqExpression(resultValueExpression, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.NullLiteralExpression())), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.DecimalLiteralExpression(1), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.DecimalLiteralExpression(0)) : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.CastExpression(countValueExpression, _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.BuildInTypeExpression.decimal, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.DecimalLiteralExpression(0))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.IncrementalFlagExpression(), countValueExpression == undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.AndBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.NotEqExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.makeGetOld)(resultValueExpression), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.StringLiteralExpression("")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.NotEqExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.makeGetOld)(resultValueExpression), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.NullLiteralExpression())), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.DecimalLiteralExpression(1), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.DecimalLiteralExpression(0)) : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.CastExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.makeGetOld)(countValueExpression), _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.BuildInTypeExpression.decimal, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.DecimalLiteralExpression(0)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.DecimalLiteralExpression(0)))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.IncrementalFlagExpression(), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.castOperandToDecimalIfNeed)((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.makeNoDeps)((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.makeStringValueReference)(countResultValueExpression.modePath.toCurrentIteration(), countResultValueExpression.valueName))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.DecimalLiteralExpression(0)));
70740
+ addPrecalculationRule(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.SetStatement(countResultValueExpression, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.CastExpression(countReduceExpr, _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.BuildInTypeExpression.string, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.StringLiteralExpression("G29"))));
70609
70741
  resultValueExpression = currentSumExpression;
70610
70742
  countValueExpression = currenCountExpression;
70611
70743
  }
70612
- const finalValue = aggregationFunction === "Sum" ? resultValueExpression : (_countValueExpression = countValueExpression) !== null && _countValueExpression !== void 0 ? _countValueExpression : (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_6__.reject)();
70613
- return selectType === "decimal" ? (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(finalValue) : finalValue;
70744
+ const finalValue = aggregationFunction === "Sum" ? resultValueExpression : (_countValueExpression = countValueExpression) !== null && _countValueExpression !== void 0 ? _countValueExpression : (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_7__.reject)();
70745
+ return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.castOperandIfNeed)(finalValue, builtInType);
70614
70746
  }
70615
70747
  }
70616
70748
  compileSumExpression(expression, prefix, target, addPrecalculationRule) {
70617
70749
  const result = expression.arguments.reduce((acc, curr) => {
70618
- const currExpr = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NullCoalesceExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(this.compileExpressionToFlangExpressionInternal(curr, prefix, target, addPrecalculationRule)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(0));
70619
- return acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.SumBinaryExpression(acc, currExpr) : currExpr;
70750
+ const currExpr = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.NullCoalesceExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.castOperandToDecimalIfNeed)(this.compileExpressionToFlangExpressionInternal(curr, prefix, target, addPrecalculationRule)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.DecimalLiteralExpression(0));
70751
+ return acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.SumBinaryExpression(acc, currExpr) : currExpr;
70620
70752
  }, undefined);
70621
70753
  if (result == undefined) {
70622
- throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_2__.InvalidProgramStateError();
70754
+ throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_3__.InvalidProgramStateError();
70623
70755
  }
70624
- return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.wrapWithArgumentsCondition)(result);
70756
+ return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.wrapWithArgumentsCondition)(result);
70625
70757
  }
70626
70758
  compileConcatExpression(expression, prefix, target, addPrecalculationRule) {
70627
70759
  const result = expression.arguments.reduce((acc, curr) => {
70628
- const currExpr = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(this.compileExpressionToFlangExpressionInternal(curr, prefix, target, addPrecalculationRule));
70629
- return acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ConcatStringsExpression(acc, currExpr) : currExpr;
70760
+ const currExpr = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.castOperandToStringIfNeed)(this.compileExpressionToFlangExpressionInternal(curr, prefix, target, addPrecalculationRule));
70761
+ return acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.ConcatStringsExpression(acc, currExpr) : currExpr;
70630
70762
  }, undefined);
70631
70763
  if (result == undefined) {
70632
- throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_2__.InvalidProgramStateError();
70764
+ throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_3__.InvalidProgramStateError();
70633
70765
  }
70634
70766
  return result;
70635
70767
  }
70636
70768
  compileOrExpression(expression, prefix, target, addPrecalculationRule) {
70637
70769
  const result = expression.arguments.reduce((acc, curr) => {
70638
70770
  const currExpr = this.compileExpressionToFlangExpressionInternal(curr, prefix, target, addPrecalculationRule);
70639
- return acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.OrBinaryExpression(acc, currExpr) : currExpr;
70771
+ return acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.OrBinaryExpression(acc, currExpr) : currExpr;
70640
70772
  }, undefined);
70641
70773
  if (result == undefined) {
70642
- throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_2__.InvalidProgramStateError();
70774
+ throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_3__.InvalidProgramStateError();
70643
70775
  }
70644
70776
  return result;
70645
70777
  }
70646
70778
  compileAndExpression(expression, prefix, target, addPrecalculationRule) {
70647
70779
  const result = expression.arguments.reduce((acc, curr) => {
70648
70780
  const currExpr = this.compileExpressionToFlangExpressionInternal(curr, prefix, target, addPrecalculationRule);
70649
- return acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.AndBinaryExpression(acc, currExpr) : currExpr;
70781
+ return acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.AndBinaryExpression(acc, currExpr) : currExpr;
70650
70782
  }, undefined);
70651
70783
  if (result == undefined) {
70652
- throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_2__.InvalidProgramStateError();
70784
+ throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_3__.InvalidProgramStateError();
70653
70785
  }
70654
70786
  return result;
70655
70787
  }
70656
70788
  compileMultiplyExpression(expression, prefix, target, addPrecalculationRule) {
70657
70789
  const result = expression.arguments.reduce((acc, curr) => {
70658
- const expr = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NullCoalesceExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(this.compileExpressionToFlangExpressionInternal(curr, prefix, target, addPrecalculationRule)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(0));
70659
- return acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.MultiplyBinaryExpression(acc, expr) : expr;
70790
+ const expr = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.NullCoalesceExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.castOperandToDecimalIfNeed)(this.compileExpressionToFlangExpressionInternal(curr, prefix, target, addPrecalculationRule)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.DecimalLiteralExpression(0));
70791
+ return acc != undefined ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.MultiplyBinaryExpression(acc, expr) : expr;
70660
70792
  }, undefined);
70661
70793
  if (result == undefined) {
70662
- throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_2__.InvalidProgramStateError();
70794
+ throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_3__.InvalidProgramStateError();
70663
70795
  }
70664
- return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.wrapWithArgumentsCondition)(result);
70796
+ return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.wrapWithArgumentsCondition)(result);
70665
70797
  }
70666
70798
  compileDivisionExpression(expression, prefix, target, addPrecalculationRule) {
70667
- const makeDivision = (numerator, denominator) => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NotEqExpression(denominator, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DecimalLiteralExpression(0)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.DivisionBinaryExpression(numerator, denominator), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_9__.NullLiteralExpression());
70799
+ const makeDivision = (numerator, denominator) => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.NotEqExpression(denominator, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.DecimalLiteralExpression(0)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.DivisionBinaryExpression(numerator, denominator), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_10__.NullLiteralExpression());
70668
70800
  const result = expression.arguments.reduce((acc, curr) => {
70669
- const currExpr = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(this.compileExpressionToFlangExpressionInternal(curr, prefix, target, addPrecalculationRule), 0);
70801
+ const currExpr = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.castOperandToDecimalIfNeed)(this.compileExpressionToFlangExpressionInternal(curr, prefix, target, addPrecalculationRule), 0);
70670
70802
  return acc != undefined ? makeDivision(acc, currExpr) : currExpr;
70671
70803
  }, undefined);
70672
70804
  if (result == undefined) {
70673
- throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_2__.InvalidProgramStateError();
70805
+ throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_3__.InvalidProgramStateError();
70674
70806
  }
70675
- return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.wrapWithArgumentsCondition)(result);
70807
+ return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_9__.wrapWithArgumentsCondition)(result);
70676
70808
  }
70677
70809
  preparePathAndAdjustMultiplicity(prefix, path) {
70678
- const resultPath = this.adjustPathMultiplicity(prefix.joinWith((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createModelPath)(path.replace(/\@/g, ""), "auto")).normalize());
70810
+ const resultPath = this.adjustPathMultiplicity(prefix.joinWith((0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_2__.createModelPath)(path.replace(/\@/g, ""), "auto")).normalize());
70679
70811
  return resultPath;
70680
70812
  }
70681
70813
  }
@@ -70784,7 +70916,7 @@ class AutoValueForValueByDefaultNormalizationRuleGenerator {
70784
70916
  const valueRef = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.ValueReferenceExpression(autoValueRule.left.modePath, "value");
70785
70917
  const valueRefCurrentIteration = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.ValueReferenceExpression(autoValueRule.left.modePath.toCurrentIteration(), "value");
70786
70918
  const autoFlagRefCurrentIteration = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.ValueReferenceExpression(autoValueRule.left.modePath.toCurrentIteration(), "autoFlag");
70787
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.SetStatement(valueRef, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.AndBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.EqExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.NoDepsExpression(valueRefCurrentIteration), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.NullLiteralExpression()), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.EqExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.NoDepsExpression(autoFlagRefCurrentIteration), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.NullLiteralExpression())), autoValueRule.right, formulaRulesMap.has(valueRef) ? (_formulaRulesMap$get$ = (_formulaRulesMap$get = formulaRulesMap.get(valueRef)) === null || _formulaRulesMap$get === void 0 ? void 0 : _formulaRulesMap$get.right) !== null && _formulaRulesMap$get$ !== void 0 ? _formulaRulesMap$get$ : (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_4__.reject)("Unexpected error") : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.NullCoalesceExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.ValueReferenceExpression(autoValueRule.left.modePath.toCurrentIteration(), "value"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.StringLiteralExpression(this.dataDeclarationHelper.getDefaultValue(autoValueRule.left.modePath)))));
70919
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.SetStatement(valueRef, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.AndBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.EqExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_1__.makeNoDeps)(valueRefCurrentIteration), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.NullLiteralExpression()), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.EqExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_1__.makeNoDeps)(autoFlagRefCurrentIteration), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.NullLiteralExpression())), autoValueRule.right, formulaRulesMap.has(valueRef) ? (_formulaRulesMap$get$ = (_formulaRulesMap$get = formulaRulesMap.get(valueRef)) === null || _formulaRulesMap$get === void 0 ? void 0 : _formulaRulesMap$get.right) !== null && _formulaRulesMap$get$ !== void 0 ? _formulaRulesMap$get$ : (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_4__.reject)("Unexpected error") : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.NullCoalesceExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.ValueReferenceExpression(autoValueRule.left.modePath.toCurrentIteration(), "value"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.StringLiteralExpression(this.dataDeclarationHelper.getDefaultValue(autoValueRule.left.modePath)))));
70788
70920
  };
70789
70921
  const updatedFormulaRules = Iterator.from(formulaFLangRules).flatMap(x => x instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.SetStatement && x.left.valueName === "autoValue" ? [x, createValueRuleFromAutoValueRule(x)] : [x]);
70790
70922
 
@@ -70831,7 +70963,7 @@ class FormulaAndInitOnlyNormalizationRuleGenerator {
70831
70963
  this.optionalSectionRuleBuilder = optionalSectionRuleBuilder;
70832
70964
  }
70833
70965
  generateRules() {
70834
- const createValueRuleFromAutoValueRule = autoValueRule => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(autoValueRule.left.modePath, "value"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.NotEqExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.NoDepsExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(autoValueRule.left.modePath.toCurrentIteration(), "value")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.NullLiteralExpression()), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.NoDepsExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(autoValueRule.left.modePath.toCurrentIteration(), "value")), autoValueRule.right));
70966
+ const createValueRuleFromAutoValueRule = autoValueRule => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(autoValueRule.left.modePath, "value"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.NotEqExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_2__.makeNoDeps)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(autoValueRule.left.modePath.toCurrentIteration(), "value")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.NullLiteralExpression()), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_2__.makeNoDeps)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(autoValueRule.left.modePath.toCurrentIteration(), "value")), autoValueRule.right));
70835
70967
  const createValueRuleEmptyRule = path => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(path, "value"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.NoDepsExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(path.toCurrentIteration(), "value")));
70836
70968
  const createDisableValueAutoInitRule = path => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(path, "disableValueAutoInit"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.StringLiteralExpression("true"));
70837
70969
  const ignoredValueSetRuleMapper = x => {
@@ -70912,8 +71044,12 @@ class FormulaOnlyNormalizationRuleGenerator {
70912
71044
  const precalculationRules = [];
70913
71045
  const defaultValue = this.dataDeclarationHelper.getDefaultValue(fullTarget.toLegacyPath());
70914
71046
  const isTargetAutoField = this.dataDeclarationHelper.isNodeHasAutoFlagEntry(fullTarget.toAbsolute());
71047
+ const getFormulaExpression = field => {
71048
+ const result = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_5__.castOperandToStringIfNeed)(this.formulaExprConverter.compileExpressionToFlangExpression(formula.expression, prefix, new _Common_ModelPath_AbsoluteModelFieldPath__WEBPACK_IMPORTED_MODULE_3__.AbsoluteModelFieldPath(fullTarget, field), x => precalculationRules.push(x)), "G29");
71049
+ const resultType = result.getType();
71050
+ return resultType === _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.string ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.NullCoalesceExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_5__.wrapWithArgumentsCondition)(result), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.StringLiteralExpression(defaultValue)) : result;
71051
+ };
70915
71052
  const result = [];
70916
- const getFormulaExpression = field => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.NullCoalesceExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_5__.wrapWithArgumentsCondition)((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_5__.castOperandToStringIfNeed)(this.formulaExprConverter.compileExpressionToFlangExpression(formula.expression, prefix, new _Common_ModelPath_AbsoluteModelFieldPath__WEBPACK_IMPORTED_MODULE_3__.AbsoluteModelFieldPath(fullTarget, field), x => precalculationRules.push(x)), "G29")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.StringLiteralExpression(defaultValue));
70917
71053
  if (isTargetAutoField) {
70918
71054
  result.push(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression(fullTarget, "autoValue"), getFormulaExpression("autoValue")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression(fullTarget, "value"), getFormulaExpression("value")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression(fullTarget, "autoFlag"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.CastExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.IsEqualsBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "value"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "autoValue")), _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_4__.BuildInTypeExpression.string)));
70919
71055
  } else {
@@ -70942,6 +71078,12 @@ __webpack_require__.r(__webpack_exports__);
70942
71078
  /* harmony export */ });
70943
71079
  /* harmony import */ var _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../../Common/IterableUtils */ "./Common/IterableUtils.ts");
70944
71080
  /* harmony import */ var _FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../FLang/FlangUtils */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FlangUtils.ts");
71081
+ /* harmony import */ var _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../FLang/FLangCodeDom */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FLangCodeDom.ts");
71082
+ /* harmony import */ var _Common_ModelPath_AbsoluteModelFieldPath__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../../Common/ModelPath/AbsoluteModelFieldPath */ "./Common/ModelPath/AbsoluteModelFieldPath.ts");
71083
+ /* harmony import */ var _Common_TypingUtils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../../../Common/TypingUtils */ "./Common/TypingUtils.ts");
71084
+
71085
+
71086
+
70945
71087
 
70946
71088
 
70947
71089
 
@@ -70974,8 +71116,13 @@ class NormalizationRulesGenerator {
70974
71116
  const dataDeclarationRules = this.sugarRulesBuilder.buildRules();
70975
71117
 
70976
71118
  // Порядок важен, т.к. потом делаем distinctBy.
70977
- const allRules = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_0__.IterUtils.concat(initializeRules, lazyLoadingRules, formulaFLangRules, optionalSectionRules, dataDeclarationRules, sugarValidationRules).flatMap(rule => (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_1__.wrapWithDisableValueAutoInitFlagCheckIfRequired)(this.formSchemaRng, rule));
70978
- return (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_1__.combineRulesWithOptionalSectionChecking)(allRules, this.optionalSectionRulesBuilder);
71119
+ const allRules = _Common_IterableUtils__WEBPACK_IMPORTED_MODULE_0__.IterUtils.concat(initializeRules, lazyLoadingRules, formulaFLangRules, optionalSectionRules, dataDeclarationRules, sugarValidationRules).flatMap(rule => (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_1__.wrapWithDisableValueAutoInitFlagCheckIfRequired)(this.formSchemaRng, rule)).toArray();
71120
+ const dictionaryRules = Iterator.from(allRules).filter(rule => rule instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.SetStatement && (rule.right.getType() === _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.BuildInTypeExpression.dict || rule.right instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.CastExpression && rule.right.targetExpression.getType() === _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.BuildInTypeExpression.dict || rule.right instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.NullCoalesceExpression && rule.right.expression instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.CastExpression && rule.right.expression.targetExpression.getType() === _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.BuildInTypeExpression.dict)).map(x => x instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_2__.SetStatement ? new _Common_ModelPath_AbsoluteModelFieldPath__WEBPACK_IMPORTED_MODULE_3__.AbsoluteModelFieldPath(x.left.modePath, x.left.valueName) : undefined).filter(_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_4__.isNotNullOrUndefined).toArray();
71121
+ const content = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_1__.combineRulesWithOptionalSectionChecking)(allRules, this.optionalSectionRulesBuilder);
71122
+ return {
71123
+ content: content,
71124
+ serverOnlyPaths: dictionaryRules
71125
+ };
70979
71126
  }
70980
71127
  }
70981
71128
 
@@ -71056,7 +71203,11 @@ class FormulaRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MODULE_6__.
71056
71203
  const isTargetAutoField = this.dataDeclarationHelper.isNodeHasAutoFlagEntry(fullTarget.toAbsolute());
71057
71204
  const isDisabled = this.dataDeclarationHelper.isNodeHasDisabledEntry(fullTarget.toAbsolute());
71058
71205
  const isDecimal = ((_this$formSchemaRng$g = this.formSchemaRng.getTypeNodeByPath(fullTarget.toAbsolute())) === null || _this$formSchemaRng$g === void 0 ? void 0 : _this$formSchemaRng$g.baseType) === "decimal";
71059
- const getFormulaExpression = targetField => new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NullCoalesceExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.wrapWithArgumentsCondition)((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.castOperandToStringIfNeed)(this.formulaExprConverter.compileExpressionToFlangExpression(formula.expression, prefix, new _Common_ModelPath_AbsoluteModelFieldPath__WEBPACK_IMPORTED_MODULE_4__.AbsoluteModelFieldPath(fullTarget, targetField), x => precalculationRules.push(x)), "G29")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression(defaultValue));
71206
+ const getFormulaExpression = targetField => {
71207
+ const result = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.castOperandToStringIfNeed)(this.formulaExprConverter.compileExpressionToFlangExpression(formula.expression, prefix, new _Common_ModelPath_AbsoluteModelFieldPath__WEBPACK_IMPORTED_MODULE_4__.AbsoluteModelFieldPath(fullTarget, targetField), x => precalculationRules.push(x)), "G29");
71208
+ const resultType = result.getType();
71209
+ return resultType === _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.BuildInTypeExpression.string ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NullCoalesceExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.wrapWithArgumentsCondition)(result), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression(defaultValue)) : result;
71210
+ };
71060
71211
  const valueRule = isTargetAutoField ? isDisabled ? this.createValueRuleForDisabledAutoField(fullTarget, getFormulaExpression) : this.createValueRuleForAutoField(fullTarget, defaultValue, getFormulaExpression) : this.createRegularValueRule(fullTarget, getFormulaExpression);
71061
71212
  const autoValueRule = isTargetAutoField ? this.createAutoValueRule(fullTarget, getFormulaExpression) : undefined;
71062
71213
  const autoFlagRule = isTargetAutoField ? this.createAutoFlagRule(fullTarget, isDecimal) : undefined;
@@ -71070,13 +71221,13 @@ class FormulaRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MODULE_6__.
71070
71221
  return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget, "value"), getFormulaExpression("value"));
71071
71222
  }
71072
71223
  createAutoFlagRule(fullTarget, isDecimal) {
71073
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget, "autoFlag"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.OrBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.IsEqualsBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "autoFlag"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NullLiteralExpression()), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.IsEqualsBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "autoFlag"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression("false"))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.CastExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.IsEqualsBinaryExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.decimalWrapper)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "value"), isDecimal), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.decimalWrapper)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "autoValue"), isDecimal)), _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.BuildInTypeExpression.string), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NoDepsExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "autoFlag"))));
71224
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget, "autoFlag"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.OrBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.IsEqualsBinaryExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeStringValueReference)(fullTarget.toCurrentIteration(), "autoFlag"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NullLiteralExpression()), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.IsEqualsBinaryExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeStringValueReference)(fullTarget.toCurrentIteration(), "autoFlag"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression("false"))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.CastExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.IsEqualsBinaryExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.decimalWrapper)((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeStringValueReference)(fullTarget.toCurrentIteration(), "value"), isDecimal), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.decimalWrapper)((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeStringValueReference)(fullTarget.toCurrentIteration(), "autoValue"), isDecimal)), _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.BuildInTypeExpression.string), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeNoDeps)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "autoFlag"))));
71074
71225
  }
71075
71226
  createValueRuleForDisabledAutoField(fullTarget, getFormulaExpression) {
71076
71227
  return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget, "value"), getFormulaExpression("value"));
71077
71228
  }
71078
71229
  createValueRuleForAutoField(fullTarget, defaultValue, getFormulaExpression) {
71079
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget, "value"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.IsEqualsBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NoDepsExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "autoFlag")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression("true")), getFormulaExpression("value"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NullCoalesceExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "value"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression(defaultValue))));
71230
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget, "value"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.IsEqualsBinaryExpression((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeNoDeps)((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeStringValueReference)(fullTarget.toCurrentIteration(), "autoFlag")), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression("true")), getFormulaExpression("value"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NullCoalesceExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(fullTarget.toCurrentIteration(), "value"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression(defaultValue))));
71080
71231
  }
71081
71232
  adjustPathMultiplicity(path) {
71082
71233
  return (0,_DataSchema_DataSchemaUtils__WEBPACK_IMPORTED_MODULE_2__.adjustPathMultiplicityComplex)(path, this.formSchemaRng, this.dataDeclarationHelper);
@@ -71188,6 +71339,8 @@ __webpack_require__.r(__webpack_exports__);
71188
71339
  /* harmony import */ var _Common_ModelPath_ModelPathHelper__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../../../Common/ModelPath/ModelPathHelper */ "./Common/ModelPath/ModelPathHelper.ts");
71189
71340
  /* harmony import */ var _Common_PathConstants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../../../Common/PathConstants */ "./Common/PathConstants.ts");
71190
71341
  /* harmony import */ var _BaseRuleBuilder__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./BaseRuleBuilder */ "./Generator/src/generators/ServerSideFLangNormalization/RuleBuilders/BaseRuleBuilder.ts");
71342
+ /* harmony import */ var _FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../FLang/FlangUtils */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FlangUtils.ts");
71343
+
71191
71344
 
71192
71345
 
71193
71346
 
@@ -71306,7 +71459,7 @@ class OptionalSectionRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MOD
71306
71459
  var _pathGroup$, _pathGroup$map$reduce;
71307
71460
  const iterationEntry = (_pathGroup$ = pathGroup[0]) === null || _pathGroup$ === void 0 ? void 0 : _pathGroup$.lastIterationEntry;
71308
71461
  const pathCheckExpr = (_pathGroup$map$reduce = pathGroup.map(pathInfo => {
71309
- const pathValueRef = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.NoDepsExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(pathInfo.path.toCurrentIteration(), "value"));
71462
+ const pathValueRef = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_10__.makeNoDeps)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(pathInfo.path.toCurrentIteration(), "value"));
71310
71463
  const checkExpression = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.NotEqExpression(pathValueRef, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.NullLiteralExpression());
71311
71464
  return checkExpression;
71312
71465
  }).reduce((acc, current) => acc == undefined ? current : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.OrBinaryExpression(acc, current), undefined)) !== null && _pathGroup$map$reduce !== void 0 ? _pathGroup$map$reduce : (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_4__.reject)();
@@ -71460,11 +71613,9 @@ class ValidationRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MODULE_1
71460
71613
  const validationText = next.message.reduce((acc, item) => {
71461
71614
  if (item instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.StringLiteralExpression) {
71462
71615
  return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ConcatStringsExpression(acc, (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToStringIfNeed)(item));
71463
- } else if (item instanceof _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression) {
71464
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ConcatStringsExpression(acc, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.JoinExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.DeserializeEnumerationExpression([item], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.BoolLiteralExpression(true)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.StringLiteralExpression(", ")));
71465
- } else {
71466
- throw new Error(`Invalid WithDescription ${item.toString()}`);
71467
71616
  }
71617
+ const valueReference = (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.extractValueReferenceFromCast)(item);
71618
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ConcatStringsExpression(acc, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.JoinExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.DeserializeEnumerationExpression([valueReference], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.BoolLiteralExpression(true)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.StringLiteralExpression(", ")));
71468
71619
  }, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.StringLiteralExpression(""));
71469
71620
  const condition = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.NegateUnaryExpression(next.checkExpression), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ConcatStringsExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ConcatStringsExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.StringLiteralExpression(`["`), validationText), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.StringLiteralExpression(`"]`)), current);
71470
71621
  return condition;
@@ -71518,7 +71669,7 @@ class ValidationRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MODULE_1
71518
71669
  }
71519
71670
  buildErrorWarningCountReduceRule(iterable, countFieldName, getAllItemsSumExpression) {
71520
71671
  const nextErrorCountTarget = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(iterable, countFieldName);
71521
- const aggregationReduce = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ReduceCallExpression(iterable.toCurrentIteration(), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.AnonymousFunctionDeclarationExpression(_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.BuildInTypeExpression.decimal, [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ArgumentDeclarationExpression("result", _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.BuildInTypeExpression.decimal)], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.SumBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ArgumentReferenceExpression("result"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.MinusBinaryExpression(getAllItemsSumExpression(false), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.IncrementalFlagExpression(), getAllItemsSumExpression(true), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.DecimalLiteralExpression(0))))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.IncrementalFlagExpression(), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.GetOldExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(iterable.toCurrentIteration(), countFieldName))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.DecimalLiteralExpression(0)));
71672
+ const aggregationReduce = new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ReduceCallExpression(iterable.toCurrentIteration(), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.AnonymousFunctionDeclarationExpression(_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.BuildInTypeExpression.decimal, [new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ArgumentDeclarationExpression("result", _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.BuildInTypeExpression.decimal)], new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.SumBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ArgumentReferenceExpression("result"), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.MinusBinaryExpression(getAllItemsSumExpression(false), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.IncrementalFlagExpression(), getAllItemsSumExpression(true), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.DecimalLiteralExpression(0))))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.IncrementalFlagExpression(), (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.castOperandToDecimalIfNeed)((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeGetOld)((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeStringValueReference)(iterable.toCurrentIteration(), countFieldName))), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.DecimalLiteralExpression(0)));
71522
71673
  return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.SetStatement(nextErrorCountTarget, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.CastExpression(aggregationReduce, _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.BuildInTypeExpression.string, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.StringLiteralExpression("G29")));
71523
71674
  }
71524
71675
  buildErrorWarningCountSimpleSumRule(iterable, countFieldName, getAllItemsSumExpression) {
@@ -71526,11 +71677,11 @@ class ValidationRulesBuilder extends _BaseRuleBuilder__WEBPACK_IMPORTED_MODULE_1
71526
71677
  return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.SetStatement(nextErrorCountTarget, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.CastExpression(getAllItemsSumExpression(false), _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.BuildInTypeExpression.string, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.StringLiteralExpression("G29")));
71527
71678
  }
71528
71679
  getErrorWarningCountExpression(path, fieldName, readOldValues) {
71529
- const valueGetExpression = readOldValues ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.GetOldExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(path, fieldName)) : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(path, fieldName);
71680
+ const valueGetExpression = readOldValues ? (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeGetOld)((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeStringValueReference)(path, fieldName)) : (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeStringValueReference)(path, fieldName);
71530
71681
  return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ConditionalExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.OrBinaryExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.IsEqualsBinaryExpression(valueGetExpression, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.StringLiteralExpression(`[]`)), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.IsEqualsBinaryExpression(valueGetExpression, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.NullLiteralExpression())), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.DecimalLiteralExpression(0), new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.DecimalLiteralExpression(1));
71531
71682
  }
71532
71683
  getReadErrorCountValueExpression(path, countFieldName, readOldValues) {
71533
- return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.CastExpression(readOldValues ? new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.GetOldExpression(new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(path.toCurrentIteration(), countFieldName)) : new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.ValueReferenceExpression(path.toCurrentIteration(), countFieldName), _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.BuildInTypeExpression.decimal, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.DecimalLiteralExpression(0));
71684
+ return new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.CastExpression(readOldValues ? (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeGetOld)((0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeStringValueReference)(path.toCurrentIteration(), countFieldName)) : (0,_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_8__.makeStringValueReference)(path.toCurrentIteration(), countFieldName), _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.BuildInTypeExpression.decimal, new _FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_1__.DecimalLiteralExpression(0));
71534
71685
  }
71535
71686
  buildChainOfErrorCountRules(path, countFieldName, fieldName) {
71536
71687
  const reduceResult = Iterator.from((0,_Common_IterableUtils__WEBPACK_IMPORTED_MODULE_4__.reverseArray)([...this.splitModelPathIfErrorCountRequired(path)])).flatMap(iterationPath => this.dataDeclarationHelper.isNodeHasChildrenEntry(iterationPath) ? [iterationPath.joinWith(_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_0__.PathTokens.each), iterationPath] : [iterationPath]).reduce((result, iterationPath) => {
@@ -95811,8 +95962,10 @@ __webpack_require__.r(__webpack_exports__);
95811
95962
  /* harmony import */ var _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ServerSideFLangNormalization/FLang/FLangCodeDom */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FLangCodeDom.ts");
95812
95963
  /* harmony import */ var _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../Common/ModelPath/ModelPath */ "./Common/ModelPath/ModelPath.ts");
95813
95964
  /* harmony import */ var _Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../Common/TypingUtils */ "./Common/TypingUtils.ts");
95814
- /* harmony import */ var _getBindingPath__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./getBindingPath */ "./Generator/src/generators/markupGenerator/getBindingPath.ts");
95815
- /* harmony import */ var _ElementProcessors_CommonNodeProperties_ValidationInfoNode__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ElementProcessors/CommonNodeProperties/ValidationInfoNode */ "./Generator/src/generators/markupGenerator/ElementProcessors/CommonNodeProperties/ValidationInfoNode.ts");
95965
+ /* harmony import */ var _ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../ServerSideFLangNormalization/FLang/FlangUtils */ "./Generator/src/generators/ServerSideFLangNormalization/FLang/FlangUtils.ts");
95966
+ /* harmony import */ var _getBindingPath__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./getBindingPath */ "./Generator/src/generators/markupGenerator/getBindingPath.ts");
95967
+ /* harmony import */ var _ElementProcessors_CommonNodeProperties_ValidationInfoNode__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ElementProcessors/CommonNodeProperties/ValidationInfoNode */ "./Generator/src/generators/markupGenerator/ElementProcessors/CommonNodeProperties/ValidationInfoNode.ts");
95968
+
95816
95969
 
95817
95970
 
95818
95971
 
@@ -95834,17 +95987,17 @@ class FLangNormalizationRulesBuilder {
95834
95987
  this.controlCustomizationContext = controlCustomizationContext;
95835
95988
  }
95836
95989
  *childrenInitializer(node, optional, defaultChildren) {
95837
- const targetPathReference = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createFromMask)((0,_getBindingPath__WEBPACK_IMPORTED_MODULE_3__.getResolvedBindingPath)(node), true, _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each);
95838
- yield new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(targetPathReference, "children"), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ConditionalExpression(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.IsEqualsBinaryExpression(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NoDepsExpression(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(targetPathReference.toCurrentIteration(), "children")), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NullLiteralExpression()), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression(JSON.stringify(defaultChildren !== null && defaultChildren !== void 0 ? defaultChildren : optional ? [] : ["0"])), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NoDepsExpression(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(targetPathReference.toCurrentIteration(), "children"))));
95990
+ const targetPathReference = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createFromMask)((0,_getBindingPath__WEBPACK_IMPORTED_MODULE_4__.getResolvedBindingPath)(node), true, _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each);
95991
+ yield new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(targetPathReference, "children"), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ConditionalExpression(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.IsEqualsBinaryExpression((0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeNoDeps)((0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeStringValueReference)(targetPathReference.toCurrentIteration(), "children")), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NullLiteralExpression()), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression(JSON.stringify(defaultChildren !== null && defaultChildren !== void 0 ? defaultChildren : optional ? [] : ["0"])), (0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeNoDeps)((0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeStringValueReference)(targetPathReference.toCurrentIteration(), "children"))));
95839
95992
  }
95840
95993
  *childrenInitializerForPicklist(node, optional, defaultChildren) {
95841
95994
  const targetPathReference = node.getFullPath().toEachIteration().trimLastStarIfLastToken();
95842
- yield new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(targetPathReference, "children"), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ConditionalExpression(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.IsEqualsBinaryExpression(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NoDepsExpression(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(targetPathReference.toCurrentIteration(), "children")), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NullLiteralExpression()), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression(JSON.stringify(defaultChildren !== null && defaultChildren !== void 0 ? defaultChildren : optional ? [] : ["0"])), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NoDepsExpression(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(targetPathReference.toCurrentIteration(), "children"))));
95995
+ yield new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(targetPathReference, "children"), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ConditionalExpression(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.IsEqualsBinaryExpression((0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeNoDeps)((0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeStringValueReference)(targetPathReference.toCurrentIteration(), "children")), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NullLiteralExpression()), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression(JSON.stringify(defaultChildren !== null && defaultChildren !== void 0 ? defaultChildren : optional ? [] : ["0"])), (0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeNoDeps)((0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeStringValueReference)(targetPathReference.toCurrentIteration(), "children"))));
95843
95996
  }
95844
95997
  valueInitializer(node, dataBinding, disabled, pathSuffix, fetchFunctionSuffix) {
95845
95998
  var _dataBinding$defaultV;
95846
- const targetPathReference = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createFromMask)((0,_getBindingPath__WEBPACK_IMPORTED_MODULE_3__.getResolvedBindingPath)(node), true, _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each).joinWith((0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.isNotNullOrEmpty)(pathSuffix) ? (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createFromMask)(pathSuffix, false, _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each) : (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.emptyModelPath)());
95847
- const originalValueReference = new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NoDepsExpression(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(targetPathReference.toCurrentIteration(), "value"));
95999
+ const targetPathReference = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createFromMask)((0,_getBindingPath__WEBPACK_IMPORTED_MODULE_4__.getResolvedBindingPath)(node), true, _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each).joinWith((0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.isNotNullOrEmpty)(pathSuffix) ? (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createFromMask)(pathSuffix, false, _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each) : (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.emptyModelPath)());
96000
+ const originalValueReference = (0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeNoDeps)((0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeStringValueReference)(targetPathReference.toCurrentIteration(), "value"));
95848
96001
  const sourceValueReference = this.getSourceValueReferenceWithCorrection(node, targetPathReference);
95849
96002
  const defaultValue = (_dataBinding$defaultV = dataBinding.defaultValue) !== null && _dataBinding$defaultV !== void 0 ? _dataBinding$defaultV : "";
95850
96003
  if ((0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.isNotNullOrEmpty)(dataBinding.fetchfn)) {
@@ -95868,11 +96021,11 @@ class FLangNormalizationRulesBuilder {
95868
96021
  if (!disabled && !dataBinding.settings) {
95869
96022
  valueExpression = new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ConditionalExpression(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.IsEqualsBinaryExpression(originalValueReference, new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NullLiteralExpression()), valueExpression, sourceValueReference);
95870
96023
  }
95871
- const finalExpression = this.dataDeclarationHelper.isNodeHasAutoFlagEntry(targetPathReference) ? new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ConditionalExpression(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.IsEqualsBinaryExpression(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NoDepsExpression(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(targetPathReference.toCurrentIteration(), "autoFlag")), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression("true")), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NoDepsExpression(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(targetPathReference.toCurrentIteration(), "autoValue")), valueExpression) : valueExpression;
96024
+ const finalExpression = this.dataDeclarationHelper.isNodeHasAutoFlagEntry(targetPathReference) ? new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ConditionalExpression(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.IsEqualsBinaryExpression((0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeNoDeps)((0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeStringValueReference)(targetPathReference.toCurrentIteration(), "autoFlag")), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression("true")), (0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeNoDeps)((0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeStringValueReference)(targetPathReference.toCurrentIteration(), "autoValue")), valueExpression) : valueExpression;
95872
96025
  return new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(targetPathReference, "value"), finalExpression);
95873
96026
  }
95874
96027
  *specialFieldsInitializer(node, options) {
95875
- const targetPathReference = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createFromMask)((0,_getBindingPath__WEBPACK_IMPORTED_MODULE_3__.getResolvedBindingPath)(node), true, _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each).joinWith((0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.isNotNullOrEmpty)(options.pathSuffix) ? (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createFromMask)(options.pathSuffix, false, _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each) : (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.emptyModelPath)());
96028
+ const targetPathReference = (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createFromMask)((0,_getBindingPath__WEBPACK_IMPORTED_MODULE_4__.getResolvedBindingPath)(node), true, _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each).joinWith((0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_2__.isNotNullOrEmpty)(options.pathSuffix) ? (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.createFromMask)(options.pathSuffix, false, _Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.PathTokens.each) : (0,_Common_ModelPath_ModelPath__WEBPACK_IMPORTED_MODULE_1__.emptyModelPath)());
95876
96029
  if (options.disabled) {
95877
96030
  yield new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.SetStatement(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(targetPathReference, "disabled"), new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.StringLiteralExpression("true"));
95878
96031
  }
@@ -95890,9 +96043,9 @@ class FLangNormalizationRulesBuilder {
95890
96043
  var _typeNode$base, _this$schemaRng$getTy;
95891
96044
  // eslint-disable-next-line
95892
96045
  const validationInfoSource = node === null || node === void 0 ? void 0 : node.validationInfo;
95893
- const typeNode = validationInfoSource instanceof _ElementProcessors_CommonNodeProperties_ValidationInfoNode__WEBPACK_IMPORTED_MODULE_4__.ValidationInfoNode ? this.nodeTypeInfoHelper.getTypeNode(validationInfoSource) : undefined;
96046
+ const typeNode = validationInfoSource instanceof _ElementProcessors_CommonNodeProperties_ValidationInfoNode__WEBPACK_IMPORTED_MODULE_5__.ValidationInfoNode ? this.nodeTypeInfoHelper.getTypeNode(validationInfoSource) : undefined;
95894
96047
  const baseType = (_typeNode$base = typeNode === null || typeNode === void 0 ? void 0 : typeNode.base) !== null && _typeNode$base !== void 0 ? _typeNode$base : (_this$schemaRng$getTy = this.schemaRng.getTypeNodeByPath(targetPathReference)) === null || _this$schemaRng$getTy === void 0 ? void 0 : _this$schemaRng$getTy.baseType;
95895
- const sourceValueReference = new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.NoDepsExpression(new _ServerSideFLangNormalization_FLang_FLangCodeDom__WEBPACK_IMPORTED_MODULE_0__.ValueReferenceExpression(targetPathReference.toCurrentIteration(), "value"));
96048
+ const sourceValueReference = (0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeNoDeps)((0,_ServerSideFLangNormalization_FLang_FlangUtils__WEBPACK_IMPORTED_MODULE_3__.makeStringValueReference)(targetPathReference.toCurrentIteration(), "value"));
95896
96049
  return baseType != undefined ? this.wrapExpressionWithCorrectionExpression(baseType, sourceValueReference) : sourceValueReference;
95897
96050
  }
95898
96051
  }