@kontur.candy/generator 4.245.0 → 4.246.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +125 -754
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -113312,7 +113312,11 @@ function ensureNotNullOrUndefined(input) {
113312
113312
  function noop() {// noop
113313
113313
  }
113314
113314
  function reject(message) {
113315
- throw new Error(message !== null && message !== void 0 ? message : "Undefined is not allowed");
113315
+ if (typeof message === "string" || message == undefined) {
113316
+ throw new Error(message !== null && message !== void 0 ? message : "Undefined is not allowed");
113317
+ } else {
113318
+ throw message;
113319
+ }
113316
113320
  }
113317
113321
  function isLengthGreaterThenOrEqual(items, minLength) {
113318
113322
  return items.length >= minLength;
@@ -120490,293 +120494,6 @@ class CompositionOperandContext extends antlr4ts_ParserRuleContext__WEBPACK_IMPO
120490
120494
 
120491
120495
  /***/ }),
120492
120496
 
120493
- /***/ "./Generator/src/common/KCLang/IKCLangExpressionVisitor.ts":
120494
- /*!*****************************************************************!*\
120495
- !*** ./Generator/src/common/KCLang/IKCLangExpressionVisitor.ts ***!
120496
- \*****************************************************************/
120497
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
120498
-
120499
- "use strict";
120500
- __webpack_require__.r(__webpack_exports__);
120501
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
120502
- /* harmony export */ "traverseKCLangExpression": () => (/* binding */ traverseKCLangExpression),
120503
- /* harmony export */ "DefaultKCLangExpressionVisitor": () => (/* binding */ DefaultKCLangExpressionVisitor)
120504
- /* harmony export */ });
120505
- /* harmony import */ var _Common_TypingUtils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../Common/TypingUtils */ "./Common/TypingUtils.ts");
120506
-
120507
- // tslint:disable-next-line:cyclomatic-complexity
120508
- function traverseKCLangExpression(node, visitor) {
120509
- switch (node.type) {
120510
- case "cast":
120511
- traverseKCLangExpression(node.expression, visitor);
120512
- visitor.visitCastExpressionKCLangNode(node);
120513
- break;
120514
-
120515
- case "oneof":
120516
- traverseKCLangExpression(node.testExpression, visitor);
120517
- visitor.visitOneOfExpressionKCLangNode(node);
120518
- break;
120519
-
120520
- case "abs":
120521
- traverseKCLangExpression(node.expression, visitor);
120522
- visitor.visitAbsKCLangNode(node);
120523
- break;
120524
-
120525
- case "xabs":
120526
- traverseKCLangExpression(node.expression, visitor);
120527
- visitor.visitXAbsKCLangNode(node);
120528
- break;
120529
-
120530
- case "exists":
120531
- visitor.visitExistsKCLangNode(node);
120532
- break;
120533
-
120534
- case "length":
120535
- traverseKCLangExpression(node.expression, visitor);
120536
- visitor.visitLengthKCLangNode(node);
120537
- break;
120538
-
120539
- case "and":
120540
- for (const expression of node.expressions) {
120541
- traverseKCLangExpression(expression, visitor);
120542
- }
120543
-
120544
- visitor.visitAndKCLangNode(node);
120545
- break;
120546
-
120547
- case "sum":
120548
- visitor.visitSumKCLangNode(node);
120549
- break;
120550
-
120551
- case "gt":
120552
- case "ge":
120553
- case "lt":
120554
- case "le":
120555
- case "eq":
120556
- case "noteq":
120557
- for (const expression of node.expressions) {
120558
- traverseKCLangExpression(expression, visitor);
120559
- }
120560
-
120561
- visitor.visitComparisonKCLangNode(node);
120562
- break;
120563
-
120564
- case "division":
120565
- case "multiply":
120566
- for (const expression of node.expressions) {
120567
- traverseKCLangExpression(expression, visitor);
120568
- }
120569
-
120570
- visitor.visitMultiplyKCLangNode(node);
120571
- break;
120572
-
120573
- case "minus":
120574
- traverseKCLangExpression(node.expression, visitor);
120575
- visitor.visitMinusKCLangNode(node);
120576
- break;
120577
-
120578
- case "not":
120579
- traverseKCLangExpression(node.expression, visitor);
120580
- visitor.visitNotKCLangNode(node);
120581
- break;
120582
-
120583
- case "round":
120584
- traverseKCLangExpression(node.expression, visitor);
120585
- visitor.visitRoundKCLangNode(node);
120586
- break;
120587
-
120588
- case "choose":
120589
- traverseKCLangExpression(node.if, visitor);
120590
- traverseKCLangExpression(node.else, visitor);
120591
- traverseKCLangExpression(node.then, visitor);
120592
- visitor.visitChooseKCLangNode(node);
120593
- break;
120594
-
120595
- case "const":
120596
- visitor.visitConstKCLangNode(node);
120597
- break;
120598
-
120599
- case "argument":
120600
- visitor.visitArgumentKCLangNode(node);
120601
- break;
120602
-
120603
- case "or":
120604
- for (const expression of node.expressions) {
120605
- traverseKCLangExpression(expression, visitor);
120606
- }
120607
-
120608
- visitor.visitOrKCLangNode(node);
120609
- break;
120610
-
120611
- case "multySum":
120612
- visitor.visitMultySumKCLangNode(node);
120613
- break;
120614
-
120615
- case "substring":
120616
- traverseKCLangExpression(node.expression, visitor);
120617
- visitor.visitSubstringKCLangNode(node);
120618
- break;
120619
-
120620
- case "regexMatch":
120621
- traverseKCLangExpression(node.expression, visitor);
120622
- visitor.visitRegexMatchKCLangNode(node);
120623
- break;
120624
-
120625
- default:
120626
- (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_0__.ensureNever)(node);
120627
- break;
120628
- }
120629
- }
120630
- class DefaultKCLangExpressionVisitor {
120631
- visitAbsKCLangNode(node) {// default empty implementation
120632
- }
120633
-
120634
- visitAndKCLangNode(node) {// default empty implementation
120635
- }
120636
-
120637
- visitArgumentKCLangNode(node) {// default empty implementation
120638
- }
120639
-
120640
- visitCastExpressionKCLangNode(node) {// default empty implementation
120641
- }
120642
-
120643
- visitChooseKCLangNode(node) {// default empty implementation
120644
- }
120645
-
120646
- visitComparisonKCLangNode(node) {// default empty implementation
120647
- }
120648
-
120649
- visitConstKCLangNode(node) {// default empty implementation
120650
- }
120651
-
120652
- visitExistsKCLangNode(node) {// default empty implementation
120653
- }
120654
-
120655
- visitLengthKCLangNode(node) {// default empty implementation
120656
- }
120657
-
120658
- visitMinusKCLangNode(node) {// default empty implementation
120659
- }
120660
-
120661
- visitMultiplyKCLangNode(node) {// default empty implementation
120662
- }
120663
-
120664
- visitMultySumKCLangNode(node) {// default empty implementation
120665
- }
120666
-
120667
- visitNotKCLangNode(node) {// default empty implementation
120668
- }
120669
-
120670
- visitOneOfExpressionKCLangNode(node) {// default empty implementation
120671
- }
120672
-
120673
- visitOrKCLangNode(node) {// default empty implementation
120674
- }
120675
-
120676
- visitRegexMatchKCLangNode(node) {// default empty implementation
120677
- }
120678
-
120679
- visitRoundKCLangNode(node) {// default empty implementation
120680
- }
120681
-
120682
- visitSubstringKCLangNode(node) {// default empty implementation
120683
- }
120684
-
120685
- visitSumKCLangNode(node) {// default empty implementation
120686
- }
120687
-
120688
- visitXAbsKCLangNode(node) {// default empty implementation
120689
- }
120690
-
120691
- }
120692
-
120693
- /***/ }),
120694
-
120695
- /***/ "./Generator/src/common/KCLang/KCLangDescriptionGrammar.ts":
120696
- /*!*****************************************************************!*\
120697
- !*** ./Generator/src/common/KCLang/KCLangDescriptionGrammar.ts ***!
120698
- \*****************************************************************/
120699
- /***/ ((module) => {
120700
-
120701
- // this file was prevaled
120702
-
120703
- /* eslint-disable */
120704
- // @ts-ignore
120705
- module.exports = "/*\n * Generated by PEG.js 0.10.0.\n *\n * http://pegjs.org/\n */\n(function() {\n \"use strict\";\n\n function peg$subclass(child, parent) {\n function ctor() { this.constructor = child; }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor();\n }\n\n function peg$SyntaxError(message, expected, found, location) {\n this.message = message;\n this.expected = expected;\n this.found = found;\n this.location = location;\n this.name = \"SyntaxError\";\n\n if (typeof Error.captureStackTrace === \"function\") {\n Error.captureStackTrace(this, peg$SyntaxError);\n }\n }\n\n peg$subclass(peg$SyntaxError, Error);\n\n peg$SyntaxError.buildMessage = function(expected, found) {\n var DESCRIBE_EXPECTATION_FNS = {\n literal: function(expectation) {\n return \"\\\"\" + literalEscape(expectation.text) + \"\\\"\";\n },\n\n \"class\": function(expectation) {\n var escapedParts = \"\",\n i;\n\n for (i = 0; i < expectation.parts.length; i++) {\n escapedParts += expectation.parts[i] instanceof Array\n ? classEscape(expectation.parts[i][0]) + \"-\" + classEscape(expectation.parts[i][1])\n : classEscape(expectation.parts[i]);\n }\n\n return \"[\" + (expectation.inverted ? \"^\" : \"\") + escapedParts + \"]\";\n },\n\n any: function(expectation) {\n return \"any character\";\n },\n\n end: function(expectation) {\n return \"end of input\";\n },\n\n other: function(expectation) {\n return expectation.description;\n }\n };\n\n function hex(ch) {\n return ch.charCodeAt(0).toString(16).toUpperCase();\n }\n\n function literalEscape(s) {\n return s\n .replace(/\\\\/g, '\\\\\\\\')\n .replace(/\"/g, '\\\\\"')\n .replace(/\\0/g, '\\\\0')\n .replace(/\\t/g, '\\\\t')\n .replace(/\\n/g, '\\\\n')\n .replace(/\\r/g, '\\\\r')\n .replace(/[\\x00-\\x0F]/g, function(ch) { return '\\\\x0' + hex(ch); })\n .replace(/[\\x10-\\x1F\\x7F-\\x9F]/g, function(ch) { return '\\\\x' + hex(ch); });\n }\n\n function classEscape(s) {\n return s\n .replace(/\\\\/g, '\\\\\\\\')\n .replace(/\\]/g, '\\\\]')\n .replace(/\\^/g, '\\\\^')\n .replace(/-/g, '\\\\-')\n .replace(/\\0/g, '\\\\0')\n .replace(/\\t/g, '\\\\t')\n .replace(/\\n/g, '\\\\n')\n .replace(/\\r/g, '\\\\r')\n .replace(/[\\x00-\\x0F]/g, function(ch) { return '\\\\x0' + hex(ch); })\n .replace(/[\\x10-\\x1F\\x7F-\\x9F]/g, function(ch) { return '\\\\x' + hex(ch); });\n }\n\n function describeExpectation(expectation) {\n return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);\n }\n\n function describeExpected(expected) {\n var descriptions = new Array(expected.length),\n i, j;\n\n for (i = 0; i < expected.length; i++) {\n descriptions[i] = describeExpectation(expected[i]);\n }\n\n descriptions.sort();\n\n if (descriptions.length > 0) {\n for (i = 1, j = 1; i < descriptions.length; i++) {\n if (descriptions[i - 1] !== descriptions[i]) {\n descriptions[j] = descriptions[i];\n j++;\n }\n }\n descriptions.length = j;\n }\n\n switch (descriptions.length) {\n case 1:\n return descriptions[0];\n\n case 2:\n return descriptions[0] + \" or \" + descriptions[1];\n\n default:\n return descriptions.slice(0, -1).join(\", \")\n + \", or \"\n + descriptions[descriptions.length - 1];\n }\n }\n\n function describeFound(found) {\n return found ? \"\\\"\" + literalEscape(found) + \"\\\"\" : \"end of input\";\n }\n\n return \"Expected \" + describeExpected(expected) + \" but \" + describeFound(found) + \" found.\";\n };\n\n function peg$parse(input, options) {\n options = options !== void 0 ? options : {};\n\n var peg$FAILED = {},\n\n peg$startRuleFunctions = { Text: peg$parseText },\n peg$startRuleFunction = peg$parseText,\n\n peg$c0 = function(items) {\r\n \treturn items.filter(x => x !== \"\");\r\n },\n peg$c1 = \"[\",\n peg$c2 = peg$literalExpectation(\"[\", false),\n peg$c3 = \"]\",\n peg$c4 = peg$literalExpectation(\"]\", false),\n peg$c5 = \"(\",\n peg$c6 = peg$literalExpectation(\"(\", false),\n peg$c7 = \")\",\n peg$c8 = peg$literalExpectation(\")\", false),\n peg$c9 = function(text, src) {\r\n return {\r\n \ttype: \"link\",\r\n text: text,\r\n src: src,\r\n }\r\n },\n peg$c10 = /^[^ \\]\\t\\n\\r]/,\n peg$c11 = peg$classExpectation([\" \", \"]\", \"\\t\", \"\\n\", \"\\r\"], true, false),\n peg$c12 = function(w) { return w.join(\"\") },\n peg$c13 = function(items) {\r\n return items.filter(x => x !== \"\");\r\n },\n peg$c14 = /^[^)]/,\n peg$c15 = peg$classExpectation([\")\"], true, false),\n peg$c16 = function(w) {\r\n \treturn w.join(\"\").trim()\r\n },\n peg$c17 = /^[\\n]/,\n peg$c18 = peg$classExpectation([\"\\n\"], false, false),\n peg$c19 = /^[ \\t\\n\\r]/,\n peg$c20 = peg$classExpectation([\" \", \"\\t\", \"\\n\", \"\\r\"], false, false),\n peg$c21 = function() {\r\n \treturn \"\\n\"\r\n },\n peg$c22 = /^[^ \\t\\n\\r]/,\n peg$c23 = peg$classExpectation([\" \", \"\\t\", \"\\n\", \"\\r\"], true, false),\n peg$c24 = function(w) {\r\n \treturn w.join(\"\");\r\n },\n peg$c25 = function() {\r\n \treturn \"\";\r\n },\n\n peg$currPos = 0,\n peg$savedPos = 0,\n peg$posDetailsCache = [{ line: 1, column: 1 }],\n peg$maxFailPos = 0,\n peg$maxFailExpected = [],\n peg$silentFails = 0,\n\n peg$result;\n\n if (\"startRule\" in options) {\n if (!(options.startRule in peg$startRuleFunctions)) {\n throw new Error(\"Can't start parsing from rule \\\"\" + options.startRule + \"\\\".\");\n }\n\n peg$startRuleFunction = peg$startRuleFunctions[options.startRule];\n }\n\n function text() {\n return input.substring(peg$savedPos, peg$currPos);\n }\n\n function location() {\n return peg$computeLocation(peg$savedPos, peg$currPos);\n }\n\n function expected(description, location) {\n location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos)\n\n throw peg$buildStructuredError(\n [peg$otherExpectation(description)],\n input.substring(peg$savedPos, peg$currPos),\n location\n );\n }\n\n function error(message, location) {\n location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos)\n\n throw peg$buildSimpleError(message, location);\n }\n\n function peg$literalExpectation(text, ignoreCase) {\n return { type: \"literal\", text: text, ignoreCase: ignoreCase };\n }\n\n function peg$classExpectation(parts, inverted, ignoreCase) {\n return { type: \"class\", parts: parts, inverted: inverted, ignoreCase: ignoreCase };\n }\n\n function peg$anyExpectation() {\n return { type: \"any\" };\n }\n\n function peg$endExpectation() {\n return { type: \"end\" };\n }\n\n function peg$otherExpectation(description) {\n return { type: \"other\", description: description };\n }\n\n function peg$computePosDetails(pos) {\n var details = peg$posDetailsCache[pos], p;\n\n if (details) {\n return details;\n } else {\n p = pos - 1;\n while (!peg$posDetailsCache[p]) {\n p--;\n }\n\n details = peg$posDetailsCache[p];\n details = {\n line: details.line,\n column: details.column\n };\n\n while (p < pos) {\n if (input.charCodeAt(p) === 10) {\n details.line++;\n details.column = 1;\n } else {\n details.column++;\n }\n\n p++;\n }\n\n peg$posDetailsCache[pos] = details;\n return details;\n }\n }\n\n function peg$computeLocation(startPos, endPos) {\n var startPosDetails = peg$computePosDetails(startPos),\n endPosDetails = peg$computePosDetails(endPos);\n\n return {\n start: {\n offset: startPos,\n line: startPosDetails.line,\n column: startPosDetails.column\n },\n end: {\n offset: endPos,\n line: endPosDetails.line,\n column: endPosDetails.column\n }\n };\n }\n\n function peg$fail(expected) {\n if (peg$currPos < peg$maxFailPos) { return; }\n\n if (peg$currPos > peg$maxFailPos) {\n peg$maxFailPos = peg$currPos;\n peg$maxFailExpected = [];\n }\n\n peg$maxFailExpected.push(expected);\n }\n\n function peg$buildSimpleError(message, location) {\n return new peg$SyntaxError(message, null, null, location);\n }\n\n function peg$buildStructuredError(expected, found, location) {\n return new peg$SyntaxError(\n peg$SyntaxError.buildMessage(expected, found),\n expected,\n found,\n location\n );\n }\n\n function peg$parseText() {\n var s0, s1, s2;\n\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$parseLink();\n if (s2 === peg$FAILED) {\n s2 = peg$parseWord();\n if (s2 === peg$FAILED) {\n s2 = peg$parseNewLine();\n if (s2 === peg$FAILED) {\n s2 = peg$parse_();\n }\n }\n }\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$parseLink();\n if (s2 === peg$FAILED) {\n s2 = peg$parseWord();\n if (s2 === peg$FAILED) {\n s2 = peg$parseNewLine();\n if (s2 === peg$FAILED) {\n s2 = peg$parse_();\n }\n }\n }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c0(s1);\n }\n s0 = s1;\n\n return s0;\n }\n\n function peg$parseLink() {\n var s0, s1, s2, s3, s4, s5, s6;\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 91) {\n s1 = peg$c1;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c2); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parseLinkText();\n if (s2 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 93) {\n s3 = peg$c3;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c4); }\n }\n if (s3 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 40) {\n s4 = peg$c5;\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c6); }\n }\n if (s4 !== peg$FAILED) {\n s5 = peg$parseLinkSrc();\n if (s5 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 41) {\n s6 = peg$c7;\n peg$currPos++;\n } else {\n s6 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c8); }\n }\n if (s6 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c9(s2, s5);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseLinkText() {\n var s0, s1, s2, s3, s4;\n\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$currPos;\n s3 = [];\n if (peg$c10.test(input.charAt(peg$currPos))) {\n s4 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c11); }\n }\n if (s4 !== peg$FAILED) {\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n if (peg$c10.test(input.charAt(peg$currPos))) {\n s4 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c11); }\n }\n }\n } else {\n s3 = peg$FAILED;\n }\n if (s3 !== peg$FAILED) {\n peg$savedPos = s2;\n s3 = peg$c12(s3);\n }\n s2 = s3;\n if (s2 === peg$FAILED) {\n s2 = peg$parse_();\n }\n if (s2 !== peg$FAILED) {\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$currPos;\n s3 = [];\n if (peg$c10.test(input.charAt(peg$currPos))) {\n s4 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c11); }\n }\n if (s4 !== peg$FAILED) {\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n if (peg$c10.test(input.charAt(peg$currPos))) {\n s4 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c11); }\n }\n }\n } else {\n s3 = peg$FAILED;\n }\n if (s3 !== peg$FAILED) {\n peg$savedPos = s2;\n s3 = peg$c12(s3);\n }\n s2 = s3;\n if (s2 === peg$FAILED) {\n s2 = peg$parse_();\n }\n }\n } else {\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c13(s1);\n }\n s0 = s1;\n\n return s0;\n }\n\n function peg$parseLinkSrc() {\n var s0, s1, s2;\n\n s0 = peg$currPos;\n s1 = [];\n if (peg$c14.test(input.charAt(peg$currPos))) {\n s2 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c15); }\n }\n if (s2 !== peg$FAILED) {\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n if (peg$c14.test(input.charAt(peg$currPos))) {\n s2 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c15); }\n }\n }\n } else {\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c16(s1);\n }\n s0 = s1;\n\n return s0;\n }\n\n function peg$parseNewLine() {\n var s0, s1, s2, s3, s4;\n\n s0 = peg$currPos;\n if (peg$c17.test(input.charAt(peg$currPos))) {\n s1 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c18); }\n }\n if (s1 !== peg$FAILED) {\n if (peg$c17.test(input.charAt(peg$currPos))) {\n s2 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c18); }\n }\n if (s2 !== peg$FAILED) {\n s3 = [];\n if (peg$c19.test(input.charAt(peg$currPos))) {\n s4 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c20); }\n }\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n if (peg$c19.test(input.charAt(peg$currPos))) {\n s4 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c20); }\n }\n }\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c21();\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseWord() {\n var s0, s1, s2;\n\n s0 = peg$currPos;\n s1 = [];\n if (peg$c22.test(input.charAt(peg$currPos))) {\n s2 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c23); }\n }\n if (s2 !== peg$FAILED) {\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n if (peg$c22.test(input.charAt(peg$currPos))) {\n s2 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c23); }\n }\n }\n } else {\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c24(s1);\n }\n s0 = s1;\n\n return s0;\n }\n\n function peg$parse_() {\n var s0, s1, s2, s3, s4, s5, s6;\n\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$currPos;\n s3 = peg$currPos;\n peg$silentFails++;\n s4 = peg$currPos;\n if (peg$c17.test(input.charAt(peg$currPos))) {\n s5 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c18); }\n }\n if (s5 !== peg$FAILED) {\n if (peg$c17.test(input.charAt(peg$currPos))) {\n s6 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s6 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c18); }\n }\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n peg$silentFails--;\n if (s4 === peg$FAILED) {\n s3 = void 0;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n if (s3 !== peg$FAILED) {\n if (peg$c19.test(input.charAt(peg$currPos))) {\n s4 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c20); }\n }\n if (s4 !== peg$FAILED) {\n s3 = [s3, s4];\n s2 = s3;\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$currPos;\n s3 = peg$currPos;\n peg$silentFails++;\n s4 = peg$currPos;\n if (peg$c17.test(input.charAt(peg$currPos))) {\n s5 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c18); }\n }\n if (s5 !== peg$FAILED) {\n if (peg$c17.test(input.charAt(peg$currPos))) {\n s6 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s6 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c18); }\n }\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n peg$silentFails--;\n if (s4 === peg$FAILED) {\n s3 = void 0;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n if (s3 !== peg$FAILED) {\n if (peg$c19.test(input.charAt(peg$currPos))) {\n s4 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c20); }\n }\n if (s4 !== peg$FAILED) {\n s3 = [s3, s4];\n s2 = s3;\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n }\n } else {\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c25();\n }\n s0 = s1;\n\n return s0;\n }\n\n peg$result = peg$startRuleFunction();\n\n if (peg$result !== peg$FAILED && peg$currPos === input.length) {\n return peg$result;\n } else {\n if (peg$result !== peg$FAILED && peg$currPos < input.length) {\n peg$fail(peg$endExpectation());\n }\n\n throw peg$buildStructuredError(\n peg$maxFailExpected,\n peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null,\n peg$maxFailPos < input.length\n ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1)\n : peg$computeLocation(peg$maxFailPos, peg$maxFailPos)\n );\n }\n }\n\n return {\n SyntaxError: peg$SyntaxError,\n parse: peg$parse\n };\n})()";
120706
-
120707
- /***/ }),
120708
-
120709
- /***/ "./Generator/src/common/KCLang/KCLangDescriptionParser.ts":
120710
- /*!****************************************************************!*\
120711
- !*** ./Generator/src/common/KCLang/KCLangDescriptionParser.ts ***!
120712
- \****************************************************************/
120713
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
120714
-
120715
- "use strict";
120716
- __webpack_require__.r(__webpack_exports__);
120717
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
120718
- /* harmony export */ "KCLangDescriptionParser": () => (/* binding */ KCLangDescriptionParser)
120719
- /* harmony export */ });
120720
- /* harmony import */ var _KCLangDescriptionGrammar__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./KCLangDescriptionGrammar */ "./Generator/src/common/KCLang/KCLangDescriptionGrammar.ts");
120721
- /* harmony import */ var _KCLangDescriptionGrammar__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_KCLangDescriptionGrammar__WEBPACK_IMPORTED_MODULE_0__);
120722
- // @ts-ignore
120723
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
120724
-
120725
- const evalParse = eval((_KCLangDescriptionGrammar__WEBPACK_IMPORTED_MODULE_0___default())).parse;
120726
- class KCLangDescriptionParser {
120727
- static getOrCreateParser() {
120728
- return evalParse;
120729
- }
120730
-
120731
- static parse(code) {
120732
- const parser = this.getOrCreateParser();
120733
- return parser(code);
120734
- }
120735
-
120736
- }
120737
-
120738
- /***/ }),
120739
-
120740
- /***/ "./Generator/src/common/KCLang/KCLangNodes.ts":
120741
- /*!****************************************************!*\
120742
- !*** ./Generator/src/common/KCLang/KCLangNodes.ts ***!
120743
- \****************************************************/
120744
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
120745
-
120746
- "use strict";
120747
- __webpack_require__.r(__webpack_exports__);
120748
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
120749
- /* harmony export */ "isFormulaStatement": () => (/* binding */ isFormulaStatement),
120750
- /* harmony export */ "isBlockStatement": () => (/* binding */ isBlockStatement),
120751
- /* harmony export */ "isEnsureStatement": () => (/* binding */ isEnsureStatement),
120752
- /* harmony export */ "isConditionalStatement": () => (/* binding */ isConditionalStatement),
120753
- /* harmony export */ "isDescribeStatement": () => (/* binding */ isDescribeStatement),
120754
- /* harmony export */ "andKCLangNode": () => (/* binding */ andKCLangNode)
120755
- /* harmony export */ });
120756
- function isFormulaStatement(node) {
120757
- return node.type === "formula";
120758
- }
120759
- function isBlockStatement(node) {
120760
- return node.type === "block";
120761
- }
120762
- function isEnsureStatement(node) {
120763
- return node.type === "ensure";
120764
- }
120765
- function isConditionalStatement(node) {
120766
- return node.type === "if";
120767
- }
120768
- function isDescribeStatement(node) {
120769
- return node.type === "describe";
120770
- }
120771
- function andKCLangNode(...expressions) {
120772
- return {
120773
- type: "and",
120774
- expressions: expressions
120775
- };
120776
- }
120777
-
120778
- /***/ }),
120779
-
120780
120497
  /***/ "./Generator/src/common/KCLang/KCLangToJsTranspiler.ts":
