@formio/js 5.0.0-rc.40 → 5.0.0-rc.41

Sign up to get free protection for your applications and to get access to all the features.
@@ -388,7 +388,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexpo
388
388
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
389
389
 
390
390
  "use strict";
391
- eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.calculateProcessInfo = exports.calculateProcess = exports.calculateProcessSync = exports.shouldCalculate = void 0;\nconst jsonlogic_1 = __importDefault(__webpack_require__(/*! ../../modules/jsonlogic */ \"../core/lib/modules/jsonlogic/index.js\"));\nconst set_1 = __importDefault(__webpack_require__(/*! lodash/set */ \"../core/node_modules/lodash/set.js\"));\nconst Evaluator = jsonlogic_1.default.evaluator;\nconst shouldCalculate = (context) => {\n const { component, config } = context;\n if (!component.calculateValue ||\n ((config === null || config === void 0 ? void 0 : config.server) && !component.calculateServer)) {\n return false;\n }\n return true;\n};\nexports.shouldCalculate = shouldCalculate;\nconst calculateProcessSync = (context) => {\n const { component, data, evalContext, scope, path } = context;\n if (!(0, exports.shouldCalculate)(context)) {\n return;\n }\n const evalContextValue = evalContext ? evalContext(context) : context;\n evalContextValue.value = null;\n if (!scope.calculated)\n scope.calculated = [];\n let newValue = Evaluator.evaluate(component.calculateValue, evalContextValue, 'value');\n // Only set a new value if it is not \"null\" which would be the case if no calculation occurred.\n if (newValue !== null) {\n scope.calculated.push({\n path,\n value: newValue\n });\n (0, set_1.default)(data, path, newValue);\n }\n return;\n};\nexports.calculateProcessSync = calculateProcessSync;\nconst calculateProcess = (context) => __awaiter(void 0, void 0, void 0, function* () {\n return (0, exports.calculateProcessSync)(context);\n});\nexports.calculateProcess = calculateProcess;\nexports.calculateProcessInfo = {\n name: 'calculate',\n process: exports.calculateProcess,\n processSync: exports.calculateProcessSync,\n shouldProcess: exports.shouldCalculate,\n};\n\n\n//# sourceURL=webpack://Formio/../core/lib/process/calculation/index.js?");
391
+ eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.calculateProcessInfo = exports.calculateProcess = exports.calculateProcessSync = exports.shouldCalculate = void 0;\nconst jsonlogic_1 = __importDefault(__webpack_require__(/*! ../../modules/jsonlogic */ \"../core/lib/modules/jsonlogic/index.js\"));\nconst set_1 = __importDefault(__webpack_require__(/*! lodash/set */ \"../core/node_modules/lodash/set.js\"));\nconst Evaluator = jsonlogic_1.default.evaluator;\nconst shouldCalculate = (context) => {\n const { component, config } = context;\n if (!component.calculateValue ||\n ((config === null || config === void 0 ? void 0 : config.server) && !component.calculateServer)) {\n return false;\n }\n return true;\n};\nexports.shouldCalculate = shouldCalculate;\nconst calculateProcessSync = (context) => {\n const { component, data, evalContext, scope, path, value } = context;\n if (!(0, exports.shouldCalculate)(context)) {\n return;\n }\n const evalContextValue = evalContext ? evalContext(context) : context;\n evalContextValue.value = value || null;\n if (!scope.calculated)\n scope.calculated = [];\n let newValue = Evaluator.evaluate(component.calculateValue, evalContextValue, 'value');\n // Only set a new value if it is not \"null\" which would be the case if no calculation occurred.\n if (newValue !== null) {\n scope.calculated.push({\n path,\n value: newValue\n });\n (0, set_1.default)(data, path, newValue);\n }\n return;\n};\nexports.calculateProcessSync = calculateProcessSync;\nconst calculateProcess = (context) => __awaiter(void 0, void 0, void 0, function* () {\n return (0, exports.calculateProcessSync)(context);\n});\nexports.calculateProcess = calculateProcess;\nexports.calculateProcessInfo = {\n name: 'calculate',\n process: exports.calculateProcess,\n processSync: exports.calculateProcessSync,\n shouldProcess: exports.shouldCalculate,\n};\n\n\n//# sourceURL=webpack://Formio/../core/lib/process/calculation/index.js?");
392
392
 
393
393
  /***/ }),
394
394
 
@@ -399,7 +399,7 @@ eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _argument
399
399
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
400
400
 
401
401
  "use strict";
402
- eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.conditionProcessInfo = exports.simpleConditionProcessInfo = exports.customConditionProcessInfo = exports.conditionProcessSync = exports.conditionProcess = exports.simpleConditionProcessSync = exports.simpleConditionProcess = exports.customConditionProcessSync = exports.customConditionProcess = exports.conditionalProcess = exports.isConditionallyHidden = exports.isSimpleConditionallyHidden = exports.isCustomConditionallyHidden = exports.hasConditions = void 0;\nconst utils_1 = __webpack_require__(/*! ../../utils */ \"../core/lib/utils/index.js\");\nconst unset_1 = __importDefault(__webpack_require__(/*! lodash/unset */ \"../core/node_modules/lodash/unset.js\"));\nconst formUtil_1 = __webpack_require__(/*! ../../utils/formUtil */ \"../core/lib/utils/formUtil.js\");\nconst conditions_1 = __webpack_require__(/*! ../../utils/conditions */ \"../core/lib/utils/conditions.js\");\nconst skipOnServer = (context) => {\n const { component, config } = context;\n const clearOnHide = component.hasOwnProperty('clearOnHide') ? component.clearOnHide : true;\n if ((config === null || config === void 0 ? void 0 : config.server) && !clearOnHide) {\n // No need to run conditionals on server unless clearOnHide is set.\n return true;\n }\n return false;\n};\nconst hasCustomConditions = (context) => {\n if (skipOnServer(context)) {\n return false;\n }\n const { component } = context;\n return !!component.customConditional;\n};\nconst hasSimpleConditions = (context) => {\n if (skipOnServer(context)) {\n return false;\n }\n const { component } = context;\n const { conditional } = component;\n if ((0, conditions_1.isLegacyConditional)(conditional) ||\n (0, conditions_1.isSimpleConditional)(conditional) ||\n (0, conditions_1.isJSONConditional)(conditional)) {\n return true;\n }\n return false;\n};\nconst hasConditions = (context) => {\n if (skipOnServer(context)) {\n return false;\n }\n return hasSimpleConditions(context) || hasCustomConditions(context);\n};\nexports.hasConditions = hasConditions;\nconst isCustomConditionallyHidden = (context) => {\n if (!hasCustomConditions(context)) {\n return false;\n }\n const { component } = context;\n const { customConditional } = component;\n let show = null;\n if (customConditional) {\n show = (0, conditions_1.checkCustomConditional)(customConditional, context, 'show');\n }\n if (show === null) {\n return false;\n }\n return !show;\n};\nexports.isCustomConditionallyHidden = isCustomConditionallyHidden;\nconst isSimpleConditionallyHidden = (context) => {\n if (!hasSimpleConditions(context)) {\n return false;\n }\n const { component } = context;\n const { conditional } = component;\n let show = null;\n if ((0, conditions_1.isJSONConditional)(conditional)) {\n show = (0, conditions_1.checkJsonConditional)(conditional, context);\n }\n if ((0, conditions_1.isLegacyConditional)(conditional)) {\n show = (0, conditions_1.checkLegacyConditional)(conditional, context);\n }\n if ((0, conditions_1.isSimpleConditional)(conditional)) {\n show = (0, conditions_1.checkSimpleConditional)(conditional, context);\n }\n if (show === null || show === undefined) {\n return false;\n }\n return !show;\n};\nexports.isSimpleConditionallyHidden = isSimpleConditionallyHidden;\nconst isConditionallyHidden = (context) => {\n return (0, exports.isCustomConditionallyHidden)(context) || (0, exports.isSimpleConditionallyHidden)(context);\n};\nexports.isConditionallyHidden = isConditionallyHidden;\nconst conditionalProcess = (context, isHidden) => {\n const { component, data, row, scope, path } = context;\n const conditionallyHidden = isHidden(context);\n if (!scope.conditionals)\n scope.conditionals = [];\n if (conditionallyHidden) {\n const info = (0, formUtil_1.componentInfo)(component);\n if (info.hasColumns || info.hasComps || info.hasRows) {\n // If this is a container component, we need to add all the child components as conditionally hidden as well.\n utils_1.Utils.eachComponentData([component], row, (comp, data, compRow, compPath) => {\n var _a;\n (_a = scope.conditionals) === null || _a === void 0 ? void 0 : _a.push({ path: (0, formUtil_1.getComponentPath)(comp, compPath), conditionallyHidden: true });\n if (!comp.hasOwnProperty('clearOnHide') || comp.clearOnHide) {\n (0, unset_1.default)(compRow, (0, formUtil_1.getComponentKey)(comp));\n }\n });\n }\n else {\n scope.conditionals.push({ path, conditionallyHidden: true });\n if (!component.hasOwnProperty('clearOnHide') || component.clearOnHide) {\n (0, unset_1.default)(data, path);\n }\n }\n }\n};\nexports.conditionalProcess = conditionalProcess;\nconst customConditionProcess = (context) => __awaiter(void 0, void 0, void 0, function* () {\n return (0, exports.customConditionProcessSync)(context);\n});\nexports.customConditionProcess = customConditionProcess;\nconst customConditionProcessSync = (context) => {\n return (0, exports.conditionalProcess)(context, exports.isCustomConditionallyHidden);\n};\nexports.customConditionProcessSync = customConditionProcessSync;\nconst simpleConditionProcess = (context) => __awaiter(void 0, void 0, void 0, function* () {\n return (0, exports.simpleConditionProcessSync)(context);\n});\nexports.simpleConditionProcess = simpleConditionProcess;\nconst simpleConditionProcessSync = (context) => {\n return (0, exports.conditionalProcess)(context, exports.isSimpleConditionallyHidden);\n};\nexports.simpleConditionProcessSync = simpleConditionProcessSync;\nconst conditionProcess = (context) => __awaiter(void 0, void 0, void 0, function* () {\n return (0, exports.conditionProcessSync)(context);\n});\nexports.conditionProcess = conditionProcess;\nconst conditionProcessSync = (context) => {\n return (0, exports.conditionalProcess)(context, exports.isConditionallyHidden);\n};\nexports.conditionProcessSync = conditionProcessSync;\nexports.customConditionProcessInfo = {\n name: 'customConditions',\n process: exports.customConditionProcess,\n processSync: exports.customConditionProcessSync,\n shouldProcess: hasCustomConditions,\n};\nexports.simpleConditionProcessInfo = {\n name: 'simpleConditions',\n process: exports.simpleConditionProcess,\n processSync: exports.simpleConditionProcessSync,\n shouldProcess: hasSimpleConditions,\n};\nexports.conditionProcessInfo = {\n name: 'conditions',\n process: exports.conditionProcess,\n processSync: exports.conditionProcessSync,\n shouldProcess: hasSimpleConditions,\n};\n\n\n//# sourceURL=webpack://Formio/../core/lib/process/conditions/index.js?");
402
+ eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.conditionProcessInfo = exports.simpleConditionProcessInfo = exports.customConditionProcessInfo = exports.conditionProcessSync = exports.conditionProcess = exports.simpleConditionProcessSync = exports.simpleConditionProcess = exports.customConditionProcessSync = exports.customConditionProcess = exports.conditionalProcess = exports.isConditionallyHidden = exports.isSimpleConditionallyHidden = exports.isCustomConditionallyHidden = exports.hasConditions = void 0;\nconst utils_1 = __webpack_require__(/*! ../../utils */ \"../core/lib/utils/index.js\");\nconst unset_1 = __importDefault(__webpack_require__(/*! lodash/unset */ \"../core/node_modules/lodash/unset.js\"));\nconst formUtil_1 = __webpack_require__(/*! ../../utils/formUtil */ \"../core/lib/utils/formUtil.js\");\nconst conditions_1 = __webpack_require__(/*! ../../utils/conditions */ \"../core/lib/utils/conditions.js\");\nconst skipOnServer = (context) => {\n const { component, config } = context;\n const clearOnHide = component.hasOwnProperty('clearOnHide') ? component.clearOnHide : true;\n if ((config === null || config === void 0 ? void 0 : config.server) && !clearOnHide) {\n // No need to run conditionals on server unless clearOnHide is set.\n return true;\n }\n return false;\n};\nconst hasCustomConditions = (context) => {\n const { component } = context;\n return !!component.customConditional;\n};\nconst hasSimpleConditions = (context) => {\n const { component } = context;\n const { conditional } = component;\n if ((0, conditions_1.isLegacyConditional)(conditional) ||\n (0, conditions_1.isSimpleConditional)(conditional) ||\n (0, conditions_1.isJSONConditional)(conditional)) {\n return true;\n }\n return false;\n};\nconst hasConditions = (context) => {\n return hasSimpleConditions(context) || hasCustomConditions(context);\n};\nexports.hasConditions = hasConditions;\nconst isCustomConditionallyHidden = (context) => {\n if (!hasCustomConditions(context)) {\n return false;\n }\n const { component } = context;\n const { customConditional } = component;\n let show = null;\n if (customConditional) {\n show = (0, conditions_1.checkCustomConditional)(customConditional, context, 'show');\n }\n if (show === null) {\n return false;\n }\n return !show;\n};\nexports.isCustomConditionallyHidden = isCustomConditionallyHidden;\nconst isSimpleConditionallyHidden = (context) => {\n if (!hasSimpleConditions(context)) {\n return false;\n }\n const { component } = context;\n const { conditional } = component;\n let show = null;\n if ((0, conditions_1.isJSONConditional)(conditional)) {\n show = (0, conditions_1.checkJsonConditional)(conditional, context);\n }\n if ((0, conditions_1.isLegacyConditional)(conditional)) {\n show = (0, conditions_1.checkLegacyConditional)(conditional, context);\n }\n if ((0, conditions_1.isSimpleConditional)(conditional)) {\n show = (0, conditions_1.checkSimpleConditional)(conditional, context);\n }\n if (show === null || show === undefined) {\n return false;\n }\n return !show;\n};\nexports.isSimpleConditionallyHidden = isSimpleConditionallyHidden;\nconst isConditionallyHidden = (context) => {\n return (0, exports.isCustomConditionallyHidden)(context) || (0, exports.isSimpleConditionallyHidden)(context);\n};\nexports.isConditionallyHidden = isConditionallyHidden;\nconst conditionalProcess = (context, isHidden) => {\n const { component, data, row, scope, path } = context;\n if (!(0, exports.hasConditions)(context)) {\n return;\n }\n if (!scope.conditionals) {\n scope.conditionals = [];\n }\n scope.conditionals.push({ path, conditionallyHidden: true });\n const conditionalComp = scope.conditionals[scope.conditionals.length - 1];\n if (skipOnServer(context)) {\n return false;\n }\n const conditionallyHidden = isHidden(context);\n if (conditionallyHidden) {\n conditionalComp.conditionallyHidden = conditionallyHidden;\n const info = (0, formUtil_1.componentInfo)(component);\n if (info.hasColumns || info.hasComps || info.hasRows) {\n // If this is a container component, we need to add all the child components as conditionally hidden as well.\n utils_1.Utils.eachComponentData([component], row, (comp, data, compRow, compPath) => {\n var _a;\n if (comp !== component) {\n (_a = scope.conditionals) === null || _a === void 0 ? void 0 : _a.push({ path: (0, formUtil_1.getComponentPath)(comp, compPath), conditionallyHidden: true });\n }\n if (!comp.hasOwnProperty('clearOnHide') || comp.clearOnHide) {\n (0, unset_1.default)(compRow, (0, formUtil_1.getComponentKey)(comp));\n }\n });\n }\n else {\n if (!component.hasOwnProperty('clearOnHide') || component.clearOnHide) {\n (0, unset_1.default)(data, path);\n }\n }\n }\n else {\n conditionalComp.conditionallyHidden = false;\n }\n};\nexports.conditionalProcess = conditionalProcess;\nconst customConditionProcess = (context) => __awaiter(void 0, void 0, void 0, function* () {\n return (0, exports.customConditionProcessSync)(context);\n});\nexports.customConditionProcess = customConditionProcess;\nconst customConditionProcessSync = (context) => {\n return (0, exports.conditionalProcess)(context, exports.isCustomConditionallyHidden);\n};\nexports.customConditionProcessSync = customConditionProcessSync;\nconst simpleConditionProcess = (context) => __awaiter(void 0, void 0, void 0, function* () {\n return (0, exports.simpleConditionProcessSync)(context);\n});\nexports.simpleConditionProcess = simpleConditionProcess;\nconst simpleConditionProcessSync = (context) => {\n return (0, exports.conditionalProcess)(context, exports.isSimpleConditionallyHidden);\n};\nexports.simpleConditionProcessSync = simpleConditionProcessSync;\nconst conditionProcess = (context) => __awaiter(void 0, void 0, void 0, function* () {\n return (0, exports.conditionProcessSync)(context);\n});\nexports.conditionProcess = conditionProcess;\nconst conditionProcessSync = (context) => {\n return (0, exports.conditionalProcess)(context, exports.isConditionallyHidden);\n};\nexports.conditionProcessSync = conditionProcessSync;\nexports.customConditionProcessInfo = {\n name: 'customConditions',\n process: exports.customConditionProcess,\n processSync: exports.customConditionProcessSync,\n shouldProcess: hasCustomConditions,\n};\nexports.simpleConditionProcessInfo = {\n name: 'simpleConditions',\n process: exports.simpleConditionProcess,\n processSync: exports.simpleConditionProcessSync,\n shouldProcess: hasSimpleConditions,\n};\nexports.conditionProcessInfo = {\n name: 'conditions',\n process: exports.conditionProcess,\n processSync: exports.conditionProcessSync,\n shouldProcess: hasSimpleConditions,\n};\n\n\n//# sourceURL=webpack://Formio/../core/lib/process/conditions/index.js?");
403
403
 
404
404
  /***/ }),
405
405
 
@@ -498,7 +498,7 @@ eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _argument
498
498
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
499
499
 
500
500
  "use strict";
501
- eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.processOneSync = exports.processOne = exports.dataValue = void 0;\nconst lodash_1 = __webpack_require__(/*! lodash */ \"../core/node_modules/lodash/lodash.js\");\nconst types_1 = __webpack_require__(/*! ../types */ \"../core/lib/types/index.js\");\nconst formUtil_1 = __webpack_require__(/*! ../utils/formUtil */ \"../core/lib/utils/formUtil.js\");\nfunction dataValue(component, row) {\n const key = (0, formUtil_1.getComponentKey)(component);\n return key ? (0, lodash_1.get)(row, key) : undefined;\n}\nexports.dataValue = dataValue;\nfunction processOne(context) {\n return __awaiter(this, void 0, void 0, function* () {\n const { processors } = context;\n // Create a getter for `value` that is always derived from the current data object\n if (typeof context.value === 'undefined') {\n Object.defineProperty(context, 'value', {\n get() {\n return (0, lodash_1.get)(context.data, context.path);\n },\n set(newValue) {\n (0, lodash_1.set)(context.data, context.path, newValue);\n }\n });\n }\n if (!context.row) {\n return;\n }\n context.processor = types_1.ProcessorType.Custom;\n for (const processor of processors) {\n if (processor === null || processor === void 0 ? void 0 : processor.process) {\n yield processor.process(context);\n }\n }\n });\n}\nexports.processOne = processOne;\nfunction processOneSync(context) {\n const { processors, component } = context;\n // Create a getter for `value` that is always derived from the current data object\n if (typeof context.value === 'undefined') {\n Object.defineProperty(context, 'value', {\n get() {\n return (0, lodash_1.get)(context.data, context.path);\n },\n set(newValue) {\n (0, lodash_1.set)(context.data, context.path, newValue);\n }\n });\n }\n if (!context.row) {\n return;\n }\n context.processor = types_1.ProcessorType.Custom;\n for (const processor of processors) {\n if (processor === null || processor === void 0 ? void 0 : processor.processSync) {\n processor.processSync(context);\n }\n }\n}\nexports.processOneSync = processOneSync;\n\n\n//# sourceURL=webpack://Formio/../core/lib/process/processOne.js?");
501
+ eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.processOneSync = exports.processOne = exports.dataValue = void 0;\nconst lodash_1 = __webpack_require__(/*! lodash */ \"../core/node_modules/lodash/lodash.js\");\nconst types_1 = __webpack_require__(/*! ../types */ \"../core/lib/types/index.js\");\nconst formUtil_1 = __webpack_require__(/*! ../utils/formUtil */ \"../core/lib/utils/formUtil.js\");\nfunction dataValue(component, row) {\n const key = (0, formUtil_1.getComponentKey)(component);\n return key ? (0, lodash_1.get)(row, key) : undefined;\n}\nexports.dataValue = dataValue;\nfunction processOne(context) {\n return __awaiter(this, void 0, void 0, function* () {\n const { processors } = context;\n // Create a getter for `value` that is always derived from the current data object\n if (typeof context.value === 'undefined') {\n Object.defineProperty(context, 'value', {\n enumerable: true,\n get() {\n return (0, lodash_1.get)(context.data, context.path);\n },\n set(newValue) {\n (0, lodash_1.set)(context.data, context.path, newValue);\n }\n });\n }\n if (!context.row) {\n return;\n }\n context.processor = types_1.ProcessorType.Custom;\n for (const processor of processors) {\n if (processor === null || processor === void 0 ? void 0 : processor.process) {\n yield processor.process(context);\n }\n }\n });\n}\nexports.processOne = processOne;\nfunction processOneSync(context) {\n const { processors, component } = context;\n // Create a getter for `value` that is always derived from the current data object\n if (typeof context.value === 'undefined') {\n Object.defineProperty(context, 'value', {\n enumerable: true,\n get() {\n return (0, lodash_1.get)(context.data, context.path);\n },\n set(newValue) {\n (0, lodash_1.set)(context.data, context.path, newValue);\n }\n });\n }\n if (!context.row) {\n return;\n }\n context.processor = types_1.ProcessorType.Custom;\n for (const processor of processors) {\n if (processor === null || processor === void 0 ? void 0 : processor.processSync) {\n processor.processSync(context);\n }\n }\n}\nexports.processOneSync = processOneSync;\n\n\n//# sourceURL=webpack://Formio/../core/lib/process/processOne.js?");
502
502
 
503
503
  /***/ }),
504
504
 
@@ -619,7 +619,7 @@ eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _argument
619
619
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
620
620
 
621
621
  "use strict";