120781
120498
  /*!*************************************************************!*\
120782
120499
  !*** ./Generator/src/common/KCLang/KCLangToJsTranspiler.ts ***!
@@ -121074,345 +120791,6 @@ class KCLangToJsTranspiler {
121074
120791
 
121075
120792
  /***/ }),
121076
120793
 
121077
- /***/ "./Generator/src/common/KCLang/KCLangToXmlTranspiler.ts":
121078
- /*!**************************************************************!*\
121079
- !*** ./Generator/src/common/KCLang/KCLangToXmlTranspiler.ts ***!
121080
- \**************************************************************/
121081
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
121082
-
121083
- "use strict";
121084
- __webpack_require__.r(__webpack_exports__);
121085
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
121086
- /* harmony export */ "KCLangToXmlTranspiler": () => (/* binding */ KCLangToXmlTranspiler),
121087
- /* harmony export */ "kclang": () => (/* binding */ kclang)
121088
- /* harmony export */ });
121089
- /* harmony import */ var _Common_Errors__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../Common/Errors */ "./Common/Errors.ts");
121090
- /* harmony import */ var _Common_TypingUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../Common/TypingUtils */ "./Common/TypingUtils.ts");
121091
- /* harmony import */ var _IKCLangExpressionVisitor__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./IKCLangExpressionVisitor */ "./Generator/src/common/KCLang/IKCLangExpressionVisitor.ts");
121092
- /* harmony import */ var _KCLangDescriptionParser__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./KCLangDescriptionParser */ "./Generator/src/common/KCLang/KCLangDescriptionParser.ts");
121093
- /* harmony import */ var _KCLangNodes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./KCLangNodes */ "./Generator/src/common/KCLang/KCLangNodes.ts");
121094
- /* harmony import */ var _Utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Utils */ "./Generator/src/common/KCLang/Utils.ts");
121095
- /* harmony import */ var _Antlr_KCLangAntlrParser__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Antlr/KCLangAntlrParser */ "./Generator/src/common/KCLang/Antlr/KCLangAntlrParser.ts");
121096
-
121097
-
121098
-
121099
-
121100
-
121101
-
121102
- // tslint:disable-next-line:cyclomatic-complexity
121103
-
121104
- function generateKCXmlExpression(expression) {
121105
- switch (expression.type) {
121106
- case "abs":
121107
- case "xabs":
121108
- case "length":
121109
- return [`<m:${expression.type}>`, (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(generateKCXmlExpression(expression.expression), 1), `</m:${expression.type}>`].join("\n");
121110
-
121111
- case "exists":
121112
- case "multySum":
121113
- return `<m:${expression.type} select="${expression.select}" />`;
121114
-
121115
- case "cast":
121116
- if (expression.expression.type === "argument") {
121117
- return `<m:argument select="${expression.expression.select}" type="${expression.targetType}" />`;
121118
- }
121119
-
121120
- throw new Error("Cast supports only for argument");
121121
-
121122
- case "and":
121123
- case "or":
121124
- return [`<m:${expression.type}>`, ...expression.expressions.map(generateKCXmlExpression).map(x => (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(x, 1)), `</m:${expression.type}>`].join("\n");
121125
-
121126
- case "sum":
121127
- return [`<m:sum>`, ...expression.operands.map(operand => {
121128
- if (operand.operator === "+") {
121129
- return generateKCXmlExpression(operand.expression);
121130
- }
121131
-
121132
- return [`<m:minus>`, (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(generateKCXmlExpression(operand.expression), 1), `</m:minus>`].join("\n");
121133
- }).map(x => (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(x, 1)), `</m:sum>`].join("\n");
121134
-
121135
- case "gt":
121136
- case "ge":
121137
- case "lt":
121138
- case "le":
121139
- case "eq":
121140
- case "multiply":
121141
- case "division":
121142
- return [`<m:${expression.type}>`, (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(generateKCXmlExpression(expression.expressions[0]), 1), (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(generateKCXmlExpression(expression.expressions[1]), 1), `</m:${expression.type}>`].join("\n");
121143
-
121144
- case "noteq":
121145
- return [`<m:not>`, ` <m:eq>`, (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(generateKCXmlExpression(expression.expressions[0]), 2), (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(generateKCXmlExpression(expression.expressions[1]), 2), ` </m:eq>`, `</m:not>`].join("\n");
121146
-
121147
- case "minus":
121148
- case "not":
121149
- return [`<m:${expression.type}>`, (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(generateKCXmlExpression(expression.expression), 1), `</m:${expression.type}>`].join("\n");
121150
- break;
121151
- break;
121152
-
121153
- case "round":
121154
- return [expression.fractionalDigits != undefined ? `<m:round fractionalDigits="${expression.fractionalDigits}">` : `<m:round>`, (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(generateKCXmlExpression(expression.expression), 1), `</m:round>`].join("\n");
121155
-
121156
- case "substring":
121157
- return [expression.length != undefined ? `<m:substring start="${expression.start}" length="${expression.length}">` : `<m:substring start="${expression.start}">`, (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(generateKCXmlExpression(expression.expression), 1), `</m:substring>`].join("\n");
121158
-
121159
- case "regexMatch":
121160
- return [`<m:regexMatch pattern="${expression.pattern}">`, (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(generateKCXmlExpression(expression.expression), 1), `</m:regexMatch>`].join("\n");
121161
-
121162
- case "choose":
121163
- return [`<m:choose>`, ` <m:if>`, (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(generateKCXmlExpression(expression.if), 2), ` </m:if>`, ` <m:then>`, (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(generateKCXmlExpression(expression.then), 2), ` </m:then>`, ` <m:else>`, (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(generateKCXmlExpression(expression.else), 2), ` </m:else>`, `</m:choose>`].join("\n");
121164
- break;
121165
-
121166
- case "const":
121167
- if (expression.value.type === "decimal") {
121168
- return `<m:const value="${expression.value.value}" type="decimal" />`;
121169
- }
121170
-
121171
- if (expression.value.type === "string") {
121172
- return `<m:const value="${expression.value.value}" type="string" />`;
121173
- }
121174
-
121175
- throw new _Common_Errors__WEBPACK_IMPORTED_MODULE_0__.NotImplementedError();
121176
-
121177
- case "argument":
121178
- return `<m:argument select="${expression.select}" />`;
121179
-
121180
- case "oneof":
121181
- {
121182
- const testExpr = generateKCXmlExpression(expression.testExpression);
121183
- return [`<m:or>`, ...expression.expressions.items.map(x => [`<m:eq>`, (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(testExpr, 1), (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(generateKCXmlExpression(x), 1), `</m:eq>`]).flat().map(x => (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(x, 1)), `</m:or>`].join("\n");
121184
- }
121185
-
121186
- default:
121187
- // @ts-ignore
121188
- throw new Error(`Expression of type '${expression.type}' is not supported`);
121189
- }
121190
- }
121191
-
121192
- function formatDescribeStatement(ast, matchPath, describe) {
121193
- return _KCLangDescriptionParser__WEBPACK_IMPORTED_MODULE_3__.KCLangDescriptionParser.parse(describe.text).map(item => {
121194
- if (typeof item === "string") {
121195
- return item;
121196
- } else {
121197
- return `{{link ref=${item.src}}}${item.text.join(" ")}{{/link}}`;
121198
- }
121199
- }).join(" ");
121200
- }
121201
-
121202
- function generateKCXmlFormula(ast, matchPath, describe) {
121203
- const descriptionAttr = describe != undefined ? ` description="${formatDescribeStatement(ast, matchPath, describe)}"` : "";
121204
- return `<m:formula match="${matchPath}" target="${ast.target}"${descriptionAttr}>\n` + (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(generateKCXmlExpression(ast.expression), 1) + "\n" + `</m:formula>`;
121205
- }
121206
-
121207
- function removeTrailingSlash(inputStr) {
121208
- if (inputStr.endsWith("/")) {
121209
- return inputStr.substring(0, inputStr.length - 1);
121210
- }
121211
-
121212
- return inputStr;
121213
- }
121214
-
121215
- function joinPaths(paths) {
121216
- return paths.map(removeTrailingSlash).join("/");
121217
- }
121218
-
121219
- function generateBlockKCXmlFormulas(block, parents) {
121220
- const matchPath = joinPaths([...(parents !== null && parents !== void 0 ? parents : []).map(x => x.path), block.path]);
121221
- const result = [];
121222
- let lastDescribeStatement;
121223
-
121224
- for (const statement of block.statements) {
121225
- if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_4__.isFormulaStatement)(statement)) {
121226
- result.push(generateKCXmlFormula(statement, matchPath, lastDescribeStatement));
121227
- lastDescribeStatement = undefined;
121228
- }
121229
-
121230
- if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_4__.isEnsureStatement)(statement)) {
121231
- lastDescribeStatement = undefined;
121232
- }
121233
-
121234
- if (lastDescribeStatement != undefined) {
121235
- throw new Error("Describe should be placed before assign of ensure statements");
121236
- }
121237
-
121238
- if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_4__.isDescribeStatement)(statement)) {
121239
- lastDescribeStatement = statement;
121240
- }
121241
-
121242
- if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_4__.isBlockStatement)(statement)) {
121243
- result.push(generateBlockKCXmlFormulas(statement, [...(parents !== null && parents !== void 0 ? parents : []), block]));
121244
- }
121245
- }
121246
-
121247
- return result.join("\n");
121248
- }
121249
-
121250
- function guessConditionTarget(condition) {
121251
- let result;
121252
-
121253
- class GuessConditionTargetVisitor extends _IKCLangExpressionVisitor__WEBPACK_IMPORTED_MODULE_2__.DefaultKCLangExpressionVisitor {
121254
- visitExistsKCLangNode(node) {
121255
- if (result == undefined) {
121256
- result = node.select;
121257
- }
121258
- }
121259
-
121260
- visitArgumentKCLangNode(node) {
121261
- if (result == undefined) {
121262
- result = node.select;
121263
- }
121264
- }
121265
-
121266
- }
121267
-
121268
- (0,_IKCLangExpressionVisitor__WEBPACK_IMPORTED_MODULE_2__.traverseKCLangExpression)(condition.expression, new GuessConditionTargetVisitor());
121269
- return result;
121270
- }
121271
-
121272
- function generateKCXmlCondition(ast, matchPath, parentConditions, describe) {
121273
- const levelAttr = ast.level === "error" ? ` errorLevel="Error"` : "";
121274
- const descriptionAttr = describe != undefined ? ` description="${formatDescribeStatement(ast, matchPath, describe)}"` : "";
121275
- const guessedTarget = guessConditionTarget(ast);
121276
- const targetAttr = guessedTarget != undefined ? ` target="${guessedTarget}"` : "";
121277
-
121278
- if (parentConditions != undefined && (0,_Common_TypingUtils__WEBPACK_IMPORTED_MODULE_1__.arrayIsNotEmpty)(parentConditions)) {
121279
- var _parentConditions$map;
121280
-
121281
- const condition = parentConditions.length === 1 ? parentConditions[0].condition : (0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_4__.andKCLangNode)(...((_parentConditions$map = parentConditions === null || parentConditions === void 0 ? void 0 : parentConditions.map(z => z.condition)) !== null && _parentConditions$map !== void 0 ? _parentConditions$map : []));
121282
- return `<m:condition match="${matchPath}"${descriptionAttr}${levelAttr}${targetAttr}>\n` + ` <m:when>\n` + (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(generateKCXmlExpression(condition), 2) + "\n" + (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(generateKCXmlExpression(ast.expression), 2) + "\n" + ` </m:when>\n` + `</m:condition>`;
121283
- }
121284
-
121285
- return `<m:condition match="${matchPath}"${descriptionAttr}${levelAttr}${targetAttr}>\n` + (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(generateKCXmlExpression(ast.expression), 1) + "\n" + `</m:condition>`;
121286
- }
121287
-
121288
- function generateBlockKCXmlConditions(block, parents, parentConditions) {
121289
- const matchPath = joinPaths([...(parents !== null && parents !== void 0 ? parents : []).map(x => x.path), block.path]);
121290
- const result = [];
121291
- let lastDescribeStatement;
121292
-
121293
- for (const statement of block.statements) {
121294
- if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_4__.isFormulaStatement)(statement)) {
121295
- lastDescribeStatement = undefined;
121296
- }
121297
-
121298
- if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_4__.isEnsureStatement)(statement)) {
121299
- result.push(generateKCXmlCondition(statement, matchPath, parentConditions, lastDescribeStatement));
121300
- lastDescribeStatement = undefined;
121301
- }
121302
-
121303
- if (lastDescribeStatement != undefined) {
121304
- throw new Error("Describe should be placed before assign of ensure statements");
121305
- }
121306
-
121307
- if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_4__.isDescribeStatement)(statement)) {
121308
- lastDescribeStatement = statement;
121309
- }
121310
-
121311
- if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_4__.isConditionalStatement)(statement)) {
121312
- result.push(generateConditionalConditions(statement, [...(parents !== null && parents !== void 0 ? parents : []), block], parentConditions));
121313
- }
121314
-
121315
- if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_4__.isBlockStatement)(statement)) {
121316
- result.push(generateBlockKCXmlConditions(statement, [...(parents !== null && parents !== void 0 ? parents : []), block], parentConditions));
121317
- }
121318
- }
121319
-
121320
- return result.join("\n");
121321
- }
121322
-
121323
- function generateConditionalConditions(conditionalStatement, parents, parentConditions) {
121324
- const matchPath = joinPaths([...(parents !== null && parents !== void 0 ? parents : []).map(x => x.path)]);
121325
- const result = [];
121326
- let lastDescribeStatement;
121327
-
121328
- for (const x of conditionalStatement.statements) {
121329
- if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_4__.isEnsureStatement)(x)) {
121330
- result.push(generateKCXmlCondition(x, matchPath, [...(parentConditions !== null && parentConditions !== void 0 ? parentConditions : []), conditionalStatement], lastDescribeStatement));
121331
- lastDescribeStatement = undefined;
121332
- }
121333
-
121334
- if (lastDescribeStatement != undefined) {
121335
- throw new Error("Describe should be placed before assign of ensure statements");
121336
- }
121337
-
121338
- if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_4__.isDescribeStatement)(x)) {
121339
- lastDescribeStatement = x;
121340
- }
121341
-
121342
- if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_4__.isConditionalStatement)(x)) {
121343
- result.push(generateConditionalConditions(x, parents, [...(parentConditions !== null && parentConditions !== void 0 ? parentConditions : []), conditionalStatement]));
121344
- }
121345
-
121346
- if ((0,_KCLangNodes__WEBPACK_IMPORTED_MODULE_4__.isBlockStatement)(x)) {
121347
- result.push(generateBlockKCXmlConditions(x, parents, [...(parentConditions !== null && parentConditions !== void 0 ? parentConditions : []), conditionalStatement]));
121348
- }
121349
- }
121350
-
121351
- return result.join("\n");
121352
- }
121353
-
121354
- function generateKCXmlFormulas(blocks) {
121355
- const formulas = Iterator.from(blocks).map(generateBlockKCXmlFormulas).toArray();
121356
-
121357
- if (formulas.filter(x => x !== "").length > 0) {
121358
- return `<m:formulas>\n` + (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(formulas.join("\n"), 1) + "\n" + `</m:formulas>\n`;
121359
- } else {
121360
- return "";
121361
- }
121362
- }
121363
-
121364
- function generateKCXmlConditions(blocks) {
121365
- const conditions = Iterator.from(blocks).map(generateBlockKCXmlConditions).toArray();
121366
-
121367
- if (conditions.filter(x => x !== "").length > 0) {
121368
- return `<m:conditions>\n` + (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(conditions.join("\n"), 1) + "\n" + `</m:conditions>\n`;
121369
- } else {
121370
- return "";
121371
- }
121372
- }
121373
-
121374
- function generateKCXml(blocks) {
121375
- return `<?xml version="1.0" encoding="utf-8"?>\n` + `<m:math xmlns:m="http://www.kontur-extern.ru/ФНС 4.0/math.xsd">\n` + (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(generateKCXmlFormulas(blocks), 1) + (0,_Utils__WEBPACK_IMPORTED_MODULE_5__.indent)(generateKCXmlConditions(blocks), 1) + `</m:math>`;
121376
- }
121377
-
121378
- class KCLangToXmlTranspiler {
121379
- static transpile(kcLang, customParser) {
121380
- const parser = customParser !== null && customParser !== void 0 ? customParser : _Antlr_KCLangAntlrParser__WEBPACK_IMPORTED_MODULE_6__.KCLangAntlrParser.parse;
121381
- const kcxml = generateKCXml(parser(kcLang).blocks);
121382
- return kcxml;
121383
- }
121384
-
121385
- }
121386
- function kclang(str) {
121387
- return KCLangToXmlTranspiler.transpile(str.join(""));
121388
- }
121389
-
121390
- /***/ }),
121391
-
121392
- /***/ "./Generator/src/common/KCLang/Utils.ts":
121393
- /*!**********************************************!*\
121394
- !*** ./Generator/src/common/KCLang/Utils.ts ***!
121395
- \**********************************************/
121396
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
121397
-
121398
- "use strict";
121399
- __webpack_require__.r(__webpack_exports__);
121400
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
121401
- /* harmony export */ "indent": () => (/* binding */ indent)
121402
- /* harmony export */ });
121403
- function indent(str, count) {
121404
- const indentStr = new Array(count * 2).fill(" ").join("");
121405
- return str.split("\n").map(x => {
121406
- if (x === "") {
121407
- return x;
121408
- }
121409
-
121410
- return indentStr + x;
121411
- }).join("\n");
121412
- }
121413
-
121414
- /***/ }),
121415
-
121416
120794
  /***/ "./Generator/src/common/RequireContext/LoadDocumentationFileFormContext.ts":
121417
120795
  /*!*********************************************************************************!*\
121418
120796
  !*** ./Generator/src/common/RequireContext/LoadDocumentationFileFormContext.ts ***!
@@ -126806,7 +126184,8 @@ __webpack_require__.r(__webpack_exports__);
126806
126184
 
126807
126185
 
126808
126186
  class FormulasAutoCalculationsGenerator {
126809
- generate(formulas, schemaRng, dataDeclarationHelper) {
126187
+ generate(formulaContainer, schemaRng, dataDeclarationHelper) {
126188
+ const formulas = formulaContainer.formulas == undefined || formulaContainer.formulas.items == undefined ? [] : formulaContainer.formulas.items;
126810
126189
  const formulaAutoCalculations = formulas.map(formula => this.buildFormulaAutoCalculation(formula, schemaRng, dataDeclarationHelper)).flat();
126811
126190
  return this.mergeFormulaAutoCalculations(formulaAutoCalculations);
126812
126191
  }
@@ -127536,73 +126915,35 @@ __webpack_require__.r(__webpack_exports__);
127536
126915
  /* harmony export */ });
127537
126916
  /* harmony import */ var _common_XmlParser_XmlParser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../common/XmlParser/XmlParser */ "./Generator/src/common/XmlParser/XmlParser.ts");