622
- eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.validateCustomInfo = exports.validateCustomSync = exports.shouldValidate = exports.validateCustom = void 0;\nconst lodash_1 = __webpack_require__(/*! lodash */ \"../core/node_modules/lodash/lodash.js\");\nconst FieldError_1 = __webpack_require__(/*! ../../../error/FieldError */ \"../core/lib/error/FieldError.js\");\nconst utils_1 = __webpack_require__(/*! ../../../utils */ \"../core/lib/utils/index.js\");\nconst validateCustom = (context) => __awaiter(void 0, void 0, void 0, function* () {\n return (0, exports.validateCustomSync)(context);\n});\nexports.validateCustom = validateCustom;\nconst shouldValidate = (context) => {\n var _a;\n const { component, value } = context;\n const customValidation = (_a = component.validate) === null || _a === void 0 ? void 0 : _a.custom;\n if (!customValidation || !value || ((typeof value === 'string' || typeof value === 'object') && (0, lodash_1.isEmpty)(value))) {\n return false;\n }\n return true;\n};\nexports.shouldValidate = shouldValidate;\nconst validateCustomSync = (context) => {\n var _a;\n const { component, data, row, value, index, instance, evalContext } = context;\n const customValidation = (_a = component.validate) === null || _a === void 0 ? void 0 : _a.custom;\n if (!(0, exports.shouldValidate)(context)) {\n return null;\n }\n const evalContextValue = Object.assign(Object.assign({}, ((instance === null || instance === void 0 ? void 0 : instance.evalContext) ? instance.evalContext() : (evalContext ? evalContext(context) : context))), { component,\n data,\n row, rowIndex: index, instance, valid: true, input: value });\n const isValid = utils_1.Evaluator.evaluate(customValidation, evalContextValue, 'valid', true, {}, {});\n if (isValid === null || isValid === true) {\n return null;\n }\n return new FieldError_1.FieldError(typeof isValid === 'string' ? isValid : 'custom', Object.assign(Object.assign({}, context), { hasLabel: false }));\n};\nexports.validateCustomSync = validateCustomSync;\nexports.validateCustomInfo = {\n name: 'validateCustom',\n process: exports.validateCustom,\n processSync: exports.validateCustomSync,\n shouldProcess: exports.shouldValidate\n};\n\n\n//# sourceURL=webpack://Formio/../core/lib/process/validation/rules/validateCustom.js?");
622
+ eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.validateCustomInfo = exports.validateCustomSync = exports.shouldValidate = exports.validateCustom = void 0;\nconst FieldError_1 = __webpack_require__(/*! ../../../error/FieldError */ \"../core/lib/error/FieldError.js\");\nconst utils_1 = __webpack_require__(/*! ../../../utils */ \"../core/lib/utils/index.js\");\nconst validateCustom = (context) => __awaiter(void 0, void 0, void 0, function* () {\n return (0, exports.validateCustomSync)(context);\n});\nexports.validateCustom = validateCustom;\nconst shouldValidate = (context) => {\n var _a;\n const { component, value } = context;\n const customValidation = (_a = component.validate) === null || _a === void 0 ? void 0 : _a.custom;\n if (!customValidation) {\n return false;\n }\n return true;\n};\nexports.shouldValidate = shouldValidate;\nconst validateCustomSync = (context) => {\n var _a;\n const { component, data, row, value, index, instance, evalContext } = context;\n const customValidation = (_a = component.validate) === null || _a === void 0 ? void 0 : _a.custom;\n if (!(0, exports.shouldValidate)(context)) {\n return null;\n }\n const evalContextValue = Object.assign(Object.assign({}, ((instance === null || instance === void 0 ? void 0 : instance.evalContext) ? instance.evalContext() : (evalContext ? evalContext(context) : context))), { component,\n data,\n row, rowIndex: index, instance, valid: true, input: value });\n const isValid = utils_1.Evaluator.evaluate(customValidation, evalContextValue, 'valid', true, {}, {});\n if (isValid === null || isValid === true) {\n return null;\n }\n return new FieldError_1.FieldError(typeof isValid === 'string' ? isValid : 'custom', Object.assign(Object.assign({}, context), { hasLabel: false }));\n};\nexports.validateCustomSync = validateCustomSync;\nexports.validateCustomInfo = {\n name: 'validateCustom',\n process: exports.validateCustom,\n processSync: exports.validateCustomSync,\n shouldProcess: exports.shouldValidate\n};\n\n\n//# sourceURL=webpack://Formio/../core/lib/process/validation/rules/validateCustom.js?");
623
623
 
624
624
  /***/ }),
625
625
 
@@ -1565,7 +1565,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexpo
1565
1565
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
1566
1566
 
1567
1567
  "use strict";