127538
126917
  /* harmony import */ var _markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../markupGenerator/Serializer/SugarSerializer */ "./Generator/src/generators/markupGenerator/Serializer/SugarSerializer.ts");
127539
- /* harmony import */ var _common_KCLang_KCLangToXmlTranspiler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../common/KCLang/KCLangToXmlTranspiler */ "./Generator/src/common/KCLang/KCLangToXmlTranspiler.ts");
127540
- /* harmony import */ var _Formula__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Formula */ "./Generator/src/generators/AutoCalculationsGenerator/AutoCalculationsFromFormulas/KCXmlContract/Formula.ts");
127541
-
126918
+ /* harmony import */ var _Formula__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Formula */ "./Generator/src/generators/AutoCalculationsGenerator/AutoCalculationsFromFormulas/KCXmlContract/Formula.ts");
127542
126919
 
127543
126920
 
127544
126921
 
127545
126922
  class FormulaReader {
127546
- readFormulas(kcxmlSources, kclangSources) {
126923
+ readFormulas(kcxmlSource) {
127547
126924
  const serializer = this.createFormulaSerializer();
127548
- const result = [];
127549
-
127550
- for (const kcxmlSource of kcxmlSources) {
127551
- const rootNode = serializer.deserializeFromSugarXmlNode((0,_common_XmlParser_XmlParser__WEBPACK_IMPORTED_MODULE_0__.parseXml)(kcxmlSource));
127552
-
127553
- if (rootNode instanceof _Formula__WEBPACK_IMPORTED_MODULE_3__.MathContainer) {
127554
- var _rootNode$formulas$it, _rootNode$formulas;
127555
-
127556
- result.push(...((_rootNode$formulas$it = (_rootNode$formulas = rootNode.formulas) === null || _rootNode$formulas === void 0 ? void 0 : _rootNode$formulas.items) !== null && _rootNode$formulas$it !== void 0 ? _rootNode$formulas$it : []));
127557
- }
127558
- }
126925
+ const result = serializer.deserializeFromSugarXmlNode((0,_common_XmlParser_XmlParser__WEBPACK_IMPORTED_MODULE_0__.parseXml)(kcxmlSource));
127559
126926
 
127560
- for (const kclangSource of kclangSources) {
127561
- const rootNode = serializer.deserializeFromSugarXmlNode((0,_common_XmlParser_XmlParser__WEBPACK_IMPORTED_MODULE_0__.parseXml)(_common_KCLang_KCLangToXmlTranspiler__WEBPACK_IMPORTED_MODULE_2__.KCLangToXmlTranspiler.transpile(kclangSource)));
127562
-
127563
- if (rootNode instanceof _Formula__WEBPACK_IMPORTED_MODULE_3__.MathContainer) {
127564
- var _rootNode$formulas$it2, _rootNode$formulas2;
127565
-
127566
- result.push(...((_rootNode$formulas$it2 = (_rootNode$formulas2 = rootNode.formulas) === null || _rootNode$formulas2 === void 0 ? void 0 : _rootNode$formulas2.items) !== null && _rootNode$formulas$it2 !== void 0 ? _rootNode$formulas$it2 : []));
127567
- }
126927
+ if (result instanceof _Formula__WEBPACK_IMPORTED_MODULE_2__.DummyContent) {
126928
+ return this.createEmptyMathContainer();
127568
126929
  }
127569
126930
 
127570
126931
  return result;
127571
126932
  }
127572
126933
 
127573
- readConditions(kcxmlSources, kclangSources) {
127574
- const serializer = this.createFormulaSerializer();
127575
- const result = [];
127576
-
127577
- for (const kcxmlSource of kcxmlSources) {
127578
- const rootNode = serializer.deserializeFromSugarXmlNode((0,_common_XmlParser_XmlParser__WEBPACK_IMPORTED_MODULE_0__.parseXml)(kcxmlSource));
127579
-
127580
- if (rootNode instanceof _Formula__WEBPACK_IMPORTED_MODULE_3__.MathContainer) {
127581
- var _rootNode$conditions$, _rootNode$conditions;
127582
-
127583
- result.push(...((_rootNode$conditions$ = (_rootNode$conditions = rootNode.conditions) === null || _rootNode$conditions === void 0 ? void 0 : _rootNode$conditions.items) !== null && _rootNode$conditions$ !== void 0 ? _rootNode$conditions$ : []));
127584
- }
127585
- }
127586
-
127587
- for (const kclangSource of kclangSources) {
127588
- const rootNode = serializer.deserializeFromSugarXmlNode((0,_common_XmlParser_XmlParser__WEBPACK_IMPORTED_MODULE_0__.parseXml)(_common_KCLang_KCLangToXmlTranspiler__WEBPACK_IMPORTED_MODULE_2__.KCLangToXmlTranspiler.transpile(kclangSource)));
127589
-
127590
- if (rootNode instanceof _Formula__WEBPACK_IMPORTED_MODULE_3__.MathContainer) {
127591
- var _rootNode$conditions$2, _rootNode$conditions2;
127592
-
127593
- result.push(...((_rootNode$conditions$2 = (_rootNode$conditions2 = rootNode.conditions) === null || _rootNode$conditions2 === void 0 ? void 0 : _rootNode$conditions2.items) !== null && _rootNode$conditions$2 !== void 0 ? _rootNode$conditions$2 : []));
127594
- }
127595
- }
127596
-
127597
- return result;
126934
+ createEmptyMathContainer() {
126935
+ const mathContainer = new _Formula__WEBPACK_IMPORTED_MODULE_2__.MathContainer();
126936
+ mathContainer.formulas = new _Formula__WEBPACK_IMPORTED_MODULE_2__.Formulas();
126937
+ mathContainer.formulas.items = [];
126938
+ return mathContainer;
127598
126939
  }
127599
126940
 
127600
126941
  createFormulaSerializer() {
127601
126942
  const result = new _markupGenerator_Serializer_SugarSerializer__WEBPACK_IMPORTED_MODULE_1__.SugarSerializer();
127602
- result.registerNode(_Formula__WEBPACK_IMPORTED_MODULE_3__.DummyContent);
127603
- result.registerNode(_Formula__WEBPACK_IMPORTED_MODULE_3__.MathContainer);
126943
+ result.registerNode(_Formula__WEBPACK_IMPORTED_MODULE_2__.DummyContent);
126944
+ result.registerNode(_Formula__WEBPACK_IMPORTED_MODULE_2__.MathContainer);
127604
126945
 
127605
- for (const formulaExpression of _Formula__WEBPACK_IMPORTED_MODULE_3__.formulaExpressions) {
126946
+ for (const formulaExpression of _Formula__WEBPACK_IMPORTED_MODULE_2__.formulaExpressions) {
127606
126947
  result.registerNode(formulaExpression);
127607
126948
  }
127608
126949
 
@@ -129043,26 +128384,47 @@ const gfv = '${gfv}'
129043
128384
  const resourcesHash = ${JSON.stringify(resourcesHash)}
129044
128385
 
129045
128386
  window.CF.entryPoint = window.CF.entryPoint || {};
129046
- window.CF.entryPoint[gfv] = function(container, { renderForm, ...settings }) {
129047
- const resources = {
129048
- dataDeclaration: dataDeclaration,
129049
- calculationFunctions: calculationFunctions,
129050
- validationFunctions: validationFunctions,
129051
- requisiteList: requisiteList,
129052
- resourcesHash: resourcesHash,
129053
- localizationDictionary: localizationDictionary,
129054
- hooks: hooks,
129055
- autocalculationConfigurators: [...autocalculationConfigurators, kcXmlValidationConfigurator, rngSchemaValidationConfigurator],
129056
- settings: {
129057
- ...defaultSettings,
129058
- ...settings,
129059
- isDisabledCleanForm: defaultSettings.isDisabledCleanForm || settings.isDisabledCleanForm,
129060
- isDisabledCloseButton: defaultSettings.isDisabledCloseButton || settings.isDisabledCloseButton,
129061
- isDisabledCloseAndSaveButton: defaultSettings.isDisabledCloseAndSaveButton || settings.isDisabledCloseAndSaveButton,
129062
- }
128387
+ if (window.CF.entryPoint[gfv]) {
128388
+ for (const instance of window.CF.entryPoint[gfv].instances) {
128389
+ const resources = {
128390
+ dataDeclaration: dataDeclaration,
128391
+ calculationFunctions: calculationFunctions,
128392
+ validationFunctions: validationFunctions,
128393
+ requisiteList: requisiteList,
128394
+ autocalculationConfigurators: [...autocalculationConfigurators, kcXmlValidationConfigurator, rngSchemaValidationConfigurator],
128395
+ }
128396
+ instance.updateFormResources(Form, resources);
129063
128397
  }
129064
- return renderForm(Form, resources, container)
129065
- }`;
128398
+ } else {
128399
+ window.CF.entryPoint[gfv] = async function(container, { renderForm, ...settings }) {
128400
+ const resources = {
128401
+ dataDeclaration: dataDeclaration,
128402
+ calculationFunctions: calculationFunctions,
128403
+ validationFunctions: validationFunctions,
128404
+ requisiteList: requisiteList,
128405
+ resourcesHash: resourcesHash,
128406
+ localizationDictionary: localizationDictionary,
128407
+ hooks: hooks,
128408
+ autocalculationConfigurators: [...autocalculationConfigurators, kcXmlValidationConfigurator, rngSchemaValidationConfigurator],
128409
+ settings: {
128410
+ ...defaultSettings,
128411
+ ...settings,
128412
+ isDisabledCleanForm: defaultSettings.isDisabledCleanForm || settings.isDisabledCleanForm,
128413
+ isDisabledCloseButton: defaultSettings.isDisabledCloseButton || settings.isDisabledCloseButton,
128414
+ isDisabledCloseAndSaveButton: defaultSettings.isDisabledCloseAndSaveButton || settings.isDisabledCloseAndSaveButton,
128415
+ }
128416
+ }
128417
+ const formInstance = await renderForm(Form, resources, container)
128418
+ window.CF.entryPoint[gfv].instances = window.CF.entryPoint[gfv].instances ?? [];
128419
+ window.CF.entryPoint[gfv].instances.push(formInstance)
128420
+ return formInstance;
128421
+ }
128422
+ }
128423
+
128424
+ if (module.hot) {
128425
+ module.hot.accept();
128426
+ }
128427
+ `;
129066
128428
  }
129067
128429
 
129068
128430
  /***/ }),
@@ -129230,9 +128592,11 @@ class KCXmlValidationGenerator {
129230
128592
  const conditionReader = new _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_FormulaReader__WEBPACK_IMPORTED_MODULE_2__.FormulaReader();
129231
128593
 
129232
128594
  for (const file of importedKcXmlValidations) {
129233
- const conditions = conditionReader.readConditions([file], []);
128595
+ const math = conditionReader.readFormulas(file);
128596
+
128597
+ for (const condition of (_math$conditions$item = math === null || math === void 0 ? void 0 : (_math$conditions = math.conditions) === null || _math$conditions === void 0 ? void 0 : _math$conditions.items) !== null && _math$conditions$item !== void 0 ? _math$conditions$item : []) {
128598
+ var _math$conditions$item, _math$conditions;
129234
128599
 
129235
- for (const condition of conditions) {
129236
128600
  compiledConditions.push(this.compileCondition(condition));
129237
128601
  }
129238
128602
  }
@@ -129417,7 +128781,7 @@ function processSugar(formSugarContent, additionalContent, generationOptions) {
129417
128781
  const sugarAst = (0,_common_SugarXmlParser_SugarParser__WEBPACK_IMPORTED_MODULE_4__.parseSugar)(formSugarContent, additionalContent.preprocessor || {});
129418
128782
  const serializer = (0,_markupGenerator_SugarNodes_DefaultSugarSerializer__WEBPACK_IMPORTED_MODULE_12__.createDefaultSugarSerializer)();
129419
128783
  const sugarRoot = (0,_markupGenerator_SugarNodes_SugarNodeUtils__WEBPACK_IMPORTED_MODULE_13__.strictCastNode)(serializer.deserializeFromSugarXmlNode(sugarAst), _markupGenerator_ElementProcessors_FormParts_Form_FormNode__WEBPACK_IMPORTED_MODULE_10__.FormNode);
129420
- const formulas = new _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_FormulaReader__WEBPACK_IMPORTED_MODULE_16__.FormulaReader().readFormulas(additionalContent.kcJsXmlContent, additionalContent.kclangAutocaclulationsContent);
128784
+ const formulas = new _AutoCalculationsGenerator_AutoCalculationsFromFormulas_KCXmlContract_FormulaReader__WEBPACK_IMPORTED_MODULE_16__.FormulaReader().readFormulas(additionalContent.kcJsXmlContent);
129421
128785
  const schemaRng = (0,_common_XmlParser_XmlParser__WEBPACK_IMPORTED_MODULE_5__.parseXml)(additionalContent.schemaRngContent);
129422
128786
  const formSchemaRng = _common_SchemaRng_FormSchemaRng__WEBPACK_IMPORTED_MODULE_3__.FormSchemaRng.createFromSchemaRng(additionalContent.schemaRngContent);
129423
128787
  const typeRegistry = (0,_validationGenerator_TypesRegistry__WEBPACK_IMPORTED_MODULE_14__.buildTypesRegistry)(sugarRoot);
@@ -129547,17 +128911,19 @@ __webpack_require__.r(__webpack_exports__);
129547
128911
  /* harmony import */ var fs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(fs__WEBPACK_IMPORTED_MODULE_0__);
129548
128912
  /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! path */ "path");
129549
128913
  /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(path__WEBPACK_IMPORTED_MODULE_1__);
129550
- /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! chalk */ "./node_modules/chalk/source/index.js");
129551
- /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_2__);
129552
- /* harmony import */ var fs_extra__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! fs-extra */ "./node_modules/fs-extra/lib/index.js");
129553
- /* harmony import */ var fs_extra__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(fs_extra__WEBPACK_IMPORTED_MODULE_3__);
129554
- /* harmony import */ var md5__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! md5 */ "./node_modules/md5/md5.js");
129555
- /* harmony import */ var md5__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(md5__WEBPACK_IMPORTED_MODULE_4__);
129556
- /* harmony import */ var md5_file__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! md5-file */ "./node_modules/md5-file/index.js");
129557
- /* harmony import */ var md5_file__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(md5_file__WEBPACK_IMPORTED_MODULE_5__);
129558
- /* harmony import */ var recursive_readdir__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! recursive-readdir */ "./node_modules/recursive-readdir/index.js");
129559
- /* harmony import */ var recursive_readdir__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(recursive_readdir__WEBPACK_IMPORTED_MODULE_6__);
129560
- /* harmony import */ var _common_ExtractSugarReferences__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../common/ExtractSugarReferences */ "./Generator/src/common/ExtractSugarReferences.ts");
128914
+ /* harmony import */ var util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! util */ "util");
128915
+ /* harmony import */ var util__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(util__WEBPACK_IMPORTED_MODULE_2__);
128916
+ /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! chalk */ "./node_modules/chalk/source/index.js");
128917
+ /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(chalk__WEBPACK_IMPORTED_MODULE_3__);
128918
+ /* harmony import */ var fs_extra__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! fs-extra */ "./node_modules/fs-extra/lib/index.js");
128919
+ /* harmony import */ var fs_extra__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(fs_extra__WEBPACK_IMPORTED_MODULE_4__);
128920
+ /* harmony import */ var md5__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! md5 */ "./node_modules/md5/md5.js");
128921
+ /* harmony import */ var md5__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(md5__WEBPACK_IMPORTED_MODULE_5__);
128922
+ /* harmony import */ var md5_file__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! md5-file */ "./node_modules/md5-file/index.js");
128923
+ /* harmony import */ var md5_file__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(md5_file__WEBPACK_IMPORTED_MODULE_6__);
128924
+ /* harmony import */ var recursive_readdir__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! recursive-readdir */ "./node_modules/recursive-readdir/index.js");
128925
+ /* harmony import */ var recursive_readdir__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(recursive_readdir__WEBPACK_IMPORTED_MODULE_7__);
128926
+ /* harmony import */ var _common_ExtractSugarReferences__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../common/ExtractSugarReferences */ "./Generator/src/common/ExtractSugarReferences.ts");
129561
128927
 
129562
128928
 
129563
128929
 
@@ -129566,6 +128932,10 @@ __webpack_require__.r(__webpack_exports__);
129566
128932
 
129567
128933
 
129568
128934
 
128935
+
128936
+ const statAsync = (0,util__WEBPACK_IMPORTED_MODULE_2__.promisify)(fs__WEBPACK_IMPORTED_MODULE_0__.stat);
128937
+ const readFileAsync = (0,util__WEBPACK_IMPORTED_MODULE_2__.promisify)(fs__WEBPACK_IMPORTED_MODULE_0__.readFile);
128938
+ const readdirAsync = (0,util__WEBPACK_IMPORTED_MODULE_2__.promisify)(fs__WEBPACK_IMPORTED_MODULE_0__.readdir);
129569
128939
  async function readFormSources(formSourcesPath, farmDirectory) {
129570
128940
  var _JSON$parse$settings;
129571
128941
 
@@ -129577,9 +128947,9 @@ async function readFormSources(formSourcesPath, farmDirectory) {
129577
128947
 
129578
128948
  if (sugarReferences.fetchFunctionFiles.length === 0) {
129579
128949
  // eslint-disable-next-line no-console
129580
- console.warn(chalk__WEBPACK_IMPORTED_MODULE_2___default().yellow(`[WARN] Форма не содержит ссылок на fetch-функции. Будут автоматически подключены функции из каталога legacyfetchfuctions\n` + `[WARN] В будущем необходимо явно прописывать ссылки на используемые fetch-функции`));
128950
+ console.warn(chalk__WEBPACK_IMPORTED_MODULE_3___default().yellow(`[WARN] Форма не содержит ссылок на fetch-функции. Будут автоматически подключены функции из каталога legacyfetchfuctions\n` + `[WARN] В будущем необходимо явно прописывать ссылки на используемые fetch-функции`));
129581
128951
  const legacyfetchfunctionsDirectory = path__WEBPACK_IMPORTED_MODULE_1___default().join(farmDirectory, "legacyfetchfunctions");
129582
- sugarReferences.fetchFunctionFiles = (await (0,fs_extra__WEBPACK_IMPORTED_MODULE_3__.readdir)(legacyfetchfunctionsDirectory)).map(x => path__WEBPACK_IMPORTED_MODULE_1___default().resolve(legacyfetchfunctionsDirectory, x));
128952
+ sugarReferences.fetchFunctionFiles = (await readdirAsync(legacyfetchfunctionsDirectory)).map(x => path__WEBPACK_IMPORTED_MODULE_1___default().resolve(legacyfetchfunctionsDirectory, x));
129583
128953
  }
129584
128954
 
129585
128955
  const result = {
@@ -129589,12 +128959,11 @@ async function readFormSources(formSourcesPath, farmDirectory) {
129589
128959
  formSourcesPath: formSourcesPath,
129590
128960
  formJsonSettings: (_JSON$parse$settings = JSON.parse(await readFileSource(formSourcesPath, "form.json", "{}"))["settings"]) !== null && _JSON$parse$settings !== void 0 ? _JSON$parse$settings : {},
129591
128961
  additionalSettings: await readFileSource(formSourcesPath, "settings.json", "{}"),
129592
- autocalcsContent: await readFilesFromDir(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "autocalc"), /\.js$/),
128962
+ autocalcsContent: await readAutoCalcFiles(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "autocalc")),
129593
128963
  helpersContent: await readJavaScriptFilesWithNames(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "helpers")),
129594
128964
  validationsContent: await readJavaScriptFilesWithNames(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "validations")),