1568
- eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.getComponentActualValue = exports.getComponentData = exports.eachComponentAsync = exports.eachComponent = exports.componentInfo = exports.getContextualRowData = exports.getContextualRowPath = exports.getComponentKey = exports.eachComponentData = exports.eachComponentDataAsync = exports.componentChildPath = exports.componentPath = exports.isComponentNestedDataType = exports.isComponentModelType = exports.getComponentPath = exports.getComponentAbsolutePath = exports.getModelType = exports.MODEL_TYPES = exports.uniqueName = exports.guid = exports.flattenComponents = void 0;\nconst lodash_1 = __webpack_require__(/*! lodash */ \"../core/node_modules/lodash/lodash.js\");\nconst Evaluator_1 = __webpack_require__(/*! ./Evaluator */ \"../core/lib/utils/Evaluator.js\");\n/**\n * Flatten the form components for data manipulation.\n *\n * @param {Object} components\n * The components to iterate.\n * @param {Boolean} includeAll\n * Whether or not to include layout components.\n *\n * @returns {Object}\n * The flattened components map.\n */\nfunction flattenComponents(components, includeAll) {\n const flattened = {};\n eachComponent(components, (component, path) => {\n flattened[path] = component;\n }, includeAll);\n return flattened;\n}\nexports.flattenComponents = flattenComponents;\nfunction guid() {\n return \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, (c) => {\n const r = (Math.random() * 16) | 0;\n const v = c === \"x\" ? r : (r & 0x3) | 0x8;\n return v.toString(16);\n });\n}\nexports.guid = guid;\n/**\n * Make a filename guaranteed to be unique.\n * @param name\n * @param template\n * @param evalContext\n * @returns {string}\n */\nfunction uniqueName(name, template, evalContext) {\n template = template || \"{{fileName}}-{{guid}}\";\n //include guid in template anyway, to prevent overwriting issue if filename matches existing file\n if (!template.includes(\"{{guid}}\")) {\n template = `${template}-{{guid}}`;\n }\n const parts = name.split(\".\");\n let fileName = parts.slice(0, parts.length - 1).join(\".\");\n const extension = parts.length > 1 ? `.${(0, lodash_1.last)(parts)}` : \"\";\n //allow only 100 characters from original name to avoid issues with filename length restrictions\n fileName = fileName.substr(0, 100);\n evalContext = Object.assign(evalContext || {}, {\n fileName,\n guid: guid(),\n });\n //only letters, numbers, dots, dashes, underscores and spaces are allowed. Anything else will be replaced with dash\n const uniqueName = `${Evaluator_1.Evaluator.interpolate(template, evalContext)}${extension}`.replace(/[^0-9a-zA-Z.\\-_ ]/g, \"-\");\n return uniqueName;\n}\nexports.uniqueName = uniqueName;\nexports.MODEL_TYPES = {\n array: [\n 'datagrid',\n 'editgrid',\n 'datatable',\n 'dynamicWizard',\n ],\n dataObject: [\n 'form'\n ],\n object: [\n 'container',\n 'address'\n ],\n map: [\n 'datamap'\n ],\n content: [\n 'htmlelement',\n 'content'\n ],\n layout: [\n 'table',\n 'tabs',\n 'well',\n 'columns',\n 'fieldset',\n 'panel',\n 'tabs'\n ],\n};\nfunction getModelType(component) {\n if (isComponentNestedDataType(component)) {\n if (isComponentModelType(component, 'dataObject')) {\n return 'dataObject';\n }\n if (isComponentModelType(component, 'array')) {\n return 'array';\n }\n return 'object';\n }\n if ((component.input === false) || isComponentModelType(component, 'layout')) {\n return 'inherit';\n }\n if (getComponentKey(component)) {\n return 'value';\n }\n return 'inherit';\n}\nexports.getModelType = getModelType;\nfunction getComponentAbsolutePath(component) {\n let paths = [component.path];\n while (component.parent) {\n component = component.parent;\n // We only need to do this for nested forms because they reset the data contexts for the children.\n if (isComponentModelType(component, 'dataObject')) {\n paths[paths.length - 1] = `data.${paths[paths.length - 1]}`;\n paths.push(component.path);\n }\n }\n return paths.reverse().join('.');\n}\nexports.getComponentAbsolutePath = getComponentAbsolutePath;\nfunction getComponentPath(component, path) {\n const key = getComponentKey(component);\n if (!key) {\n return path;\n }\n if (!path) {\n return key;\n }\n if (path.match(new RegExp(`${key}$`))) {\n return path;\n }\n return (getModelType(component) === 'inherit') ? `${path}.${key}` : path;\n}\nexports.getComponentPath = getComponentPath;\nfunction isComponentModelType(component, modelType) {\n return component.modelType === modelType || exports.MODEL_TYPES[modelType].includes(component.type);\n}\nexports.isComponentModelType = isComponentModelType;\nfunction isComponentNestedDataType(component) {\n return component.tree || isComponentModelType(component, 'array') ||\n isComponentModelType(component, 'dataObject') ||\n isComponentModelType(component, 'object') ||\n isComponentModelType(component, 'map');\n}\nexports.isComponentNestedDataType = isComponentNestedDataType;\nfunction componentPath(component, parentPath) {\n parentPath = component.parentPath || parentPath;\n const key = getComponentKey(component);\n if (!key) {\n // If the component does not have a key, then just always return the parent path.\n return parentPath || '';\n }\n return parentPath ? `${parentPath}.${key}` : key;\n}\nexports.componentPath = componentPath;\nconst componentChildPath = (component, parentPath, path) => {\n parentPath = component.parentPath || parentPath;\n path = path || componentPath(component, parentPath);\n // See if we are a nested component.\n if (component.components && Array.isArray(component.components)) {\n if (isComponentModelType(component, 'dataObject')) {\n return `${path}.data`;\n }\n if (isComponentNestedDataType(component)) {\n return path;\n }\n return parentPath === undefined ? path : parentPath;\n }\n return path;\n};\nexports.componentChildPath = componentChildPath;\n// Async each component data.\nconst eachComponentDataAsync = (components, data, fn, path = \"\", index, parent) => __awaiter(void 0, void 0, void 0, function* () {\n if (!components || !data) {\n return;\n }\n return yield eachComponentAsync(components, (component, compPath, componentComponents, compParent) => __awaiter(void 0, void 0, void 0, function* () {\n const row = getContextualRowData(component, compPath, data);\n if ((yield fn(component, data, row, compPath, componentComponents, index, compParent)) === true) {\n return true;\n }\n if (isComponentNestedDataType(component)) {\n const value = (0, lodash_1.get)(data, compPath, data);\n if (Array.isArray(value)) {\n for (let i = 0; i < value.length; i++) {\n yield (0, exports.eachComponentDataAsync)(component.components, data, fn, `${compPath}[${i}]`, i, component);\n }\n return true;\n }\n else if ((0, lodash_1.isEmpty)(row)) {\n // Tree components may submit empty objects; since we've already evaluated the parent tree/layout component, we won't worry about constituent elements\n return true;\n }\n if (isComponentModelType(component, 'dataObject')) {\n // No need to bother processing all the children data if there is no data for this form.\n if ((0, lodash_1.has)(data, component.path)) {\n // For nested forms, we need to reset the \"data\" and \"path\" objects for all of the children components, and then re-establish the data when it is done.\n const childPath = (0, exports.componentChildPath)(component, path, compPath);\n const childData = (0, lodash_1.get)(data, childPath, null);\n yield (0, exports.eachComponentDataAsync)(component.components, childData, fn, '', index, component);\n (0, lodash_1.set)(data, childPath, childData);\n }\n }\n else {\n yield (0, exports.eachComponentDataAsync)(component.components, data, fn, (0, exports.componentChildPath)(component, path, compPath), index, component);\n }\n return true;\n }\n else {\n return false;\n }\n }), true, path, parent);\n});\nexports.eachComponentDataAsync = eachComponentDataAsync;\nconst eachComponentData = (components, data, fn, path = \"\", index, parent) => {\n if (!components || !data) {\n return;\n }\n return eachComponent(components, (component, compPath, componentComponents, compParent) => {\n const row = getContextualRowData(component, compPath, data);\n if (fn(component, data, row, compPath, componentComponents, index, compParent) === true) {\n return true;\n }\n if (isComponentNestedDataType(component)) {\n const value = (0, lodash_1.get)(data, compPath, data);\n if (Array.isArray(value)) {\n for (let i = 0; i < value.length; i++) {\n (0, exports.eachComponentData)(component.components, data, fn, `${compPath}[${i}]`, i, component);\n }\n return true;\n }\n else if ((0, lodash_1.isEmpty)(row)) {\n // Tree components may submit empty objects; since we've already evaluated the parent tree/layout component, we won't worry about constituent elements\n return true;\n }\n if (isComponentModelType(component, 'dataObject')) {\n // No need to bother processing all the children data if there is no data for this form.\n if ((0, lodash_1.has)(data, component.path)) {\n // For nested forms, we need to reset the \"data\" and \"path\" objects for all of the children components, and then re-establish the data when it is done.\n const childPath = (0, exports.componentChildPath)(component, path, compPath);\n const childData = (0, lodash_1.get)(data, childPath, {});\n (0, exports.eachComponentData)(component.components, childData, fn, '', index, component);\n (0, lodash_1.set)(data, childPath, childData);\n }\n }\n else {\n (0, exports.eachComponentData)(component.components, data, fn, (0, exports.componentChildPath)(component, path, compPath), index, component);\n }\n return true;\n }\n else {\n return false;\n }\n }, true, path, parent);\n};\nexports.eachComponentData = eachComponentData;\nfunction getComponentKey(component) {\n if (component.type === 'checkbox' &&\n component.inputType === 'radio' &&\n component.name) {\n return component.name;\n }\n return component.key;\n}\nexports.getComponentKey = getComponentKey;\nfunction getContextualRowPath(component, path) {\n return path.replace(new RegExp(`\\.?${getComponentKey(component)}$`), '');\n}\nexports.getContextualRowPath = getContextualRowPath;\nfunction getContextualRowData(component, path, data) {\n const rowPath = getContextualRowPath(component, path);\n return rowPath ? (0, lodash_1.get)(data, rowPath, null) : data;\n}\nexports.getContextualRowData = getContextualRowData;\nfunction componentInfo(component) {\n const hasColumns = component.columns && Array.isArray(component.columns);\n const hasRows = component.rows && Array.isArray(component.rows);\n const hasComps = component.components && Array.isArray(component.components);\n return {\n hasColumns,\n hasRows,\n hasComps,\n iterable: hasColumns || hasRows || hasComps || isComponentModelType(component, 'content'),\n };\n}\nexports.componentInfo = componentInfo;\n/**\n * Iterate through each component within a form.\n *\n * @param {Object} components\n * The components to iterate.\n * @param {Function} fn\n * The iteration function to invoke for each component.\n * @param {Boolean} includeAll\n * Whether or not to include layout components.\n * @param {String} path\n * The current data path of the element. Example: data.user.firstName\n * @param {Object} parent\n * The parent object.\n */\nfunction eachComponent(components, fn, includeAll, path, parent) {\n if (!components)\n return;\n path = path || \"\";\n components.forEach((component) => {\n if (!component) {\n return;\n }\n const info = componentInfo(component);\n let noRecurse = false;\n // Keep track of parent references.\n if (parent) {\n // Ensure we don't create infinite JSON structures.\n Object.defineProperty(component, 'parent', {\n enumerable: false,\n writable: true,\n value: JSON.parse(JSON.stringify(parent))\n });\n component.parent.path = parent.path;\n delete component.parent.components;\n delete component.parent.componentMap;\n delete component.parent.columns;\n delete component.parent.rows;\n }\n Object.defineProperty(component, 'path', {\n enumerable: false,\n writable: true,\n value: componentPath(component, path)\n });\n if (includeAll || component.tree || !info.iterable) {\n noRecurse = fn(component, component.path, components, parent);\n }\n if (!noRecurse) {\n if (info.hasColumns) {\n component.columns.forEach((column) => eachComponent(column.components, fn, includeAll, path, parent ? component : null));\n }\n else if (info.hasRows) {\n component.rows.forEach((row) => {\n if (Array.isArray(row)) {\n row.forEach((column) => eachComponent(column.components, fn, includeAll, path, parent ? component : null));\n }\n });\n }\n else if (info.hasComps) {\n eachComponent(component.components, fn, includeAll, (0, exports.componentChildPath)(component, path), parent ? component : null);\n }\n }\n });\n}\nexports.eachComponent = eachComponent;\n// Async each component.\nfunction eachComponentAsync(components, fn, includeAll = false, path = \"\", parent) {\n var _a, _b;\n return __awaiter(this, void 0, void 0, function* () {\n if (!components)\n return;\n for (let i = 0; i < components.length; i++) {\n if (!components[i]) {\n continue;\n }\n let component = components[i];\n const info = componentInfo(component);\n // Keep track of parent references.\n if (parent) {\n // Ensure we don't create infinite JSON structures.\n Object.defineProperty(component, 'parent', {\n enumerable: false,\n writable: true,\n value: JSON.parse(JSON.stringify(parent))\n });\n component.parent.path = parent.path;\n delete component.parent.components;\n delete component.parent.componentMap;\n delete component.parent.columns;\n delete component.parent.rows;\n }\n Object.defineProperty(component, 'path', {\n enumerable: false,\n writable: true,\n value: componentPath(component, path)\n });\n if (includeAll || component.tree || !info.iterable) {\n if (yield fn(component, component.path, components, parent)) {\n continue;\n }\n }\n if (info.hasColumns) {\n for (let j = 0; j < component.columns.length; j++) {\n yield eachComponentAsync((_a = component.columns[j]) === null || _a === void 0 ? void 0 : _a.components, fn, includeAll, path, parent ? component : null);\n }\n }\n else if (info.hasRows) {\n for (let j = 0; j < component.rows.length; j++) {\n let row = component.rows[j];\n if (Array.isArray(row)) {\n for (let k = 0; k < row.length; k++) {\n yield eachComponentAsync((_b = row[k]) === null || _b === void 0 ? void 0 : _b.components, fn, includeAll, path, parent ? component : null);\n }\n }\n }\n }\n else if (info.hasComps) {\n yield eachComponentAsync(component.components, fn, includeAll, (0, exports.componentChildPath)(component, path), parent ? component : null);\n }\n }\n });\n}\nexports.eachComponentAsync = eachComponentAsync;\n// Provided components, data, and a key, this will return the components data.\nfunction getComponentData(components, data, path) {\n const compData = { component: null, data: null };\n (0, exports.eachComponentData)(components, data, (component, data, row, compPath) => {\n if (compPath === path) {\n compData.component = component;\n compData.data = row;\n return true;\n }\n });\n return compData;\n}\nexports.getComponentData = getComponentData;\nfunction getComponentActualValue(compPath, data, row) {\n let value = null;\n if (row) {\n value = (0, lodash_1.get)(row, compPath);\n }\n if (data && (0, lodash_1.isNil)(value)) {\n value = (0, lodash_1.get)(data, compPath);\n }\n if ((0, lodash_1.isNil)(value) || ((0, lodash_1.isObject)(value) && (0, lodash_1.isEmpty)(value))) {\n value = '';\n }\n return value;\n}\nexports.getComponentActualValue = getComponentActualValue;\n\n\n//# sourceURL=webpack://Formio/../core/lib/utils/formUtil.js?");
1568
+ eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.findComponent = exports.applyFormChanges = exports.generateFormChange = exports.getStrings = exports.getValue = exports.escapeRegExCharacters = exports.formatAsCurrency = exports.parseFloatExt = exports.hasCondition = exports.removeComponent = exports.searchComponents = exports.getComponent = exports.matchComponent = exports.isLayoutComponent = exports.getComponentActualValue = exports.getComponentData = exports.eachComponentAsync = exports.eachComponent = exports.componentInfo = exports.getContextualRowData = exports.getContextualRowPath = exports.getComponentKey = exports.eachComponentData = exports.eachComponentDataAsync = exports.componentChildPath = exports.componentPath = exports.isComponentNestedDataType = exports.isComponentModelType = exports.getComponentPath = exports.getComponentAbsolutePath = exports.getModelType = exports.MODEL_TYPES = exports.uniqueName = exports.guid = exports.flattenComponents = void 0;\nconst lodash_1 = __webpack_require__(/*! lodash */ \"../core/node_modules/lodash/lodash.js\");\nconst fast_json_patch_1 = __webpack_require__(/*! fast-json-patch */ \"../core/node_modules/fast-json-patch/index.mjs\");\nconst Evaluator_1 = __webpack_require__(/*! ./Evaluator */ \"../core/lib/utils/Evaluator.js\");\n/**\n * Flatten the form components for data manipulation.\n *\n * @param {Object} components\n * The components to iterate.\n * @param {Boolean} includeAll\n * Whether or not to include layout components.\n *\n * @returns {Object}\n * The flattened components map.\n */\nfunction flattenComponents(components, includeAll) {\n const flattened = {};\n eachComponent(components, (component, path) => {\n flattened[path] = component;\n }, includeAll);\n return flattened;\n}\nexports.flattenComponents = flattenComponents;\nfunction guid() {\n return \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, (c) => {\n const r = (Math.random() * 16) | 0;\n const v = c === \"x\" ? r : (r & 0x3) | 0x8;\n return v.toString(16);\n });\n}\nexports.guid = guid;\n/**\n * Make a filename guaranteed to be unique.\n * @param name\n * @param template\n * @param evalContext\n * @returns {string}\n */\nfunction uniqueName(name, template, evalContext) {\n template = template || \"{{fileName}}-{{guid}}\";\n //include guid in template anyway, to prevent overwriting issue if filename matches existing file\n if (!template.includes(\"{{guid}}\")) {\n template = `${template}-{{guid}}`;\n }\n const parts = name.split(\".\");\n let fileName = parts.slice(0, parts.length - 1).join(\".\");\n const extension = parts.length > 1 ? `.${(0, lodash_1.last)(parts)}` : \"\";\n //allow only 100 characters from original name to avoid issues with filename length restrictions\n fileName = fileName.substr(0, 100);\n evalContext = Object.assign(evalContext || {}, {\n fileName,\n guid: guid(),\n });\n //only letters, numbers, dots, dashes, underscores and spaces are allowed. Anything else will be replaced with dash\n const uniqueName = `${Evaluator_1.Evaluator.interpolate(template, evalContext)}${extension}`.replace(/[^0-9a-zA-Z.\\-_ ]/g, \"-\");\n return uniqueName;\n}\nexports.uniqueName = uniqueName;\nexports.MODEL_TYPES = {\n array: [\n 'datagrid',\n 'editgrid',\n 'datatable',\n 'dynamicWizard',\n ],\n dataObject: [\n 'form'\n ],\n object: [\n 'container',\n 'address'\n ],\n map: [\n 'datamap'\n ],\n content: [\n 'htmlelement',\n 'content'\n ],\n layout: [\n 'table',\n 'tabs',\n 'well',\n 'columns',\n 'fieldset',\n 'panel',\n 'tabs'\n ],\n};\nfunction getModelType(component) {\n if (isComponentNestedDataType(component)) {\n if (isComponentModelType(component, 'dataObject')) {\n return 'dataObject';\n }\n if (isComponentModelType(component, 'array')) {\n return 'array';\n }\n return 'object';\n }\n if ((component.input === false) || isComponentModelType(component, 'layout')) {\n return 'inherit';\n }\n if (getComponentKey(component)) {\n return 'value';\n }\n return 'inherit';\n}\nexports.getModelType = getModelType;\nfunction getComponentAbsolutePath(component) {\n let paths = [component.path];\n while (component.parent) {\n component = component.parent;\n // We only need to do this for nested forms because they reset the data contexts for the children.\n if (isComponentModelType(component, 'dataObject')) {\n paths[paths.length - 1] = `data.${paths[paths.length - 1]}`;\n paths.push(component.path);\n }\n }\n return paths.reverse().join('.');\n}\nexports.getComponentAbsolutePath = getComponentAbsolutePath;\nfunction getComponentPath(component, path) {\n const key = getComponentKey(component);\n if (!key) {\n return path;\n }\n if (!path) {\n return key;\n }\n if (path.match(new RegExp(`${key}$`))) {\n return path;\n }\n return (getModelType(component) === 'inherit') ? `${path}.${key}` : path;\n}\nexports.getComponentPath = getComponentPath;\nfunction isComponentModelType(component, modelType) {\n return component.modelType === modelType || exports.MODEL_TYPES[modelType].includes(component.type);\n}\nexports.isComponentModelType = isComponentModelType;\nfunction isComponentNestedDataType(component) {\n return component.tree || isComponentModelType(component, 'array') ||\n isComponentModelType(component, 'dataObject') ||\n isComponentModelType(component, 'object') ||\n isComponentModelType(component, 'map');\n}\nexports.isComponentNestedDataType = isComponentNestedDataType;\nfunction componentPath(component, parentPath) {\n parentPath = component.parentPath || parentPath;\n const key = getComponentKey(component);\n if (!key) {\n // If the component does not have a key, then just always return the parent path.\n return parentPath || '';\n }\n return parentPath ? `${parentPath}.${key}` : key;\n}\nexports.componentPath = componentPath;\nconst componentChildPath = (component, parentPath, path) => {\n parentPath = component.parentPath || parentPath;\n path = path || componentPath(component, parentPath);\n // See if we are a nested component.\n if (component.components && Array.isArray(component.components)) {\n if (isComponentModelType(component, 'dataObject')) {\n return `${path}.data`;\n }\n if (isComponentNestedDataType(component)) {\n return path;\n }\n return parentPath === undefined ? path : parentPath;\n }\n return path;\n};\nexports.componentChildPath = componentChildPath;\n// Async each component data.\nconst eachComponentDataAsync = (components, data, fn, path = \"\", index, parent) => __awaiter(void 0, void 0, void 0, function* () {\n if (!components || !data) {\n return;\n }\n return yield eachComponentAsync(components, (component, compPath, componentComponents, compParent) => __awaiter(void 0, void 0, void 0, function* () {\n const row = getContextualRowData(component, compPath, data);\n if ((yield fn(component, data, row, compPath, componentComponents, index, compParent)) === true) {\n return true;\n }\n if (isComponentNestedDataType(component)) {\n const value = (0, lodash_1.get)(data, compPath, data);\n if (Array.isArray(value)) {\n for (let i = 0; i < value.length; i++) {\n yield (0, exports.eachComponentDataAsync)(component.components, data, fn, `${compPath}[${i}]`, i, component);\n }\n return true;\n }\n else if ((0, lodash_1.isEmpty)(row)) {\n // Tree components may submit empty objects; since we've already evaluated the parent tree/layout component, we won't worry about constituent elements\n return true;\n }\n if (isComponentModelType(component, 'dataObject')) {\n // No need to bother processing all the children data if there is no data for this form.\n if ((0, lodash_1.has)(data, component.path)) {\n // For nested forms, we need to reset the \"data\" and \"path\" objects for all of the children components, and then re-establish the data when it is done.\n const childPath = (0, exports.componentChildPath)(component, path, compPath);\n const childData = (0, lodash_1.get)(data, childPath, null);\n yield (0, exports.eachComponentDataAsync)(component.components, childData, fn, '', index, component);\n (0, lodash_1.set)(data, childPath, childData);\n }\n }\n else {\n yield (0, exports.eachComponentDataAsync)(component.components, data, fn, (0, exports.componentChildPath)(component, path, compPath), index, component);\n }\n return true;\n }\n else {\n return false;\n }\n }), true, path, parent);\n});\nexports.eachComponentDataAsync = eachComponentDataAsync;\nconst eachComponentData = (components, data, fn, path = \"\", index, parent) => {\n if (!components || !data) {\n return;\n }\n return eachComponent(components, (component, compPath, componentComponents, compParent) => {\n const row = getContextualRowData(component, compPath, data);\n if (fn(component, data, row, compPath, componentComponents, index, compParent) === true) {\n return true;\n }\n if (isComponentNestedDataType(component)) {\n const value = (0, lodash_1.get)(data, compPath, data);\n if (Array.isArray(value)) {\n for (let i = 0; i < value.length; i++) {\n (0, exports.eachComponentData)(component.components, data, fn, `${compPath}[${i}]`, i, component);\n }\n return true;\n }\n else if ((0, lodash_1.isEmpty)(row)) {\n // Tree components may submit empty objects; since we've already evaluated the parent tree/layout component, we won't worry about constituent elements\n return true;\n }\n if (isComponentModelType(component, 'dataObject')) {\n // No need to bother processing all the children data if there is no data for this form.\n if ((0, lodash_1.has)(data, component.path)) {\n // For nested forms, we need to reset the \"data\" and \"path\" objects for all of the children components, and then re-establish the data when it is done.\n const childPath = (0, exports.componentChildPath)(component, path, compPath);\n const childData = (0, lodash_1.get)(data, childPath, {});\n (0, exports.eachComponentData)(component.components, childData, fn, '', index, component);\n (0, lodash_1.set)(data, childPath, childData);\n }\n }\n else {\n (0, exports.eachComponentData)(component.components, data, fn, (0, exports.componentChildPath)(component, path, compPath), index, component);\n }\n return true;\n }\n else {\n return false;\n }\n }, true, path, parent);\n};\nexports.eachComponentData = eachComponentData;\nfunction getComponentKey(component) {\n if (component.type === 'checkbox' &&\n component.inputType === 'radio' &&\n component.name) {\n return component.name;\n }\n return component.key;\n}\nexports.getComponentKey = getComponentKey;\nfunction getContextualRowPath(component, path) {\n return path.replace(new RegExp(`\\.?${getComponentKey(component)}$`), '');\n}\nexports.getContextualRowPath = getContextualRowPath;\nfunction getContextualRowData(component, path, data) {\n const rowPath = getContextualRowPath(component, path);\n return rowPath ? (0, lodash_1.get)(data, rowPath, null) : data;\n}\nexports.getContextualRowData = getContextualRowData;\nfunction componentInfo(component) {\n const hasColumns = component.columns && Array.isArray(component.columns);\n const hasRows = component.rows && Array.isArray(component.rows);\n const hasComps = component.components && Array.isArray(component.components);\n return {\n hasColumns,\n hasRows,\n hasComps,\n iterable: hasColumns || hasRows || hasComps || isComponentModelType(component, 'content'),\n };\n}\nexports.componentInfo = componentInfo;\n/**\n * Iterate through each component within a form.\n *\n * @param {Object} components\n * The components to iterate.\n * @param {Function} fn\n * The iteration function to invoke for each component.\n * @param {Boolean} includeAll\n * Whether or not to include layout components.\n * @param {String} path\n * The current data path of the element. Example: data.user.firstName\n * @param {Object} parent\n * The parent object.\n */\nfunction eachComponent(components, fn, includeAll, path, parent) {\n if (!components)\n return;\n path = path || \"\";\n components.forEach((component) => {\n if (!component) {\n return;\n }\n const info = componentInfo(component);\n let noRecurse = false;\n // Keep track of parent references.\n if (parent) {\n // Ensure we don't create infinite JSON structures.\n Object.defineProperty(component, 'parent', {\n enumerable: false,\n writable: true,\n value: JSON.parse(JSON.stringify(parent))\n });\n Object.defineProperty(component.parent, 'parent', {\n enumerable: false,\n writable: true,\n value: parent.parent\n });\n Object.defineProperty(component.parent, 'path', {\n enumerable: false,\n writable: true,\n value: parent.path\n });\n delete component.parent.components;\n delete component.parent.componentMap;\n delete component.parent.columns;\n delete component.parent.rows;\n }\n Object.defineProperty(component, 'path', {\n enumerable: false,\n writable: true,\n value: componentPath(component, path)\n });\n if (includeAll || component.tree || !info.iterable) {\n noRecurse = fn(component, component.path, components, parent);\n }\n if (!noRecurse) {\n if (info.hasColumns) {\n component.columns.forEach((column) => eachComponent(column.components, fn, includeAll, path, parent ? component : null));\n }\n else if (info.hasRows) {\n component.rows.forEach((row) => {\n if (Array.isArray(row)) {\n row.forEach((column) => eachComponent(column.components, fn, includeAll, path, parent ? component : null));\n }\n });\n }\n else if (info.hasComps) {\n eachComponent(component.components, fn, includeAll, (0, exports.componentChildPath)(component, path), parent ? component : null);\n }\n }\n });\n}\nexports.eachComponent = eachComponent;\n// Async each component.\nfunction eachComponentAsync(components, fn, includeAll = false, path = \"\", parent) {\n var _a, _b;\n return __awaiter(this, void 0, void 0, function* () {\n if (!components)\n return;\n for (let i = 0; i < components.length; i++) {\n if (!components[i]) {\n continue;\n }\n let component = components[i];\n const info = componentInfo(component);\n // Keep track of parent references.\n if (parent) {\n // Ensure we don't create infinite JSON structures.\n Object.defineProperty(component, 'parent', {\n enumerable: false,\n writable: true,\n value: JSON.parse(JSON.stringify(parent))\n });\n Object.defineProperty(component.parent, 'parent', {\n enumerable: false,\n writable: true,\n value: parent.parent\n });\n Object.defineProperty(component.parent, 'path', {\n enumerable: false,\n writable: true,\n value: parent.path\n });\n delete component.parent.components;\n delete component.parent.componentMap;\n delete component.parent.columns;\n delete component.parent.rows;\n }\n Object.defineProperty(component, 'path', {\n enumerable: false,\n writable: true,\n value: componentPath(component, path)\n });\n if (includeAll || component.tree || !info.iterable) {\n if (yield fn(component, component.path, components, parent)) {\n continue;\n }\n }\n if (info.hasColumns) {\n for (let j = 0; j < component.columns.length; j++) {\n yield eachComponentAsync((_a = component.columns[j]) === null || _a === void 0 ? void 0 : _a.components, fn, includeAll, path, parent ? component : null);\n }\n }\n else if (info.hasRows) {\n for (let j = 0; j < component.rows.length; j++) {\n let row = component.rows[j];\n if (Array.isArray(row)) {\n for (let k = 0; k < row.length; k++) {\n yield eachComponentAsync((_b = row[k]) === null || _b === void 0 ? void 0 : _b.components, fn, includeAll, path, parent ? component : null);\n }\n }\n }\n }\n else if (info.hasComps) {\n yield eachComponentAsync(component.components, fn, includeAll, (0, exports.componentChildPath)(component, path), parent ? component : null);\n }\n }\n });\n}\nexports.eachComponentAsync = eachComponentAsync;\n// Provided components, data, and a key, this will return the components data.\nfunction getComponentData(components, data, path) {\n const compData = { component: null, data: null };\n (0, exports.eachComponentData)(components, data, (component, data, row, compPath) => {\n if (compPath === path) {\n compData.component = component;\n compData.data = row;\n return true;\n }\n });\n return compData;\n}\nexports.getComponentData = getComponentData;\nfunction getComponentActualValue(compPath, data, row) {\n let value = null;\n if (row) {\n value = (0, lodash_1.get)(row, compPath);\n }\n if (data && (0, lodash_1.isNil)(value)) {\n value = (0, lodash_1.get)(data, compPath);\n }\n if ((0, lodash_1.isNil)(value) || ((0, lodash_1.isObject)(value) && (0, lodash_1.isEmpty)(value))) {\n value = '';\n }\n return value;\n}\nexports.getComponentActualValue = getComponentActualValue;\n/**\n * Determine if a component is a layout component or not.\n *\n * @param {Object} component\n * The component to check.\n *\n * @returns {Boolean}\n * Whether or not the component is a layout component.\n */\nfunction isLayoutComponent(component) {\n return Boolean((component.columns && Array.isArray(component.columns)) ||\n (component.rows && Array.isArray(component.rows)) ||\n (component.components && Array.isArray(component.components)));\n}\nexports.isLayoutComponent = isLayoutComponent;\n/**\n * Matches if a component matches the query.\n *\n * @param component\n * @param query\n * @return {boolean}\n */\nfunction matchComponent(component, query) {\n if ((0, lodash_1.isString)(query)) {\n return (component.key === query) || (component.path === query);\n }\n else {\n let matches = false;\n (0, lodash_1.forOwn)(query, (value, key) => {\n matches = ((0, lodash_1.get)(component, key) === value);\n if (!matches) {\n return false;\n }\n });\n return matches;\n }\n}\nexports.matchComponent = matchComponent;\n/**\n * Get a component by its key\n *\n * @param {Object} components\n * The components to iterate.\n * @param {String|Object} key\n * The key of the component to get, or a query of the component to search.\n *\n * @returns {Object}\n * The component that matches the given key, or undefined if not found.\n */\nfunction getComponent(components, key, includeAll) {\n let result;\n eachComponent(components, (component, path) => {\n if ((path === key) || (component.path === key)) {\n result = component;\n return true;\n }\n }, includeAll);\n return result;\n}\nexports.getComponent = getComponent;\n/**\n * Finds a component provided a query of properties of that component.\n *\n * @param components\n * @param query\n * @return {*}\n */\nfunction searchComponents(components, query) {\n const results = [];\n eachComponent(components, (component) => {\n if (matchComponent(component, query)) {\n results.push(component);\n }\n }, true);\n return results;\n}\nexports.searchComponents = searchComponents;\n/**\n * Remove a component by path.\n *\n * @param components\n * @param path\n */\nfunction removeComponent(components, path) {\n // Using _.unset() leave a null value. Use Array splice instead.\n // @ts-ignore\n var index = path.pop();\n if (path.length !== 0) {\n components = (0, lodash_1.get)(components, path);\n }\n components.splice(index, 1);\n}\nexports.removeComponent = removeComponent;\n/**\n * Returns if this component has a conditional statement.\n *\n * @param component - The component JSON schema.\n *\n * @returns {boolean} - TRUE - This component has a conditional, FALSE - No conditional provided.\n */\nfunction hasCondition(component) {\n return Boolean((component.customConditional) ||\n (component.conditional && (component.conditional.when ||\n component.conditional.json ||\n component.conditional.condition)));\n}\nexports.hasCondition = hasCondition;\n/**\n * Extension of standard #parseFloat(value) function, that also clears input string.\n *\n * @param {any} value\n * The value to parse.\n *\n * @returns {Number}\n * Parsed value.\n */\nfunction parseFloatExt(value) {\n return parseFloat((0, lodash_1.isString)(value)\n ? value.replace(/[^\\de.+-]/gi, '')\n : value);\n}\nexports.parseFloatExt = parseFloatExt;\n/**\n * Formats provided value in way how Currency component uses it.\n *\n * @param {any} value\n * The value to format.\n *\n * @returns {String}\n * Value formatted for Currency component.\n */\nfunction formatAsCurrency(value) {\n const parsedValue = parseFloatExt(value);\n if (isNaN(parsedValue)) {\n return '';\n }\n const parts = (0, lodash_1.round)(parsedValue, 2)\n .toString()\n .split('.');\n parts[0] = (0, lodash_1.chunk)(Array.from(parts[0]).reverse(), 3)\n .reverse()\n .map((part) => part\n .reverse()\n .join(''))\n .join(',');\n parts[1] = (0, lodash_1.pad)(parts[1], 2, '0');\n return parts.join('.');\n}\nexports.formatAsCurrency = formatAsCurrency;\n/**\n * Escapes RegEx characters in provided String value.\n *\n * @param {String} value\n * String for escaping RegEx characters.\n * @returns {string}\n * String with escaped RegEx characters.\n */\nfunction escapeRegExCharacters(value) {\n return value.replace(/[-[\\]/{}()*+?.\\\\^$|]/g, '\\\\$&');\n}\nexports.escapeRegExCharacters = escapeRegExCharacters;\n/**\n * Get the value for a component key, in the given submission.\n *\n * @param {Object} submission\n * A submission object to search.\n * @param {String} key\n * A for components API key to search for.\n */\nfunction getValue(submission, key) {\n const search = (data) => {\n if ((0, lodash_1.isPlainObject)(data)) {\n if ((0, lodash_1.has)(data, key)) {\n return (0, lodash_1.get)(data, key);\n }\n let value = null;\n (0, lodash_1.forOwn)(data, (prop) => {\n const result = search(prop);\n if (!(0, lodash_1.isNil)(result)) {\n value = result;\n return false;\n }\n });\n return value;\n }\n else {\n return null;\n }\n };\n return search(submission.data);\n}\nexports.getValue = getValue;\n/**\n * Iterate over all components in a form and get string values for translation.\n * @param form\n */\nfunction getStrings(form) {\n const properties = ['label', 'title', 'legend', 'tooltip', 'description', 'placeholder', 'prefix', 'suffix', 'errorLabel', 'content', 'html'];\n const strings = [];\n eachComponent(form.components, (component) => {\n properties.forEach(property => {\n if (component.hasOwnProperty(property) && component[property]) {\n strings.push({\n key: component.key,\n type: component.type,\n property,\n string: component[property]\n });\n }\n });\n if ((!component.dataSrc || component.dataSrc === 'values') && component.hasOwnProperty('values') && Array.isArray(component.values) && component.values.length) {\n component.values.forEach((value, index) => {\n strings.push({\n key: component.key,\n property: `value[${index}].label`,\n string: component.values[index].label\n });\n });\n }\n // Hard coded values from Day component\n if (component.type === 'day') {\n [\n 'day',\n 'month',\n 'year',\n 'Day',\n 'Month',\n 'Year',\n 'january',\n 'february',\n 'march',\n 'april',\n 'may',\n 'june',\n 'july',\n 'august',\n 'september',\n 'october',\n 'november',\n 'december'\n ].forEach(string => {\n strings.push({\n key: component.key,\n property: 'day',\n string,\n });\n });\n if (component.fields.day.placeholder) {\n strings.push({\n key: component.key,\n property: 'fields.day.placeholder',\n string: component.fields.day.placeholder,\n });\n }\n if (component.fields.month.placeholder) {\n strings.push({\n key: component.key,\n property: 'fields.month.placeholder',\n string: component.fields.month.placeholder,\n });\n }\n if (component.fields.year.placeholder) {\n strings.push({\n key: component.key,\n property: 'fields.year.placeholder',\n string: component.fields.year.placeholder,\n });\n }\n }\n if (component.type === 'editgrid') {\n const string = component.addAnother || 'Add Another';\n if (component.addAnother) {\n strings.push({\n key: component.key,\n property: 'addAnother',\n string,\n });\n }\n }\n if (component.type === 'select') {\n [\n 'loading...',\n 'Type to search'\n ].forEach(string => {\n strings.push({\n key: component.key,\n property: 'select',\n string,\n });\n });\n }\n }, true);\n return strings;\n}\nexports.getStrings = getStrings;\n// ?????????????????????????\n// questionable section\nfunction generateFormChange(type, data) {\n let change;\n switch (type) {\n case 'add':\n change = {\n op: 'add',\n key: data.component.key,\n container: data.parent.key, // Parent component\n path: data.path, // Path to container within parent component.\n index: data.index, // Index of component in parent container.\n component: data.component\n };\n break;\n case 'edit':\n change = {\n op: 'edit',\n key: data.originalComponent.key,\n patches: (0, fast_json_patch_1.compare)(data.originalComponent, data.component)\n };\n // Don't save if nothing changed.\n if (!change.patches.length) {\n change = null;\n }\n break;\n case 'remove':\n change = {\n op: 'remove',\n key: data.component.key,\n };\n break;\n }\n return change;\n}\nexports.generateFormChange = generateFormChange;\nfunction applyFormChanges(form, changes) {\n const failed = [];\n changes.forEach(function (change) {\n var found = false;\n switch (change.op) {\n case 'add':\n var newComponent = change.component;\n // Find the container to set the component in.\n findComponent(form.components, change.container, null, function (parent) {\n if (!change.container) {\n parent = form;\n }\n // A move will first run an add so remove any existing components with matching key before inserting.\n findComponent(form.components, change.key, null, function (component, path) {\n // If found, use the existing component. (If someone else edited it, the changes would be here)\n newComponent = component;\n removeComponent(form.components, path);\n });\n found = true;\n var container = (0, lodash_1.get)(parent, change.path);\n container.splice(change.index, 0, newComponent);\n });\n break;\n case 'remove':\n findComponent(form.components, change.key, null, function (component, path) {\n found = true;\n const oldComponent = (0, lodash_1.get)(form.components, path);\n if (oldComponent.key !== component.key) {\n path.pop();\n }\n removeComponent(form.components, path);\n });\n break;\n case 'edit':\n findComponent(form.components, change.key, null, function (component, path) {\n found = true;\n try {\n const oldComponent = (0, lodash_1.get)(form.components, path);\n const newComponent = (0, fast_json_patch_1.applyPatch)(component, change.patches).newDocument;\n if (oldComponent.key !== newComponent.key) {\n path.pop();\n }\n (0, lodash_1.set)(form.components, path, newComponent);\n }\n catch (err) {\n failed.push(change);\n }\n });\n break;\n case 'move':\n break;\n }\n if (!found) {\n failed.push(change);\n }\n });\n return {\n form,\n failed\n };\n}\nexports.applyFormChanges = applyFormChanges;\n/**\n* This function will find a component in a form and return the component AND THE PATH to the component in the form.\n* Path to the component is stored as an array of nested components and their indexes.The Path is being filled recursively\n* when you iterating through the nested structure.\n* If the component is not found the callback won't be called and function won't return anything.\n*\n* @param components\n* @param key\n* @param fn\n* @param path\n* @returns {*}\n*/\nfunction findComponent(components, key, path, fn) {\n if (!components)\n return;\n path = path || [];\n if (!key) {\n return fn(components);\n }\n components.forEach(function (component, index) {\n var newPath = path.slice();\n // Add an index of the component it iterates through in nested structure\n newPath.push(index);\n if (!component)\n return;\n if (component.hasOwnProperty('columns') && Array.isArray(component.columns)) {\n newPath.push('columns');\n component.columns.forEach(function (column, index) {\n var colPath = newPath.slice();\n colPath.push(index);\n colPath.push('components');\n findComponent(column.components, key, colPath, fn);\n });\n }\n if (component.hasOwnProperty('rows') && Array.isArray(component.rows)) {\n newPath.push('rows');\n component.rows.forEach(function (row, index) {\n var rowPath = newPath.slice();\n rowPath.push(index);\n row.forEach(function (column, index) {\n var colPath = rowPath.slice();\n colPath.push(index);\n colPath.push('components');\n findComponent(column.components, key, colPath, fn);\n });\n });\n }\n if (component.hasOwnProperty('components') && Array.isArray(component.components)) {\n newPath.push('components');\n findComponent(component.components, key, newPath, fn);\n }\n if (component.key === key) {\n //Final callback if the component is found\n fn(component, newPath, components);\n }\n });\n}\nexports.findComponent = findComponent;\n\n\n//# sourceURL=webpack://Formio/../core/lib/utils/formUtil.js?");
1569
1569
 
1570
1570
  /***/ }),
1571
1571
 