129595
128965
  schemaRngContent: await readSchemaRngFile(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "schemas"), formName),
129596
- kcJsXmlContent: await readFilesFromDir(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "autocalc"), /\.(KC|КС|КC|KС|КС\.candy\.js).xml$/),
129597
- kclangAutocaclulationsContent: await readFilesFromDir(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "autocalc"), /\.kclang$/),
128966
+ kcJsXmlContent: (await readFileSource(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "autocalc"), `${formName}.КС.candy.js.xml`, "<dummy/>")) || "",
129598
128967
  tourSteps: await readFileSource(path__WEBPACK_IMPORTED_MODULE_1___default().join(rootPath, "tour"), "tour.js", "{}"),
129599
128968
  hooksContent: await readHooksFile(formSourcesPath),
129600
128969
  customControlsContent: await readCustomControlsFiles(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "controls")),
@@ -129638,7 +129007,7 @@ function evalModule(moduleCode) {
129638
129007
 
129639
129008
  async function isDirectoryExists(directoryPath) {
129640
129009
  try {
129641
- const dirStat = await (0,fs_extra__WEBPACK_IMPORTED_MODULE_3__.stat)(directoryPath);
129010
+ const dirStat = await statAsync(directoryPath);
129642
129011
  return dirStat.isDirectory();
129643
129012
  } catch (ignoreError) {
129644
129013
  return false;
@@ -129649,27 +129018,27 @@ async function readFiles(filePaths) {
129649
129018
  const result = [];
129650
129019
 
129651
129020
  for (const filePath of filePaths) {
129652
- result.push(await (0,fs_extra__WEBPACK_IMPORTED_MODULE_3__.readFile)(filePath, "utf-8"));
129021
+ result.push(await readFileAsync(filePath, "utf-8"));
129653
129022
  }
129654
129023
 
129655
129024
  return result;
129656
129025
  }
129657
129026
 
129658
129027
  async function extractReferences(formSugarDirectoryPath) {
129659
- const indexContent = await (0,fs_extra__WEBPACK_IMPORTED_MODULE_3__.readFile)(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSugarDirectoryPath, "index.sugar.xml"), "utf-8");
129660
- return (0,_common_ExtractSugarReferences__WEBPACK_IMPORTED_MODULE_7__.extractSugarReferences)(indexContent, filePath => (0,fs_extra__WEBPACK_IMPORTED_MODULE_3__.readFile)(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSugarDirectoryPath, filePath), "utf-8"));
129028
+ const indexContent = await readFileAsync(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSugarDirectoryPath, "index.sugar.xml"), "utf-8");
129029
+ return (0,_common_ExtractSugarReferences__WEBPACK_IMPORTED_MODULE_8__.extractSugarReferences)(indexContent, filePath => readFileAsync(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSugarDirectoryPath, filePath), "utf-8"));
129661
129030
  }