@@ -6584,7 +6584,7 @@ eval("/* module decorator */ module = __webpack_require__.nmd(module);\n//! mome
6584
6584
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
6585
6585
 
6586
6586
  "use strict";
6587
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": function() { return /* binding */ SignaturePad; }\n/* harmony export */ });\n/*!\n * Signature Pad v4.1.7 | https://github.com/szimek/signature_pad\n * (c) 2023 Szymon Nowak | Released under the MIT license\n */\n\nclass Point {\n constructor(x, y, pressure, time) {\n if (isNaN(x) || isNaN(y)) {\n throw new Error(`Point is invalid: (${x}, ${y})`);\n }\n this.x = +x;\n this.y = +y;\n this.pressure = pressure || 0;\n this.time = time || Date.now();\n }\n distanceTo(start) {\n return Math.sqrt(Math.pow(this.x - start.x, 2) + Math.pow(this.y - start.y, 2));\n }\n equals(other) {\n return (this.x === other.x &&\n this.y === other.y &&\n this.pressure === other.pressure &&\n this.time === other.time);\n }\n velocityFrom(start) {\n return this.time !== start.time\n ? this.distanceTo(start) / (this.time - start.time)\n : 0;\n }\n}\n\nclass Bezier {\n static fromPoints(points, widths) {\n const c2 = this.calculateControlPoints(points[0], points[1], points[2]).c2;\n const c3 = this.calculateControlPoints(points[1], points[2], points[3]).c1;\n return new Bezier(points[1], c2, c3, points[2], widths.start, widths.end);\n }\n static calculateControlPoints(s1, s2, s3) {\n const dx1 = s1.x - s2.x;\n const dy1 = s1.y - s2.y;\n const dx2 = s2.x - s3.x;\n const dy2 = s2.y - s3.y;\n const m1 = { x: (s1.x + s2.x) / 2.0, y: (s1.y + s2.y) / 2.0 };\n const m2 = { x: (s2.x + s3.x) / 2.0, y: (s2.y + s3.y) / 2.0 };\n const l1 = Math.sqrt(dx1 * dx1 + dy1 * dy1);\n const l2 = Math.sqrt(dx2 * dx2 + dy2 * dy2);\n const dxm = m1.x - m2.x;\n const dym = m1.y - m2.y;\n const k = l2 / (l1 + l2);\n const cm = { x: m2.x + dxm * k, y: m2.y + dym * k };\n const tx = s2.x - cm.x;\n const ty = s2.y - cm.y;\n return {\n c1: new Point(m1.x + tx, m1.y + ty),\n c2: new Point(m2.x + tx, m2.y + ty),\n };\n }\n constructor(startPoint, control2, control1, endPoint, startWidth, endWidth) {\n this.startPoint = startPoint;\n this.control2 = control2;\n this.control1 = control1;\n this.endPoint = endPoint;\n this.startWidth = startWidth;\n this.endWidth = endWidth;\n }\n length() {\n const steps = 10;\n let length = 0;\n let px;\n let py;\n for (let i = 0; i <= steps; i += 1) {\n const t = i / steps;\n const cx = this.point(t, this.startPoint.x, this.control1.x, this.control2.x, this.endPoint.x);\n const cy = this.point(t, this.startPoint.y, this.control1.y, this.control2.y, this.endPoint.y);\n if (i > 0) {\n const xdiff = cx - px;\n const ydiff = cy - py;\n length += Math.sqrt(xdiff * xdiff + ydiff * ydiff);\n }\n px = cx;\n py = cy;\n }\n return length;\n }\n point(t, start, c1, c2, end) {\n return (start * (1.0 - t) * (1.0 - t) * (1.0 - t))\n + (3.0 * c1 * (1.0 - t) * (1.0 - t) * t)\n + (3.0 * c2 * (1.0 - t) * t * t)\n + (end * t * t * t);\n }\n}\n\nclass SignatureEventTarget {\n constructor() {\n try {\n this._et = new EventTarget();\n }\n catch (error) {\n this._et = document;\n }\n }\n addEventListener(type, listener, options) {\n this._et.addEventListener(type, listener, options);\n }\n dispatchEvent(event) {\n return this._et.dispatchEvent(event);\n }\n removeEventListener(type, callback, options) {\n this._et.removeEventListener(type, callback, options);\n }\n}\n\nfunction throttle(fn, wait = 250) {\n let previous = 0;\n let timeout = null;\n let result;\n let storedContext;\n let storedArgs;\n const later = () => {\n previous = Date.now();\n timeout = null;\n result = fn.apply(storedContext, storedArgs);\n if (!timeout) {\n storedContext = null;\n storedArgs = [];\n }\n };\n return function wrapper(...args) {\n const now = Date.now();\n const remaining = wait - (now - previous);\n storedContext = this;\n storedArgs = args;\n if (remaining <= 0 || remaining > wait) {\n if (timeout) {\n clearTimeout(timeout);\n timeout = null;\n }\n previous = now;\n result = fn.apply(storedContext, storedArgs);\n if (!timeout) {\n storedContext = null;\n storedArgs = [];\n }\n }\n else if (!timeout) {\n timeout = window.setTimeout(later, remaining);\n }\n return result;\n };\n}\n\nclass SignaturePad extends SignatureEventTarget {\n constructor(canvas, options = {}) {\n super();\n this.canvas = canvas;\n this._drawingStroke = false;\n this._isEmpty = true;\n this._lastPoints = [];\n this._data = [];\n this._lastVelocity = 0;\n this._lastWidth = 0;\n this._handleMouseDown = (event) => {\n if (event.buttons === 1) {\n this._strokeBegin(event);\n }\n };\n this._handleMouseMove = (event) => {\n this._strokeMoveUpdate(event);\n };\n this._handleMouseUp = (event) => {\n if (event.buttons === 1) {\n this._strokeEnd(event);\n }\n };\n this._handleTouchStart = (event) => {\n if (event.cancelable) {\n event.preventDefault();\n }\n if (event.targetTouches.length === 1) {\n const touch = event.changedTouches[0];\n this._strokeBegin(touch);\n }\n };\n this._handleTouchMove = (event) => {\n if (event.cancelable) {\n event.preventDefault();\n }\n const touch = event.targetTouches[0];\n this._strokeMoveUpdate(touch);\n };\n this._handleTouchEnd = (event) => {\n const wasCanvasTouched = event.target === this.canvas;\n if (wasCanvasTouched) {\n if (event.cancelable) {\n event.preventDefault();\n }\n const touch = event.changedTouches[0];\n this._strokeEnd(touch);\n }\n };\n this._handlePointerStart = (event) => {\n event.preventDefault();\n this._strokeBegin(event);\n };\n this._handlePointerMove = (event) => {\n this._strokeMoveUpdate(event);\n };\n this._handlePointerEnd = (event) => {\n if (this._drawingStroke) {\n event.preventDefault();\n this._strokeEnd(event);\n }\n };\n this.velocityFilterWeight = options.velocityFilterWeight || 0.7;\n this.minWidth = options.minWidth || 0.5;\n this.maxWidth = options.maxWidth || 2.5;\n this.throttle = ('throttle' in options ? options.throttle : 16);\n this.minDistance = ('minDistance' in options ? options.minDistance : 5);\n this.dotSize = options.dotSize || 0;\n this.penColor = options.penColor || 'black';\n this.backgroundColor = options.backgroundColor || 'rgba(0,0,0,0)';\n this.compositeOperation = options.compositeOperation || 'source-over';\n this._strokeMoveUpdate = this.throttle\n ? throttle(SignaturePad.prototype._strokeUpdate, this.throttle)\n : SignaturePad.prototype._strokeUpdate;\n this._ctx = canvas.getContext('2d');\n this.clear();\n this.on();\n }\n clear() {\n const { _ctx: ctx, canvas } = this;\n ctx.fillStyle = this.backgroundColor;\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n this._data = [];\n this._reset(this._getPointGroupOptions());\n this._isEmpty = true;\n }\n fromDataURL(dataUrl, options = {}) {\n return new Promise((resolve, reject) => {\n const image = new Image();\n const ratio = options.ratio || window.devicePixelRatio || 1;\n const width = options.width || this.canvas.width / ratio;\n const height = options.height || this.canvas.height / ratio;\n const xOffset = options.xOffset || 0;\n const yOffset = options.yOffset || 0;\n this._reset(this._getPointGroupOptions());\n image.onload = () => {\n this._ctx.drawImage(image, xOffset, yOffset, width, height);\n resolve();\n };\n image.onerror = (error) => {\n reject(error);\n };\n image.crossOrigin = 'anonymous';\n image.src = dataUrl;\n this._isEmpty = false;\n });\n }\n toDataURL(type = 'image/png', encoderOptions) {\n switch (type) {\n case 'image/svg+xml':\n if (typeof encoderOptions !== 'object') {\n encoderOptions = undefined;\n }\n return `data:image/svg+xml;base64,${btoa(this.toSVG(encoderOptions))}`;\n default:\n if (typeof encoderOptions !== 'number') {\n encoderOptions = undefined;\n }\n return this.canvas.toDataURL(type, encoderOptions);\n }\n }\n on() {\n this.canvas.style.touchAction = 'none';\n this.canvas.style.msTouchAction = 'none';\n this.canvas.style.userSelect = 'none';\n const isIOS = /Macintosh/.test(navigator.userAgent) && 'ontouchstart' in document;\n if (window.PointerEvent && !isIOS) {\n this._handlePointerEvents();\n }\n else {\n this._handleMouseEvents();\n if ('ontouchstart' in window) {\n this._handleTouchEvents();\n }\n }\n }\n off() {\n this.canvas.style.touchAction = 'auto';\n this.canvas.style.msTouchAction = 'auto';\n this.canvas.style.userSelect = 'auto';\n this.canvas.removeEventListener('pointerdown', this._handlePointerStart);\n this.canvas.removeEventListener('pointermove', this._handlePointerMove);\n this.canvas.ownerDocument.removeEventListener('pointerup', this._handlePointerEnd);\n this.canvas.removeEventListener('mousedown', this._handleMouseDown);\n this.canvas.removeEventListener('mousemove', this._handleMouseMove);\n this.canvas.ownerDocument.removeEventListener('mouseup', this._handleMouseUp);\n this.canvas.removeEventListener('touchstart', this._handleTouchStart);\n this.canvas.removeEventListener('touchmove', this._handleTouchMove);\n this.canvas.removeEventListener('touchend', this._handleTouchEnd);\n }\n isEmpty() {\n return this._isEmpty;\n }\n fromData(pointGroups, { clear = true } = {}) {\n if (clear) {\n this.clear();\n }\n this._fromData(pointGroups, this._drawCurve.bind(this), this._drawDot.bind(this));\n this._data = this._data.concat(pointGroups);\n }\n toData() {\n return this._data;\n }\n _getPointGroupOptions(group) {\n return {\n penColor: group && 'penColor' in group ? group.penColor : this.penColor,\n dotSize: group && 'dotSize' in group ? group.dotSize : this.dotSize,\n minWidth: group && 'minWidth' in group ? group.minWidth : this.minWidth,\n maxWidth: group && 'maxWidth' in group ? group.maxWidth : this.maxWidth,\n velocityFilterWeight: group && 'velocityFilterWeight' in group\n ? group.velocityFilterWeight\n : this.velocityFilterWeight,\n compositeOperation: group && 'compositeOperation' in group\n ? group.compositeOperation\n : this.compositeOperation,\n };\n }\n _strokeBegin(event) {\n const cancelled = !this.dispatchEvent(new CustomEvent('beginStroke', { detail: event, cancelable: true }));\n if (cancelled) {\n return;\n }\n this._drawingStroke = true;\n const pointGroupOptions = this._getPointGroupOptions();\n const newPointGroup = Object.assign(Object.assign({}, pointGroupOptions), { points: [] });\n this._data.push(newPointGroup);\n this._reset(pointGroupOptions);\n this._strokeUpdate(event);\n }\n _strokeUpdate(event) {\n if (!this._drawingStroke) {\n return;\n }\n if (this._data.length === 0) {\n this._strokeBegin(event);\n return;\n }\n this.dispatchEvent(new CustomEvent('beforeUpdateStroke', { detail: event }));\n const x = event.clientX;\n const y = event.clientY;\n const pressure = event.pressure !== undefined\n ? event.pressure\n : event.force !== undefined\n ? event.force\n : 0;\n const point = this._createPoint(x, y, pressure);\n const lastPointGroup = this._data[this._data.length - 1];\n const lastPoints = lastPointGroup.points;\n const lastPoint = lastPoints.length > 0 && lastPoints[lastPoints.length - 1];\n const isLastPointTooClose = lastPoint\n ? point.distanceTo(lastPoint) <= this.minDistance\n : false;\n const pointGroupOptions = this._getPointGroupOptions(lastPointGroup);\n if (!lastPoint || !(lastPoint && isLastPointTooClose)) {\n const curve = this._addPoint(point, pointGroupOptions);\n if (!lastPoint) {\n this._drawDot(point, pointGroupOptions);\n }\n else if (curve) {\n this._drawCurve(curve, pointGroupOptions);\n }\n lastPoints.push({\n time: point.time,\n x: point.x,\n y: point.y,\n pressure: point.pressure,\n });\n }\n this.dispatchEvent(new CustomEvent('afterUpdateStroke', { detail: event }));\n }\n _strokeEnd(event) {\n if (!this._drawingStroke) {\n return;\n }\n this._strokeUpdate(event);\n this._drawingStroke = false;\n this.dispatchEvent(new CustomEvent('endStroke', { detail: event }));\n }\n _handlePointerEvents() {\n this._drawingStroke = false;\n this.canvas.addEventListener('pointerdown', this._handlePointerStart);\n this.canvas.addEventListener('pointermove', this._handlePointerMove);\n this.canvas.ownerDocument.addEventListener('pointerup', this._handlePointerEnd);\n }\n _handleMouseEvents() {\n this._drawingStroke = false;\n this.canvas.addEventListener('mousedown', this._handleMouseDown);\n this.canvas.addEventListener('mousemove', this._handleMouseMove);\n this.canvas.ownerDocument.addEventListener('mouseup', this._handleMouseUp);\n }\n _handleTouchEvents() {\n this.canvas.addEventListener('touchstart', this._handleTouchStart);\n this.canvas.addEventListener('touchmove', this._handleTouchMove);\n this.canvas.addEventListener('touchend', this._handleTouchEnd);\n }\n _reset(options) {\n this._lastPoints = [];\n this._lastVelocity = 0;\n this._lastWidth = (options.minWidth + options.maxWidth) / 2;\n this._ctx.fillStyle = options.penColor;\n this._ctx.globalCompositeOperation = options.compositeOperation;\n }\n _createPoint(x, y, pressure) {\n const rect = this.canvas.getBoundingClientRect();\n return new Point(x - rect.left, y - rect.top, pressure, new Date().getTime());\n }\n _addPoint(point, options) {\n const { _lastPoints } = this;\n _lastPoints.push(point);\n if (_lastPoints.length > 2) {\n if (_lastPoints.length === 3) {\n _lastPoints.unshift(_lastPoints[0]);\n }\n const widths = this._calculateCurveWidths(_lastPoints[1], _lastPoints[2], options);\n const curve = Bezier.fromPoints(_lastPoints, widths);\n _lastPoints.shift();\n return curve;\n }\n return null;\n }\n _calculateCurveWidths(startPoint, endPoint, options) {\n const velocity = options.velocityFilterWeight * endPoint.velocityFrom(startPoint) +\n (1 - options.velocityFilterWeight) * this._lastVelocity;\n const newWidth = this._strokeWidth(velocity, options);\n const widths = {\n end: newWidth,\n start: this._lastWidth,\n };\n this._lastVelocity = velocity;\n this._lastWidth = newWidth;\n return widths;\n }\n _strokeWidth(velocity, options) {\n return Math.max(options.maxWidth / (velocity + 1), options.minWidth);\n }\n _drawCurveSegment(x, y, width) {\n const ctx = this._ctx;\n ctx.moveTo(x, y);\n ctx.arc(x, y, width, 0, 2 * Math.PI, false);\n this._isEmpty = false;\n }\n _drawCurve(curve, options) {\n const ctx = this._ctx;\n const widthDelta = curve.endWidth - curve.startWidth;\n const drawSteps = Math.ceil(curve.length()) * 2;\n ctx.beginPath();\n ctx.fillStyle = options.penColor;\n for (let i = 0; i < drawSteps; i += 1) {\n const t = i / drawSteps;\n const tt = t * t;\n const ttt = tt * t;\n const u = 1 - t;\n const uu = u * u;\n const uuu = uu * u;\n let x = uuu * curve.startPoint.x;\n x += 3 * uu * t * curve.control1.x;\n x += 3 * u * tt * curve.control2.x;\n x += ttt * curve.endPoint.x;\n let y = uuu * curve.startPoint.y;\n y += 3 * uu * t * curve.control1.y;\n y += 3 * u * tt * curve.control2.y;\n y += ttt * curve.endPoint.y;\n const width = Math.min(curve.startWidth + ttt * widthDelta, options.maxWidth);\n this._drawCurveSegment(x, y, width);\n }\n ctx.closePath();\n ctx.fill();\n }\n _drawDot(point, options) {\n const ctx = this._ctx;\n const width = options.dotSize > 0\n ? options.dotSize\n : (options.minWidth + options.maxWidth) / 2;\n ctx.beginPath();\n this._drawCurveSegment(point.x, point.y, width);\n ctx.closePath();\n ctx.fillStyle = options.penColor;\n ctx.fill();\n }\n _fromData(pointGroups, drawCurve, drawDot) {\n for (const group of pointGroups) {\n const { points } = group;\n const pointGroupOptions = this._getPointGroupOptions(group);\n if (points.length > 1) {\n for (let j = 0; j < points.length; j += 1) {\n const basicPoint = points[j];\n const point = new Point(basicPoint.x, basicPoint.y, basicPoint.pressure, basicPoint.time);\n if (j === 0) {\n this._reset(pointGroupOptions);\n }\n const curve = this._addPoint(point, pointGroupOptions);\n if (curve) {\n drawCurve(curve, pointGroupOptions);\n }\n }\n }\n else {\n this._reset(pointGroupOptions);\n drawDot(points[0], pointGroupOptions);\n }\n }\n }\n toSVG({ includeBackgroundColor = false } = {}) {\n const pointGroups = this._data;\n const ratio = Math.max(window.devicePixelRatio || 1, 1);\n const minX = 0;\n const minY = 0;\n const maxX = this.canvas.width / ratio;\n const maxY = this.canvas.height / ratio;\n const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n svg.setAttribute('xmlns', 'http://www.w3.org/2000/svg');\n svg.setAttribute('xmlns:xlink', 'http://www.w3.org/1999/xlink');\n svg.setAttribute('viewBox', `${minX} ${minY} ${maxX} ${maxY}`);\n svg.setAttribute('width', maxX.toString());\n svg.setAttribute('height', maxY.toString());\n if (includeBackgroundColor && this.backgroundColor) {\n const rect = document.createElement('rect');\n rect.setAttribute('width', '100%');\n rect.setAttribute('height', '100%');\n rect.setAttribute('fill', this.backgroundColor);\n svg.appendChild(rect);\n }\n this._fromData(pointGroups, (curve, { penColor }) => {\n const path = document.createElement('path');\n if (!isNaN(curve.control1.x) &&\n !isNaN(curve.control1.y) &&\n !isNaN(curve.control2.x) &&\n !isNaN(curve.control2.y)) {\n const attr = `M ${curve.startPoint.x.toFixed(3)},${curve.startPoint.y.toFixed(3)} ` +\n `C ${curve.control1.x.toFixed(3)},${curve.control1.y.toFixed(3)} ` +\n `${curve.control2.x.toFixed(3)},${curve.control2.y.toFixed(3)} ` +\n `${curve.endPoint.x.toFixed(3)},${curve.endPoint.y.toFixed(3)}`;\n path.setAttribute('d', attr);\n path.setAttribute('stroke-width', (curve.endWidth * 2.25).toFixed(3));\n path.setAttribute('stroke', penColor);\n path.setAttribute('fill', 'none');\n path.setAttribute('stroke-linecap', 'round');\n svg.appendChild(path);\n }\n }, (point, { penColor, dotSize, minWidth, maxWidth }) => {\n const circle = document.createElement('circle');\n const size = dotSize > 0 ? dotSize : (minWidth + maxWidth) / 2;\n circle.setAttribute('r', size.toString());\n circle.setAttribute('cx', point.x.toString());\n circle.setAttribute('cy', point.y.toString());\n circle.setAttribute('fill', penColor);\n svg.appendChild(circle);\n });\n return svg.outerHTML;\n }\n}\n\n\n//# sourceMappingURL=signature_pad.js.map\n\n\n//# sourceURL=webpack://Formio/./node_modules/signature_pad/dist/signature_pad.js?");
6587
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": function() { return /* binding */ SignaturePad; }\n/* harmony export */ });\n/*!\n * Signature Pad v4.2.0 | https://github.com/szimek/signature_pad\n * (c) 2024 Szymon Nowak | Released under the MIT license\n */\n\nclass Point {\n constructor(x, y, pressure, time) {\n if (isNaN(x) || isNaN(y)) {\n throw new Error(`Point is invalid: (${x}, ${y})`);\n }\n this.x = +x;\n this.y = +y;\n this.pressure = pressure || 0;\n this.time = time || Date.now();\n }\n distanceTo(start) {\n return Math.sqrt(Math.pow(this.x - start.x, 2) + Math.pow(this.y - start.y, 2));\n }\n equals(other) {\n return (this.x === other.x &&\n this.y === other.y &&\n this.pressure === other.pressure &&\n this.time === other.time);\n }\n velocityFrom(start) {\n return this.time !== start.time\n ? this.distanceTo(start) / (this.time - start.time)\n : 0;\n }\n}\n\nclass Bezier {\n static fromPoints(points, widths) {\n const c2 = this.calculateControlPoints(points[0], points[1], points[2]).c2;\n const c3 = this.calculateControlPoints(points[1], points[2], points[3]).c1;\n return new Bezier(points[1], c2, c3, points[2], widths.start, widths.end);\n }\n static calculateControlPoints(s1, s2, s3) {\n const dx1 = s1.x - s2.x;\n const dy1 = s1.y - s2.y;\n const dx2 = s2.x - s3.x;\n const dy2 = s2.y - s3.y;\n const m1 = { x: (s1.x + s2.x) / 2.0, y: (s1.y + s2.y) / 2.0 };\n const m2 = { x: (s2.x + s3.x) / 2.0, y: (s2.y + s3.y) / 2.0 };\n const l1 = Math.sqrt(dx1 * dx1 + dy1 * dy1);\n const l2 = Math.sqrt(dx2 * dx2 + dy2 * dy2);\n const dxm = m1.x - m2.x;\n const dym = m1.y - m2.y;\n const k = l2 / (l1 + l2);\n const cm = { x: m2.x + dxm * k, y: m2.y + dym * k };\n const tx = s2.x - cm.x;\n const ty = s2.y - cm.y;\n return {\n c1: new Point(m1.x + tx, m1.y + ty),\n c2: new Point(m2.x + tx, m2.y + ty),\n };\n }\n constructor(startPoint, control2, control1, endPoint, startWidth, endWidth) {\n this.startPoint = startPoint;\n this.control2 = control2;\n this.control1 = control1;\n this.endPoint = endPoint;\n this.startWidth = startWidth;\n this.endWidth = endWidth;\n }\n length() {\n const steps = 10;\n let length = 0;\n let px;\n let py;\n for (let i = 0; i <= steps; i += 1) {\n const t = i / steps;\n const cx = this.point(t, this.startPoint.x, this.control1.x, this.control2.x, this.endPoint.x);\n const cy = this.point(t, this.startPoint.y, this.control1.y, this.control2.y, this.endPoint.y);\n if (i > 0) {\n const xdiff = cx - px;\n const ydiff = cy - py;\n length += Math.sqrt(xdiff * xdiff + ydiff * ydiff);\n }\n px = cx;\n py = cy;\n }\n return length;\n }\n point(t, start, c1, c2, end) {\n return (start * (1.0 - t) * (1.0 - t) * (1.0 - t))\n + (3.0 * c1 * (1.0 - t) * (1.0 - t) * t)\n + (3.0 * c2 * (1.0 - t) * t * t)\n + (end * t * t * t);\n }\n}\n\nclass SignatureEventTarget {\n constructor() {\n try {\n this._et = new EventTarget();\n }\n catch (error) {\n this._et = document;\n }\n }\n addEventListener(type, listener, options) {\n this._et.addEventListener(type, listener, options);\n }\n dispatchEvent(event) {\n return this._et.dispatchEvent(event);\n }\n removeEventListener(type, callback, options) {\n this._et.removeEventListener(type, callback, options);\n }\n}\n\nfunction throttle(fn, wait = 250) {\n let previous = 0;\n let timeout = null;\n let result;\n let storedContext;\n let storedArgs;\n const later = () => {\n previous = Date.now();\n timeout = null;\n result = fn.apply(storedContext, storedArgs);\n if (!timeout) {\n storedContext = null;\n storedArgs = [];\n }\n };\n return function wrapper(...args) {\n const now = Date.now();\n const remaining = wait - (now - previous);\n storedContext = this;\n storedArgs = args;\n if (remaining <= 0 || remaining > wait) {\n if (timeout) {\n clearTimeout(timeout);\n timeout = null;\n }\n previous = now;\n result = fn.apply(storedContext, storedArgs);\n if (!timeout) {\n storedContext = null;\n storedArgs = [];\n }\n }\n else if (!timeout) {\n timeout = window.setTimeout(later, remaining);\n }\n return result;\n };\n}\n\nclass SignaturePad extends SignatureEventTarget {\n constructor(canvas, options = {}) {\n super();\n this.canvas = canvas;\n this._drawingStroke = false;\n this._isEmpty = true;\n this._lastPoints = [];\n this._data = [];\n this._lastVelocity = 0;\n this._lastWidth = 0;\n this._handleMouseDown = (event) => {\n if (event.buttons === 1) {\n this._strokeBegin(event);\n }\n };\n this._handleMouseMove = (event) => {\n this._strokeMoveUpdate(event);\n };\n this._handleMouseUp = (event) => {\n if (event.buttons === 1) {\n this._strokeEnd(event);\n }\n };\n this._handleTouchStart = (event) => {\n if (event.cancelable) {\n event.preventDefault();\n }\n if (event.targetTouches.length === 1) {\n const touch = event.changedTouches[0];\n this._strokeBegin(touch);\n }\n };\n this._handleTouchMove = (event) => {\n if (event.cancelable) {\n event.preventDefault();\n }\n const touch = event.targetTouches[0];\n this._strokeMoveUpdate(touch);\n };\n this._handleTouchEnd = (event) => {\n const wasCanvasTouched = event.target === this.canvas;\n if (wasCanvasTouched) {\n if (event.cancelable) {\n event.preventDefault();\n }\n const touch = event.changedTouches[0];\n this._strokeEnd(touch);\n }\n };\n this._handlePointerStart = (event) => {\n event.preventDefault();\n this._strokeBegin(event);\n };\n this._handlePointerMove = (event) => {\n this._strokeMoveUpdate(event);\n };\n this._handlePointerEnd = (event) => {\n if (this._drawingStroke) {\n event.preventDefault();\n this._strokeEnd(event);\n }\n };\n this.velocityFilterWeight = options.velocityFilterWeight || 0.7;\n this.minWidth = options.minWidth || 0.5;\n this.maxWidth = options.maxWidth || 2.5;\n this.throttle = ('throttle' in options ? options.throttle : 16);\n this.minDistance = ('minDistance' in options ? options.minDistance : 5);\n this.dotSize = options.dotSize || 0;\n this.penColor = options.penColor || 'black';\n this.backgroundColor = options.backgroundColor || 'rgba(0,0,0,0)';\n this.compositeOperation = options.compositeOperation || 'source-over';\n this.canvasContextOptions = ('canvasContextOptions' in options ? options.canvasContextOptions : {});\n this._strokeMoveUpdate = this.throttle\n ? throttle(SignaturePad.prototype._strokeUpdate, this.throttle)\n : SignaturePad.prototype._strokeUpdate;\n this._ctx = canvas.getContext('2d', this.canvasContextOptions);\n this.clear();\n this.on();\n }\n clear() {\n const { _ctx: ctx, canvas } = this;\n ctx.fillStyle = this.backgroundColor;\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n this._data = [];\n this._reset(this._getPointGroupOptions());\n this._isEmpty = true;\n }\n fromDataURL(dataUrl, options = {}) {\n return new Promise((resolve, reject) => {\n const image = new Image();\n const ratio = options.ratio || window.devicePixelRatio || 1;\n const width = options.width || this.canvas.width / ratio;\n const height = options.height || this.canvas.height / ratio;\n const xOffset = options.xOffset || 0;\n const yOffset = options.yOffset || 0;\n this._reset(this._getPointGroupOptions());\n image.onload = () => {\n this._ctx.drawImage(image, xOffset, yOffset, width, height);\n resolve();\n };\n image.onerror = (error) => {\n reject(error);\n };\n image.crossOrigin = 'anonymous';\n image.src = dataUrl;\n this._isEmpty = false;\n });\n }\n toDataURL(type = 'image/png', encoderOptions) {\n switch (type) {\n case 'image/svg+xml':\n if (typeof encoderOptions !== 'object') {\n encoderOptions = undefined;\n }\n return `data:image/svg+xml;base64,${btoa(this.toSVG(encoderOptions))}`;\n default:\n if (typeof encoderOptions !== 'number') {\n encoderOptions = undefined;\n }\n return this.canvas.toDataURL(type, encoderOptions);\n }\n }\n on() {\n this.canvas.style.touchAction = 'none';\n this.canvas.style.msTouchAction = 'none';\n this.canvas.style.userSelect = 'none';\n const isIOS = /Macintosh/.test(navigator.userAgent) && 'ontouchstart' in document;\n if (window.PointerEvent && !isIOS) {\n this._handlePointerEvents();\n }\n else {\n this._handleMouseEvents();\n if ('ontouchstart' in window) {\n this._handleTouchEvents();\n }\n }\n }\n off() {\n this.canvas.style.touchAction = 'auto';\n this.canvas.style.msTouchAction = 'auto';\n this.canvas.style.userSelect = 'auto';\n this.canvas.removeEventListener('pointerdown', this._handlePointerStart);\n this.canvas.removeEventListener('pointermove', this._handlePointerMove);\n this.canvas.ownerDocument.removeEventListener('pointerup', this._handlePointerEnd);\n this.canvas.removeEventListener('mousedown', this._handleMouseDown);\n this.canvas.removeEventListener('mousemove', this._handleMouseMove);\n this.canvas.ownerDocument.removeEventListener('mouseup', this._handleMouseUp);\n this.canvas.removeEventListener('touchstart', this._handleTouchStart);\n this.canvas.removeEventListener('touchmove', this._handleTouchMove);\n this.canvas.removeEventListener('touchend', this._handleTouchEnd);\n }\n isEmpty() {\n return this._isEmpty;\n }\n fromData(pointGroups, { clear = true } = {}) {\n if (clear) {\n this.clear();\n }\n this._fromData(pointGroups, this._drawCurve.bind(this), this._drawDot.bind(this));\n this._data = this._data.concat(pointGroups);\n }\n toData() {\n return this._data;\n }\n _getPointGroupOptions(group) {\n return {\n penColor: group && 'penColor' in group ? group.penColor : this.penColor,\n dotSize: group && 'dotSize' in group ? group.dotSize : this.dotSize,\n minWidth: group && 'minWidth' in group ? group.minWidth : this.minWidth,\n maxWidth: group && 'maxWidth' in group ? group.maxWidth : this.maxWidth,\n velocityFilterWeight: group && 'velocityFilterWeight' in group\n ? group.velocityFilterWeight\n : this.velocityFilterWeight,\n compositeOperation: group && 'compositeOperation' in group\n ? group.compositeOperation\n : this.compositeOperation,\n };\n }\n _strokeBegin(event) {\n const cancelled = !this.dispatchEvent(new CustomEvent('beginStroke', { detail: event, cancelable: true }));\n if (cancelled) {\n return;\n }\n this._drawingStroke = true;\n const pointGroupOptions = this._getPointGroupOptions();\n const newPointGroup = Object.assign(Object.assign({}, pointGroupOptions), { points: [] });\n this._data.push(newPointGroup);\n this._reset(pointGroupOptions);\n this._strokeUpdate(event);\n }\n _strokeUpdate(event) {\n if (!this._drawingStroke) {\n return;\n }\n if (this._data.length === 0) {\n this._strokeBegin(event);\n return;\n }\n this.dispatchEvent(new CustomEvent('beforeUpdateStroke', { detail: event }));\n const x = event.clientX;\n const y = event.clientY;\n const pressure = event.pressure !== undefined\n ? event.pressure\n : event.force !== undefined\n ? event.force\n : 0;\n const point = this._createPoint(x, y, pressure);\n const lastPointGroup = this._data[this._data.length - 1];\n const lastPoints = lastPointGroup.points;\n const lastPoint = lastPoints.length > 0 && lastPoints[lastPoints.length - 1];\n const isLastPointTooClose = lastPoint\n ? point.distanceTo(lastPoint) <= this.minDistance\n : false;\n const pointGroupOptions = this._getPointGroupOptions(lastPointGroup);\n if (!lastPoint || !(lastPoint && isLastPointTooClose)) {\n const curve = this._addPoint(point, pointGroupOptions);\n if (!lastPoint) {\n this._drawDot(point, pointGroupOptions);\n }\n else if (curve) {\n this._drawCurve(curve, pointGroupOptions);\n }\n lastPoints.push({\n time: point.time,\n x: point.x,\n y: point.y,\n pressure: point.pressure,\n });\n }\n this.dispatchEvent(new CustomEvent('afterUpdateStroke', { detail: event }));\n }\n _strokeEnd(event) {\n if (!this._drawingStroke) {\n return;\n }\n this._strokeUpdate(event);\n this._drawingStroke = false;\n this.dispatchEvent(new CustomEvent('endStroke', { detail: event }));\n }\n _handlePointerEvents() {\n this._drawingStroke = false;\n this.canvas.addEventListener('pointerdown', this._handlePointerStart);\n this.canvas.addEventListener('pointermove', this._handlePointerMove);\n this.canvas.ownerDocument.addEventListener('pointerup', this._handlePointerEnd);\n }\n _handleMouseEvents() {\n this._drawingStroke = false;\n this.canvas.addEventListener('mousedown', this._handleMouseDown);\n this.canvas.addEventListener('mousemove', this._handleMouseMove);\n this.canvas.ownerDocument.addEventListener('mouseup', this._handleMouseUp);\n }\n _handleTouchEvents() {\n this.canvas.addEventListener('touchstart', this._handleTouchStart);\n this.canvas.addEventListener('touchmove', this._handleTouchMove);\n this.canvas.addEventListener('touchend', this._handleTouchEnd);\n }\n _reset(options) {\n this._lastPoints = [];\n this._lastVelocity = 0;\n this._lastWidth = (options.minWidth + options.maxWidth) / 2;\n this._ctx.fillStyle = options.penColor;\n this._ctx.globalCompositeOperation = options.compositeOperation;\n }\n _createPoint(x, y, pressure) {\n const rect = this.canvas.getBoundingClientRect();\n return new Point(x - rect.left, y - rect.top, pressure, new Date().getTime());\n }\n _addPoint(point, options) {\n const { _lastPoints } = this;\n _lastPoints.push(point);\n if (_lastPoints.length > 2) {\n if (_lastPoints.length === 3) {\n _lastPoints.unshift(_lastPoints[0]);\n }\n const widths = this._calculateCurveWidths(_lastPoints[1], _lastPoints[2], options);\n const curve = Bezier.fromPoints(_lastPoints, widths);\n _lastPoints.shift();\n return curve;\n }\n return null;\n }\n _calculateCurveWidths(startPoint, endPoint, options) {\n const velocity = options.velocityFilterWeight * endPoint.velocityFrom(startPoint) +\n (1 - options.velocityFilterWeight) * this._lastVelocity;\n const newWidth = this._strokeWidth(velocity, options);\n const widths = {\n end: newWidth,\n start: this._lastWidth,\n };\n this._lastVelocity = velocity;\n this._lastWidth = newWidth;\n return widths;\n }\n _strokeWidth(velocity, options) {\n return Math.max(options.maxWidth / (velocity + 1), options.minWidth);\n }\n _drawCurveSegment(x, y, width) {\n const ctx = this._ctx;\n ctx.moveTo(x, y);\n ctx.arc(x, y, width, 0, 2 * Math.PI, false);\n this._isEmpty = false;\n }\n _drawCurve(curve, options) {\n const ctx = this._ctx;\n const widthDelta = curve.endWidth - curve.startWidth;\n const drawSteps = Math.ceil(curve.length()) * 2;\n ctx.beginPath();\n ctx.fillStyle = options.penColor;\n for (let i = 0; i < drawSteps; i += 1) {\n const t = i / drawSteps;\n const tt = t * t;\n const ttt = tt * t;\n const u = 1 - t;\n const uu = u * u;\n const uuu = uu * u;\n let x = uuu * curve.startPoint.x;\n x += 3 * uu * t * curve.control1.x;\n x += 3 * u * tt * curve.control2.x;\n x += ttt * curve.endPoint.x;\n let y = uuu * curve.startPoint.y;\n y += 3 * uu * t * curve.control1.y;\n y += 3 * u * tt * curve.control2.y;\n y += ttt * curve.endPoint.y;\n const width = Math.min(curve.startWidth + ttt * widthDelta, options.maxWidth);\n this._drawCurveSegment(x, y, width);\n }\n ctx.closePath();\n ctx.fill();\n }\n _drawDot(point, options) {\n const ctx = this._ctx;\n const width = options.dotSize > 0\n ? options.dotSize\n : (options.minWidth + options.maxWidth) / 2;\n ctx.beginPath();\n this._drawCurveSegment(point.x, point.y, width);\n ctx.closePath();\n ctx.fillStyle = options.penColor;\n ctx.fill();\n }\n _fromData(pointGroups, drawCurve, drawDot) {\n for (const group of pointGroups) {\n const { points } = group;\n const pointGroupOptions = this._getPointGroupOptions(group);\n if (points.length > 1) {\n for (let j = 0; j < points.length; j += 1) {\n const basicPoint = points[j];\n const point = new Point(basicPoint.x, basicPoint.y, basicPoint.pressure, basicPoint.time);\n if (j === 0) {\n this._reset(pointGroupOptions);\n }\n const curve = this._addPoint(point, pointGroupOptions);\n if (curve) {\n drawCurve(curve, pointGroupOptions);\n }\n }\n }\n else {\n this._reset(pointGroupOptions);\n drawDot(points[0], pointGroupOptions);\n }\n }\n }\n toSVG({ includeBackgroundColor = false } = {}) {\n const pointGroups = this._data;\n const ratio = Math.max(window.devicePixelRatio || 1, 1);\n const minX = 0;\n const minY = 0;\n const maxX = this.canvas.width / ratio;\n const maxY = this.canvas.height / ratio;\n const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n svg.setAttribute('xmlns', 'http://www.w3.org/2000/svg');\n svg.setAttribute('xmlns:xlink', 'http://www.w3.org/1999/xlink');\n svg.setAttribute('viewBox', `${minX} ${minY} ${maxX} ${maxY}`);\n svg.setAttribute('width', maxX.toString());\n svg.setAttribute('height', maxY.toString());\n if (includeBackgroundColor && this.backgroundColor) {\n const rect = document.createElement('rect');\n rect.setAttribute('width', '100%');\n rect.setAttribute('height', '100%');\n rect.setAttribute('fill', this.backgroundColor);\n svg.appendChild(rect);\n }\n this._fromData(pointGroups, (curve, { penColor }) => {\n const path = document.createElement('path');\n if (!isNaN(curve.control1.x) &&\n !isNaN(curve.control1.y) &&\n !isNaN(curve.control2.x) &&\n !isNaN(curve.control2.y)) {\n const attr = `M ${curve.startPoint.x.toFixed(3)},${curve.startPoint.y.toFixed(3)} ` +\n `C ${curve.control1.x.toFixed(3)},${curve.control1.y.toFixed(3)} ` +\n `${curve.control2.x.toFixed(3)},${curve.control2.y.toFixed(3)} ` +\n `${curve.endPoint.x.toFixed(3)},${curve.endPoint.y.toFixed(3)}`;\n path.setAttribute('d', attr);\n path.setAttribute('stroke-width', (curve.endWidth * 2.25).toFixed(3));\n path.setAttribute('stroke', penColor);\n path.setAttribute('fill', 'none');\n path.setAttribute('stroke-linecap', 'round');\n svg.appendChild(path);\n }\n }, (point, { penColor, dotSize, minWidth, maxWidth }) => {\n const circle = document.createElement('circle');\n const size = dotSize > 0 ? dotSize : (minWidth + maxWidth) / 2;\n circle.setAttribute('r', size.toString());\n circle.setAttribute('cx', point.x.toString());\n circle.setAttribute('cy', point.y.toString());\n circle.setAttribute('fill', penColor);\n svg.appendChild(circle);\n });\n return svg.outerHTML;\n }\n}\n\n\n//# sourceMappingURL=signature_pad.js.map\n\n\n//# sourceURL=webpack://Formio/./node_modules/signature_pad/dist/signature_pad.js?");
6588
6588
 
6589
6589
  /***/ }),
6590
6590
 
@@ -10455,7 +10455,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nfunc
10455
10455
  /***/ (function(__unused_webpack_module, exports) {
10456
10456
 
10457
10457
  "use strict";
10458
- eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.withRetries = void 0;\nfunction withRetries(fn_1, args_1) {\n return __awaiter(this, arguments, void 0, function* (fn, args, retries = 3, err = null) {\n if (!retries) {\n throw new Error(err);\n }\n return fn(...args).catch(() => withRetries(fn, args, retries - 1, err));\n });\n}\nexports.withRetries = withRetries;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/providers/storage/util.js?");
10458
+ eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.withRetries = void 0;\nfunction withRetries(fn, args, retries = 3, err = null) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!retries) {\n throw new Error(err);\n }\n return fn(...args).catch(() => withRetries(fn, args, retries - 1, err));\n });\n}\nexports.withRetries = withRetries;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/providers/storage/util.js?");
10459
10459
 
10460
10460
  /***/ }),
10461
10461
 
@@ -10664,7 +10664,7 @@ eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {
10664
10664
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
10665
10665
 
10666
10666
  "use strict";
10667
- eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst ConditionOperator_1 = __importDefault(__webpack_require__(/*! ./ConditionOperator */ \"./lib/cjs/utils/conditionOperators/ConditionOperator.js\"));\nconst lodash_1 = __importDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nconst utils_1 = __webpack_require__(/*! ../utils */ \"./lib/cjs/utils/utils.js\");\nclass IsEqualTo extends ConditionOperator_1.default {\n static get operatorKey() {\n return 'isEqual';\n }\n static get displayedName() {\n return 'Is Equal To';\n }\n execute({ value, comparedValue, instance, conditionComponentPath }) {\n var _a;\n if (value && comparedValue && typeof value !== typeof comparedValue && lodash_1.default.isString(comparedValue)) {\n try {\n comparedValue = JSON.parse(comparedValue);\n }\n // eslint-disable-next-line no-empty\n catch (e) { }\n }\n if (instance && instance.root) {\n const conditionTriggerComponent = instance.root.getComponent(conditionComponentPath);\n if (conditionTriggerComponent\n && (0, utils_1.isSelectResourceWithObjectValue)(conditionTriggerComponent.component)\n && ((_a = conditionTriggerComponent.component) === null || _a === void 0 ? void 0 : _a.template)) {\n if (!value || !lodash_1.default.isPlainObject(value)) {\n return false;\n }\n const { template, valueProperty } = conditionTriggerComponent.component;\n if (valueProperty === 'data') {\n value = { data: value };\n comparedValue = { data: comparedValue };\n }\n return lodash_1.default.every((0, utils_1.getItemTemplateKeys)(template) || [], k => lodash_1.default.isEqual(lodash_1.default.get(value, k), lodash_1.default.get(comparedValue, k)));\n }\n }\n //special check for select boxes\n if (lodash_1.default.isObject(value) && comparedValue && lodash_1.default.isBoolean(value[comparedValue])) {\n return value[comparedValue];\n }\n return lodash_1.default.isEqual(value, comparedValue);\n }\n}\nexports[\"default\"] = IsEqualTo;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/utils/conditionOperators/IsEqualTo.js?");
10667
+ eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nconst ConditionOperator_1 = __importDefault(__webpack_require__(/*! ./ConditionOperator */ \"./lib/cjs/utils/conditionOperators/ConditionOperator.js\"));\nconst lodash_1 = __importDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nconst utils_1 = __webpack_require__(/*! ../utils */ \"./lib/cjs/utils/utils.js\");\nclass IsEqualTo extends ConditionOperator_1.default {\n static get operatorKey() {\n return 'isEqual';\n }\n static get displayedName() {\n return 'Is Equal To';\n }\n execute({ value, comparedValue, instance, conditionComponentPath }) {\n var _a;\n if ((value || value === false) && comparedValue && typeof value !== typeof comparedValue && lodash_1.default.isString(comparedValue)) {\n try {\n comparedValue = JSON.parse(comparedValue);\n }\n // eslint-disable-next-line no-empty\n catch (e) { }\n }\n if (instance && instance.root) {\n const conditionTriggerComponent = instance.root.getComponent(conditionComponentPath);\n if (conditionTriggerComponent\n && (0, utils_1.isSelectResourceWithObjectValue)(conditionTriggerComponent.component)\n && ((_a = conditionTriggerComponent.component) === null || _a === void 0 ? void 0 : _a.template)) {\n if (!value || !lodash_1.default.isPlainObject(value)) {\n return false;\n }\n const { template, valueProperty } = conditionTriggerComponent.component;\n if (valueProperty === 'data') {\n value = { data: value };\n comparedValue = { data: comparedValue };\n }\n return lodash_1.default.every((0, utils_1.getItemTemplateKeys)(template) || [], k => lodash_1.default.isEqual(lodash_1.default.get(value, k), lodash_1.default.get(comparedValue, k)));\n }\n }\n //special check for select boxes\n if (lodash_1.default.isObject(value) && comparedValue && lodash_1.default.isBoolean(value[comparedValue])) {\n return value[comparedValue];\n }\n return lodash_1.default.isEqual(value, comparedValue);\n }\n}\nexports[\"default\"] = IsEqualTo;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/utils/conditionOperators/IsEqualTo.js?");
10668
10668
 
10669
10669
  /***/ }),
10670
10670
 
@@ -12409,7 +12409,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexpo
12409
12409
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
12410
12410
 
12411
12411
  "use strict";
12412
- eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nvar _a;\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.FormBuilder = exports.Form = exports.Formio = void 0;\nconst CDN_js_1 = __importDefault(__webpack_require__(/*! ./CDN.js */ \"./lib/cjs/CDN.js\"));\nclass Formio {\n static setLicense(license, norecurse = false) {\n _a.license = license;\n if (!norecurse && _a.FormioClass) {\n _a.FormioClass.setLicense(license);\n }\n }\n static setBaseUrl(url, norecurse = false) {\n _a.baseUrl = url;\n if (!norecurse && _a.FormioClass) {\n _a.FormioClass.setBaseUrl(url);\n }\n }\n static setApiUrl(url, norecurse = false) {\n _a.baseUrl = url;\n if (!norecurse && _a.FormioClass) {\n _a.FormioClass.setApiUrl(url);\n }\n }\n static setProjectUrl(url, norecurse = false) {\n _a.projectUrl = url;\n if (!norecurse && _a.FormioClass) {\n _a.FormioClass.setProjectUrl(url);\n }\n }\n static setAppUrl(url, norecurse = false) {\n _a.projectUrl = url;\n if (!norecurse && _a.FormioClass) {\n _a.FormioClass.setAppUrl(url);\n }\n }\n static setPathType(type, norecurse = false) {\n _a.pathType = type;\n if (!norecurse && _a.FormioClass) {\n _a.FormioClass.setPathType(type);\n }\n }\n static debug(...args) {\n if (_a.config.debug) {\n console.log(...args);\n }\n }\n static clearCache() {\n if (_a.FormioClass) {\n _a.FormioClass.clearCache();\n }\n }\n static global(prop, flag = '') {\n const globalValue = window[prop];\n if (flag && globalValue && !globalValue[flag]) {\n return null;\n }\n _a.debug(`Getting global ${prop}`, globalValue);\n return globalValue;\n }\n static use(module) {\n if (_a.FormioClass && _a.FormioClass.isRenderer) {\n _a.FormioClass.use(module);\n }\n else {\n _a.modules.push(module);\n }\n }\n static createElement(type, attrs, children) {\n const element = document.createElement(type);\n Object.keys(attrs).forEach(key => {\n element.setAttribute(key, attrs[key]);\n });\n (children || []).forEach(child => {\n element.appendChild(_a.createElement(child.tag, child.attrs, child.children));\n });\n return element;\n }\n static addScript(wrapper_1, src_1, name_1) {\n return __awaiter(this, arguments, void 0, function* (wrapper, src, name, flag = '') {\n if (!src) {\n return Promise.resolve();\n }\n if (typeof src !== 'string' && src.length) {\n return Promise.all(src.map(ref => _a.addScript(wrapper, ref)));\n }\n if (name && _a.global(name, flag)) {\n _a.debug(`${name} already loaded.`);\n return Promise.resolve(_a.global(name));\n }\n _a.debug('Adding Script', src);\n try {\n wrapper.appendChild(_a.createElement('script', {\n src\n }));\n }\n catch (err) {\n _a.debug(err);\n return Promise.resolve();\n }\n if (!name) {\n return Promise.resolve();\n }\n return new Promise((resolve) => {\n _a.debug(`Waiting to load ${name}`);\n const wait = setInterval(() => {\n if (_a.global(name, flag)) {\n clearInterval(wait);\n _a.debug(`${name} loaded.`);\n resolve(_a.global(name));\n }\n }, 100);\n });\n });\n }\n static addStyles(wrapper, href) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!href) {\n return;\n }\n if (typeof href !== 'string' && href.length) {\n href.forEach(ref => _a.addStyles(wrapper, ref));\n return;\n }\n _a.debug('Adding Styles', href);\n wrapper.appendChild(_a.createElement('link', {\n rel: 'stylesheet',\n href\n }));\n });\n }\n static submitDone(instance, submission) {\n return __awaiter(this, void 0, void 0, function* () {\n _a.debug('Submision Complete', submission);\n const successMessage = (_a.config.success || '').toString();\n if (successMessage && successMessage.toLowerCase() !== 'false' && instance.element) {\n instance.element.innerHTML = `<div class=\"alert-success\" role=\"alert\">${successMessage}</div>`;\n }\n let returnUrl = _a.config.redirect;\n // Allow form based configuration for return url.\n if (!returnUrl &&\n (instance._form &&\n instance._form.settings &&\n (instance._form.settings.returnUrl ||\n instance._form.settings.redirect))) {\n _a.debug('Return url found in form configuration');\n returnUrl = instance._form.settings.returnUrl || instance._form.settings.redirect;\n }\n if (returnUrl) {\n const formSrc = instance.formio ? instance.formio.formUrl : '';\n const hasQuery = !!returnUrl.match(/\\?/);\n const isOrigin = returnUrl.indexOf(location.origin) === 0;\n returnUrl += hasQuery ? '&' : '?';\n returnUrl += `sub=${submission._id}`;\n if (!isOrigin && formSrc) {\n returnUrl += `&form=${encodeURIComponent(formSrc)}`;\n }\n _a.debug('Return URL', returnUrl);\n window.location.href = returnUrl;\n if (isOrigin) {\n window.location.reload();\n }\n }\n });\n }\n // Return the full script if the builder is being used.\n static formioScript(script, builder) {\n builder = builder || _a.config.includeBuilder;\n if (_a.fullAdded || builder) {\n _a.fullAdded = true;\n return script.replace('formio.form', 'formio.full');\n }\n return script;\n }\n static addLibrary(wrapper, lib, name) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!lib) {\n return;\n }\n if (lib.dependencies) {\n for (let i = 0; i < lib.dependencies.length; i++) {\n yield _a.addLibrary(wrapper, _a.cdn.libs[lib.dependencies[i]]);\n }\n }\n if (lib.css) {\n yield _a.addStyles(wrapper, lib.css);\n }\n if (lib.js) {\n const module = yield _a.addScript(wrapper, lib.js, lib.use ? name : false);\n if (lib.use) {\n _a.debug(`Using ${name}`);\n const options = lib.options || {};\n if (!options.license && _a.license) {\n options.license = _a.license;\n }\n _a.use((typeof lib.use === 'function' ? lib.use(module) : module), options);\n }\n }\n });\n }\n static addLoader(wrapper) {\n return __awaiter(this, void 0, void 0, function* () {\n wrapper.appendChild(_a.createElement('div', {\n 'class': 'formio-loader'\n }, [{\n tag: 'div',\n attrs: {\n class: 'loader-wrapper'\n },\n children: [{\n tag: 'div',\n attrs: {\n class: 'loader text-center'\n }\n }]\n }]));\n });\n }\n // eslint-disable-next-line max-statements\n static init(element_1) {\n return __awaiter(this, arguments, void 0, function* (element, options = {}, builder = false) {\n _a.cdn = new CDN_js_1.default(_a.config.cdn, _a.config.cdnUrls || {});\n _a.config.libs = _a.config.libs || {\n uswds: {\n dependencies: ['fontawesome'],\n js: `${_a.cdn.uswds}/uswds.min.js`,\n css: `${_a.cdn.uswds}/uswds.min.css`,\n use: true\n },\n fontawesome: {\n css: `${_a.cdn['font-awesome']}/css/font-awesome.min.css`\n },\n bootstrap4: {\n dependencies: ['fontawesome'],\n css: `${_a.cdn.bootstrap4}/css/bootstrap.min.css`\n },\n bootstrap: {\n dependencies: ['bootstrap-icons'],\n css: `${_a.cdn.bootstrap}/css/bootstrap.min.css`\n },\n 'bootstrap-icons': {\n css: `${_a.cdn['bootstrap-icons']}/css/bootstrap-icons.css`\n }\n };\n const id = _a.config.id || `formio-${Math.random().toString(36).substring(7)}`;\n // Create a new wrapper and add the element inside of a new wrapper.\n let wrapper = _a.createElement('div', {\n 'id': `${id}-wrapper`\n });\n element.parentNode.insertBefore(wrapper, element);\n // If we include the libraries, then we will attempt to run this in shadow dom.\n const useShadowDom = _a.config.includeLibs && (typeof wrapper.attachShadow === 'function');\n if (useShadowDom) {\n wrapper = wrapper.attachShadow({\n mode: 'open'\n });\n options.shadowRoot = wrapper;\n }\n element.parentNode.removeChild(element);\n wrapper.appendChild(element);\n // If this is inside of shadow dom, then we need to add the styles and scripts to the shadow dom.\n const libWrapper = useShadowDom ? wrapper : document.body;\n // Load the renderer styles.\n yield _a.addStyles(libWrapper, _a.config.embedCSS || `${_a.cdn.js}/formio.embed.css`);\n // Add a loader.\n _a.addLoader(wrapper);\n const formioSrc = _a.config.full ? 'formio.full' : 'formio.form';\n const renderer = _a.config.debug ? formioSrc : `${formioSrc}.min`;\n _a.FormioClass = yield _a.addScript(libWrapper, _a.formioScript(_a.config.script || `${_a.cdn.js}/${renderer}.js`, builder), 'Formio', builder ? 'isBuilder' : 'isRenderer');\n _a.FormioClass.cdn = _a.cdn;\n _a.FormioClass.setBaseUrl(options.baseUrl || _a.baseUrl || _a.config.base);\n _a.FormioClass.setProjectUrl(options.projectUrl || _a.projectUrl || _a.config.project);\n _a.FormioClass.language = _a.language;\n _a.setLicense(_a.license || _a.config.license || false);\n _a.modules.forEach((module) => {\n _a.FormioClass.use(module);\n });\n if (_a.icons) {\n _a.FormioClass.icons = _a.icons;\n }\n if (_a.pathType) {\n _a.FormioClass.setPathType(_a.pathType);\n }\n // Add libraries if they wish to include the libs.\n if (_a.config.template && _a.config.includeLibs) {\n yield _a.addLibrary(libWrapper, _a.config.libs[_a.config.template], _a.config.template);\n }\n // Add the premium modules.\n if (_a.config.premium) {\n _a.config.modules.premium = _a.config.premium;\n }\n // Allow adding dynamic modules.\n if (_a.config.modules) {\n for (const name in _a.config.modules) {\n const lib = _a.config.modules[name];\n lib.use = lib.use || true;\n yield _a.addLibrary(libWrapper, lib, name);\n }\n }\n yield _a.addStyles(libWrapper, _a.formioScript(_a.config.style || `${_a.cdn.js}/${renderer}.css`, builder));\n if (_a.config.before) {\n yield _a.config.before(_a.FormioClass, element, _a.config);\n }\n _a.FormioClass.license = true;\n _a._formioReady(_a.FormioClass);\n return wrapper;\n });\n }\n // Called after an instance has been created.\n static afterCreate(instance, wrapper, readyEvent) {\n return __awaiter(this, void 0, void 0, function* () {\n const loader = wrapper.querySelector('.formio-loader');\n if (loader) {\n wrapper.removeChild(loader);\n }\n _a.FormioClass.events.emit(readyEvent, instance);\n if (_a.config.after) {\n _a.debug('Calling ready callback');\n _a.config.after(instance, _a.config);\n }\n return instance;\n });\n }\n // Create a new form.\n static createForm(element_1, form_1) {\n return __awaiter(this, arguments, void 0, function* (element, form, options = {}) {\n if (_a.FormioClass) {\n return _a.FormioClass.createForm(element, form, Object.assign(Object.assign({}, options), { noLoader: true }));\n }\n const wrapper = yield _a.init(element, options);\n return _a.FormioClass.createForm(element, form, Object.assign(Object.assign({}, options), { noLoader: true })).then((instance) => {\n // Set the default submission data.\n if (_a.config.submission) {\n _a.debug('Setting submission', _a.config.submission);\n instance.submission = _a.config.submission;\n }\n // Call the after create method.\n _a.afterCreate(instance, wrapper, 'formEmbedded');\n return instance;\n });\n });\n }\n // Create a form builder.\n static builder(element_1, form_1) {\n return __awaiter(this, arguments, void 0, function* (element, form, options = {}) {\n var _a;\n if ((_a = _a.FormioClass) === null || _a === void 0 ? void 0 : _a.builder) {\n return _a.FormioClass.builder(element, form, options);\n }\n const wrapper = yield _a.init(element, options, true);\n return _a.FormioClass.builder(element, form, options).then((instance) => {\n _a.afterCreate(instance, wrapper, 'builderEmbedded');\n return instance;\n });\n });\n }\n}\nexports.Formio = Formio;\n_a = Formio;\nFormio.FormioClass = null;\nFormio.config = {};\nFormio.modules = [];\nFormio.icons = '';\nFormio.license = '';\nFormio.formioReady = new Promise((ready, reject) => {\n _a._formioReady = ready;\n _a._formioReadyReject = reject;\n});\nFormio.version = '5.0.0-rc.40';\n// Create a report.\nFormio.Report = {\n create: (element_1, submission_1, ...args_1) => __awaiter(void 0, [element_1, submission_1, ...args_1], void 0, function* (element, submission, options = {}) {\n var _b;\n if ((_b = _a.FormioClass) === null || _b === void 0 ? void 0 : _b.Report) {\n return _a.FormioClass.Report.create(element, submission, options);\n }\n const wrapper = yield _a.init(element, options, true);\n return _a.FormioClass.Report.create(element, submission, options).then((instance) => {\n _a.afterCreate(instance, wrapper, 'reportEmbedded');\n return instance;\n });\n })\n};\nCDN_js_1.default.defaultCDN = Formio.version.includes('rc') ? 'https://cdn.test-form.io' : 'https://cdn.form.io';\nclass Form {\n constructor(element, form, options) {\n this.form = form;\n this.element = element;\n this.options = options || {};\n this.init();\n this.instance = {\n proxy: true,\n ready: this.ready,\n destroy: () => { }\n };\n }\n init() {\n if (this.instance && !this.instance.proxy) {\n this.instance.destroy();\n }\n this.element.innerHTML = '';\n this.ready = this.create().then((instance) => {\n this.instance = instance;\n this.form = instance.form;\n return instance;\n });\n }\n create() {\n return Formio.createForm(this.element, this.form, this.options);\n }\n setForm(form) {\n this.form = form;\n if (this.instance) {\n this.instance.setForm(form);\n }\n }\n setDisplay(display) {\n if (this.instance.proxy) {\n return this.ready;\n }\n this.form.display = display;\n this.instance.destroy();\n this.ready = this.create().then((instance) => {\n this.instance = instance;\n this.setForm(this.form);\n });\n return this.ready;\n }\n}\nexports.Form = Form;\nclass FormBuilder extends Form {\n create() {\n return Formio.builder(this.element, this.form, this.options);\n }\n}\nexports.FormBuilder = FormBuilder;\nFormio.Form = Form;\nFormio.FormBuilder = FormBuilder;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/Embed.js?");
12412
+ eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nvar _a;\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.FormBuilder = exports.Form = exports.Formio = void 0;\nconst CDN_js_1 = __importDefault(__webpack_require__(/*! ./CDN.js */ \"./lib/cjs/CDN.js\"));\nclass Formio {\n static setLicense(license, norecurse = false) {\n _a.license = license;\n if (!norecurse && _a.FormioClass) {\n _a.FormioClass.setLicense(license);\n }\n }\n static setBaseUrl(url, norecurse = false) {\n _a.baseUrl = url;\n if (!norecurse && _a.FormioClass) {\n _a.FormioClass.setBaseUrl(url);\n }\n }\n static setApiUrl(url, norecurse = false) {\n _a.baseUrl = url;\n if (!norecurse && _a.FormioClass) {\n _a.FormioClass.setApiUrl(url);\n }\n }\n static setProjectUrl(url, norecurse = false) {\n _a.projectUrl = url;\n if (!norecurse && _a.FormioClass) {\n _a.FormioClass.setProjectUrl(url);\n }\n }\n static setAppUrl(url, norecurse = false) {\n _a.projectUrl = url;\n if (!norecurse && _a.FormioClass) {\n _a.FormioClass.setAppUrl(url);\n }\n }\n static setPathType(type, norecurse = false) {\n _a.pathType = type;\n if (!norecurse && _a.FormioClass) {\n _a.FormioClass.setPathType(type);\n }\n }\n static debug(...args) {\n if (_a.config.debug) {\n console.log(...args);\n }\n }\n static clearCache() {\n if (_a.FormioClass) {\n _a.FormioClass.clearCache();\n }\n }\n static global(prop, flag = '') {\n const globalValue = window[prop];\n if (flag && globalValue && !globalValue[flag]) {\n return null;\n }\n _a.debug(`Getting global ${prop}`, globalValue);\n return globalValue;\n }\n static use(module) {\n if (_a.FormioClass && _a.FormioClass.isRenderer) {\n _a.FormioClass.use(module);\n }\n else {\n _a.modules.push(module);\n }\n }\n static createElement(type, attrs, children) {\n const element = document.createElement(type);\n Object.keys(attrs).forEach(key => {\n element.setAttribute(key, attrs[key]);\n });\n (children || []).forEach(child => {\n element.appendChild(_a.createElement(child.tag, child.attrs, child.children));\n });\n return element;\n }\n static addScript(wrapper, src, name, flag = '') {\n return __awaiter(this, void 0, void 0, function* () {\n if (!src) {\n return Promise.resolve();\n }\n if (typeof src !== 'string' && src.length) {\n return Promise.all(src.map(ref => _a.addScript(wrapper, ref)));\n }\n if (name && _a.global(name, flag)) {\n _a.debug(`${name} already loaded.`);\n return Promise.resolve(_a.global(name));\n }\n _a.debug('Adding Script', src);\n try {\n wrapper.appendChild(_a.createElement('script', {\n src\n }));\n }\n catch (err) {\n _a.debug(err);\n return Promise.resolve();\n }\n if (!name) {\n return Promise.resolve();\n }\n return new Promise((resolve) => {\n _a.debug(`Waiting to load ${name}`);\n const wait = setInterval(() => {\n if (_a.global(name, flag)) {\n clearInterval(wait);\n _a.debug(`${name} loaded.`);\n resolve(_a.global(name));\n }\n }, 100);\n });\n });\n }\n static addStyles(wrapper, href) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!href) {\n return;\n }\n if (typeof href !== 'string' && href.length) {\n href.forEach(ref => _a.addStyles(wrapper, ref));\n return;\n }\n _a.debug('Adding Styles', href);\n wrapper.appendChild(_a.createElement('link', {\n rel: 'stylesheet',\n href\n }));\n });\n }\n static submitDone(instance, submission) {\n return __awaiter(this, void 0, void 0, function* () {\n _a.debug('Submision Complete', submission);\n const successMessage = (_a.config.success || '').toString();\n if (successMessage && successMessage.toLowerCase() !== 'false' && instance.element) {\n instance.element.innerHTML = `<div class=\"alert-success\" role=\"alert\">${successMessage}</div>`;\n }\n let returnUrl = _a.config.redirect;\n // Allow form based configuration for return url.\n if (!returnUrl &&\n (instance._form &&\n instance._form.settings &&\n (instance._form.settings.returnUrl ||\n instance._form.settings.redirect))) {\n _a.debug('Return url found in form configuration');\n returnUrl = instance._form.settings.returnUrl || instance._form.settings.redirect;\n }\n if (returnUrl) {\n const formSrc = instance.formio ? instance.formio.formUrl : '';\n const hasQuery = !!returnUrl.match(/\\?/);\n const isOrigin = returnUrl.indexOf(location.origin) === 0;\n returnUrl += hasQuery ? '&' : '?';\n returnUrl += `sub=${submission._id}`;\n if (!isOrigin && formSrc) {\n returnUrl += `&form=${encodeURIComponent(formSrc)}`;\n }\n _a.debug('Return URL', returnUrl);\n window.location.href = returnUrl;\n if (isOrigin) {\n window.location.reload();\n }\n }\n });\n }\n // Return the full script if the builder is being used.\n static formioScript(script, builder) {\n builder = builder || _a.config.includeBuilder;\n if (_a.fullAdded || builder) {\n _a.fullAdded = true;\n return script.replace('formio.form', 'formio.full');\n }\n return script;\n }\n static addLibrary(wrapper, lib, name) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!lib) {\n return;\n }\n if (lib.dependencies) {\n for (let i = 0; i < lib.dependencies.length; i++) {\n yield _a.addLibrary(wrapper, _a.cdn.libs[lib.dependencies[i]]);\n }\n }\n if (lib.css) {\n yield _a.addStyles(wrapper, lib.css);\n }\n if (lib.js) {\n const module = yield _a.addScript(wrapper, lib.js, lib.use ? name : false);\n if (lib.use) {\n _a.debug(`Using ${name}`);\n const options = lib.options || {};\n if (!options.license && _a.license) {\n options.license = _a.license;\n }\n _a.use((typeof lib.use === 'function' ? lib.use(module) : module), options);\n }\n }\n });\n }\n static addLoader(wrapper) {\n return __awaiter(this, void 0, void 0, function* () {\n wrapper.appendChild(_a.createElement('div', {\n 'class': 'formio-loader'\n }, [{\n tag: 'div',\n attrs: {\n class: 'loader-wrapper'\n },\n children: [{\n tag: 'div',\n attrs: {\n class: 'loader text-center'\n }\n }]\n }]));\n });\n }\n // eslint-disable-next-line max-statements\n static init(element, options = {}, builder = false) {\n return __awaiter(this, void 0, void 0, function* () {\n _a.cdn = new CDN_js_1.default(_a.config.cdn, _a.config.cdnUrls || {});\n _a.config.libs = _a.config.libs || {\n uswds: {\n dependencies: ['fontawesome'],\n js: `${_a.cdn.uswds}/uswds.min.js`,\n css: `${_a.cdn.uswds}/uswds.min.css`,\n use: true\n },\n fontawesome: {\n css: `${_a.cdn['font-awesome']}/css/font-awesome.min.css`\n },\n bootstrap4: {\n dependencies: ['fontawesome'],\n css: `${_a.cdn.bootstrap4}/css/bootstrap.min.css`\n },\n bootstrap: {\n dependencies: ['bootstrap-icons'],\n css: `${_a.cdn.bootstrap}/css/bootstrap.min.css`\n },\n 'bootstrap-icons': {\n css: `${_a.cdn['bootstrap-icons']}/css/bootstrap-icons.css`\n }\n };\n const id = _a.config.id || `formio-${Math.random().toString(36).substring(7)}`;\n // Create a new wrapper and add the element inside of a new wrapper.\n let wrapper = _a.createElement('div', {\n 'id': `${id}-wrapper`\n });\n element.parentNode.insertBefore(wrapper, element);\n // If we include the libraries, then we will attempt to run this in shadow dom.\n const useShadowDom = _a.config.includeLibs && (typeof wrapper.attachShadow === 'function');\n if (useShadowDom) {\n wrapper = wrapper.attachShadow({\n mode: 'open'\n });\n options.shadowRoot = wrapper;\n }\n element.parentNode.removeChild(element);\n wrapper.appendChild(element);\n // If this is inside of shadow dom, then we need to add the styles and scripts to the shadow dom.\n const libWrapper = useShadowDom ? wrapper : document.body;\n // Load the renderer styles.\n yield _a.addStyles(libWrapper, _a.config.embedCSS || `${_a.cdn.js}/formio.embed.css`);\n // Add a loader.\n _a.addLoader(wrapper);\n const formioSrc = _a.config.full ? 'formio.full' : 'formio.form';\n const renderer = _a.config.debug ? formioSrc : `${formioSrc}.min`;\n _a.FormioClass = yield _a.addScript(libWrapper, _a.formioScript(_a.config.script || `${_a.cdn.js}/${renderer}.js`, builder), 'Formio', builder ? 'isBuilder' : 'isRenderer');\n _a.FormioClass.cdn = _a.cdn;\n _a.FormioClass.setBaseUrl(options.baseUrl || _a.baseUrl || _a.config.base);\n _a.FormioClass.setProjectUrl(options.projectUrl || _a.projectUrl || _a.config.project);\n _a.FormioClass.language = _a.language;\n _a.setLicense(_a.license || _a.config.license || false);\n _a.modules.forEach((module) => {\n _a.FormioClass.use(module);\n });\n if (_a.icons) {\n _a.FormioClass.icons = _a.icons;\n }\n if (_a.pathType) {\n _a.FormioClass.setPathType(_a.pathType);\n }\n // Add libraries if they wish to include the libs.\n if (_a.config.template && _a.config.includeLibs) {\n yield _a.addLibrary(libWrapper, _a.config.libs[_a.config.template], _a.config.template);\n }\n // Add the premium modules.\n if (_a.config.premium) {\n _a.config.modules.premium = _a.config.premium;\n }\n // Allow adding dynamic modules.\n if (_a.config.modules) {\n for (const name in _a.config.modules) {\n const lib = _a.config.modules[name];\n lib.use = lib.use || true;\n yield _a.addLibrary(libWrapper, lib, name);\n }\n }\n yield _a.addStyles(libWrapper, _a.formioScript(_a.config.style || `${_a.cdn.js}/${renderer}.css`, builder));\n if (_a.config.before) {\n yield _a.config.before(_a.FormioClass, element, _a.config);\n }\n _a.FormioClass.license = true;\n _a._formioReady(_a.FormioClass);\n return wrapper;\n });\n }\n // Called after an instance has been created.\n static afterCreate(instance, wrapper, readyEvent) {\n return __awaiter(this, void 0, void 0, function* () {\n const loader = wrapper.querySelector('.formio-loader');\n if (loader) {\n wrapper.removeChild(loader);\n }\n _a.FormioClass.events.emit(readyEvent, instance);\n if (_a.config.after) {\n _a.debug('Calling ready callback');\n _a.config.after(instance, _a.config);\n }\n return instance;\n });\n }\n // Create a new form.\n static createForm(element, form, options = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n if (_a.FormioClass) {\n return _a.FormioClass.createForm(element, form, Object.assign(Object.assign({}, options), { noLoader: true }));\n }\n const wrapper = yield _a.init(element, options);\n return _a.FormioClass.createForm(element, form, Object.assign(Object.assign({}, options), { noLoader: true })).then((instance) => {\n // Set the default submission data.\n if (_a.config.submission) {\n _a.debug('Setting submission', _a.config.submission);\n instance.submission = _a.config.submission;\n }\n // Call the after create method.\n _a.afterCreate(instance, wrapper, 'formEmbedded');\n return instance;\n });\n });\n }\n // Create a form builder.\n static builder(element, form, options = {}) {\n var _b;\n return __awaiter(this, void 0, void 0, function* () {\n if ((_b = _a.FormioClass) === null || _b === void 0 ? void 0 : _b.builder) {\n return _a.FormioClass.builder(element, form, options);\n }\n const wrapper = yield _a.init(element, options, true);\n return _a.FormioClass.builder(element, form, options).then((instance) => {\n _a.afterCreate(instance, wrapper, 'builderEmbedded');\n return instance;\n });\n });\n }\n}\nexports.Formio = Formio;\n_a = Formio;\nFormio.FormioClass = null;\nFormio.config = {};\nFormio.modules = [];\nFormio.icons = '';\nFormio.license = '';\nFormio.formioReady = new Promise((ready, reject) => {\n _a._formioReady = ready;\n _a._formioReadyReject = reject;\n});\nFormio.version = '5.0.0-rc.41';\n// Create a report.\nFormio.Report = {\n create: (element, submission, options = {}) => __awaiter(void 0, void 0, void 0, function* () {\n var _b;\n if ((_b = _a.FormioClass) === null || _b === void 0 ? void 0 : _b.Report) {\n return _a.FormioClass.Report.create(element, submission, options);\n }\n const wrapper = yield _a.init(element, options, true);\n return _a.FormioClass.Report.create(element, submission, options).then((instance) => {\n _a.afterCreate(instance, wrapper, 'reportEmbedded');\n return instance;\n });\n })\n};\nCDN_js_1.default.defaultCDN = Formio.version.includes('rc') ? 'https://cdn.test-form.io' : 'https://cdn.form.io';\nclass Form {\n constructor(element, form, options) {\n this.form = form;\n this.element = element;\n this.options = options || {};\n this.init();\n this.instance = {\n proxy: true,\n ready: this.ready,\n destroy: () => { }\n };\n }\n init() {\n if (this.instance && !this.instance.proxy) {\n this.instance.destroy();\n }\n this.element.innerHTML = '';\n this.ready = this.create().then((instance) => {\n this.instance = instance;\n this.form = instance.form;\n return instance;\n });\n }\n create() {\n return Formio.createForm(this.element, this.form, this.options);\n }\n setForm(form) {\n this.form = form;\n if (this.instance) {\n this.instance.setForm(form);\n }\n }\n setDisplay(display) {\n if (this.instance.proxy) {\n return this.ready;\n }\n this.form.display = display;\n this.instance.destroy();\n this.ready = this.create().then((instance) => {\n this.instance = instance;\n this.setForm(this.form);\n });\n return this.ready;\n }\n}\nexports.Form = Form;\nclass FormBuilder extends Form {\n create() {\n return Formio.builder(this.element, this.form, this.options);\n }\n}\nexports.FormBuilder = FormBuilder;\nFormio.Form = Form;\nFormio.FormBuilder = FormBuilder;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/Embed.js?");
12413
12413
 
12414
12414
  /***/ }),
12415
12415
 
@@ -12420,7 +12420,51 @@ eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _argument
12420
12420
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
12421
12421
 
12422
12422
  "use strict";
12423
- eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Formio = void 0;\nconst sdk_1 = __webpack_require__(/*! @formio/core/sdk */ \"../core/lib/sdk/index.js\");\nObject.defineProperty(exports, \"Formio\", ({ enumerable: true, get: function () { return sdk_1.Formio; } }));\nconst Embed_1 = __webpack_require__(/*! ./Embed */ \"./lib/cjs/Embed.js\");\nconst CDN_1 = __importDefault(__webpack_require__(/*! ./CDN */ \"./lib/cjs/CDN.js\"));\nconst providers_1 = __importDefault(__webpack_require__(/*! ./providers */ \"./lib/cjs/providers/index.js\"));\nsdk_1.Formio.cdn = new CDN_1.default();\nsdk_1.Formio.Providers = providers_1.default;\nsdk_1.Formio.version = '5.0.0-rc.40';\nCDN_1.default.defaultCDN = sdk_1.Formio.version.includes('rc') ? 'https://cdn.test-form.io' : 'https://cdn.form.io';\nconst isNil = (val) => val === null || val === undefined;\nsdk_1.Formio.prototype.uploadFile = function (storage, file, fileName, dir, progressCallback, url, options, fileKey, groupPermissions, groupId, uploadStartCallback, abortCallback, multipartOptions) {\n const requestArgs = {\n provider: storage,\n method: 'upload',\n file: file,\n fileName: fileName,\n dir: dir\n };\n fileKey = fileKey || 'file';\n const request = sdk_1.Formio.pluginWait('preRequest', requestArgs)\n .then(() => {\n return sdk_1.Formio.pluginGet('fileRequest', requestArgs)\n .then((result) => {\n if (storage && isNil(result)) {\n const Provider = providers_1.default.getProvider('storage', storage);\n if (Provider) {\n const provider = new Provider(this);\n if (uploadStartCallback) {\n uploadStartCallback();\n }\n return provider.uploadFile(file, fileName, dir, progressCallback, url, options, fileKey, groupPermissions, groupId, abortCallback, multipartOptions);\n }\n else {\n throw ('Storage provider not found');\n }\n }\n return result || { url: '' };\n });\n });\n return sdk_1.Formio.pluginAlter('wrapFileRequestPromise', request, requestArgs);\n};\nsdk_1.Formio.prototype.downloadFile = function (file, options) {\n const requestArgs = {\n method: 'download',\n file: file\n };\n const request = sdk_1.Formio.pluginWait('preRequest', requestArgs)\n .then(() => {\n return sdk_1.Formio.pluginGet('fileRequest', requestArgs)\n .then((result) => {\n if (file.storage && isNil(result)) {\n const Provider = providers_1.default.getProvider('storage', file.storage);\n if (Provider) {\n const provider = new Provider(this);\n return provider.downloadFile(file, options);\n }\n else {\n throw ('Storage provider not found');\n }\n }\n return result || { url: '' };\n });\n });\n return sdk_1.Formio.pluginAlter('wrapFileRequestPromise', request, requestArgs);\n};\nsdk_1.Formio.prototype.deleteFile = function (file, options) {\n const requestArgs = {\n method: 'delete',\n file: file\n };\n const request = sdk_1.Formio.pluginWait('preRequest', requestArgs)\n .then(() => {\n return sdk_1.Formio.pluginGet('fileRequest', requestArgs)\n .then((result) => {\n if (file.storage && isNil(result)) {\n const Provider = providers_1.default.getProvider('storage', file.storage);\n if (Provider) {\n const provider = new Provider(this);\n return provider.deleteFile(file, options);\n }\n else {\n throw ('Storage provider not found');\n }\n }\n return result || { url: '' };\n });\n });\n return sdk_1.Formio.pluginAlter('wrapFileRequestPromise', request, requestArgs);\n};\n// Esnure we proxy the following methods to the FormioEmbed class.\n['setBaseUrl', 'setApiUrl', 'setAppUrl', 'setProjectUrl', 'setPathType', 'setLicense'].forEach((fn) => {\n const baseFn = sdk_1.Formio[fn];\n sdk_1.Formio[fn] = function (arg) {\n const retVal = Embed_1.Formio[fn](arg, true);\n return baseFn ? baseFn.call(this, arg) : retVal;\n };\n});\n// For reverse compatability.\nsdk_1.Formio.Promise = Promise;\nsdk_1.Formio.formioReady = Embed_1.Formio.formioReady;\nsdk_1.Formio.config = Embed_1.Formio.config;\nsdk_1.Formio.builder = Embed_1.Formio.builder;\nsdk_1.Formio.Report = Embed_1.Formio.Report;\nsdk_1.Formio.Form = Embed_1.Formio.Form;\nsdk_1.Formio.FormBuilder = Embed_1.Formio.FormBuilder;\nsdk_1.Formio.use = Embed_1.Formio.use;\nsdk_1.Formio.createForm = Embed_1.Formio.createForm;\nsdk_1.Formio.submitDone = Embed_1.Formio.submitDone;\nsdk_1.Formio.addLibrary = Embed_1.Formio.addLibrary;\nsdk_1.Formio.addLoader = Embed_1.Formio.addLoader;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/Formio.js?");
12423
+ eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Formio = void 0;\nconst sdk_1 = __webpack_require__(/*! @formio/core/sdk */ \"../core/lib/sdk/index.js\");\nObject.defineProperty(exports, \"Formio\", ({ enumerable: true, get: function () { return sdk_1.Formio; } }));\nconst Embed_1 = __webpack_require__(/*! ./Embed */ \"./lib/cjs/Embed.js\");\nconst CDN_1 = __importDefault(__webpack_require__(/*! ./CDN */ \"./lib/cjs/CDN.js\"));\nconst providers_1 = __importDefault(__webpack_require__(/*! ./providers */ \"./lib/cjs/providers/index.js\"));\nsdk_1.Formio.cdn = new CDN_1.default();\nsdk_1.Formio.Providers = providers_1.default;\nsdk_1.Formio.version = '5.0.0-rc.41';\nCDN_1.default.defaultCDN = sdk_1.Formio.version.includes('rc') ? 'https://cdn.test-form.io' : 'https://cdn.form.io';\nconst isNil = (val) => val === null || val === undefined;\nsdk_1.Formio.prototype.uploadFile = function (storage, file, fileName, dir, progressCallback, url, options, fileKey, groupPermissions, groupId, uploadStartCallback, abortCallback, multipartOptions) {\n const requestArgs = {\n provider: storage,\n method: 'upload',\n file: file,\n fileName: fileName,\n dir: dir\n };\n fileKey = fileKey || 'file';\n const request = sdk_1.Formio.pluginWait('preRequest', requestArgs)\n .then(() => {\n return sdk_1.Formio.pluginGet('fileRequest', requestArgs)\n .then((result) => {\n if (storage && isNil(result)) {\n const Provider = providers_1.default.getProvider('storage', storage);\n if (Provider) {\n const provider = new Provider(this);\n if (uploadStartCallback) {\n uploadStartCallback();\n }\n return provider.uploadFile(file, fileName, dir, progressCallback, url, options, fileKey, groupPermissions, groupId, abortCallback, multipartOptions);\n }\n else {\n throw ('Storage provider not found');\n }\n }\n return result || { url: '' };\n });\n });\n return sdk_1.Formio.pluginAlter('wrapFileRequestPromise', request, requestArgs);\n};\nsdk_1.Formio.prototype.downloadFile = function (file, options) {\n const requestArgs = {\n method: 'download',\n file: file\n };\n const request = sdk_1.Formio.pluginWait('preRequest', requestArgs)\n .then(() => {\n return sdk_1.Formio.pluginGet('fileRequest', requestArgs)\n .then((result) => {\n if (file.storage && isNil(result)) {\n const Provider = providers_1.default.getProvider('storage', file.storage);\n if (Provider) {\n const provider = new Provider(this);\n return provider.downloadFile(file, options);\n }\n else {\n throw ('Storage provider not found');\n }\n }\n return result || { url: '' };\n });\n });\n return sdk_1.Formio.pluginAlter('wrapFileRequestPromise', request, requestArgs);\n};\nsdk_1.Formio.prototype.deleteFile = function (file, options) {\n const requestArgs = {\n method: 'delete',\n file: file\n };\n const request = sdk_1.Formio.pluginWait('preRequest', requestArgs)\n .then(() => {\n return sdk_1.Formio.pluginGet('fileRequest', requestArgs)\n .then((result) => {\n if (file.storage && isNil(result)) {\n const Provider = providers_1.default.getProvider('storage', file.storage);\n if (Provider) {\n const provider = new Provider(this);\n return provider.deleteFile(file, options);\n }\n else {\n throw ('Storage provider not found');\n }\n }\n return result || { url: '' };\n });\n });\n return sdk_1.Formio.pluginAlter('wrapFileRequestPromise', request, requestArgs);\n};\n// Esnure we proxy the following methods to the FormioEmbed class.\n['setBaseUrl', 'setApiUrl', 'setAppUrl', 'setProjectUrl', 'setPathType', 'setLicense'].forEach((fn) => {\n const baseFn = sdk_1.Formio[fn];\n sdk_1.Formio[fn] = function (arg) {\n const retVal = Embed_1.Formio[fn](arg, true);\n return baseFn ? baseFn.call(this, arg) : retVal;\n };\n});\n// For reverse compatability.\nsdk_1.Formio.Promise = Promise;\nsdk_1.Formio.formioReady = Embed_1.Formio.formioReady;\nsdk_1.Formio.config = Embed_1.Formio.config;\nsdk_1.Formio.builder = Embed_1.Formio.builder;\nsdk_1.Formio.Report = Embed_1.Formio.Report;\nsdk_1.Formio.Form = Embed_1.Formio.Form;\nsdk_1.Formio.FormBuilder = Embed_1.Formio.FormBuilder;\nsdk_1.Formio.use = Embed_1.Formio.use;\nsdk_1.Formio.createForm = Embed_1.Formio.createForm;\nsdk_1.Formio.submitDone = Embed_1.Formio.submitDone;\nsdk_1.Formio.addLibrary = Embed_1.Formio.addLibrary;\nsdk_1.Formio.addLoader = Embed_1.Formio.addLoader;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/Formio.js?");
12424
+
12425
+ /***/ }),
12426
+
12427
+ /***/ "../core/node_modules/fast-json-patch/index.mjs":
12428
+ /*!******************************************************!*\
12429
+ !*** ../core/node_modules/fast-json-patch/index.mjs ***!
12430
+ \******************************************************/
12431
+ /***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
12432
+
12433
+ "use strict";
12434
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ JsonPatchError: function() { return /* reexport safe */ _module_helpers_mjs__WEBPACK_IMPORTED_MODULE_2__.PatchError; },\n/* harmony export */ _areEquals: function() { return /* reexport safe */ _module_core_mjs__WEBPACK_IMPORTED_MODULE_0__._areEquals; },\n/* harmony export */ applyOperation: function() { return /* reexport safe */ _module_core_mjs__WEBPACK_IMPORTED_MODULE_0__.applyOperation; },\n/* harmony export */ applyPatch: function() { return /* reexport safe */ _module_core_mjs__WEBPACK_IMPORTED_MODULE_0__.applyPatch; },\n/* harmony export */ applyReducer: function() { return /* reexport safe */ _module_core_mjs__WEBPACK_IMPORTED_MODULE_0__.applyReducer; },\n/* harmony export */ compare: function() { return /* reexport safe */ _module_duplex_mjs__WEBPACK_IMPORTED_MODULE_1__.compare; },\n/* harmony export */ deepClone: function() { return /* reexport safe */ _module_helpers_mjs__WEBPACK_IMPORTED_MODULE_2__._deepClone; },\n/* harmony export */ \"default\": function() { return __WEBPACK_DEFAULT_EXPORT__; },\n/* harmony export */ escapePathComponent: function() { return /* reexport safe */ _module_helpers_mjs__WEBPACK_IMPORTED_MODULE_2__.escapePathComponent; },\n/* harmony export */ generate: function() { return /* reexport safe */ _module_duplex_mjs__WEBPACK_IMPORTED_MODULE_1__.generate; },\n/* harmony export */ getValueByPointer: function() { return /* reexport safe */ _module_core_mjs__WEBPACK_IMPORTED_MODULE_0__.getValueByPointer; },\n/* harmony export */ observe: function() { return /* reexport safe */ _module_duplex_mjs__WEBPACK_IMPORTED_MODULE_1__.observe; },\n/* harmony export */ unescapePathComponent: function() { return /* reexport safe */ _module_helpers_mjs__WEBPACK_IMPORTED_MODULE_2__.unescapePathComponent; },\n/* harmony export */ unobserve: function() { return /* reexport safe */ _module_duplex_mjs__WEBPACK_IMPORTED_MODULE_1__.unobserve; },\n/* harmony export */ validate: function() { return /* reexport safe */ _module_core_mjs__WEBPACK_IMPORTED_MODULE_0__.validate; },\n/* harmony export */ validator: function() { return /* reexport safe */ _module_core_mjs__WEBPACK_IMPORTED_MODULE_0__.validator; }\n/* harmony export */ });\n/* harmony import */ var _module_core_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./module/core.mjs */ \"../core/node_modules/fast-json-patch/module/core.mjs\");\n/* harmony import */ var _module_duplex_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./module/duplex.mjs */ \"../core/node_modules/fast-json-patch/module/duplex.mjs\");\n/* harmony import */ var _module_helpers_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./module/helpers.mjs */ \"../core/node_modules/fast-json-patch/module/helpers.mjs\");\n\n\n\n\n\n/**\n * Default export for backwards compat\n */\n\n\n\n\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Object.assign({}, _module_core_mjs__WEBPACK_IMPORTED_MODULE_0__, _module_duplex_mjs__WEBPACK_IMPORTED_MODULE_1__, {\n JsonPatchError: _module_helpers_mjs__WEBPACK_IMPORTED_MODULE_2__.PatchError,\n deepClone: _module_helpers_mjs__WEBPACK_IMPORTED_MODULE_2__._deepClone,\n escapePathComponent: _module_helpers_mjs__WEBPACK_IMPORTED_MODULE_2__.escapePathComponent,\n unescapePathComponent: _module_helpers_mjs__WEBPACK_IMPORTED_MODULE_2__.unescapePathComponent\n}));\n\n//# sourceURL=webpack://Formio/../core/node_modules/fast-json-patch/index.mjs?");
12435
+
12436
+ /***/ }),
12437
+
12438
+ /***/ "../core/node_modules/fast-json-patch/module/core.mjs":
12439
+ /*!************************************************************!*\
12440
+ !*** ../core/node_modules/fast-json-patch/module/core.mjs ***!
12441
+ \************************************************************/
12442
+ /***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
12443
+
12444
+ "use strict";
12445
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ JsonPatchError: function() { return /* binding */ JsonPatchError; },\n/* harmony export */ _areEquals: function() { return /* binding */ _areEquals; },\n/* harmony export */ applyOperation: function() { return /* binding */ applyOperation; },\n/* harmony export */ applyPatch: function() { return /* binding */ applyPatch; },\n/* harmony export */ applyReducer: function() { return /* binding */ applyReducer; },\n/* harmony export */ deepClone: function() { return /* binding */ deepClone; },\n/* harmony export */ getValueByPointer: function() { return /* binding */ getValueByPointer; },\n/* harmony export */ validate: function() { return /* binding */ validate; },\n/* harmony export */ validator: function() { return /* binding */ validator; }\n/* harmony export */ });\n/* harmony import */ var _helpers_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./helpers.mjs */ \"../core/node_modules/fast-json-patch/module/helpers.mjs\");\n\nvar JsonPatchError = _helpers_mjs__WEBPACK_IMPORTED_MODULE_0__.PatchError;\nvar deepClone = _helpers_mjs__WEBPACK_IMPORTED_MODULE_0__._deepClone;\n/* We use a Javascript hash to store each\n function. Each hash entry (property) uses\n the operation identifiers specified in rfc6902.\n In this way, we can map each patch operation\n to its dedicated function in efficient way.\n */\n/* The operations applicable to an object */\nvar objOps = {\n add: function (obj, key, document) {\n obj[key] = this.value;\n return { newDocument: document };\n },\n remove: function (obj, key, document) {\n var removed = obj[key];\n delete obj[key];\n return { newDocument: document, removed: removed };\n },\n replace: function (obj, key, document) {\n var removed = obj[key];\n obj[key] = this.value;\n return { newDocument: document, removed: removed };\n },\n move: function (obj, key, document) {\n /* in case move target overwrites an existing value,\n return the removed value, this can be taxing performance-wise,\n and is potentially unneeded */\n var removed = getValueByPointer(document, this.path);\n if (removed) {\n removed = (0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_0__._deepClone)(removed);\n }\n var originalValue = applyOperation(document, { op: \"remove\", path: this.from }).removed;\n applyOperation(document, { op: \"add\", path: this.path, value: originalValue });\n return { newDocument: document, removed: removed };\n },\n copy: function (obj, key, document) {\n var valueToCopy = getValueByPointer(document, this.from);\n // enforce copy by value so further operations don't affect source (see issue #177)\n applyOperation(document, { op: \"add\", path: this.path, value: (0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_0__._deepClone)(valueToCopy) });\n return { newDocument: document };\n },\n test: function (obj, key, document) {\n return { newDocument: document, test: _areEquals(obj[key], this.value) };\n },\n _get: function (obj, key, document) {\n this.value = obj[key];\n return { newDocument: document };\n }\n};\n/* The operations applicable to an array. Many are the same as for the object */\nvar arrOps = {\n add: function (arr, i, document) {\n if ((0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_0__.isInteger)(i)) {\n arr.splice(i, 0, this.value);\n }\n else { // array props\n arr[i] = this.value;\n }\n // this may be needed when using '-' in an array\n return { newDocument: document, index: i };\n },\n remove: function (arr, i, document) {\n var removedList = arr.splice(i, 1);\n return { newDocument: document, removed: removedList[0] };\n },\n replace: function (arr, i, document) {\n var removed = arr[i];\n arr[i] = this.value;\n return { newDocument: document, removed: removed };\n },\n move: objOps.move,\n copy: objOps.copy,\n test: objOps.test,\n _get: objOps._get\n};\n/**\n * Retrieves a value from a JSON document by a JSON pointer.\n * Returns the value.\n *\n * @param document The document to get the value from\n * @param pointer an escaped JSON pointer\n * @return The retrieved value\n */\nfunction getValueByPointer(document, pointer) {\n if (pointer == '') {\n return document;\n }\n var getOriginalDestination = { op: \"_get\", path: pointer };\n applyOperation(document, getOriginalDestination);\n return getOriginalDestination.value;\n}\n/**\n * Apply a single JSON Patch Operation on a JSON document.\n * Returns the {newDocument, result} of the operation.\n * It modifies the `document` and `operation` objects - it gets the values by reference.\n * If you would like to avoid touching your values, clone them:\n * `jsonpatch.applyOperation(document, jsonpatch._deepClone(operation))`.\n *\n * @param document The document to patch\n * @param operation The operation to apply\n * @param validateOperation `false` is without validation, `true` to use default jsonpatch's validation, or you can pass a `validateOperation` callback to be used for validation.\n * @param mutateDocument Whether to mutate the original document or clone it before applying\n * @param banPrototypeModifications Whether to ban modifications to `__proto__`, defaults to `true`.\n * @return `{newDocument, result}` after the operation\n */\nfunction applyOperation(document, operation, validateOperation, mutateDocument, banPrototypeModifications, index) {\n if (validateOperation === void 0) { validateOperation = false; }\n if (mutateDocument === void 0) { mutateDocument = true; }\n if (banPrototypeModifications === void 0) { banPrototypeModifications = true; }\n if (index === void 0) { index = 0; }\n if (validateOperation) {\n if (typeof validateOperation == 'function') {\n validateOperation(operation, 0, document, operation.path);\n }\n else {\n validator(operation, 0);\n }\n }\n /* ROOT OPERATIONS */\n if (operation.path === \"\") {\n var returnValue = { newDocument: document };\n if (operation.op === 'add') {\n returnValue.newDocument = operation.value;\n return returnValue;\n }\n else if (operation.op === 'replace') {\n returnValue.newDocument = operation.value;\n returnValue.removed = document; //document we removed\n return returnValue;\n }\n else if (operation.op === 'move' || operation.op === 'copy') { // it's a move or copy to root\n returnValue.newDocument = getValueByPointer(document, operation.from); // get the value by json-pointer in `from` field\n if (operation.op === 'move') { // report removed item\n returnValue.removed = document;\n }\n return returnValue;\n }\n else if (operation.op === 'test') {\n returnValue.test = _areEquals(document, operation.value);\n if (returnValue.test === false) {\n throw new JsonPatchError(\"Test operation failed\", 'TEST_OPERATION_FAILED', index, operation, document);\n }\n returnValue.newDocument = document;\n return returnValue;\n }\n else if (operation.op === 'remove') { // a remove on root\n returnValue.removed = document;\n returnValue.newDocument = null;\n return returnValue;\n }\n else if (operation.op === '_get') {\n operation.value = document;\n return returnValue;\n }\n else { /* bad operation */\n if (validateOperation) {\n throw new JsonPatchError('Operation `op` property is not one of operations defined in RFC-6902', 'OPERATION_OP_INVALID', index, operation, document);\n }\n else {\n return returnValue;\n }\n }\n } /* END ROOT OPERATIONS */\n else {\n if (!mutateDocument) {\n document = (0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_0__._deepClone)(document);\n }\n var path = operation.path || \"\";\n var keys = path.split('/');\n var obj = document;\n var t = 1; //skip empty element - http://jsperf.com/to-shift-or-not-to-shift\n var len = keys.length;\n var existingPathFragment = undefined;\n var key = void 0;\n var validateFunction = void 0;\n if (typeof validateOperation == 'function') {\n validateFunction = validateOperation;\n }\n else {\n validateFunction = validator;\n }\n while (true) {\n key = keys[t];\n if (key && key.indexOf('~') != -1) {\n key = (0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_0__.unescapePathComponent)(key);\n }\n if (banPrototypeModifications &&\n (key == '__proto__' ||\n (key == 'prototype' && t > 0 && keys[t - 1] == 'constructor'))) {\n throw new TypeError('JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README');\n }\n if (validateOperation) {\n if (existingPathFragment === undefined) {\n if (obj[key] === undefined) {\n existingPathFragment = keys.slice(0, t).join('/');\n }\n else if (t == len - 1) {\n existingPathFragment = operation.path;\n }\n if (existingPathFragment !== undefined) {\n validateFunction(operation, 0, document, existingPathFragment);\n }\n }\n }\n t++;\n if (Array.isArray(obj)) {\n if (key === '-') {\n key = obj.length;\n }\n else {\n if (validateOperation && !(0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_0__.isInteger)(key)) {\n throw new JsonPatchError(\"Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index\", \"OPERATION_PATH_ILLEGAL_ARRAY_INDEX\", index, operation, document);\n } // only parse key when it's an integer for `arr.prop` to work\n else if ((0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_0__.isInteger)(key)) {\n key = ~~key;\n }\n }\n if (t >= len) {\n if (validateOperation && operation.op === \"add\" && key > obj.length) {\n throw new JsonPatchError(\"The specified index MUST NOT be greater than the number of elements in the array\", \"OPERATION_VALUE_OUT_OF_BOUNDS\", index, operation, document);\n }\n var returnValue = arrOps[operation.op].call(operation, obj, key, document); // Apply patch\n if (returnValue.test === false) {\n throw new JsonPatchError(\"Test operation failed\", 'TEST_OPERATION_FAILED', index, operation, document);\n }\n return returnValue;\n }\n }\n else {\n if (t >= len) {\n var returnValue = objOps[operation.op].call(operation, obj, key, document); // Apply patch\n if (returnValue.test === false) {\n throw new JsonPatchError(\"Test operation failed\", 'TEST_OPERATION_FAILED', index, operation, document);\n }\n return returnValue;\n }\n }\n obj = obj[key];\n // If we have more keys in the path, but the next value isn't a non-null object,\n // throw an OPERATION_PATH_UNRESOLVABLE error instead of iterating again.\n if (validateOperation && t < len && (!obj || typeof obj !== \"object\")) {\n throw new JsonPatchError('Cannot perform operation at the desired path', 'OPERATION_PATH_UNRESOLVABLE', index, operation, document);\n }\n }\n }\n}\n/**\n * Apply a full JSON Patch array on a JSON document.\n * Returns the {newDocument, result} of the patch.\n * It modifies the `document` object and `patch` - it gets the values by reference.\n * If you would like to avoid touching your values, clone them:\n * `jsonpatch.applyPatch(document, jsonpatch._deepClone(patch))`.\n *\n * @param document The document to patch\n * @param patch The patch to apply\n * @param validateOperation `false` is without validation, `true` to use default jsonpatch's validation, or you can pass a `validateOperation` callback to be used for validation.\n * @param mutateDocument Whether to mutate the original document or clone it before applying\n * @param banPrototypeModifications Whether to ban modifications to `__proto__`, defaults to `true`.\n * @return An array of `{newDocument, result}` after the patch\n */\nfunction applyPatch(document, patch, validateOperation, mutateDocument, banPrototypeModifications) {\n if (mutateDocument === void 0) { mutateDocument = true; }\n if (banPrototypeModifications === void 0) { banPrototypeModifications = true; }\n if (validateOperation) {\n if (!Array.isArray(patch)) {\n throw new JsonPatchError('Patch sequence must be an array', 'SEQUENCE_NOT_AN_ARRAY');\n }\n }\n if (!mutateDocument) {\n document = (0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_0__._deepClone)(document);\n }\n var results = new Array(patch.length);\n for (var i = 0, length_1 = patch.length; i < length_1; i++) {\n // we don't need to pass mutateDocument argument because if it was true, we already deep cloned the object, we'll just pass `true`\n results[i] = applyOperation(document, patch[i], validateOperation, true, banPrototypeModifications, i);\n document = results[i].newDocument; // in case root was replaced\n }\n results.newDocument = document;\n return results;\n}\n/**\n * Apply a single JSON Patch Operation on a JSON document.\n * Returns the updated document.\n * Suitable as a reducer.\n *\n * @param document The document to patch\n * @param operation The operation to apply\n * @return The updated document\n */\nfunction applyReducer(document, operation, index) {\n var operationResult = applyOperation(document, operation);\n if (operationResult.test === false) { // failed test\n throw new JsonPatchError(\"Test operation failed\", 'TEST_OPERATION_FAILED', index, operation, document);\n }\n return operationResult.newDocument;\n}\n/**\n * Validates a single operation. Called from `jsonpatch.validate`. Throws `JsonPatchError` in case of an error.\n * @param {object} operation - operation object (patch)\n * @param {number} index - index of operation in the sequence\n * @param {object} [document] - object where the operation is supposed to be applied\n * @param {string} [existingPathFragment] - comes along with `document`\n */\nfunction validator(operation, index, document, existingPathFragment) {\n if (typeof operation !== 'object' || operation === null || Array.isArray(operation)) {\n throw new JsonPatchError('Operation is not an object', 'OPERATION_NOT_AN_OBJECT', index, operation, document);\n }\n else if (!objOps[operation.op]) {\n throw new JsonPatchError('Operation `op` property is not one of operations defined in RFC-6902', 'OPERATION_OP_INVALID', index, operation, document);\n }\n else if (typeof operation.path !== 'string') {\n throw new JsonPatchError('Operation `path` property is not a string', 'OPERATION_PATH_INVALID', index, operation, document);\n }\n else if (operation.path.indexOf('/') !== 0 && operation.path.length > 0) {\n // paths that aren't empty string should start with \"/\"\n throw new JsonPatchError('Operation `path` property must start with \"/\"', 'OPERATION_PATH_INVALID', index, operation, document);\n }\n else if ((operation.op === 'move' || operation.op === 'copy') && typeof operation.from !== 'string') {\n throw new JsonPatchError('Operation `from` property is not present (applicable in `move` and `copy` operations)', 'OPERATION_FROM_REQUIRED', index, operation, document);\n }\n else if ((operation.op === 'add' || operation.op === 'replace' || operation.op === 'test') && operation.value === undefined) {\n throw new JsonPatchError('Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)', 'OPERATION_VALUE_REQUIRED', index, operation, document);\n }\n else if ((operation.op === 'add' || operation.op === 'replace' || operation.op === 'test') && (0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_0__.hasUndefined)(operation.value)) {\n throw new JsonPatchError('Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)', 'OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED', index, operation, document);\n }\n else if (document) {\n if (operation.op == \"add\") {\n var pathLen = operation.path.split(\"/\").length;\n var existingPathLen = existingPathFragment.split(\"/\").length;\n if (pathLen !== existingPathLen + 1 && pathLen !== existingPathLen) {\n throw new JsonPatchError('Cannot perform an `add` operation at the desired path', 'OPERATION_PATH_CANNOT_ADD', index, operation, document);\n }\n }\n else if (operation.op === 'replace' || operation.op === 'remove' || operation.op === '_get') {\n if (operation.path !== existingPathFragment) {\n throw new JsonPatchError('Cannot perform the operation at a path that does not exist', 'OPERATION_PATH_UNRESOLVABLE', index, operation, document);\n }\n }\n else if (operation.op === 'move' || operation.op === 'copy') {\n var existingValue = { op: \"_get\", path: operation.from, value: undefined };\n var error = validate([existingValue], document);\n if (error && error.name === 'OPERATION_PATH_UNRESOLVABLE') {\n throw new JsonPatchError('Cannot perform the operation from a path that does not exist', 'OPERATION_FROM_UNRESOLVABLE', index, operation, document);\n }\n }\n }\n}\n/**\n * Validates a sequence of operations. If `document` parameter is provided, the sequence is additionally validated against the object document.\n * If error is encountered, returns a JsonPatchError object\n * @param sequence\n * @param document\n * @returns {JsonPatchError|undefined}\n */\nfunction validate(sequence, document, externalValidator) {\n try {\n if (!Array.isArray(sequence)) {\n throw new JsonPatchError('Patch sequence must be an array', 'SEQUENCE_NOT_AN_ARRAY');\n }\n if (document) {\n //clone document and sequence so that we can safely try applying operations\n applyPatch((0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_0__._deepClone)(document), (0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_0__._deepClone)(sequence), externalValidator || true);\n }\n else {\n externalValidator = externalValidator || validator;\n for (var i = 0; i < sequence.length; i++) {\n externalValidator(sequence[i], i, document, undefined);\n }\n }\n }\n catch (e) {\n if (e instanceof JsonPatchError) {\n return e;\n }\n else {\n throw e;\n }\n }\n}\n// based on https://github.com/epoberezkin/fast-deep-equal\n// MIT License\n// Copyright (c) 2017 Evgeny Poberezkin\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\nfunction _areEquals(a, b) {\n if (a === b)\n return true;\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n var arrA = Array.isArray(a), arrB = Array.isArray(b), i, length, key;\n if (arrA && arrB) {\n length = a.length;\n if (length != b.length)\n return false;\n for (i = length; i-- !== 0;)\n if (!_areEquals(a[i], b[i]))\n return false;\n return true;\n }\n if (arrA != arrB)\n return false;\n var keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length)\n return false;\n for (i = length; i-- !== 0;)\n if (!b.hasOwnProperty(keys[i]))\n return false;\n for (i = length; i-- !== 0;) {\n key = keys[i];\n if (!_areEquals(a[key], b[key]))\n return false;\n }\n return true;\n }\n return a !== a && b !== b;\n}\n;\n\n\n//# sourceURL=webpack://Formio/../core/node_modules/fast-json-patch/module/core.mjs?");
12446
+
12447
+ /***/ }),
12448
+
12449
+ /***/ "../core/node_modules/fast-json-patch/module/duplex.mjs":
12450
+ /*!**************************************************************!*\
12451
+ !*** ../core/node_modules/fast-json-patch/module/duplex.mjs ***!
12452
+ \**************************************************************/
12453
+ /***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
12454
+
12455
+ "use strict";
12456
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ compare: function() { return /* binding */ compare; },\n/* harmony export */ generate: function() { return /* binding */ generate; },\n/* harmony export */ observe: function() { return /* binding */ observe; },\n/* harmony export */ unobserve: function() { return /* binding */ unobserve; }\n/* harmony export */ });\n/* harmony import */ var _helpers_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./helpers.mjs */ \"../core/node_modules/fast-json-patch/module/helpers.mjs\");\n/* harmony import */ var _core_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./core.mjs */ \"../core/node_modules/fast-json-patch/module/core.mjs\");\n/*!\n * https://github.com/Starcounter-Jack/JSON-Patch\n * (c) 2017-2021 Joachim Wester\n * MIT license\n */\n\n\nvar beforeDict = new WeakMap();\nvar Mirror = /** @class */ (function () {\n function Mirror(obj) {\n this.observers = new Map();\n this.obj = obj;\n }\n return Mirror;\n}());\nvar ObserverInfo = /** @class */ (function () {\n function ObserverInfo(callback, observer) {\n this.callback = callback;\n this.observer = observer;\n }\n return ObserverInfo;\n}());\nfunction getMirror(obj) {\n return beforeDict.get(obj);\n}\nfunction getObserverFromMirror(mirror, callback) {\n return mirror.observers.get(callback);\n}\nfunction removeObserverFromMirror(mirror, observer) {\n mirror.observers.delete(observer.callback);\n}\n/**\n * Detach an observer from an object\n */\nfunction unobserve(root, observer) {\n observer.unobserve();\n}\n/**\n * Observes changes made to an object, which can then be retrieved using generate\n */\nfunction observe(obj, callback) {\n var patches = [];\n var observer;\n var mirror = getMirror(obj);\n if (!mirror) {\n mirror = new Mirror(obj);\n beforeDict.set(obj, mirror);\n }\n else {\n var observerInfo = getObserverFromMirror(mirror, callback);\n observer = observerInfo && observerInfo.observer;\n }\n if (observer) {\n return observer;\n }\n observer = {};\n mirror.value = (0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_0__._deepClone)(obj);\n if (callback) {\n observer.callback = callback;\n observer.next = null;\n var dirtyCheck = function () {\n generate(observer);\n };\n var fastCheck = function () {\n clearTimeout(observer.next);\n observer.next = setTimeout(dirtyCheck);\n };\n if (typeof window !== 'undefined') { //not Node\n window.addEventListener('mouseup', fastCheck);\n window.addEventListener('keyup', fastCheck);\n window.addEventListener('mousedown', fastCheck);\n window.addEventListener('keydown', fastCheck);\n window.addEventListener('change', fastCheck);\n }\n }\n observer.patches = patches;\n observer.object = obj;\n observer.unobserve = function () {\n generate(observer);\n clearTimeout(observer.next);\n removeObserverFromMirror(mirror, observer);\n if (typeof window !== 'undefined') {\n window.removeEventListener('mouseup', fastCheck);\n window.removeEventListener('keyup', fastCheck);\n window.removeEventListener('mousedown', fastCheck);\n window.removeEventListener('keydown', fastCheck);\n window.removeEventListener('change', fastCheck);\n }\n };\n mirror.observers.set(callback, new ObserverInfo(callback, observer));\n return observer;\n}\n/**\n * Generate an array of patches from an observer\n */\nfunction generate(observer, invertible) {\n if (invertible === void 0) { invertible = false; }\n var mirror = beforeDict.get(observer.object);\n _generate(mirror.value, observer.object, observer.patches, \"\", invertible);\n if (observer.patches.length) {\n (0,_core_mjs__WEBPACK_IMPORTED_MODULE_1__.applyPatch)(mirror.value, observer.patches);\n }\n var temp = observer.patches;\n if (temp.length > 0) {\n observer.patches = [];\n if (observer.callback) {\n observer.callback(temp);\n }\n }\n return temp;\n}\n// Dirty check if obj is different from mirror, generate patches and update mirror\nfunction _generate(mirror, obj, patches, path, invertible) {\n if (obj === mirror) {\n return;\n }\n if (typeof obj.toJSON === \"function\") {\n obj = obj.toJSON();\n }\n var newKeys = (0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_0__._objectKeys)(obj);\n var oldKeys = (0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_0__._objectKeys)(mirror);\n var changed = false;\n var deleted = false;\n //if ever \"move\" operation is implemented here, make sure this test runs OK: \"should not generate the same patch twice (move)\"\n for (var t = oldKeys.length - 1; t >= 0; t--) {\n var key = oldKeys[t];\n var oldVal = mirror[key];\n if ((0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_0__.hasOwnProperty)(obj, key) && !(obj[key] === undefined && oldVal !== undefined && Array.isArray(obj) === false)) {\n var newVal = obj[key];\n if (typeof oldVal == \"object\" && oldVal != null && typeof newVal == \"object\" && newVal != null && Array.isArray(oldVal) === Array.isArray(newVal)) {\n _generate(oldVal, newVal, patches, path + \"/\" + (0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_0__.escapePathComponent)(key), invertible);\n }\n else {\n if (oldVal !== newVal) {\n changed = true;\n if (invertible) {\n patches.push({ op: \"test\", path: path + \"/\" + (0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_0__.escapePathComponent)(key), value: (0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_0__._deepClone)(oldVal) });\n }\n patches.push({ op: \"replace\", path: path + \"/\" + (0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_0__.escapePathComponent)(key), value: (0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_0__._deepClone)(newVal) });\n }\n }\n }\n else if (Array.isArray(mirror) === Array.isArray(obj)) {\n if (invertible) {\n patches.push({ op: \"test\", path: path + \"/\" + (0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_0__.escapePathComponent)(key), value: (0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_0__._deepClone)(oldVal) });\n }\n patches.push({ op: \"remove\", path: path + \"/\" + (0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_0__.escapePathComponent)(key) });\n deleted = true; // property has been deleted\n }\n else {\n if (invertible) {\n patches.push({ op: \"test\", path: path, value: mirror });\n }\n patches.push({ op: \"replace\", path: path, value: obj });\n changed = true;\n }\n }\n if (!deleted && newKeys.length == oldKeys.length) {\n return;\n }\n for (var t = 0; t < newKeys.length; t++) {\n var key = newKeys[t];\n if (!(0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_0__.hasOwnProperty)(mirror, key) && obj[key] !== undefined) {\n patches.push({ op: \"add\", path: path + \"/\" + (0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_0__.escapePathComponent)(key), value: (0,_helpers_mjs__WEBPACK_IMPORTED_MODULE_0__._deepClone)(obj[key]) });\n }\n }\n}\n/**\n * Create an array of patches from the differences in two objects\n */\nfunction compare(tree1, tree2, invertible) {\n if (invertible === void 0) { invertible = false; }\n var patches = [];\n _generate(tree1, tree2, patches, '', invertible);\n return patches;\n}\n\n\n//# sourceURL=webpack://Formio/../core/node_modules/fast-json-patch/module/duplex.mjs?");
12457
+
12458
+ /***/ }),
12459
+
12460
+ /***/ "../core/node_modules/fast-json-patch/module/helpers.mjs":
12461
+ /*!***************************************************************!*\
12462
+ !*** ../core/node_modules/fast-json-patch/module/helpers.mjs ***!
12463
+ \***************************************************************/
12464
+ /***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
12465
+
12466
+ "use strict";
12467
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ PatchError: function() { return /* binding */ PatchError; },\n/* harmony export */ _deepClone: function() { return /* binding */ _deepClone; },\n/* harmony export */ _getPathRecursive: function() { return /* binding */ _getPathRecursive; },\n/* harmony export */ _objectKeys: function() { return /* binding */ _objectKeys; },\n/* harmony export */ escapePathComponent: function() { return /* binding */ escapePathComponent; },\n/* harmony export */ getPath: function() { return /* binding */ getPath; },\n/* harmony export */ hasOwnProperty: function() { return /* binding */ hasOwnProperty; },\n/* harmony export */ hasUndefined: function() { return /* binding */ hasUndefined; },\n/* harmony export */ isInteger: function() { return /* binding */ isInteger; },\n/* harmony export */ unescapePathComponent: function() { return /* binding */ unescapePathComponent; }\n/* harmony export */ });\n/*!\n * https://github.com/Starcounter-Jack/JSON-Patch\n * (c) 2017-2022 Joachim Wester\n * MIT licensed\n */\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar _hasOwnProperty = Object.prototype.hasOwnProperty;\nfunction hasOwnProperty(obj, key) {\n return _hasOwnProperty.call(obj, key);\n}\nfunction _objectKeys(obj) {\n if (Array.isArray(obj)) {\n var keys_1 = new Array(obj.length);\n for (var k = 0; k < keys_1.length; k++) {\n keys_1[k] = \"\" + k;\n }\n return keys_1;\n }\n if (Object.keys) {\n return Object.keys(obj);\n }\n var keys = [];\n for (var i in obj) {\n if (hasOwnProperty(obj, i)) {\n keys.push(i);\n }\n }\n return keys;\n}\n;\n/**\n* Deeply clone the object.\n* https://jsperf.com/deep-copy-vs-json-stringify-json-parse/25 (recursiveDeepCopy)\n* @param {any} obj value to clone\n* @return {any} cloned obj\n*/\nfunction _deepClone(obj) {\n switch (typeof obj) {\n case \"object\":\n return JSON.parse(JSON.stringify(obj)); //Faster than ES5 clone - http://jsperf.com/deep-cloning-of-objects/5\n case \"undefined\":\n return null; //this is how JSON.stringify behaves for array items\n default:\n return obj; //no need to clone primitives\n }\n}\n//3x faster than cached /^\\d+$/.test(str)\nfunction isInteger(str) {\n var i = 0;\n var len = str.length;\n var charCode;\n while (i < len) {\n charCode = str.charCodeAt(i);\n if (charCode >= 48 && charCode <= 57) {\n i++;\n continue;\n }\n return false;\n }\n return true;\n}\n/**\n* Escapes a json pointer path\n* @param path The raw pointer\n* @return the Escaped path\n*/\nfunction escapePathComponent(path) {\n if (path.indexOf('/') === -1 && path.indexOf('~') === -1)\n return path;\n return path.replace(/~/g, '~0').replace(/\\//g, '~1');\n}\n/**\n * Unescapes a json pointer path\n * @param path The escaped pointer\n * @return The unescaped path\n */\nfunction unescapePathComponent(path) {\n return path.replace(/~1/g, '/').replace(/~0/g, '~');\n}\nfunction _getPathRecursive(root, obj) {\n var found;\n for (var key in root) {\n if (hasOwnProperty(root, key)) {\n if (root[key] === obj) {\n return escapePathComponent(key) + '/';\n }\n else if (typeof root[key] === 'object') {\n found = _getPathRecursive(root[key], obj);\n if (found != '') {\n return escapePathComponent(key) + '/' + found;\n }\n }\n }\n }\n return '';\n}\nfunction getPath(root, obj) {\n if (root === obj) {\n return '/';\n }\n var path = _getPathRecursive(root, obj);\n if (path === '') {\n throw new Error(\"Object not found in root\");\n }\n return \"/\" + path;\n}\n/**\n* Recursively checks whether an object has any undefined values inside.\n*/\nfunction hasUndefined(obj) {\n if (obj === undefined) {\n return true;\n }\n if (obj) {\n if (Array.isArray(obj)) {\n for (var i_1 = 0, len = obj.length; i_1 < len; i_1++) {\n if (hasUndefined(obj[i_1])) {\n return true;\n }\n }\n }\n else if (typeof obj === \"object\") {\n var objKeys = _objectKeys(obj);\n var objKeysLength = objKeys.length;\n for (var i = 0; i < objKeysLength; i++) {\n if (hasUndefined(obj[objKeys[i]])) {\n return true;\n }\n }\n }\n }\n return false;\n}\nfunction patchErrorMessageFormatter(message, args) {\n var messageParts = [message];\n for (var key in args) {\n var value = typeof args[key] === 'object' ? JSON.stringify(args[key], null, 2) : args[key]; // pretty print\n if (typeof value !== 'undefined') {\n messageParts.push(key + \": \" + value);\n }\n }\n return messageParts.join('\\n');\n}\nvar PatchError = /** @class */ (function (_super) {\n __extends(PatchError, _super);\n function PatchError(message, name, index, operation, tree) {\n var _newTarget = this.constructor;\n var _this = _super.call(this, patchErrorMessageFormatter(message, { name: name, index: index, operation: operation, tree: tree })) || this;\n _this.name = name;\n _this.index = index;\n _this.operation = operation;\n _this.tree = tree;\n Object.setPrototypeOf(_this, _newTarget.prototype); // restore prototype chain, see https://stackoverflow.com/a/48342359\n _this.message = patchErrorMessageFormatter(message, { name: name, index: index, operation: operation, tree: tree });\n return _this;\n }\n return PatchError;\n}(Error));\n\n\n\n//# sourceURL=webpack://Formio/../core/node_modules/fast-json-patch/module/helpers.mjs?");
12424
12468
 
12425
12469
  /***/ }),
12426
12470