129662
129031
 
129663
129032
  async function getAllFilePathsInDirectory(directoryPath, _filelist) {
129664
- if (!(await (0,fs_extra__WEBPACK_IMPORTED_MODULE_3__.pathExists)(directoryPath))) {
129033
+ if (!(await (0,fs_extra__WEBPACK_IMPORTED_MODULE_4__.pathExists)(directoryPath))) {
129665
129034
  return [];
129666
129035
  }
129667
129036
 
129668
- const files = await (0,fs_extra__WEBPACK_IMPORTED_MODULE_3__.readdir)(directoryPath);
129037
+ const files = await readdirAsync(directoryPath);
129669
129038
  let filelist = _filelist || [];
129670
129039
 
129671
129040
  for (const file of files) {
129672
- if ((await (0,fs_extra__WEBPACK_IMPORTED_MODULE_3__.stat)(path__WEBPACK_IMPORTED_MODULE_1___default().join(directoryPath, file))).isDirectory()) {
129041
+ if ((await statAsync(path__WEBPACK_IMPORTED_MODULE_1___default().join(directoryPath, file))).isDirectory()) {
129673
129042
  filelist = await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(directoryPath, file), filelist);
129674
129043
  } else {
129675
129044
  filelist.push(path__WEBPACK_IMPORTED_MODULE_1___default().join(directoryPath, file));
@@ -129680,7 +129049,7 @@ async function getAllFilePathsInDirectory(directoryPath, _filelist) {
129680
129049
  }
129681
129050
 
129682
129051
  async function checkFileExists(filePath) {
129683
- if (!(await (0,fs_extra__WEBPACK_IMPORTED_MODULE_3__.pathExists)(filePath))) {
129052
+ if (!(await (0,fs_extra__WEBPACK_IMPORTED_MODULE_4__.pathExists)(filePath))) {
129684
129053
  return [];
129685
129054
  }
129686
129055
 
@@ -129693,7 +129062,7 @@ async function getAllDependencies(formSourcesPath, farmDirectory) {
129693
129062
 
129694
129063
  if (sugarReferences.fetchFunctionFiles.length === 0) {
129695
129064
  const legacyfetchfunctionsDirectory = path__WEBPACK_IMPORTED_MODULE_1___default().join(farmDirectory, "legacyfetchfunctions");
129696
- sugarReferences.fetchFunctionFiles = (await (0,fs_extra__WEBPACK_IMPORTED_MODULE_3__.readdir)(legacyfetchfunctionsDirectory)).map(x => path__WEBPACK_IMPORTED_MODULE_1___default().resolve(legacyfetchfunctionsDirectory, x));
129065
+ sugarReferences.fetchFunctionFiles = (await readdirAsync(legacyfetchfunctionsDirectory)).map(x => path__WEBPACK_IMPORTED_MODULE_1___default().resolve(legacyfetchfunctionsDirectory, x));
129697
129066
  }
129698
129067
 
129699
129068
  return [path__WEBPACK_IMPORTED_MODULE_1___default().join(formSugarDirectoryPath, "index.sugar.xml"), ...sugarReferences.fetchFunctionFiles.map(x => path__WEBPACK_IMPORTED_MODULE_1___default().resolve(formSugarDirectoryPath, x)), ...sugarReferences.sugarFiles.map(x => path__WEBPACK_IMPORTED_MODULE_1___default().resolve(formSugarDirectoryPath, x + ".sugar.xml")), ...sugarReferences.resourceFiles.map(x => path__WEBPACK_IMPORTED_MODULE_1___default().resolve(formSugarDirectoryPath, x)), ...(await checkFileExists(path__WEBPACK_IMPORTED_MODULE_1___default().resolve(formSourcesPath, "settings.json"))), ...(await checkFileExists(path__WEBPACK_IMPORTED_MODULE_1___default().resolve(formSourcesPath, "hooks.js"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "autocalc"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "helpers"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "validations"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "schemas"))), ...(await checkFileExists(path__WEBPACK_IMPORTED_MODULE_1___default().join(farmDirectory, "tour", "tour.js"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "controls"))), ...(await getAllFilePathsInDirectory(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSourcesPath, "localization")))];
@@ -129706,23 +129075,23 @@ function normalizeLineEndings(content) {
129706
129075
  async function getAllDependenciesHash(formSourcesPath, farmDirectory) {
129707
129076
  const allDeps = await getAllDependencies(formSourcesPath, farmDirectory);
129708
129077
  const hashes = await Promise.all(allDeps.map(async depFilePath => {
129709
- if ([".js", ".kclang", ".xml", ".xslt", ".json"].some(ext => depFilePath.endsWith(ext))) {
129710
- let content = await (0,fs_extra__WEBPACK_IMPORTED_MODULE_3__.readFile)(depFilePath, "utf-8");
129078
+ if ([".js", ".xml", ".xslt", ".json"].some(ext => depFilePath.endsWith(ext))) {
129079
+ let content = await readFileAsync(depFilePath, "utf-8");
129711
129080
  content = normalizeLineEndings(content);
129712
- return md5__WEBPACK_IMPORTED_MODULE_4___default()(content);
129081
+ return md5__WEBPACK_IMPORTED_MODULE_5___default()(content);
129713
129082
  }
129714
129083
 
129715
- return md5_file__WEBPACK_IMPORTED_MODULE_5___default()(depFilePath);
129084
+ return md5_file__WEBPACK_IMPORTED_MODULE_6___default()(depFilePath);
129716
129085
  }));
129717
- return md5__WEBPACK_IMPORTED_MODULE_4___default()(hashes.join(""));
129086
+ return md5__WEBPACK_IMPORTED_MODULE_5___default()(hashes.join(""));
129718
129087
  }
129719
129088
  async function readSugarFiles(formSugarDirectoryPath, references) {
129720
129089
  const result = {
129721
- "./index": await (0,fs_extra__WEBPACK_IMPORTED_MODULE_3__.readFile)(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSugarDirectoryPath, "index.sugar.xml"), "utf-8")
129090
+ "./index": await readFileAsync(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSugarDirectoryPath, "index.sugar.xml"), "utf-8")
129722
129091
  };
129723
129092
 
129724
129093
  for (const sugarPath of references.sugarFiles) {
129725
- const sugarModuleContent = await (0,fs_extra__WEBPACK_IMPORTED_MODULE_3__.readFile)(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSugarDirectoryPath, sugarPath + ".sugar.xml"), "utf-8");
129094
+ const sugarModuleContent = await readFileAsync(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSugarDirectoryPath, sugarPath + ".sugar.xml"), "utf-8");
129726
129095
  result[sugarPath] = sugarModuleContent;
129727
129096
  }
129728
129097
 
@@ -129734,11 +129103,11 @@ async function readCustomControlsFiles(formSugarDirectoryPath) {
129734
129103
  return {};
129735
129104
  }
129736
129105
 
129737
- const fileNames = await recursive_readdir__WEBPACK_IMPORTED_MODULE_6___default()(formSugarDirectoryPath);
129106
+ const fileNames = await recursive_readdir__WEBPACK_IMPORTED_MODULE_7___default()(formSugarDirectoryPath);
129738
129107
  const result = {};
129739
129108
 
129740
129109
  for (const fileName of fileNames) {
129741
- const sugarModuleContent = await (0,fs_extra__WEBPACK_IMPORTED_MODULE_3__.readFile)(fileName, "utf-8");
129110
+ const sugarModuleContent = await readFileAsync(fileName, "utf-8");
129742
129111
  const relativeFileName = ("controls\\" + fileName.replace(formSugarDirectoryPath + "\\", "")).replace(/\\/g, "/");
129743
129112
  result[relativeFileName] = sugarModuleContent;
129744
129113
  }
@@ -129746,23 +129115,23 @@ async function readCustomControlsFiles(formSugarDirectoryPath) {
129746
129115
  return result;
129747
129116
  }
129748
129117
 
129749
- async function readFilesFromDir(directoryPath, fileNameTest) {
129750
- if (!(await (0,fs_extra__WEBPACK_IMPORTED_MODULE_3__.pathExists)(directoryPath))) {
129118
+ async function readAutoCalcFiles(formAutoCalcPath) {
129119
+ try {
129120
+ const files = await readdirAsync(formAutoCalcPath);
129121
+ const jsFiles = files.filter(filename => /\.js$/.test(filename));
129122
+ return Promise.all(jsFiles.map(filename => readFileAsync(path__WEBPACK_IMPORTED_MODULE_1___default().join(formAutoCalcPath, filename), "utf-8")));
129123
+ } catch (ignoreError) {
129751
129124
  return [];
129752
129125
  }
129753
-
129754
- const files = await (0,fs_extra__WEBPACK_IMPORTED_MODULE_3__.readdir)(directoryPath);
129755
- const jsFiles = files.filter(filename => fileNameTest.test(filename));
129756
- return Promise.all(jsFiles.map(filename => (0,fs_extra__WEBPACK_IMPORTED_MODULE_3__.readFile)(path__WEBPACK_IMPORTED_MODULE_1___default().join(directoryPath, filename), "utf-8")));
129757
129126
  }
129758
129127
 
129759
129128
  async function readImportedFiles(rootPath) {
129760
129129
  try {
129761
129130
  const result = {};
129762
- const files = await (0,fs_extra__WEBPACK_IMPORTED_MODULE_3__.readdir)(path__WEBPACK_IMPORTED_MODULE_1___default().join(rootPath, "validations"));
129131
+ const files = await readdirAsync(path__WEBPACK_IMPORTED_MODULE_1___default().join(rootPath, "validations"));
129763
129132
 
129764
129133
  for (const fileName of files) {
129765
- result["../validations/" + fileName] = await (0,fs_extra__WEBPACK_IMPORTED_MODULE_3__.readFile)(path__WEBPACK_IMPORTED_MODULE_1___default().join(rootPath, "validations", fileName), "utf-8");
129134
+ result["../validations/" + fileName] = await readFileAsync(path__WEBPACK_IMPORTED_MODULE_1___default().join(rootPath, "validations", fileName), "utf-8");
129766
129135
  }
129767
129136
 
129768
129137
  return result;
@@ -129773,11 +129142,11 @@ async function readImportedFiles(rootPath) {
129773
129142
 
129774
129143
  async function readJavaScriptFilesWithNames(formJavaScriptFilesPath) {
129775
129144
  try {
129776
- const files = await (0,fs_extra__WEBPACK_IMPORTED_MODULE_3__.readdir)(formJavaScriptFilesPath);
129145
+ const files = await readdirAsync(formJavaScriptFilesPath);
129777
129146
  const jsFiles = files.filter(filename => /\.js$/.test(filename));
129778
129147
  return Promise.all(jsFiles.map(async filename => ({
129779
129148
  filename: path__WEBPACK_IMPORTED_MODULE_1___default().parse(filename).name,
129780
- content: await (0,fs_extra__WEBPACK_IMPORTED_MODULE_3__.readFile)(path__WEBPACK_IMPORTED_MODULE_1___default().join(formJavaScriptFilesPath, filename), "utf-8")
129149
+ content: await readFileAsync(path__WEBPACK_IMPORTED_MODULE_1___default().join(formJavaScriptFilesPath, filename), "utf-8")
129781
129150
  })));
129782
129151
  } catch (ignoreError) {
129783
129152
  return [];
@@ -129788,7 +129157,7 @@ async function connectJSFilesWithNames(formJavaScriptFilesPath) {
129788
129157
  let jsFiles;
129789
129158
 
129790
129159
  try {
129791
- const files = await (0,fs_extra__WEBPACK_IMPORTED_MODULE_3__.readdir)(formJavaScriptFilesPath);
129160
+ const files = await readdirAsync(formJavaScriptFilesPath);
129792
129161
  jsFiles = files.filter(filename => /\.js$/.test(filename));
129793
129162
  const result = [];
129794
129163
 
@@ -129796,7 +129165,7 @@ async function connectJSFilesWithNames(formJavaScriptFilesPath) {
129796
129165
  result.push({
129797
129166
  filename: path__WEBPACK_IMPORTED_MODULE_1___default().parse(filename).name,
129798
129167
  // tslint:disable-next-line no-unsafe-any
129799
- content: evalModule(await (0,fs_extra__WEBPACK_IMPORTED_MODULE_3__.readFile)(path__WEBPACK_IMPORTED_MODULE_1___default().join(formJavaScriptFilesPath, filename), "utf-8"))
129168
+ content: evalModule(await readFileAsync(path__WEBPACK_IMPORTED_MODULE_1___default().join(formJavaScriptFilesPath, filename), "utf-8"))
129800
129169
  });
129801
129170
  }
129802
129171
 
@@ -129807,16 +129176,16 @@ async function connectJSFilesWithNames(formJavaScriptFilesPath) {
129807
129176
  }
129808
129177
 
129809
129178
  function readSchemaRngFile(formSchemasPath, gfv) {
129810
- return (0,fs_extra__WEBPACK_IMPORTED_MODULE_3__.readFile)(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSchemasPath, `${gfv}.rng.xml`), "utf-8");
129179
+ return readFileAsync(path__WEBPACK_IMPORTED_MODULE_1___default().join(formSchemasPath, `${gfv}.rng.xml`), "utf-8");
129811
129180
  }
129812
129181
 
129813
129182
  function readHooksFile(formDirectoryPath) {
129814
- return (0,fs_extra__WEBPACK_IMPORTED_MODULE_3__.readFile)(path__WEBPACK_IMPORTED_MODULE_1___default().join(formDirectoryPath, "hooks.js"), "utf-8").catch(() => "");
129183
+ return readFileAsync(path__WEBPACK_IMPORTED_MODULE_1___default().join(formDirectoryPath, "hooks.js"), "utf-8").catch(() => "");
129815
129184
  }
129816
129185
 
129817
129186
  async function readFileSource(filePath, filename, defaultValue) {
129818
129187
  try {
129819
- return await (0,fs_extra__WEBPACK_IMPORTED_MODULE_3__.readFile)(path__WEBPACK_IMPORTED_MODULE_1___default().join(filePath, filename), "utf-8");
129188
+ return await readFileAsync(path__WEBPACK_IMPORTED_MODULE_1___default().join(filePath, filename), "utf-8");
129820
129189
  } catch (ingoreError) {
129821
129190
  return defaultValue;
129822
129191
  }
@@ -130376,18 +129745,18 @@ __webpack_require__.r(__webpack_exports__);
130376
129745
 
130377
129746
 
130378
129747
  class NormalizationRulesGenerator {
130379
- constructor(sugarRoot, dataDeclarationHelper, formSchemaRng, formulas, typesRegistry, useSchemaValidations, controlCustomizationContext) {
129748
+ constructor(sugarRoot, dataDeclarationHelper, formSchemaRng, mathContainer, typesRegistry, useSchemaValidations, controlCustomizationContext) {
130380
129749
  this.sugarRoot = void 0;
130381
129750
  this.dataDeclarationHelper = void 0;
130382
129751
  this.formSchemaRng = void 0;
130383
- this.formulas = void 0;
129752
+ this.mathContainer = void 0;
130384
129753
  this.typesRegistry = void 0;
130385
129754
  this.controlCustomizationContext = void 0;
130386
129755
  this.useSchemaValidations = void 0;
130387
129756
  this.sugarRoot = sugarRoot;
130388
129757
  this.dataDeclarationHelper = dataDeclarationHelper;
130389
129758
  this.formSchemaRng = formSchemaRng;
130390
- this.formulas = formulas;
129759
+ this.mathContainer = mathContainer;
130391
129760
  this.typesRegistry = typesRegistry;
130392
129761
  this.useSchemaValidations = useSchemaValidations;
130393
129762
  this.controlCustomizationContext = controlCustomizationContext;
@@ -130417,7 +129786,9 @@ class NormalizationRulesGenerator {
130417
129786
  }
130418
129787
 
130419
129788
  *buildFormulaFLangRules() {
130420
- for (const formula of this.formulas) {
129789
+ for (const formula of (_this$mathContainer$f = (_this$mathContainer = this.mathContainer) === null || _this$mathContainer === void 0 ? void 0 : (_this$mathContainer$f2 = _this$mathContainer.formulas) === null || _this$mathContainer$f2 === void 0 ? void 0 : _this$mathContainer$f2.items) !== null && _this$mathContainer$f !== void 0 ? _this$mathContainer$f : []) {
129790
+ var _this$mathContainer$f, _this$mathContainer, _this$mathContainer$f2;
129791
+
130421
129792
  yield* this.buildFormulaFlashRule(formula);
130422
129793
  }
130423
129794
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kontur.candy/generator",
3
- "version": "4.245.0",
3
+ "version": "4.246.2",
4
4
  "description": "Candy forms generator",
5
5
  "author": "SKBKontur Candy Team",
6
6
  "private": false,