@formio/js 5.0.0-rc.51 → 5.0.0-rc.53
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/formio.embed.js +1 -1
- package/dist/formio.embed.min.js +1 -1
- package/dist/formio.embed.min.js.LICENSE.txt +1 -1
- package/dist/formio.form.js +561 -721
- package/dist/formio.form.min.js +1 -1
- package/dist/formio.form.min.js.LICENSE.txt +3 -49
- package/dist/formio.full.js +563 -693
- package/dist/formio.full.min.js +1 -1
- package/dist/formio.full.min.js.LICENSE.txt +3 -49
- package/dist/formio.js +11 -11
- package/dist/formio.min.js +1 -1
- package/dist/formio.min.js.LICENSE.txt +1 -1
- package/dist/formio.utils.js +34 -194
- package/dist/formio.utils.min.js +1 -1
- package/dist/formio.utils.min.js.LICENSE.txt +11 -49
- package/lib/cjs/Form.d.ts +281 -10
- package/lib/cjs/Form.js +22 -35
- package/lib/cjs/FormBuilder.d.ts +187 -2
- package/lib/cjs/FormBuilder.js +29 -6
- package/lib/cjs/PDF.d.ts +0 -1
- package/lib/cjs/Webform.d.ts +6 -6
- package/lib/cjs/Webform.js +2 -2
- package/lib/cjs/Wizard.d.ts +1 -1
- package/lib/cjs/addons/PasswordStrength/PasswordStrengthAddon.d.ts +8 -6
- package/lib/cjs/addons/PasswordStrength/PasswordStrengthAddon.js +6 -4
- package/lib/cjs/components/_classes/field/Field.d.ts +11 -2
- package/lib/cjs/components/_classes/field/Field.js +13 -1
- package/lib/cjs/components/_classes/input/Input.d.ts +4 -3
- package/lib/cjs/components/_classes/input/Input.js +2 -2
- package/lib/cjs/components/_classes/list/ListComponent.form.d.ts +4 -5
- package/lib/cjs/components/_classes/list/ListComponent.form.js +3 -2
- package/lib/cjs/components/_classes/multivalue/Multivalue.d.ts +42 -11
- package/lib/cjs/components/_classes/multivalue/Multivalue.js +37 -3
- package/lib/cjs/components/_classes/nested/NestedComponent.d.ts +127 -33
- package/lib/cjs/components/_classes/nested/NestedComponent.js +133 -15
- package/lib/cjs/components/_classes/nesteddata/NestedDataComponent.d.ts +6 -0
- package/lib/cjs/components/address/Address.d.ts +2 -1
- package/lib/cjs/components/button/Button.d.ts +1 -1
- package/lib/cjs/components/checkbox/Checkbox.d.ts +1 -1
- package/lib/cjs/components/columns/Columns.d.ts +1 -1
- package/lib/cjs/components/container/Container.d.ts +1 -0
- package/lib/cjs/components/datagrid/DataGrid.d.ts +1 -1
- package/lib/cjs/components/day/Day.d.ts +1 -1
- package/lib/cjs/components/editgrid/EditGrid.d.ts +2 -0
- package/lib/cjs/components/file/File.d.ts +2 -2
- package/lib/cjs/components/number/Number.d.ts +1 -1
- package/lib/cjs/components/radio/Radio.d.ts +1 -1
- package/lib/cjs/components/radio/Radio.form.d.ts +1 -3
- package/lib/cjs/components/radio/Radio.js +3 -3
- package/lib/cjs/components/select/Select.d.ts +9 -14
- package/lib/cjs/components/select/Select.form.d.ts +1 -3
- package/lib/cjs/components/select/Select.js +11 -15
- package/lib/cjs/components/selectboxes/SelectBoxes.form.d.ts +1 -3
- package/lib/cjs/components/survey/Survey.d.ts +1 -1
- package/lib/cjs/components/table/Table.d.ts +1 -1
- package/lib/cjs/components/tabs/Tabs.d.ts +1 -1
- package/lib/cjs/components/textfield/TextField.d.ts +1 -1
- package/lib/cjs/providers/address/NominatimAddressProvider.d.ts +1 -1
- package/lib/cjs/providers/address/NominatimAddressProvider.js +5 -1
- package/lib/cjs/providers/processor/fileProcessor.d.ts +7 -1
- package/lib/cjs/providers/processor/fileProcessor.js +6 -0
- package/lib/cjs/providers/storage/azure.d.ts +4 -15
- package/lib/cjs/providers/storage/azure.js +3 -2
- package/lib/cjs/providers/storage/base64.d.ts +3 -7
- package/lib/cjs/providers/storage/base64.js +2 -1
- package/lib/cjs/providers/storage/dropbox.d.ts +4 -6
- package/lib/cjs/providers/storage/dropbox.js +3 -2
- package/lib/cjs/providers/storage/googleDrive.d.ts +4 -6
- package/lib/cjs/providers/storage/googleDrive.js +3 -1
- package/lib/cjs/providers/storage/indexeddb.d.ts +3 -8
- package/lib/cjs/providers/storage/indexeddb.js +2 -1
- package/lib/cjs/providers/storage/s3.d.ts +4 -22
- package/lib/cjs/providers/storage/s3.js +3 -2
- package/lib/cjs/providers/storage/url.d.ts +3 -8
- package/lib/cjs/providers/storage/url.js +4 -3
- package/lib/cjs/providers/storage/util.d.ts +22 -6
- package/lib/cjs/providers/storage/util.js +16 -5
- package/lib/cjs/utils/builder.d.ts +9 -7
- package/lib/cjs/utils/builder.js +10 -5
- package/lib/cjs/utils/calendarUtils.d.ts +6 -10
- package/lib/cjs/utils/calendarUtils.js +7 -11
- package/lib/cjs/utils/formUtils.d.ts +4 -4
- package/lib/cjs/utils/formUtils.js +3 -3
- package/lib/cjs/utils/utils.d.ts +123 -121
- package/lib/cjs/utils/utils.js +99 -94
- package/lib/mjs/Form.d.ts +281 -10
- package/lib/mjs/Form.js +112 -28
- package/lib/mjs/FormBuilder.d.ts +187 -2
- package/lib/mjs/FormBuilder.js +31 -6
- package/lib/mjs/PDF.d.ts +0 -1
- package/lib/mjs/Webform.d.ts +6 -6
- package/lib/mjs/Webform.js +3 -3
- package/lib/mjs/Wizard.d.ts +1 -1
- package/lib/mjs/addons/PasswordStrength/PasswordStrengthAddon.d.ts +8 -6
- package/lib/mjs/addons/PasswordStrength/PasswordStrengthAddon.js +6 -4
- package/lib/mjs/components/_classes/field/Field.d.ts +11 -2
- package/lib/mjs/components/_classes/field/Field.js +13 -1
- package/lib/mjs/components/_classes/input/Input.d.ts +4 -3
- package/lib/mjs/components/_classes/input/Input.js +2 -2
- package/lib/mjs/components/_classes/list/ListComponent.form.d.ts +4 -5
- package/lib/mjs/components/_classes/list/ListComponent.form.js +3 -2
- package/lib/mjs/components/_classes/multivalue/Multivalue.d.ts +42 -11
- package/lib/mjs/components/_classes/multivalue/Multivalue.js +37 -3
- package/lib/mjs/components/_classes/nested/NestedComponent.d.ts +127 -33
- package/lib/mjs/components/_classes/nested/NestedComponent.js +133 -15
- package/lib/mjs/components/_classes/nesteddata/NestedDataComponent.d.ts +6 -0
- package/lib/mjs/components/address/Address.d.ts +2 -1
- package/lib/mjs/components/button/Button.d.ts +1 -1
- package/lib/mjs/components/checkbox/Checkbox.d.ts +1 -1
- package/lib/mjs/components/columns/Columns.d.ts +1 -1
- package/lib/mjs/components/container/Container.d.ts +1 -0
- package/lib/mjs/components/datagrid/DataGrid.d.ts +1 -1
- package/lib/mjs/components/day/Day.d.ts +1 -1
- package/lib/mjs/components/editgrid/EditGrid.d.ts +2 -0
- package/lib/mjs/components/file/File.d.ts +2 -2
- package/lib/mjs/components/number/Number.d.ts +1 -1
- package/lib/mjs/components/radio/Radio.d.ts +1 -1
- package/lib/mjs/components/radio/Radio.form.d.ts +1 -3
- package/lib/mjs/components/radio/Radio.js +3 -3
- package/lib/mjs/components/select/Select.d.ts +9 -14
- package/lib/mjs/components/select/Select.form.d.ts +1 -3
- package/lib/mjs/components/select/Select.js +11 -15
- package/lib/mjs/components/selectboxes/SelectBoxes.form.d.ts +1 -3
- package/lib/mjs/components/survey/Survey.d.ts +1 -1
- package/lib/mjs/components/table/Table.d.ts +1 -1
- package/lib/mjs/components/tabs/Tabs.d.ts +1 -1
- package/lib/mjs/components/textfield/TextField.d.ts +1 -1
- package/lib/mjs/providers/address/NominatimAddressProvider.d.ts +1 -1
- package/lib/mjs/providers/address/NominatimAddressProvider.js +5 -1
- package/lib/mjs/providers/processor/fileProcessor.d.ts +7 -1
- package/lib/mjs/providers/processor/fileProcessor.js +6 -0
- package/lib/mjs/providers/storage/azure.d.ts +4 -15
- package/lib/mjs/providers/storage/azure.js +3 -2
- package/lib/mjs/providers/storage/base64.d.ts +3 -7
- package/lib/mjs/providers/storage/base64.js +2 -1
- package/lib/mjs/providers/storage/dropbox.d.ts +4 -6
- package/lib/mjs/providers/storage/dropbox.js +3 -2
- package/lib/mjs/providers/storage/googleDrive.d.ts +4 -6
- package/lib/mjs/providers/storage/googleDrive.js +3 -1
- package/lib/mjs/providers/storage/indexeddb.d.ts +3 -8
- package/lib/mjs/providers/storage/indexeddb.js +2 -1
- package/lib/mjs/providers/storage/s3.d.ts +4 -22
- package/lib/mjs/providers/storage/s3.js +3 -2
- package/lib/mjs/providers/storage/url.d.ts +3 -8
- package/lib/mjs/providers/storage/url.js +4 -3
- package/lib/mjs/providers/storage/util.d.ts +22 -6
- package/lib/mjs/providers/storage/util.js +16 -5
- package/lib/mjs/utils/builder.d.ts +9 -7
- package/lib/mjs/utils/builder.js +10 -5
- package/lib/mjs/utils/calendarUtils.d.ts +6 -10
- package/lib/mjs/utils/calendarUtils.js +7 -11
- package/lib/mjs/utils/formUtils.d.ts +4 -4
- package/lib/mjs/utils/formUtils.js +3 -3
- package/lib/mjs/utils/utils.d.ts +123 -121
- package/lib/mjs/utils/utils.js +99 -94
- package/package.json +11 -11
package/dist/formio.utils.js
CHANGED
@@ -92,7 +92,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexpo
|
|
92
92
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
93
93
|
|
94
94
|
"use strict";
|
95
|
-
eval("\nvar
|
95
|
+
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.jsonLogic = void 0;\nconst json_logic_js_1 = __importDefault(__webpack_require__(/*! json-logic-js */ \"./node_modules/json-logic-js/logic.js\"));\nexports.jsonLogic = json_logic_js_1.default;\nconst date_1 = __webpack_require__(/*! ../../utils/date */ \"./node_modules/@formio/core/lib/utils/date.js\");\nconst operators_1 = __webpack_require__(/*! ./operators */ \"./node_modules/@formio/core/lib/modules/jsonlogic/operators.js\");\n// Configure JsonLogic\nfor (let operator in operators_1._) {\n json_logic_js_1.default.add_operation(`_${operator}`, operators_1._[operator]);\n}\n// Retrieve Any Date\njson_logic_js_1.default.add_operation('getDate', (date) => {\n return (0, date_1.dayjs)(date).toISOString();\n});\n// Set Relative Minimum Date\njson_logic_js_1.default.add_operation('relativeMinDate', (relativeMinDate) => {\n return (0, date_1.dayjs)().subtract(relativeMinDate, 'days').toISOString();\n});\n// Set Relative Maximum Date\njson_logic_js_1.default.add_operation('relativeMaxDate', (relativeMaxDate) => {\n return (0, date_1.dayjs)().add(relativeMaxDate, 'days').toISOString();\n});\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/lib/modules/jsonlogic/jsonLogic.js?");
|
96
96
|
|
97
97
|
/***/ }),
|
98
98
|
|
@@ -100,10 +100,10 @@ eval("\nvar __createBinding = (this && this.__createBinding) || (Object.create ?
|
|
100
100
|
/*!**********************************************************************!*\
|
101
101
|
!*** ./node_modules/@formio/core/lib/modules/jsonlogic/operators.js ***!
|
102
102
|
\**********************************************************************/
|
103
|
-
/***/ (function(__unused_webpack_module, exports) {
|
103
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
104
104
|
|
105
105
|
"use strict";
|
106
|
-
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.
|
106
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports._ = void 0;\n// Use only immutable useful functions from Lodash.\n// Visit https://lodash.com/docs for more info.\nconst lodash_1 = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nexports._ = {\n chunk: lodash_1.chunk,\n compact: lodash_1.compact,\n concat: lodash_1.concat,\n difference: lodash_1.difference,\n drop: lodash_1.drop,\n dropRight: lodash_1.dropRight,\n findIndex: lodash_1.findIndex,\n findLastIndex: lodash_1.findLastIndex,\n first: lodash_1.first,\n flatten: lodash_1.flatten,\n flattenDeep: lodash_1.flattenDeep,\n flattenDepth: lodash_1.flattenDepth,\n fromPairs: lodash_1.fromPairs,\n head: lodash_1.head,\n indexOf: lodash_1.indexOf,\n initial: lodash_1.initial,\n intersection: lodash_1.intersection,\n intersectionBy: lodash_1.intersectionBy,\n intersectionWith: lodash_1.intersectionWith,\n join: lodash_1.join,\n last: lodash_1.last,\n lastIndexOf: lodash_1.lastIndexOf,\n nth: lodash_1.nth,\n slice: lodash_1.slice,\n sortedIndex: lodash_1.sortedIndex,\n sortedIndexBy: lodash_1.sortedIndexBy,\n sortedIndexOf: lodash_1.sortedIndexOf,\n sortedLastIndex: lodash_1.sortedLastIndex,\n sortedLastIndexBy: lodash_1.sortedLastIndexBy,\n sortedLastIndexOf: lodash_1.sortedLastIndexOf,\n sortedUniq: lodash_1.sortedUniq,\n sortedUniqBy: lodash_1.sortedUniqBy,\n tail: lodash_1.tail,\n take: lodash_1.take,\n takeRight: lodash_1.takeRight,\n takeRightWhile: lodash_1.takeRightWhile,\n takeWhile: lodash_1.takeWhile,\n union: lodash_1.union,\n unionBy: lodash_1.unionBy,\n unionWith: lodash_1.unionWith,\n uniq: lodash_1.uniq,\n uniqBy: lodash_1.uniqBy,\n uniqWith: lodash_1.uniqWith,\n unzip: lodash_1.unzip,\n unzipWith: lodash_1.unzipWith,\n without: lodash_1.without,\n xor: lodash_1.xor,\n xorBy: lodash_1.xorBy,\n xorWith: lodash_1.xorWith,\n zip: lodash_1.zip,\n zipObject: lodash_1.zipObject,\n zipObjectDeep: lodash_1.zipObjectDeep,\n zipWith: lodash_1.zipWith,\n countBy: lodash_1.countBy,\n every: lodash_1.every,\n filter: lodash_1.filter,\n find: lodash_1.find,\n findLast: lodash_1.findLast,\n flatMap: lodash_1.flatMap,\n flatMapDeep: lodash_1.flatMapDeep,\n flatMapDepth: lodash_1.flatMapDepth,\n groupBy: lodash_1.groupBy,\n includes: lodash_1.includes,\n invokeMap: lodash_1.invokeMap,\n keyBy: lodash_1.keyBy,\n map: lodash_1.map,\n orderBy: lodash_1.orderBy,\n partition: lodash_1.partition,\n reduce: lodash_1.reduce,\n reduceRight: lodash_1.reduceRight,\n reject: lodash_1.reject,\n sample: lodash_1.sample,\n sampleSize: lodash_1.sampleSize,\n shuffle: lodash_1.shuffle,\n size: lodash_1.size,\n some: lodash_1.some,\n sortBy: lodash_1.sortBy,\n now: lodash_1.now,\n flip: lodash_1.flip,\n negate: lodash_1.negate,\n overArgs: lodash_1.overArgs,\n partial: lodash_1.partial,\n partialRight: lodash_1.partialRight,\n rearg: lodash_1.rearg,\n rest: lodash_1.rest,\n spread: lodash_1.spread,\n castArray: lodash_1.castArray,\n clone: lodash_1.clone,\n cloneDeepWith: lodash_1.cloneDeepWith,\n cloneDeep: lodash_1.cloneDeep,\n conformsTo: lodash_1.conformsTo,\n eq: lodash_1.eq,\n gt: lodash_1.gt,\n gte: lodash_1.gte,\n isArguments: lodash_1.isArguments,\n isArray: lodash_1.isArray,\n isArrayBuffer: lodash_1.isArrayBuffer,\n isArrayLike: lodash_1.isArrayLike,\n isArrayLikeObject: lodash_1.isArrayLikeObject,\n isBoolean: lodash_1.isBoolean,\n isBuffer: lodash_1.isBuffer,\n isDate: lodash_1.isDate,\n isElement: lodash_1.isElement,\n isEmpty: lodash_1.isEmpty,\n isEqual: lodash_1.isEqual,\n isEqualWith: lodash_1.isEqualWith,\n isError: lodash_1.isError,\n isFinite: lodash_1.isFinite,\n isFunction: lodash_1.isFunction,\n isInteger: lodash_1.isInteger,\n isLength: lodash_1.isLength,\n isMap: lodash_1.isMap,\n isMatch: lodash_1.isMatch,\n isMatchWith: lodash_1.isMatchWith,\n isNaN: lodash_1.isNaN,\n isNative: lodash_1.isNative,\n isNil: lodash_1.isNil,\n isNull: lodash_1.isNull,\n isNumber: lodash_1.isNumber,\n isObject: lodash_1.isObject,\n isObjectLike: lodash_1.isObjectLike,\n isPlainObject: lodash_1.isPlainObject,\n isRegExp: lodash_1.isRegExp,\n isSafeInteger: lodash_1.isSafeInteger,\n isSet: lodash_1.isSet,\n isString: lodash_1.isString,\n isSymbol: lodash_1.isSymbol,\n isTypedArray: lodash_1.isTypedArray,\n isUndefined: lodash_1.isUndefined,\n isWeakMap: lodash_1.isWeakMap,\n isWeakSet: lodash_1.isWeakSet,\n lt: lodash_1.lt,\n lte: lodash_1.lte,\n toArray: lodash_1.toArray,\n toFinite: lodash_1.toFinite,\n toInteger: lodash_1.toInteger,\n toLength: lodash_1.toLength,\n toNumber: lodash_1.toNumber,\n toPlainObject: lodash_1.toPlainObject,\n toSafeInteger: lodash_1.toSafeInteger,\n toString: lodash_1.toString,\n add: lodash_1.add,\n ceil: lodash_1.ceil,\n divide: lodash_1.divide,\n floor: lodash_1.floor,\n max: lodash_1.max,\n maxBy: lodash_1.maxBy,\n mean: lodash_1.mean,\n meanBy: lodash_1.meanBy,\n min: lodash_1.min,\n minBy: lodash_1.minBy,\n multiply: lodash_1.multiply,\n round: lodash_1.round,\n subtract: lodash_1.subtract,\n sum: lodash_1.sum,\n sumBy: lodash_1.sumBy,\n clamp: lodash_1.clamp,\n inRange: lodash_1.inRange,\n random: lodash_1.random,\n at: lodash_1.at,\n entries: lodash_1.entries,\n entriesIn: lodash_1.entriesIn,\n findKey: lodash_1.findKey,\n findLastKey: lodash_1.findLastKey,\n functions: lodash_1.functions,\n functionsIn: lodash_1.functionsIn,\n get: lodash_1.get,\n has: lodash_1.has,\n hasIn: lodash_1.hasIn,\n invert: lodash_1.invert,\n invertBy: lodash_1.invertBy,\n invoke: lodash_1.invoke,\n keys: lodash_1.keys,\n keysIn: lodash_1.keysIn,\n mapKeys: lodash_1.mapKeys,\n mapValues: lodash_1.mapValues,\n omit: lodash_1.omit,\n omitBy: lodash_1.omitBy,\n pick: lodash_1.pick,\n pickBy: lodash_1.pickBy,\n result: lodash_1.result,\n toPairs: lodash_1.toPairs,\n toPairsIn: lodash_1.toPairsIn,\n transform: lodash_1.transform,\n values: lodash_1.values,\n valuesIn: lodash_1.valuesIn,\n camelCase: lodash_1.camelCase,\n capitalize: lodash_1.capitalize,\n deburr: lodash_1.deburr,\n endsWith: lodash_1.endsWith,\n escape: lodash_1.escape,\n escapeRegExp: lodash_1.escapeRegExp,\n kebabCase: lodash_1.kebabCase,\n lowerCase: lodash_1.lowerCase,\n lowerFirst: lodash_1.lowerFirst,\n pad: lodash_1.pad,\n padEnd: lodash_1.padEnd,\n padStart: lodash_1.padStart,\n parseInt: lodash_1.parseInt,\n repeat: lodash_1.repeat,\n replace: lodash_1.replace,\n snakeCase: lodash_1.snakeCase,\n split: lodash_1.split,\n startCase: lodash_1.startCase,\n startsWith: lodash_1.startsWith,\n toLower: lodash_1.toLower,\n toUpper: lodash_1.toUpper,\n trim: lodash_1.trim,\n trimEnd: lodash_1.trimEnd,\n trimStart: lodash_1.trimStart,\n truncate: lodash_1.truncate,\n unescape: lodash_1.unescape,\n upperCase: lodash_1.upperCase,\n upperFirst: lodash_1.upperFirst,\n words: lodash_1.words,\n cond: lodash_1.cond,\n conforms: lodash_1.conforms,\n constant: lodash_1.constant,\n defaultTo: lodash_1.defaultTo,\n flow: lodash_1.flow,\n flowRight: lodash_1.flowRight,\n identity: lodash_1.identity,\n iteratee: lodash_1.iteratee,\n matches: lodash_1.matches,\n matchesProperty: lodash_1.matchesProperty,\n method: lodash_1.method,\n methodOf: lodash_1.methodOf,\n nthArg: lodash_1.nthArg,\n over: lodash_1.over,\n overEvery: lodash_1.overEvery,\n overSome: lodash_1.overSome,\n property: lodash_1.property,\n propertyOf: lodash_1.propertyOf,\n range: lodash_1.range,\n rangeRight: lodash_1.rangeRight,\n stubArray: lodash_1.stubArray,\n stubFalse: lodash_1.stubFalse,\n stubObject: lodash_1.stubObject,\n stubString: lodash_1.stubString,\n stubTrue: lodash_1.stubTrue,\n times: lodash_1.times,\n toPath: lodash_1.toPath,\n uniqueId: lodash_1.uniqueId\n};\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/lib/modules/jsonlogic/operators.js?");
|
107
107
|
|
108
108
|
/***/ }),
|
109
109
|
|
@@ -114,7 +114,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexpo
|
|
114
114
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
115
115
|
|
116
116
|
"use strict";
|
117
|
-
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 */ \"./node_modules/@formio/core/lib/modules/jsonlogic/index.js\"));\nconst
|
117
|
+
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 */ \"./node_modules/@formio/core/lib/modules/jsonlogic/index.js\"));\nconst lodash_1 = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.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, lodash_1.set)(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/./node_modules/@formio/core/lib/process/calculation/index.js?");
|
118
118
|
|
119
119
|
/***/ }),
|
120
120
|
|
@@ -125,7 +125,7 @@ eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _argument
|
|
125
125
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
126
126
|
|
127
127
|
"use strict";
|
128
|
-
eval("\
|
128
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.clearHiddenProcessInfo = exports.clearHiddenProcess = void 0;\nconst lodash_1 = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\n/**\n * This processor function checks components for the `hidden` property and unsets corresponding data\n */\nconst clearHiddenProcess = (context) => {\n var _a;\n const { component, data, path, value, scope } = context;\n if (!scope.clearHidden) {\n scope.clearHidden = {};\n }\n const conditionallyHidden = (_a = scope.conditionals) === null || _a === void 0 ? void 0 : _a.find((cond) => {\n return cond.path === path;\n });\n if ((conditionallyHidden === null || conditionallyHidden === void 0 ? void 0 : conditionallyHidden.conditionallyHidden) &&\n (value !== undefined) &&\n (!component.hasOwnProperty('clearOnHide') || component.clearOnHide)) {\n (0, lodash_1.unset)(data, path);\n scope.clearHidden[path] = true;\n }\n};\nexports.clearHiddenProcess = clearHiddenProcess;\nexports.clearHiddenProcessInfo = {\n name: 'clearHidden',\n shouldProcess: () => true,\n processSync: exports.clearHiddenProcess,\n};\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/lib/process/clearHidden.js?");
|
129
129
|
|
130
130
|
/***/ }),
|
131
131
|
|
@@ -136,7 +136,7 @@ eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {
|
|
136
136
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
137
137
|
|
138
138
|
"use strict";
|
139
|
-
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};\
|
139
|
+
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.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 */ \"./node_modules/@formio/core/lib/utils/index.js\");\nconst lodash_1 = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nconst formUtil_1 = __webpack_require__(/*! ../../utils/formUtil */ \"./node_modules/@formio/core/lib/utils/formUtil.js\");\nconst conditions_1 = __webpack_require__(/*! ../../utils/conditions */ \"./node_modules/@formio/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 let conditionalComp = scope.conditionals.find((cond) => (cond.path === path));\n if (!conditionalComp) {\n conditionalComp = { path, conditionallyHidden: false };\n scope.conditionals.push(conditionalComp);\n }\n if (skipOnServer(context)) {\n return false;\n }\n conditionalComp.conditionallyHidden = conditionalComp.conditionallyHidden || isHidden(context);\n if (conditionalComp.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 (0, lodash_1.set)(comp, 'hidden', true);\n });\n }\n else {\n (0, lodash_1.set)(component, 'hidden', true);\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/./node_modules/@formio/core/lib/process/conditions/index.js?");
|
140
140
|
|
141
141
|
/***/ }),
|
142
142
|
|
@@ -147,7 +147,7 @@ eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _argument
|
|
147
147
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
148
148
|
|
149
149
|
"use strict";
|
150
|
-
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.defaultValueProcessInfo = exports.serverDefaultValueProcessInfo = exports.customDefaultValueProcessInfo = exports.defaultValueProcessSync = exports.defaultValueProcess = exports.serverDefaultValueProcessSync = exports.serverDefaultValueProcess = exports.customDefaultValueProcessSync = exports.customDefaultValueProcess = exports.hasDefaultValue = exports.hasServerDefaultValue = exports.hasCustomDefaultValue = void 0;\nconst jsonlogic_1 = __importDefault(__webpack_require__(/*! ../../modules/jsonlogic */ \"./node_modules/@formio/core/lib/modules/jsonlogic/index.js\"));\nconst
|
150
|
+
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.defaultValueProcessInfo = exports.serverDefaultValueProcessInfo = exports.customDefaultValueProcessInfo = exports.defaultValueProcessSync = exports.defaultValueProcess = exports.serverDefaultValueProcessSync = exports.serverDefaultValueProcess = exports.customDefaultValueProcessSync = exports.customDefaultValueProcess = exports.hasDefaultValue = exports.hasServerDefaultValue = exports.hasCustomDefaultValue = void 0;\nconst jsonlogic_1 = __importDefault(__webpack_require__(/*! ../../modules/jsonlogic */ \"./node_modules/@formio/core/lib/modules/jsonlogic/index.js\"));\nconst lodash_1 = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nconst formUtil_1 = __webpack_require__(/*! ../../utils/formUtil */ \"./node_modules/@formio/core/lib/utils/formUtil.js\");\nconst Evaluator = jsonlogic_1.default.evaluator;\nconst hasCustomDefaultValue = (context) => {\n const { component } = context;\n if (!component.customDefaultValue) {\n return false;\n }\n return true;\n};\nexports.hasCustomDefaultValue = hasCustomDefaultValue;\nconst hasServerDefaultValue = (context) => {\n const { component } = context;\n if (!component.hasOwnProperty('defaultValue')) {\n return false;\n }\n return true;\n};\nexports.hasServerDefaultValue = hasServerDefaultValue;\nconst hasDefaultValue = (context) => {\n return (0, exports.hasCustomDefaultValue)(context) || (0, exports.hasServerDefaultValue)(context);\n};\nexports.hasDefaultValue = hasDefaultValue;\nconst customDefaultValueProcess = (context) => __awaiter(void 0, void 0, void 0, function* () {\n return (0, exports.customDefaultValueProcessSync)(context);\n});\nexports.customDefaultValueProcess = customDefaultValueProcess;\nconst customDefaultValueProcessSync = (context) => {\n const { component, row, data, scope, evalContext, path } = context;\n if (!(0, exports.hasCustomDefaultValue)(context)) {\n return;\n }\n if (!scope.defaultValues)\n scope.defaultValues = [];\n if ((0, lodash_1.has)(row, (0, formUtil_1.getComponentKey)(component))) {\n return;\n }\n let defaultValue = null;\n if (component.customDefaultValue) {\n const evalContextValue = evalContext ? evalContext(context) : context;\n evalContextValue.value = null;\n defaultValue = Evaluator.evaluate(component.customDefaultValue, evalContextValue, 'value');\n if (component.multiple && !Array.isArray(defaultValue)) {\n defaultValue = defaultValue ? [defaultValue] : [];\n }\n scope.defaultValues.push({\n path,\n value: defaultValue\n });\n }\n if (defaultValue !== null && defaultValue !== undefined) {\n (0, lodash_1.set)(data, path, defaultValue);\n }\n};\nexports.customDefaultValueProcessSync = customDefaultValueProcessSync;\nconst serverDefaultValueProcess = (context) => __awaiter(void 0, void 0, void 0, function* () {\n return (0, exports.serverDefaultValueProcessSync)(context);\n});\nexports.serverDefaultValueProcess = serverDefaultValueProcess;\nconst serverDefaultValueProcessSync = (context) => {\n const { component, row, data, scope, path } = context;\n if (!(0, exports.hasServerDefaultValue)(context)) {\n return;\n }\n if (!scope.defaultValues)\n scope.defaultValues = [];\n if ((0, lodash_1.has)(row, (0, formUtil_1.getComponentKey)(component))) {\n return;\n }\n let defaultValue = null;\n if (component.defaultValue !== undefined &&\n component.defaultValue !== null) {\n defaultValue = component.defaultValue;\n if (component.multiple && !Array.isArray(defaultValue)) {\n defaultValue = defaultValue ? [defaultValue] : [];\n }\n scope.defaultValues.push({\n path,\n value: defaultValue\n });\n }\n if (defaultValue !== null && defaultValue !== undefined) {\n (0, lodash_1.set)(data, path, defaultValue);\n }\n};\nexports.serverDefaultValueProcessSync = serverDefaultValueProcessSync;\nconst defaultValueProcess = (context) => __awaiter(void 0, void 0, void 0, function* () {\n return (0, exports.defaultValueProcessSync)(context);\n});\nexports.defaultValueProcess = defaultValueProcess;\nconst defaultValueProcessSync = (context) => {\n (0, exports.customDefaultValueProcessSync)(context);\n (0, exports.serverDefaultValueProcessSync)(context);\n};\nexports.defaultValueProcessSync = defaultValueProcessSync;\nexports.customDefaultValueProcessInfo = {\n name: 'customDefaultValue',\n process: exports.customDefaultValueProcess,\n processSync: exports.customDefaultValueProcessSync,\n shouldProcess: exports.hasCustomDefaultValue,\n};\nexports.serverDefaultValueProcessInfo = {\n name: 'serverDefaultValue',\n process: exports.serverDefaultValueProcess,\n processSync: exports.serverDefaultValueProcessSync,\n shouldProcess: exports.hasServerDefaultValue,\n};\nexports.defaultValueProcessInfo = {\n name: 'defaultValue',\n process: exports.defaultValueProcess,\n processSync: exports.defaultValueProcessSync,\n shouldProcess: exports.hasDefaultValue,\n};\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/lib/process/defaultValue/index.js?");
|
151
151
|
|
152
152
|
/***/ }),
|
153
153
|
|
@@ -169,7 +169,7 @@ eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _argument
|
|
169
169
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
170
170
|
|
171
171
|
"use strict";
|
172
|
-
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};\
|
172
|
+
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.fetchProcessInfo = exports.fetchProcess = exports.shouldFetch = void 0;\nconst lodash_1 = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nconst utils_1 = __webpack_require__(/*! ../../utils */ \"./node_modules/@formio/core/lib/utils/index.js\");\nconst formUtil_1 = __webpack_require__(/*! ../../utils/formUtil */ \"./node_modules/@formio/core/lib/utils/formUtil.js\");\nconst shouldFetch = (context) => {\n const { component, config } = context;\n if (component.type !== 'datasource' ||\n ((config === null || config === void 0 ? void 0 : config.server) && !(0, lodash_1.get)(component, 'trigger.server', false))) {\n return false;\n }\n return true;\n};\nexports.shouldFetch = shouldFetch;\nconst fetchProcess = (context) => __awaiter(void 0, void 0, void 0, function* () {\n var _a;\n const { component, row, evalContext, path, scope, config } = context;\n let _fetch = null;\n try {\n _fetch = context.fetch ? context.fetch : fetch;\n }\n catch (err) {\n _fetch = null;\n }\n if (!_fetch) {\n console.log('You must provide a fetch interface to the fetch processor.');\n return;\n }\n if (!(0, exports.shouldFetch)(context)) {\n return;\n }\n if (!scope.fetched)\n scope.fetched = {};\n const evalContextValue = evalContext ? evalContext(context) : context;\n const url = utils_1.Evaluator.interpolateString((0, lodash_1.get)(component, 'fetch.url', ''), evalContextValue);\n if (!url) {\n return;\n }\n const request = {\n method: (0, lodash_1.get)(component, 'fetch.method', 'get').toUpperCase(),\n headers: {}\n };\n if ((config === null || config === void 0 ? void 0 : config.headers) &&\n (component === null || component === void 0 ? void 0 : component.fetch) &&\n ((_a = component === null || component === void 0 ? void 0 : component.fetch) === null || _a === void 0 ? void 0 : _a.forwardHeaders)) {\n request.headers = JSON.parse(JSON.stringify(config.headers));\n delete request.headers['host'];\n delete request.headers['content-length'];\n delete request.headers['content-type'];\n delete request.headers['connection'];\n delete request.headers['cache-control'];\n }\n request.headers['Accept'] = '*/*';\n request.headers['user-agent'] = 'Form.io DataSource Component';\n (0, lodash_1.get)(component, 'fetch.headers', []).map((header) => {\n header.value = utils_1.Evaluator.interpolateString(header.value, evalContextValue);\n if (header.value && header.key) {\n request.headers[header.key] = header.value;\n }\n return header;\n });\n if ((0, lodash_1.get)(component, 'fetch.authenticate', false) && (config === null || config === void 0 ? void 0 : config.tokens)) {\n Object.assign(request.headers, config.tokens);\n }\n const body = (0, lodash_1.get)(component, 'fetch.specifyBody', '');\n if (request.method === 'POST') {\n request.body = JSON.stringify(utils_1.Evaluator.evaluate(body, evalContextValue, 'body'));\n }\n try {\n // Perform the fetch.\n const result = yield (yield _fetch(url, request)).json();\n const mapFunction = (0, lodash_1.get)(component, 'fetch.mapFunction');\n // Set the row data of the fetched value.\n const key = (0, formUtil_1.getComponentKey)(component);\n (0, lodash_1.set)(row, key, mapFunction ? utils_1.Evaluator.evaluate(mapFunction, Object.assign(Object.assign({}, evalContextValue), { responseData: result }), 'value') : result);\n // Make sure the value does not get filtered for now...\n if (!scope.filter)\n scope.filter = {};\n scope.filter[path] = true;\n scope.fetched[path] = true;\n }\n catch (err) {\n console.log(err.message);\n }\n});\nexports.fetchProcess = fetchProcess;\nexports.fetchProcessInfo = {\n name: 'fetch',\n process: exports.fetchProcess,\n shouldProcess: exports.shouldFetch,\n};\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/lib/process/fetch/index.js?");
|
173
173
|
|
174
174
|
/***/ }),
|
175
175
|
|
@@ -180,7 +180,7 @@ eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _argument
|
|
180
180
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
181
181
|
|
182
182
|
"use strict";
|
183
|
-
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};\
|
183
|
+
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.filterProcessInfo = exports.filterPostProcess = exports.filterProcess = exports.filterProcessSync = void 0;\nconst lodash_1 = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nconst utils_1 = __webpack_require__(/*! ../../utils */ \"./node_modules/@formio/core/lib/utils/index.js\");\nconst lodash_2 = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nconst formUtil_1 = __webpack_require__(/*! ../../utils/formUtil */ \"./node_modules/@formio/core/lib/utils/formUtil.js\");\nconst filterProcessSync = (context) => {\n const { scope, component } = context;\n let { value } = context;\n const absolutePath = (0, formUtil_1.getComponentAbsolutePath)(component);\n if (!scope.filter)\n scope.filter = {};\n if (value !== undefined) {\n const modelType = utils_1.Utils.getModelType(component);\n switch (modelType) {\n case 'dataObject':\n scope.filter[absolutePath] = {\n compModelType: modelType,\n include: true,\n value: { data: {} }\n };\n break;\n case 'array':\n scope.filter[absolutePath] = {\n compModelType: modelType,\n include: true,\n };\n break;\n case 'object':\n if (component.type !== 'container') {\n scope.filter[absolutePath] = {\n compModelType: modelType,\n include: true,\n };\n }\n break;\n default:\n scope.filter[absolutePath] = {\n compModelType: modelType,\n include: true,\n };\n break;\n }\n }\n};\nexports.filterProcessSync = filterProcessSync;\nconst filterProcess = (context) => __awaiter(void 0, void 0, void 0, function* () {\n return (0, exports.filterProcessSync)(context);\n});\nexports.filterProcess = filterProcess;\nconst filterPostProcess = (context) => {\n const { scope, submission } = context;\n const filtered = {};\n for (const path in scope.filter) {\n if (scope.filter[path].include) {\n let value = (0, lodash_2.get)(submission === null || submission === void 0 ? void 0 : submission.data, path);\n if ((0, lodash_2.isObject)(value) && (0, lodash_2.isObject)(scope.filter[path].value)) {\n if (scope.filter[path].compModelType === 'dataObject') {\n value = Object.assign(Object.assign(Object.assign({}, value), scope.filter[path].value), { data: value === null || value === void 0 ? void 0 : value.data });\n }\n else {\n value = Object.assign(Object.assign({}, value), scope.filter[path].value);\n }\n }\n (0, lodash_1.set)(filtered, path, value);\n }\n }\n context.data = filtered;\n};\nexports.filterPostProcess = filterPostProcess;\nexports.filterProcessInfo = {\n name: 'filter',\n process: exports.filterProcess,\n processSync: exports.filterProcessSync,\n postProcess: exports.filterPostProcess,\n shouldProcess: (context) => true,\n};\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/lib/process/filter/index.js?");
|
184
184
|
|
185
185
|
/***/ }),
|
186
186
|
|
@@ -213,7 +213,7 @@ eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _argument
|
|
213
213
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
214
214
|
|
215
215
|
"use strict";
|
216
|
-
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.normalizeProcessInfo = exports.normalizeProcessSync = exports.normalizeProcess = void 0;\nconst get_1 = __importDefault(__webpack_require__(/*! lodash/get */ \"./node_modules/lodash/get.js\"));\nconst set_1 = __importDefault(__webpack_require__(/*! lodash/set */ \"./node_modules/lodash/set.js\"));\nconst isString_1 = __importDefault(__webpack_require__(/*! lodash/isString */ \"./node_modules/lodash/isString.js\"));\nconst toString_1 = __importDefault(__webpack_require__(/*! lodash/toString */ \"./node_modules/lodash/toString.js\"));\nconst isNil_1 = __importDefault(__webpack_require__(/*! lodash/isNil */ \"./node_modules/lodash/isNil.js\"));\nconst isObject_1 = __importDefault(__webpack_require__(/*! lodash/isObject */ \"./node_modules/lodash/isObject.js\"));\nconst dayjs_1 = __importDefault(__webpack_require__(/*! dayjs */ \"./node_modules/dayjs/dayjs.min.js\"));\nconst customParseFormat_1 = __importDefault(__webpack_require__(/*! dayjs/plugin/customParseFormat */ \"./node_modules/dayjs/plugin/customParseFormat.js\"));\ndayjs_1.default.extend(customParseFormat_1.default);\nconst isAddressComponent = (component) => component.type === \"address\";\nconst isDayComponent = (component) => component.type === \"day\";\nconst isEmailComponent = (component) => component.type === \"email\";\nconst isRadioComponent = (component) => component.type === \"radio\";\nconst isRecaptchaComponent = (component) => component.type === \"recaptcha\";\nconst isSelectComponent = (component) => component.type === \"select\";\nconst isSelectBoxesComponent = (component) => component.type === \"selectboxes\";\nconst isTagsComponent = (component) => component.type === \"tags\";\nconst isTextFieldComponent = (component) => component.type === \"textfield\";\nconst isTimeComponent = (component) => component.type === \"time\";\nconst normalizeAddressComponentValue = (component, value) => {\n if (!component.multiple && Boolean(component.enableManualMode) && value && !value.mode) {\n return {\n mode: 'autocomplete',\n address: value,\n };\n }\n return value;\n};\nconst getLocaleDateFormatInfo = (locale = 'en') => {\n const formatInfo = {};\n const day = 21;\n const exampleDate = new Date(2017, 11, day);\n const localDateString = exampleDate.toLocaleDateString(locale);\n formatInfo.dayFirst = localDateString.slice(0, 2) === day.toString();\n return formatInfo;\n};\nconst getLocaleDayFirst = (component, form) => {\n var _a;\n if (component.useLocaleSettings) {\n return getLocaleDateFormatInfo((_a = form.options) === null || _a === void 0 ? void 0 : _a.language).dayFirst;\n }\n return component.dayFirst;\n};\nconst normalizeDayComponentValue = (component, form, value) => {\n // TODO: this is a quick and dirty port of the Day component's normalizeValue method, may need some updates\n const valueMask = /^\\d{2}\\/\\d{2}\\/\\d{4}$/;\n const isDayFirst = getLocaleDayFirst(component, form);\n const showDay = !(0, get_1.default)(component, 'fields.day.hide', false);\n const showMonth = !(0, get_1.default)(component, 'fields.month.hide', false);\n const showYear = !(0, get_1.default)(component, 'fields.year.hide', false);\n if (!value || valueMask.test(value)) {\n return value;\n }\n let dateParts = [];\n const valueParts = value.split('/');\n const [DAY, MONTH, YEAR] = component.dayFirst ? [0, 1, 2] : [1, 0, 2];\n const defaultValue = component.defaultValue ? component.defaultValue.split('/') : '';\n const getNextPart = (shouldTake, defaultValue) => dateParts.push(shouldTake ? valueParts.shift() : defaultValue);\n if (isDayFirst) {\n getNextPart(showDay, defaultValue ? defaultValue[DAY] : '00');\n }\n getNextPart(showMonth, defaultValue ? defaultValue[MONTH] : '00');\n if (!isDayFirst) {\n getNextPart(showDay, defaultValue ? defaultValue[DAY] : '00');\n }\n getNextPart(showYear, defaultValue ? defaultValue[YEAR] : '0000');\n return dateParts.join('/');\n};\nconst normalizeRadioComponentValue = (value) => {\n const isEquivalent = (0, toString_1.default)(value) === Number(value).toString();\n if (!isNaN(parseFloat(value)) && isFinite(value) && isEquivalent) {\n return +value;\n }\n if (value === 'true') {\n return true;\n }\n if (value === 'false') {\n return false;\n }\n return value;\n};\nconst normalizeSingleSelectComponentValue = (component, value) => {\n if ((0, isNil_1.default)(value)) {\n return;\n }\n const valueIsObject = (0, isObject_1.default)(value);\n //check if value equals to default emptyValue\n if (valueIsObject && Object.keys(value).length === 0) {\n return value;\n }\n const dataType = component.dataType || 'auto';\n const normalize = {\n value,\n number() {\n const numberValue = Number(this.value);\n const isEquivalent = value.toString() === numberValue.toString();\n if (!Number.isNaN(numberValue) && Number.isFinite(numberValue) && value !== '' && isEquivalent) {\n this.value = numberValue;\n }\n return this;\n },\n boolean() {\n if ((0, isString_1.default)(this.value) && (this.value.toLowerCase() === 'true' || this.value.toLowerCase() === 'false')) {\n this.value = (this.value.toLowerCase() === 'true');\n }\n return this;\n },\n string() {\n this.value = String(this.value);\n return this;\n },\n object() {\n return this;\n },\n auto() {\n if ((0, isObject_1.default)(this.value)) {\n this.value = this.object().value;\n }\n else {\n this.value = this.string().number().boolean().value;\n }\n return this;\n }\n };\n try {\n return normalize[dataType]().value;\n }\n catch (err) {\n console.warn('Failed to normalize value', err);\n return value;\n }\n};\nconst normalizeSelectComponentValue = (component, value) => {\n if (component.multiple && Array.isArray(value)) {\n return value.map((singleValue) => normalizeSingleSelectComponentValue(component, singleValue));\n }\n return normalizeSingleSelectComponentValue(component, value);\n};\nconst normalizeSelectBoxesComponentValue = (value) => {\n if (!value) {\n value = {};\n }\n if (typeof value !== 'object') {\n if (typeof value === 'string') {\n return {\n [value]: true\n };\n }\n else {\n return {};\n }\n }\n if (Array.isArray(value)) {\n return value.reduce((acc, curr) => {\n return Object.assign(Object.assign({}, acc), { [curr]: true });\n }, {});\n }\n return value;\n};\nconst normalizeTagsComponentValue = (component, value) => {\n const delimiter = component.delimeter || ',';\n if ((!component.hasOwnProperty('storeas') || component.storeas === 'string') && Array.isArray(value)) {\n return value.join(delimiter);\n }\n else if (component.storeas === 'array' && typeof value === 'string') {\n return value.split(delimiter).filter(result => result);\n }\n return value;\n};\nconst normalizeMaskValue = (component, defaultValues, value, path) => {\n if (component.inputMasks && component.inputMasks.length > 0) {\n if (!value || typeof value !== 'object') {\n return {\n value: value,\n maskName: component.inputMasks[0].label\n };\n }\n if (!value.value) {\n const defaultValue = defaultValues === null || defaultValues === void 0 ? void 0 : defaultValues.find((defaultValue) => defaultValue.path === path);\n value.value = Array.isArray(defaultValue) && defaultValue.length > 0 ? defaultValue[0] : defaultValue;\n }\n }\n return value;\n};\nconst normalizeTextFieldComponentValue = (component, defaultValues, value, path) => {\n // If the component has truncate multiple spaces enabled, then normalize the value to remove extra spaces.\n if (component.truncateMultipleSpaces && typeof value === 'string') {\n value = value.trim().replace(/\\s{2,}/g, ' ');\n }\n if (component.allowMultipleMasks && component.inputMasks && component.inputMasks.length > 0) {\n if (Array.isArray(value)) {\n return value.map((val) => normalizeMaskValue(component, defaultValues, val, path));\n }\n else {\n return normalizeMaskValue(component, defaultValues, value, path);\n }\n }\n return value;\n};\n// Allow submissions of time components in their visual \"format\" property by coercing them to the \"dataFormat\" property\n// i.e. \"HH:mm\" -> \"HH:mm:ss\"\nconst normalizeTimeComponentValue = (component, value) => {\n const defaultDataFormat = 'HH:mm:ss';\n const defaultFormat = 'HH:mm';\n if ((0, dayjs_1.default)(value, component.format || defaultFormat, true).isValid()) {\n return (0, dayjs_1.default)(value, component.format || defaultFormat, true).format(component.dataFormat || defaultDataFormat);\n }\n return value;\n};\nconst normalizeProcess = (context) => __awaiter(void 0, void 0, void 0, function* () {\n return (0, exports.normalizeProcessSync)(context);\n});\nexports.normalizeProcess = normalizeProcess;\nconst normalizeProcessSync = (context) => {\n const { component, form, scope, path, data, value } = context;\n if (!scope.normalize) {\n scope.normalize = {};\n }\n let { defaultValues } = scope;\n scope.normalize[path] = {\n type: component.type,\n normalized: false\n };\n // First check for component-type-specific transformations\n if (isAddressComponent(component)) {\n (0, set_1.default)(data, path, normalizeAddressComponentValue(component, value));\n scope.normalize[path].normalized = true;\n }\n else if (isDayComponent(component)) {\n (0, set_1.default)(data, path, normalizeDayComponentValue(component, form, value));\n scope.normalize[path].normalized = true;\n }\n else if (isEmailComponent(component)) {\n if (value && typeof value === 'string') {\n (0, set_1.default)(data, path, value.toLowerCase());\n scope.normalize[path].normalized = true;\n }\n }\n else if (isRadioComponent(component)) {\n (0, set_1.default)(data, path, normalizeRadioComponentValue(value));\n scope.normalize[path].normalized = true;\n }\n else if (isSelectComponent(component)) {\n (0, set_1.default)(data, path, normalizeSelectComponentValue(component, value));\n scope.normalize[path].normalized = true;\n }\n else if (isSelectBoxesComponent(component)) {\n (0, set_1.default)(data, path, normalizeSelectBoxesComponentValue(value));\n scope.normalize[path].normalized = true;\n }\n else if (isTagsComponent(component)) {\n (0, set_1.default)(data, path, normalizeTagsComponentValue(component, value));\n scope.normalize[path].normalized = true;\n }\n else if (isTextFieldComponent(component)) {\n (0, set_1.default)(data, path, normalizeTextFieldComponentValue(component, defaultValues, value, path));\n scope.normalize[path].normalized = true;\n }\n else if (isTimeComponent(component)) {\n (0, set_1.default)(data, path, normalizeTimeComponentValue(component, value));\n scope.normalize[path].normalized = true;\n }\n // Next perform component-type-agnostic transformations (i.e. super())\n if (component.multiple && !Array.isArray(value)) {\n (0, set_1.default)(data, path, value ? [value] : []);\n scope.normalize[path].normalized = true;\n }\n};\nexports.normalizeProcessSync = normalizeProcessSync;\nexports.normalizeProcessInfo = {\n name: 'normalize',\n shouldProcess: () => true,\n process: exports.normalizeProcess,\n processSync: exports.normalizeProcessSync\n};\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/lib/process/normalize/index.js?");
|
216
|
+
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.normalizeProcessInfo = exports.normalizeProcessSync = exports.normalizeProcess = void 0;\nconst lodash_1 = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nconst dayjs_1 = __importDefault(__webpack_require__(/*! dayjs */ \"./node_modules/dayjs/dayjs.min.js\"));\nconst customParseFormat_1 = __importDefault(__webpack_require__(/*! dayjs/plugin/customParseFormat */ \"./node_modules/dayjs/plugin/customParseFormat.js\"));\ndayjs_1.default.extend(customParseFormat_1.default);\nconst isAddressComponent = (component) => component.type === \"address\";\nconst isDayComponent = (component) => component.type === \"day\";\nconst isEmailComponent = (component) => component.type === \"email\";\nconst isRadioComponent = (component) => component.type === \"radio\";\nconst isRecaptchaComponent = (component) => component.type === \"recaptcha\";\nconst isSelectComponent = (component) => component.type === \"select\";\nconst isSelectBoxesComponent = (component) => component.type === \"selectboxes\";\nconst isTagsComponent = (component) => component.type === \"tags\";\nconst isTextFieldComponent = (component) => component.type === \"textfield\";\nconst isTimeComponent = (component) => component.type === \"time\";\nconst normalizeAddressComponentValue = (component, value) => {\n if (!component.multiple && Boolean(component.enableManualMode) && value && !value.mode) {\n return {\n mode: 'autocomplete',\n address: value,\n };\n }\n return value;\n};\nconst getLocaleDateFormatInfo = (locale = 'en') => {\n const formatInfo = {};\n const day = 21;\n const exampleDate = new Date(2017, 11, day);\n const localDateString = exampleDate.toLocaleDateString(locale);\n formatInfo.dayFirst = localDateString.slice(0, 2) === day.toString();\n return formatInfo;\n};\nconst getLocaleDayFirst = (component, form) => {\n var _a;\n if (component.useLocaleSettings) {\n return getLocaleDateFormatInfo((_a = form.options) === null || _a === void 0 ? void 0 : _a.language).dayFirst;\n }\n return component.dayFirst;\n};\nconst normalizeDayComponentValue = (component, form, value) => {\n // TODO: this is a quick and dirty port of the Day component's normalizeValue method, may need some updates\n const valueMask = /^\\d{2}\\/\\d{2}\\/\\d{4}$/;\n const isDayFirst = getLocaleDayFirst(component, form);\n const showDay = !(0, lodash_1.get)(component, 'fields.day.hide', false);\n const showMonth = !(0, lodash_1.get)(component, 'fields.month.hide', false);\n const showYear = !(0, lodash_1.get)(component, 'fields.year.hide', false);\n if (!value || valueMask.test(value)) {\n return value;\n }\n let dateParts = [];\n const valueParts = value.split('/');\n const [DAY, MONTH, YEAR] = component.dayFirst ? [0, 1, 2] : [1, 0, 2];\n const defaultValue = component.defaultValue ? component.defaultValue.split('/') : '';\n const getNextPart = (shouldTake, defaultValue) => dateParts.push(shouldTake ? valueParts.shift() : defaultValue);\n if (isDayFirst) {\n getNextPart(showDay, defaultValue ? defaultValue[DAY] : '00');\n }\n getNextPart(showMonth, defaultValue ? defaultValue[MONTH] : '00');\n if (!isDayFirst) {\n getNextPart(showDay, defaultValue ? defaultValue[DAY] : '00');\n }\n getNextPart(showYear, defaultValue ? defaultValue[YEAR] : '0000');\n return dateParts.join('/');\n};\nconst normalizeRadioComponentValue = (value) => {\n const isEquivalent = (0, lodash_1.toString)(value) === Number(value).toString();\n if (!isNaN(parseFloat(value)) && isFinite(value) && isEquivalent) {\n return +value;\n }\n if (value === 'true') {\n return true;\n }\n if (value === 'false') {\n return false;\n }\n return value;\n};\nconst normalizeSingleSelectComponentValue = (component, value) => {\n if ((0, lodash_1.isNil)(value)) {\n return;\n }\n const valueIsObject = (0, lodash_1.isObject)(value);\n //check if value equals to default emptyValue\n if (valueIsObject && Object.keys(value).length === 0) {\n return value;\n }\n const dataType = component.dataType || 'auto';\n const normalize = {\n value,\n number() {\n const numberValue = Number(this.value);\n const isEquivalent = value.toString() === numberValue.toString();\n if (!Number.isNaN(numberValue) && Number.isFinite(numberValue) && value !== '' && isEquivalent) {\n this.value = numberValue;\n }\n return this;\n },\n boolean() {\n if ((0, lodash_1.isString)(this.value) && (this.value.toLowerCase() === 'true' || this.value.toLowerCase() === 'false')) {\n this.value = (this.value.toLowerCase() === 'true');\n }\n return this;\n },\n string() {\n this.value = String(this.value);\n return this;\n },\n object() {\n return this;\n },\n auto() {\n if ((0, lodash_1.isObject)(this.value)) {\n this.value = this.object().value;\n }\n else {\n this.value = this.string().number().boolean().value;\n }\n return this;\n }\n };\n try {\n return normalize[dataType]().value;\n }\n catch (err) {\n console.warn('Failed to normalize value', err);\n return value;\n }\n};\nconst normalizeSelectComponentValue = (component, value) => {\n if (component.multiple && Array.isArray(value)) {\n return value.map((singleValue) => normalizeSingleSelectComponentValue(component, singleValue));\n }\n return normalizeSingleSelectComponentValue(component, value);\n};\nconst normalizeSelectBoxesComponentValue = (value) => {\n if (!value) {\n value = {};\n }\n if (typeof value !== 'object') {\n if (typeof value === 'string') {\n return {\n [value]: true\n };\n }\n else {\n return {};\n }\n }\n if (Array.isArray(value)) {\n return value.reduce((acc, curr) => {\n return Object.assign(Object.assign({}, acc), { [curr]: true });\n }, {});\n }\n return value;\n};\nconst normalizeTagsComponentValue = (component, value) => {\n const delimiter = component.delimeter || ',';\n if ((!component.hasOwnProperty('storeas') || component.storeas === 'string') && Array.isArray(value)) {\n return value.join(delimiter);\n }\n else if (component.storeas === 'array' && typeof value === 'string') {\n return value.split(delimiter).filter(result => result);\n }\n return value;\n};\nconst normalizeMaskValue = (component, defaultValues, value, path) => {\n if (component.inputMasks && component.inputMasks.length > 0) {\n if (!value || typeof value !== 'object') {\n return {\n value: value,\n maskName: component.inputMasks[0].label\n };\n }\n if (!value.value) {\n const defaultValue = defaultValues === null || defaultValues === void 0 ? void 0 : defaultValues.find((defaultValue) => defaultValue.path === path);\n value.value = Array.isArray(defaultValue) && defaultValue.length > 0 ? defaultValue[0] : defaultValue;\n }\n }\n return value;\n};\nconst normalizeTextFieldComponentValue = (component, defaultValues, value, path) => {\n // If the component has truncate multiple spaces enabled, then normalize the value to remove extra spaces.\n if (component.truncateMultipleSpaces && typeof value === 'string') {\n value = value.trim().replace(/\\s{2,}/g, ' ');\n }\n if (component.allowMultipleMasks && component.inputMasks && component.inputMasks.length > 0) {\n if (Array.isArray(value)) {\n return value.map((val) => normalizeMaskValue(component, defaultValues, val, path));\n }\n else {\n return normalizeMaskValue(component, defaultValues, value, path);\n }\n }\n return value;\n};\n// Allow submissions of time components in their visual \"format\" property by coercing them to the \"dataFormat\" property\n// i.e. \"HH:mm\" -> \"HH:mm:ss\"\nconst normalizeTimeComponentValue = (component, value) => {\n const defaultDataFormat = 'HH:mm:ss';\n const defaultFormat = 'HH:mm';\n if ((0, dayjs_1.default)(value, component.format || defaultFormat, true).isValid()) {\n return (0, dayjs_1.default)(value, component.format || defaultFormat, true).format(component.dataFormat || defaultDataFormat);\n }\n return value;\n};\nconst normalizeProcess = (context) => __awaiter(void 0, void 0, void 0, function* () {\n return (0, exports.normalizeProcessSync)(context);\n});\nexports.normalizeProcess = normalizeProcess;\nconst normalizeProcessSync = (context) => {\n const { component, form, scope, path, data, value } = context;\n if (!scope.normalize) {\n scope.normalize = {};\n }\n let { defaultValues } = scope;\n scope.normalize[path] = {\n type: component.type,\n normalized: false\n };\n // First check for component-type-specific transformations\n if (isAddressComponent(component)) {\n (0, lodash_1.set)(data, path, normalizeAddressComponentValue(component, value));\n scope.normalize[path].normalized = true;\n }\n else if (isDayComponent(component)) {\n (0, lodash_1.set)(data, path, normalizeDayComponentValue(component, form, value));\n scope.normalize[path].normalized = true;\n }\n else if (isEmailComponent(component)) {\n if (value && typeof value === 'string') {\n (0, lodash_1.set)(data, path, value.toLowerCase());\n scope.normalize[path].normalized = true;\n }\n }\n else if (isRadioComponent(component)) {\n (0, lodash_1.set)(data, path, normalizeRadioComponentValue(value));\n scope.normalize[path].normalized = true;\n }\n else if (isSelectComponent(component)) {\n (0, lodash_1.set)(data, path, normalizeSelectComponentValue(component, value));\n scope.normalize[path].normalized = true;\n }\n else if (isSelectBoxesComponent(component)) {\n (0, lodash_1.set)(data, path, normalizeSelectBoxesComponentValue(value));\n scope.normalize[path].normalized = true;\n }\n else if (isTagsComponent(component)) {\n (0, lodash_1.set)(data, path, normalizeTagsComponentValue(component, value));\n scope.normalize[path].normalized = true;\n }\n else if (isTextFieldComponent(component)) {\n (0, lodash_1.set)(data, path, normalizeTextFieldComponentValue(component, defaultValues, value, path));\n scope.normalize[path].normalized = true;\n }\n else if (isTimeComponent(component)) {\n (0, lodash_1.set)(data, path, normalizeTimeComponentValue(component, value));\n scope.normalize[path].normalized = true;\n }\n // Next perform component-type-agnostic transformations (i.e. super())\n if (component.multiple && !Array.isArray(value)) {\n (0, lodash_1.set)(data, path, value ? [value] : []);\n scope.normalize[path].normalized = true;\n }\n};\nexports.normalizeProcessSync = normalizeProcessSync;\nexports.normalizeProcessInfo = {\n name: 'normalize',\n shouldProcess: () => true,\n process: exports.normalizeProcess,\n processSync: exports.normalizeProcessSync\n};\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/lib/process/normalize/index.js?");
|
217
217
|
|
218
218
|
/***/ }),
|
219
219
|
|
@@ -224,7 +224,7 @@ eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _argument
|
|
224
224
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
225
225
|
|
226
226
|
"use strict";
|
227
|
-
eval("\
|
227
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.populateProcessInfo = exports.populateProcessSync = void 0;\nconst lodash_1 = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nconst formUtil_1 = __webpack_require__(/*! ../../utils/formUtil */ \"./node_modules/@formio/core/lib/utils/formUtil.js\");\n// This processor ensures that a \"linked\" row context is provided to every component.\nconst populateProcessSync = (context) => {\n const { component, path, scope } = context;\n const { data } = scope;\n const compDataPath = (0, formUtil_1.componentPath)(component, (0, formUtil_1.getContextualRowPath)(component, path));\n const compData = (0, lodash_1.get)(data, compDataPath);\n if (!scope.populated)\n scope.populated = [];\n switch ((0, formUtil_1.getModelType)(component)) {\n case 'array':\n if (!compData || !compData.length) {\n (0, lodash_1.set)(data, compDataPath, [{}]);\n scope.row = (0, lodash_1.get)(data, compDataPath)[0];\n scope.populated.push({\n path,\n row: (0, lodash_1.get)(data, compDataPath)[0]\n });\n }\n break;\n case 'dataObject':\n case 'object':\n if (!compData || typeof compData !== 'object') {\n (0, lodash_1.set)(data, compDataPath, {});\n scope.row = (0, lodash_1.get)(data, compDataPath);\n scope.populated.push({\n path,\n row: (0, lodash_1.get)(data, compDataPath)\n });\n }\n break;\n }\n};\nexports.populateProcessSync = populateProcessSync;\nexports.populateProcessInfo = {\n name: 'populate',\n shouldProcess: (context) => true,\n processSync: exports.populateProcessSync,\n};\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/lib/process/populate/index.js?");
|
228
228
|
|
229
229
|
/***/ }),
|
230
230
|
|
@@ -345,7 +345,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexpo
|
|
345
345
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
346
346
|
|
347
347
|
"use strict";
|
348
|
-
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.validateAvailableItemsInfo = exports.validateAvailableItemsSync = exports.shouldValidate = exports.validateAvailableItems = void 0;\nconst isEmpty_1 = __importDefault(__webpack_require__(/*! lodash/isEmpty */ \"./node_modules/lodash/isEmpty.js\"));\nconst error_1 = __webpack_require__(/*! ../../../error */ \"./node_modules/@formio/core/lib/error/index.js\");\nconst utils_1 = __webpack_require__(/*! ../../../utils */ \"./node_modules/@formio/core/lib/utils/index.js\");\nconst util_1 = __webpack_require__(/*! ../util */ \"./node_modules/@formio/core/lib/process/validation/util.js\");\nfunction isValidatableRadioComponent(component) {\n var _a;\n return (component &&\n component.type === 'radio' &&\n !!((_a = component.validate) === null || _a === void 0 ? void 0 : _a.onlyAvailableItems) &&\n component.dataSrc === 'values');\n}\nfunction isValidateableSelectComponent(component) {\n var _a;\n return (component &&\n !!((_a = component.validate) === null || _a === void 0 ? void 0 : _a.hasOwnProperty('onlyAvailableItems')) &&\n component.type === 'select' &&\n component.dataSrc !== 'resource');\n}\nfunction mapDynamicValues(component, values) {\n return values.map((value) => {\n if (component.valueProperty) {\n return value[component.valueProperty];\n }\n return value;\n });\n}\nfunction mapStaticValues(values) {\n return values.map((obj) => obj.value);\n}\nfunction getAvailableSelectValues(component, context) {\n return __awaiter(this, void 0, void 0, function* () {\n switch (component.dataSrc) {\n case 'values':\n if (Array.isArray(component.data.values)) {\n return mapStaticValues(component.data.values);\n }\n throw new error_1.ProcessorError(`Failed to validate available values in static values select component '${component.key}': the values are not an array`, context, 'validate:validateAvailableItems');\n case 'json': {\n if (typeof component.data.json === 'string') {\n try {\n return mapDynamicValues(component, JSON.parse(component.data.json));\n }\n catch (err) {\n throw new error_1.ProcessorError(`Failed to validate available values in JSON select component '${component.key}': ${err}`, context, 'validate:validateAvailableItems');\n }\n }\n else if (Array.isArray(component.data.json)) {\n // TODO: need to retype this\n return mapDynamicValues(component, component.data.json);\n }\n else {\n throw new error_1.ProcessorError(`Failed to validate available values in JSON select component '${component.key}': the values are not an array`, context, 'validate:validateAvailableItems');\n }\n }\n case 'custom':\n const customItems = utils_1.Evaluator.evaluate(component.data.custom, {\n values: [],\n }, 'values');\n if ((0, util_1.isPromise)(customItems)) {\n const resolvedCustomItems = yield customItems;\n if (Array.isArray(resolvedCustomItems)) {\n return resolvedCustomItems;\n }\n throw new error_1.ProcessorError(`Failed to validate available values in JSON select component '${component.key}': the values are not an array`, context, 'validate:validateAvailableItems');\n }\n if (Array.isArray(customItems)) {\n return customItems;\n }\n else {\n throw new error_1.ProcessorError(`Failed to validate available values in JSON select component '${component.key}': the values are not an array`, context, 'validate:validateAvailableItems');\n }\n default:\n throw new error_1.ProcessorError(`Failed to validate available values in select component '${component.key}': data source ${component.dataSrc} is not valid}`, context, 'validate:validateAvailableItems');\n }\n });\n}\nfunction getAvailableSelectValuesSync(component, context) {\n var _a;\n switch (component.dataSrc) {\n case 'values':\n if (Array.isArray((_a = component.data) === null || _a === void 0 ? void 0 : _a.values)) {\n return mapStaticValues(component.data.values);\n }\n throw new error_1.ProcessorError(`Failed to validate available values in static values select component '${component.key}': the values are not an array`, context, 'validate:validateAvailableItems');\n case 'json': {\n if (typeof component.data.json === 'string') {\n try {\n return mapDynamicValues(component, JSON.parse(component.data.json));\n }\n catch (err) {\n throw new error_1.ProcessorError(`Failed to validate available values in JSON select component '${component.key}': ${err}`, context, 'validate:validateAvailableItems');\n }\n }\n else if (Array.isArray(component.data.json)) {\n // TODO: need to retype this\n return mapDynamicValues(component, component.data.json);\n }\n else {\n throw new error_1.ProcessorError(`Failed to validate available values in JSON select component '${component.key}': the values are not an array`, context, 'validate:validateAvailableItems');\n }\n }\n case 'custom':\n const customItems = utils_1.Evaluator.evaluate(component.data.custom, {\n values: [],\n }, 'values');\n if (Array.isArray(customItems)) {\n return customItems;\n }\n else {\n throw new error_1.ProcessorError(`Failed to validate available values in JSON select component '${component.key}': the values are not an array`, context, 'validate:validateAvailableItems');\n }\n default:\n throw new error_1.ProcessorError(`Failed to validate available values in select component '${component.key}': data source ${component.dataSrc} is not valid}`, context, 'validate:validateAvailableItems');\n }\n}\nfunction compareComplexValues(valueA, valueB, context) {\n if (!(0, util_1.isObject)(valueA) || !(0, util_1.isObject)(valueB)) {\n return false;\n }\n try {\n // TODO: we need to have normalized values here at this moment, otherwise\n // this won't work\n return JSON.stringify(valueA) === JSON.stringify(valueB);\n }\n catch (err) {\n throw new error_1.ProcessorError(`Error while comparing available values: ${err}`, context, 'validate:validateAvailableItems');\n }\n}\nconst validateAvailableItems = (context) => __awaiter(void 0, void 0, void 0, function* () {\n const { component, value } = context;\n const error = new error_1.FieldError('invalidOption', context, 'onlyAvailableItems');\n try {\n if (isValidatableRadioComponent(component)) {\n if (value == null || (0, isEmpty_1.default)(value)) {\n return null;\n }\n const values = component.values;\n if (values) {\n return values.findIndex(({ value: optionValue }) => optionValue === value) !== -1\n ? null\n : error;\n }\n return null;\n }\n else if (isValidateableSelectComponent(component)) {\n if (value == null || (0, isEmpty_1.default)(value)) {\n return null;\n }\n const values = yield getAvailableSelectValues(component, context);\n if (values) {\n if ((0, util_1.isObject)(value)) {\n return values.find((optionValue) => compareComplexValues(optionValue, value, context)) !==\n undefined\n ? null\n : error;\n }\n return values.find((optionValue) => optionValue === value) !== undefined ? null : error;\n }\n }\n }\n catch (err) {\n throw new error_1.ProcessorError(err.message || err, context, 'validate:validateAvailableItems');\n }\n return null;\n});\nexports.validateAvailableItems = validateAvailableItems;\nconst shouldValidate = (context) => {\n const { component, value } = context;\n if (value == null || (0, isEmpty_1.default)(value)) {\n return false;\n }\n if (isValidatableRadioComponent(component)) {\n return true;\n }\n if (isValidateableSelectComponent(component)) {\n return true;\n }\n return false;\n};\nexports.shouldValidate = shouldValidate;\nconst validateAvailableItemsSync = (context) => {\n const { component, value } = context;\n const error = new error_1.FieldError('invalidOption', context, 'onlyAvailableItems');\n try {\n if (!(0, exports.shouldValidate)(context)) {\n return null;\n }\n if (isValidatableRadioComponent(component)) {\n const values = component.values;\n if (values) {\n return values.findIndex(({ value: optionValue }) => optionValue === value) !== -1\n ? null\n : error;\n }\n return null;\n }\n else if (isValidateableSelectComponent(component)) {\n const values = getAvailableSelectValuesSync(component, context);\n if (values) {\n if ((0, util_1.isObject)(value)) {\n return values.find((optionValue) => compareComplexValues(optionValue, value, context)) !==\n undefined\n ? null\n : error;\n }\n return values.find((optionValue) => optionValue === value) !== undefined ? null : error;\n }\n }\n }\n catch (err) {\n throw new error_1.ProcessorError(err.message || err, context, 'validate:validateAvailableItems');\n }\n return null;\n};\nexports.validateAvailableItemsSync = validateAvailableItemsSync;\nexports.validateAvailableItemsInfo = {\n name: 'validateAvailableItems',\n process: exports.validateAvailableItems,\n processSync: exports.validateAvailableItemsSync,\n shouldProcess: exports.shouldValidate\n};\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/lib/process/validation/rules/validateAvailableItems.js?");
|
348
|
+
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.validateAvailableItemsInfo = exports.validateAvailableItemsSync = exports.shouldValidate = exports.validateAvailableItems = void 0;\nconst lodash_1 = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nconst error_1 = __webpack_require__(/*! ../../../error */ \"./node_modules/@formio/core/lib/error/index.js\");\nconst utils_1 = __webpack_require__(/*! ../../../utils */ \"./node_modules/@formio/core/lib/utils/index.js\");\nconst util_1 = __webpack_require__(/*! ../util */ \"./node_modules/@formio/core/lib/process/validation/util.js\");\nfunction isValidatableRadioComponent(component) {\n var _a;\n return (component &&\n component.type === 'radio' &&\n !!((_a = component.validate) === null || _a === void 0 ? void 0 : _a.onlyAvailableItems) &&\n component.dataSrc === 'values');\n}\nfunction isValidateableSelectComponent(component) {\n var _a;\n return (component &&\n !!((_a = component.validate) === null || _a === void 0 ? void 0 : _a.hasOwnProperty('onlyAvailableItems')) &&\n component.type === 'select' &&\n component.dataSrc !== 'resource');\n}\nfunction mapDynamicValues(component, values) {\n return values.map((value) => {\n if (component.valueProperty) {\n return value[component.valueProperty];\n }\n return value;\n });\n}\nfunction mapStaticValues(values) {\n return values.map((obj) => obj.value);\n}\nfunction getAvailableSelectValues(component, context) {\n return __awaiter(this, void 0, void 0, function* () {\n switch (component.dataSrc) {\n case 'values':\n if (Array.isArray(component.data.values)) {\n return mapStaticValues(component.data.values);\n }\n throw new error_1.ProcessorError(`Failed to validate available values in static values select component '${component.key}': the values are not an array`, context, 'validate:validateAvailableItems');\n case 'json': {\n if (typeof component.data.json === 'string') {\n try {\n return mapDynamicValues(component, JSON.parse(component.data.json));\n }\n catch (err) {\n throw new error_1.ProcessorError(`Failed to validate available values in JSON select component '${component.key}': ${err}`, context, 'validate:validateAvailableItems');\n }\n }\n else if (Array.isArray(component.data.json)) {\n // TODO: need to retype this\n return mapDynamicValues(component, component.data.json);\n }\n else {\n throw new error_1.ProcessorError(`Failed to validate available values in JSON select component '${component.key}': the values are not an array`, context, 'validate:validateAvailableItems');\n }\n }\n case 'custom':\n const customItems = utils_1.Evaluator.evaluate(component.data.custom, {\n values: [],\n }, 'values');\n if ((0, util_1.isPromise)(customItems)) {\n const resolvedCustomItems = yield customItems;\n if (Array.isArray(resolvedCustomItems)) {\n return resolvedCustomItems;\n }\n throw new error_1.ProcessorError(`Failed to validate available values in JSON select component '${component.key}': the values are not an array`, context, 'validate:validateAvailableItems');\n }\n if (Array.isArray(customItems)) {\n return customItems;\n }\n else {\n throw new error_1.ProcessorError(`Failed to validate available values in JSON select component '${component.key}': the values are not an array`, context, 'validate:validateAvailableItems');\n }\n default:\n throw new error_1.ProcessorError(`Failed to validate available values in select component '${component.key}': data source ${component.dataSrc} is not valid}`, context, 'validate:validateAvailableItems');\n }\n });\n}\nfunction getAvailableSelectValuesSync(component, context) {\n var _a;\n switch (component.dataSrc) {\n case 'values':\n if (Array.isArray((_a = component.data) === null || _a === void 0 ? void 0 : _a.values)) {\n return mapStaticValues(component.data.values);\n }\n throw new error_1.ProcessorError(`Failed to validate available values in static values select component '${component.key}': the values are not an array`, context, 'validate:validateAvailableItems');\n case 'json': {\n if (typeof component.data.json === 'string') {\n try {\n return mapDynamicValues(component, JSON.parse(component.data.json));\n }\n catch (err) {\n throw new error_1.ProcessorError(`Failed to validate available values in JSON select component '${component.key}': ${err}`, context, 'validate:validateAvailableItems');\n }\n }\n else if (Array.isArray(component.data.json)) {\n // TODO: need to retype this\n return mapDynamicValues(component, component.data.json);\n }\n else {\n throw new error_1.ProcessorError(`Failed to validate available values in JSON select component '${component.key}': the values are not an array`, context, 'validate:validateAvailableItems');\n }\n }\n case 'custom':\n const customItems = utils_1.Evaluator.evaluate(component.data.custom, {\n values: [],\n }, 'values');\n if (Array.isArray(customItems)) {\n return customItems;\n }\n else {\n throw new error_1.ProcessorError(`Failed to validate available values in JSON select component '${component.key}': the values are not an array`, context, 'validate:validateAvailableItems');\n }\n default:\n throw new error_1.ProcessorError(`Failed to validate available values in select component '${component.key}': data source ${component.dataSrc} is not valid}`, context, 'validate:validateAvailableItems');\n }\n}\nfunction compareComplexValues(valueA, valueB, context) {\n if (!(0, util_1.isObject)(valueA) || !(0, util_1.isObject)(valueB)) {\n return false;\n }\n try {\n // TODO: we need to have normalized values here at this moment, otherwise\n // this won't work\n return JSON.stringify(valueA) === JSON.stringify(valueB);\n }\n catch (err) {\n throw new error_1.ProcessorError(`Error while comparing available values: ${err}`, context, 'validate:validateAvailableItems');\n }\n}\nconst validateAvailableItems = (context) => __awaiter(void 0, void 0, void 0, function* () {\n const { component, value } = context;\n const error = new error_1.FieldError('invalidOption', context, 'onlyAvailableItems');\n try {\n if (isValidatableRadioComponent(component)) {\n if (value == null || (0, lodash_1.isEmpty)(value)) {\n return null;\n }\n const values = component.values;\n if (values) {\n return values.findIndex(({ value: optionValue }) => optionValue === value) !== -1\n ? null\n : error;\n }\n return null;\n }\n else if (isValidateableSelectComponent(component)) {\n if (value == null || (0, lodash_1.isEmpty)(value)) {\n return null;\n }\n const values = yield getAvailableSelectValues(component, context);\n if (values) {\n if ((0, util_1.isObject)(value)) {\n return values.find((optionValue) => compareComplexValues(optionValue, value, context)) !==\n undefined\n ? null\n : error;\n }\n return values.find((optionValue) => optionValue === value) !== undefined ? null : error;\n }\n }\n }\n catch (err) {\n throw new error_1.ProcessorError(err.message || err, context, 'validate:validateAvailableItems');\n }\n return null;\n});\nexports.validateAvailableItems = validateAvailableItems;\nconst shouldValidate = (context) => {\n const { component, value } = context;\n if (value == null || (0, lodash_1.isEmpty)(value)) {\n return false;\n }\n if (isValidatableRadioComponent(component)) {\n return true;\n }\n if (isValidateableSelectComponent(component)) {\n return true;\n }\n return false;\n};\nexports.shouldValidate = shouldValidate;\nconst validateAvailableItemsSync = (context) => {\n const { component, value } = context;\n const error = new error_1.FieldError('invalidOption', context, 'onlyAvailableItems');\n try {\n if (!(0, exports.shouldValidate)(context)) {\n return null;\n }\n if (isValidatableRadioComponent(component)) {\n const values = component.values;\n if (values) {\n return values.findIndex(({ value: optionValue }) => optionValue === value) !== -1\n ? null\n : error;\n }\n return null;\n }\n else if (isValidateableSelectComponent(component)) {\n const values = getAvailableSelectValuesSync(component, context);\n if (values) {\n if ((0, util_1.isObject)(value)) {\n return values.find((optionValue) => compareComplexValues(optionValue, value, context)) !==\n undefined\n ? null\n : error;\n }\n return values.find((optionValue) => optionValue === value) !== undefined ? null : error;\n }\n }\n }\n catch (err) {\n throw new error_1.ProcessorError(err.message || err, context, 'validate:validateAvailableItems');\n }\n return null;\n};\nexports.validateAvailableItemsSync = validateAvailableItemsSync;\nexports.validateAvailableItemsInfo = {\n name: 'validateAvailableItems',\n process: exports.validateAvailableItems,\n processSync: exports.validateAvailableItemsSync,\n shouldProcess: exports.shouldValidate\n};\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/lib/process/validation/rules/validateAvailableItems.js?");
|
349
349
|
|
350
350
|
/***/ }),
|
351
351
|
|
@@ -422,7 +422,7 @@ eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _argument
|
|
422
422
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
423
423
|
|
424
424
|
"use strict";
|
425
|
-
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.validateMaskInfo = exports.validateMaskSync = exports.validateMask = exports.shouldValidate = exports.matchInputMask = void 0;\nconst lodash_1 = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nconst error_1 = __webpack_require__(/*! ../../../error */ \"./node_modules/@formio/core/lib/error/index.js\");\
|
425
|
+
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.validateMaskInfo = exports.validateMaskSync = exports.validateMask = exports.shouldValidate = exports.matchInputMask = void 0;\nconst lodash_1 = __webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\");\nconst error_1 = __webpack_require__(/*! ../../../error */ \"./node_modules/@formio/core/lib/error/index.js\");\nconst inputmask_1 = __importDefault(__webpack_require__(/*! inputmask */ \"./node_modules/inputmask/dist/inputmask.js\"));\nconst isMaskType = (obj) => {\n return ((obj === null || obj === void 0 ? void 0 : obj.maskName) &&\n typeof (obj === null || obj === void 0 ? void 0 : obj.maskName) === 'string' &&\n (obj === null || obj === void 0 ? void 0 : obj.value) &&\n typeof (obj === null || obj === void 0 ? void 0 : obj.value) === 'string');\n};\nconst isValidatableComponent = (component) => {\n // For some reason we skip mask validation for time components\n return ((component && component.type && component.type !== 'time') &&\n (component && component.hasOwnProperty('inputMask') && !!component.inputMask) ||\n (component && component.hasOwnProperty('inputMasks') && !(0, lodash_1.isEmpty)(component.inputMasks)));\n};\nfunction getMaskByLabel(component, maskName) {\n var _a;\n if (maskName) {\n const inputMask = (_a = component.inputMasks) === null || _a === void 0 ? void 0 : _a.find((inputMask) => {\n return inputMask.label === maskName;\n });\n return inputMask ? inputMask.mask : undefined;\n }\n return;\n}\nfunction getInputMask(mask, placeholderChar) {\n if (mask instanceof Array) {\n return mask;\n }\n const maskArray = [];\n for (let i = 0; i < mask.length; i++) {\n switch (mask[i]) {\n case '9':\n maskArray.push(/\\d/);\n break;\n case 'A':\n maskArray.push(/[a-zA-Z]/);\n break;\n case 'a':\n maskArray.push(/[a-z]/);\n break;\n case '*':\n maskArray.push(/[a-zA-Z0-9]/);\n break;\n // If char which is used inside mask placeholder was used in the mask, replace it with space to prevent errors\n case placeholderChar:\n maskArray.push(' ');\n break;\n default:\n maskArray.push(mask[i]);\n break;\n }\n }\n return maskArray;\n}\nfunction matchInputMask(value, inputMask) {\n if (!inputMask) {\n return true;\n }\n // If value is longer than mask, it isn't valid.\n if (value.length > inputMask.length) {\n return false;\n }\n for (let i = 0; i < inputMask.length; i++) {\n const char = value[i];\n const charPart = inputMask[i];\n if (charPart instanceof RegExp) {\n if (!charPart.test(char)) {\n return false;\n }\n continue;\n }\n else if (charPart !== char) {\n return false;\n }\n }\n return true;\n}\nexports.matchInputMask = matchInputMask;\nconst shouldValidate = (context) => {\n var _a;\n const { component, value } = context;\n if (!isValidatableComponent(component) || !value) {\n return false;\n }\n if (value == null) {\n return false;\n }\n if (component.allowMultipleMasks && ((_a = component.inputMasks) === null || _a === void 0 ? void 0 : _a.length)) {\n const mask = value && isMaskType(value) ? value : undefined;\n const formioInputMask = getMaskByLabel(component, mask === null || mask === void 0 ? void 0 : mask.maskName);\n if (formioInputMask && !getInputMask(formioInputMask)) {\n return false;\n }\n }\n else if (!getInputMask(component.inputMask || '')) {\n return false;\n }\n return true;\n};\nexports.shouldValidate = shouldValidate;\nconst validateMask = (context) => __awaiter(void 0, void 0, void 0, function* () {\n return (0, exports.validateMaskSync)(context);\n});\nexports.validateMask = validateMask;\n// TODO: this function has side effects\nconst validateMaskSync = (context) => {\n var _a;\n const { component, value } = context;\n if (!(0, exports.shouldValidate)(context)) {\n return null;\n }\n let inputMask;\n let maskValue;\n if (component.allowMultipleMasks && ((_a = component.inputMasks) === null || _a === void 0 ? void 0 : _a.length)) {\n const mask = value && isMaskType(value) ? value : undefined;\n const formioInputMask = getMaskByLabel(component, mask === null || mask === void 0 ? void 0 : mask.maskName);\n if (formioInputMask) {\n inputMask = formioInputMask;\n }\n maskValue = mask === null || mask === void 0 ? void 0 : mask.value;\n }\n else {\n inputMask = component.inputMask || '';\n }\n if (!inputMask) {\n return null;\n }\n if (value && inputMask && typeof value === 'string' && component.type === 'textfield') {\n return inputmask_1.default.isValid(value, { mask: inputMask.toString() }) ? null : new error_1.FieldError('mask', context);\n }\n let inputMaskArr = getInputMask(inputMask);\n if (value != null && inputMaskArr) {\n const error = new error_1.FieldError('mask', context);\n return matchInputMask(maskValue || value, inputMaskArr) ? null : error;\n }\n return null;\n};\nexports.validateMaskSync = validateMaskSync;\nexports.validateMaskInfo = {\n name: 'validateMask',\n process: exports.validateMask,\n processSync: exports.validateMaskSync,\n shouldProcess: exports.shouldValidate,\n};\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/lib/process/validation/rules/validateMask.js?");
|
426
426
|
|
427
427
|
/***/ }),
|
428
428
|
|
@@ -1335,7 +1335,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexpo
|
|
1335
1335
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
1336
1336
|
|
1337
1337
|
"use strict";
|
1338
|
-
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.isComponentDataEmpty = exports.getEmptyValue = exports.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 */ \"./node_modules/lodash/lodash.js\");\nconst fast_json_patch_1 = __webpack_require__(/*! fast-json-patch */ \"./node_modules/fast-json-patch/index.mjs\");\nconst Evaluator_1 = __webpack_require__(/*! ./Evaluator */ \"./node_modules/@formio/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 (isComponentModelType(component, 'array')) {\n return `${path}[0]`;\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_1, data_1, fn_1, ...args_1) => __awaiter(void 0, [components_1, data_1, fn_1, ...args_1], void 0, function* (components, data, fn, path = \"\", index, parent, includeAll = false) {\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, includeAll);\n }\n return true;\n }\n else if ((0, lodash_1.isEmpty)(row) && !includeAll) {\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, includeAll);\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, includeAll);\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, includeAll = false) => {\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, includeAll);\n }\n return true;\n }\n else if ((0, lodash_1.isEmpty)(row) && !includeAll) {\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, includeAll);\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, includeAll);\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_2, fn_1) {\n return __awaiter(this, arguments, void 0, function* (components, fn, includeAll = false, path = \"\", parent) {\n var _a, _b;\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(component, compPath, data, row) {\n var _a, _b;\n // The compPath here will NOT contain the indexes for DataGrids and EditGrids.\n //\n // a[0].b[2].c[3].d\n //\n // Because of this, we will need to determine our parent component path (not data path),\n // and find the \"row\" based comp path.\n //\n // a[0].b[2].c[3].d => a.b.c.d\n //\n if ((_a = component.parent) === null || _a === void 0 ? void 0 : _a.path) {\n const parentCompPath = (_b = component.parent) === null || _b === void 0 ? void 0 : _b.path.replace(/\\[[0-9]+\\]/g, '');\n compPath = compPath.replace(parentCompPath, '');\n compPath = (0, lodash_1.trim)(compPath, '. ');\n }\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;\nconst isCheckboxComponent = (component) => component.type === 'checkbox';\nconst isDataGridComponent = (component) => component.type === 'datagrid';\nconst isEditGridComponent = (component) => component.type === 'editgrid';\nconst isDataTableComponent = (component) => component.type === 'datatable';\nconst hasChildComponents = (component) => component.components != null;\nconst isDateTimeComponent = (component) => component.type === 'datetime';\nconst isSelectBoxesComponent = (component) => component.type === 'selectboxes';\nconst isTextAreaComponent = (component) => component.type === 'textarea';\nconst isTextFieldComponent = (component) => component.type === 'textfield';\nfunction getEmptyValue(component) {\n switch (component.type) {\n case 'textarea':\n case 'textfield':\n case 'time':\n case 'datetime':\n case 'day':\n return '';\n case 'datagrid':\n case 'editgrid':\n return [];\n default:\n return null;\n }\n}\nexports.getEmptyValue = getEmptyValue;\nconst replaceBlanks = (value) => {\n const nbsp = '<p> </p>';\n const br = '<p><br></p>';\n const brNbsp = '<p><br> </p>';\n const regExp = new RegExp(`^${nbsp}|${nbsp}$|^${br}|${br}$|^${brNbsp}|${brNbsp}$`, 'g');\n return typeof value === 'string' ? value.replace(regExp, '').trim() : value;\n};\nfunction trimBlanks(value) {\n if (!value) {\n return value;\n }\n if (Array.isArray(value)) {\n value = value.map((val) => replaceBlanks(val));\n }\n else {\n value = replaceBlanks(value);\n }\n return value;\n}\nfunction isValueEmpty(component, value) {\n const compValueIsEmptyArray = ((0, lodash_1.isArray)(value) && value.length === 1) ? (0, lodash_1.isEqual)(value[0], getEmptyValue(component)) : false;\n return value == null || value === '' || ((0, lodash_1.isArray)(value) && value.length === 0) || compValueIsEmptyArray;\n}\nfunction isComponentDataEmpty(component, data, path) {\n var _a;\n const value = (0, lodash_1.get)(data, path);\n if (isCheckboxComponent(component)) {\n return isValueEmpty(component, value) || value === false;\n }\n else if (isDataGridComponent(component) || isEditGridComponent(component) || isDataTableComponent(component) || hasChildComponents(component)) {\n if ((_a = component.components) === null || _a === void 0 ? void 0 : _a.length) {\n let childrenEmpty = true;\n // wrap component in an array to let eachComponentData handle introspection to child components (e.g. this will be different\n // for data grids versus nested forms, etc.)\n (0, exports.eachComponentData)([component], data, (thisComponent, data, row, path, components, index) => {\n if (component.key === thisComponent.key)\n return;\n if (!isComponentDataEmpty(thisComponent, data, path)) {\n childrenEmpty = false;\n }\n });\n return isValueEmpty(component, value) || childrenEmpty;\n }\n return isValueEmpty(component, value);\n }\n else if (isDateTimeComponent(component)) {\n return isValueEmpty(component, value) || value.toString() === 'Invalid date';\n }\n else if (isSelectBoxesComponent(component)) {\n let selectBoxEmpty = true;\n for (const key in value) {\n if (value[key]) {\n selectBoxEmpty = false;\n break;\n }\n }\n return isValueEmpty(component, value) || selectBoxEmpty;\n }\n else if (isTextAreaComponent(component)) {\n const isPlain = !component.wysiwyg && !component.editor;\n return isPlain ? typeof value === 'string' ? isValueEmpty(component, value.trim()) : isValueEmpty(component, value) : isValueEmpty(component, trimBlanks(value));\n }\n else if (isTextFieldComponent(component)) {\n if (component.allowMultipleMasks && !!component.inputMasks && !!component.inputMasks.length) {\n return isValueEmpty(component, value) || (component.multiple ? value.length === 0 : (!value.maskName || !value.value));\n }\n return isValueEmpty(component, value === null || value === void 0 ? void 0 : value.toString().trim());\n }\n return isValueEmpty(component, value);\n}\nexports.isComponentDataEmpty = isComponentDataEmpty;\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/lib/utils/formUtil.js?");
|
1338
|
+
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.isComponentDataEmpty = exports.getEmptyValue = exports.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 */ \"./node_modules/lodash/lodash.js\");\nconst fast_json_patch_1 = __webpack_require__(/*! fast-json-patch */ \"./node_modules/fast-json-patch/index.mjs\");\nconst Evaluator_1 = __webpack_require__(/*! ./Evaluator */ \"./node_modules/@formio/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 (isComponentModelType(component, 'array')) {\n return `${path}[0]`;\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_1, data_1, fn_1, ...args_1) => __awaiter(void 0, [components_1, data_1, fn_1, ...args_1], void 0, function* (components, data, fn, path = \"\", index, parent, includeAll = false) {\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, includeAll);\n }\n return true;\n }\n else if ((0, lodash_1.isEmpty)(row) && !includeAll) {\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, includeAll);\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, includeAll);\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, includeAll = false) => {\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, includeAll);\n }\n return true;\n }\n else if ((0, lodash_1.isEmpty)(row) && !includeAll) {\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, includeAll);\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, includeAll);\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_2, fn_1) {\n return __awaiter(this, arguments, void 0, function* (components, fn, includeAll = false, path = \"\", parent) {\n var _a, _b;\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(component, compPath, data, row) {\n var _a, _b;\n // The compPath here will NOT contain the indexes for DataGrids and EditGrids.\n //\n // a[0].b[2].c[3].d\n //\n // Because of this, we will need to determine our parent component path (not data path),\n // and find the \"row\" based comp path.\n //\n // a[0].b[2].c[3].d => a.b.c.d\n //\n if ((_a = component.parent) === null || _a === void 0 ? void 0 : _a.path) {\n const parentCompPath = (_b = component.parent) === null || _b === void 0 ? void 0 : _b.path.replace(/\\[[0-9]+\\]/g, '');\n compPath = compPath.replace(parentCompPath, '');\n compPath = (0, lodash_1.trim)(compPath, '. ');\n }\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 - The components to iterate.\n * @param {String|Object} key - The key of the component to get, or a query of the component to search.\n * @returns {Component} - 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.conjunction)));\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;\nconst isCheckboxComponent = (component) => component.type === 'checkbox';\nconst isDataGridComponent = (component) => component.type === 'datagrid';\nconst isEditGridComponent = (component) => component.type === 'editgrid';\nconst isDataTableComponent = (component) => component.type === 'datatable';\nconst hasChildComponents = (component) => component.components != null;\nconst isDateTimeComponent = (component) => component.type === 'datetime';\nconst isSelectBoxesComponent = (component) => component.type === 'selectboxes';\nconst isTextAreaComponent = (component) => component.type === 'textarea';\nconst isTextFieldComponent = (component) => component.type === 'textfield';\nfunction getEmptyValue(component) {\n switch (component.type) {\n case 'textarea':\n case 'textfield':\n case 'time':\n case 'datetime':\n case 'day':\n return '';\n case 'datagrid':\n case 'editgrid':\n return [];\n default:\n return null;\n }\n}\nexports.getEmptyValue = getEmptyValue;\nconst replaceBlanks = (value) => {\n const nbsp = '<p> </p>';\n const br = '<p><br></p>';\n const brNbsp = '<p><br> </p>';\n const regExp = new RegExp(`^${nbsp}|${nbsp}$|^${br}|${br}$|^${brNbsp}|${brNbsp}$`, 'g');\n return typeof value === 'string' ? value.replace(regExp, '').trim() : value;\n};\nfunction trimBlanks(value) {\n if (!value) {\n return value;\n }\n if (Array.isArray(value)) {\n value = value.map((val) => replaceBlanks(val));\n }\n else {\n value = replaceBlanks(value);\n }\n return value;\n}\nfunction isValueEmpty(component, value) {\n const compValueIsEmptyArray = ((0, lodash_1.isArray)(value) && value.length === 1) ? (0, lodash_1.isEqual)(value[0], getEmptyValue(component)) : false;\n return value == null || value === '' || ((0, lodash_1.isArray)(value) && value.length === 0) || compValueIsEmptyArray;\n}\nfunction isComponentDataEmpty(component, data, path) {\n var _a;\n const value = (0, lodash_1.get)(data, path);\n if (isCheckboxComponent(component)) {\n return isValueEmpty(component, value) || value === false;\n }\n else if (isDataGridComponent(component) || isEditGridComponent(component) || isDataTableComponent(component) || hasChildComponents(component)) {\n if ((_a = component.components) === null || _a === void 0 ? void 0 : _a.length) {\n let childrenEmpty = true;\n // wrap component in an array to let eachComponentData handle introspection to child components (e.g. this will be different\n // for data grids versus nested forms, etc.)\n (0, exports.eachComponentData)([component], data, (thisComponent, data, row, path, components, index) => {\n if (component.key === thisComponent.key)\n return;\n if (!isComponentDataEmpty(thisComponent, data, path)) {\n childrenEmpty = false;\n }\n });\n return isValueEmpty(component, value) || childrenEmpty;\n }\n return isValueEmpty(component, value);\n }\n else if (isDateTimeComponent(component)) {\n return isValueEmpty(component, value) || value.toString() === 'Invalid date';\n }\n else if (isSelectBoxesComponent(component)) {\n let selectBoxEmpty = true;\n for (const key in value) {\n if (value[key]) {\n selectBoxEmpty = false;\n break;\n }\n }\n return isValueEmpty(component, value) || selectBoxEmpty;\n }\n else if (isTextAreaComponent(component)) {\n const isPlain = !component.wysiwyg && !component.editor;\n return isPlain ? typeof value === 'string' ? isValueEmpty(component, value.trim()) : isValueEmpty(component, value) : isValueEmpty(component, trimBlanks(value));\n }\n else if (isTextFieldComponent(component)) {\n if (component.allowMultipleMasks && !!component.inputMasks && !!component.inputMasks.length) {\n return isValueEmpty(component, value) || (component.multiple ? value.length === 0 : (!value.maskName || !value.value));\n }\n return isValueEmpty(component, value === null || value === void 0 ? void 0 : value.toString().trim());\n }\n return isValueEmpty(component, value);\n}\nexports.isComponentDataEmpty = isComponentDataEmpty;\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/lib/utils/formUtil.js?");
|
1339
1339
|
|
1340
1340
|
/***/ }),
|
1341
1341
|
|
@@ -1621,7 +1621,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexpo
|
|
1621
1621
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
1622
1622
|
|
1623
1623
|
"use strict";
|
1624
|
-
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.sanitize = void 0;\nconst dompurify_1 = __importDefault(__webpack_require__(/*! dompurify */ \"./node_modules/dompurify/dist/purify.js\"));\nlet DOMPurify = null;\nconst getDOMPurify = () => {\n if (DOMPurify) {\n return DOMPurify;\n }\n if (window) {\n DOMPurify = (0, dompurify_1.default)(window);\n return DOMPurify;\n }\n return null;\n};\n/**\n * Sanitize an html string.\n *\n * @param string\n * @returns {*}\n */\nfunction sanitize(string, options) {\n const dompurify = getDOMPurify();\n if (!dompurify) {\n console.log('DOMPurify unable to sanitize the contents.');\n return string;\n }\n // Dompurify configuration\n const sanitizeOptions = {\n ADD_ATTR: ['ref', 'target', 'within'],\n USE_PROFILES: { html: true }\n };\n // Add attrs\n if (options.sanitizeConfig && Array.isArray(options.sanitizeConfig.addAttr) && options.sanitizeConfig.addAttr.length > 0) {\n options.sanitizeConfig.addAttr.forEach((attr) => {\n sanitizeOptions.ADD_ATTR.push(attr);\n });\n }\n // Add tags\n if (options.sanitizeConfig && Array.isArray(options.sanitizeConfig.addTags) && options.sanitizeConfig.addTags.length > 0) {\n sanitizeOptions.ADD_TAGS = options.sanitizeConfig.addTags;\n }\n // Allow tags\n if (options.sanitizeConfig && Array.isArray(options.sanitizeConfig.allowedTags) && options.sanitizeConfig.allowedTags.length > 0) {\n sanitizeOptions.ALLOWED_TAGS = options.sanitizeConfig.allowedTags;\n }\n // Allow attributes\n if (options.sanitizeConfig && Array.isArray(options.sanitizeConfig.allowedAttrs) && options.sanitizeConfig.allowedAttrs.length > 0) {\n sanitizeOptions.ALLOWED_ATTR = options.sanitizeConfig.allowedAttrs;\n }\n // Allowd URI Regex\n if (options.sanitizeConfig && options.sanitizeConfig.allowedUriRegex) {\n sanitizeOptions.ALLOWED_URI_REGEXP = options.sanitizeConfig.allowedUriRegex;\n }\n // Allow to extend the existing array of elements that are safe for URI-like values\n if (options.sanitizeConfig && Array.isArray(options.sanitizeConfig.addUriSafeAttr) && options.sanitizeConfig.addUriSafeAttr.length > 0) {\n sanitizeOptions.ADD_URI_SAFE_ATTR = options.sanitizeConfig.addUriSafeAttr;\n }\n return dompurify.sanitize(string, sanitizeOptions);\n}\nexports.sanitize = sanitize;\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/lib/utils/sanitize.js?");
|
1624
|
+
eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.sanitize = void 0;\nconst dompurify_1 = __importDefault(__webpack_require__(/*! dompurify */ \"./node_modules/@formio/core/node_modules/dompurify/dist/purify.js\"));\nlet DOMPurify = null;\nconst getDOMPurify = () => {\n if (DOMPurify) {\n return DOMPurify;\n }\n if (window) {\n DOMPurify = (0, dompurify_1.default)(window);\n return DOMPurify;\n }\n return null;\n};\n/**\n * Sanitize an html string.\n *\n * @param string\n * @returns {*}\n */\nfunction sanitize(string, options) {\n const dompurify = getDOMPurify();\n if (!dompurify) {\n console.log('DOMPurify unable to sanitize the contents.');\n return string;\n }\n // Dompurify configuration\n const sanitizeOptions = {\n ADD_ATTR: ['ref', 'target', 'within'],\n USE_PROFILES: { html: true }\n };\n // Add attrs\n if (options.sanitizeConfig && Array.isArray(options.sanitizeConfig.addAttr) && options.sanitizeConfig.addAttr.length > 0) {\n options.sanitizeConfig.addAttr.forEach((attr) => {\n sanitizeOptions.ADD_ATTR.push(attr);\n });\n }\n // Add tags\n if (options.sanitizeConfig && Array.isArray(options.sanitizeConfig.addTags) && options.sanitizeConfig.addTags.length > 0) {\n sanitizeOptions.ADD_TAGS = options.sanitizeConfig.addTags;\n }\n // Allow tags\n if (options.sanitizeConfig && Array.isArray(options.sanitizeConfig.allowedTags) && options.sanitizeConfig.allowedTags.length > 0) {\n sanitizeOptions.ALLOWED_TAGS = options.sanitizeConfig.allowedTags;\n }\n // Allow attributes\n if (options.sanitizeConfig && Array.isArray(options.sanitizeConfig.allowedAttrs) && options.sanitizeConfig.allowedAttrs.length > 0) {\n sanitizeOptions.ALLOWED_ATTR = options.sanitizeConfig.allowedAttrs;\n }\n // Allowd URI Regex\n if (options.sanitizeConfig && options.sanitizeConfig.allowedUriRegex) {\n sanitizeOptions.ALLOWED_URI_REGEXP = options.sanitizeConfig.allowedUriRegex;\n }\n // Allow to extend the existing array of elements that are safe for URI-like values\n if (options.sanitizeConfig && Array.isArray(options.sanitizeConfig.addUriSafeAttr) && options.sanitizeConfig.addUriSafeAttr.length > 0) {\n sanitizeOptions.ADD_URI_SAFE_ATTR = options.sanitizeConfig.addUriSafeAttr;\n }\n return dompurify.sanitize(string, sanitizeOptions);\n}\nexports.sanitize = sanitize;\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/lib/utils/sanitize.js?");
|
1625
1625
|
|
1626
1626
|
/***/ }),
|
1627
1627
|
|
@@ -1647,73 +1647,13 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexpo
|
|
1647
1647
|
|
1648
1648
|
/***/ }),
|
1649
1649
|
|
1650
|
-
/***/ "./node_modules/@formio/core/node_modules/
|
1651
|
-
|
1652
|
-
!*** ./node_modules/@formio/core/node_modules/
|
1653
|
-
|
1654
|
-
/***/ (function(module
|
1655
|
-
|
1656
|
-
eval("var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!\n* dependencyLibs/inputmask.dependencyLib.js\n* https://github.com/RobinHerbots/Inputmask\n* Copyright (c) 2010 - 2019 Robin Herbots\n* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)\n* Version: 4.0.9\n*/\n\n(function(factory) {\n if (true) {\n !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ __webpack_require__(/*! ../global/window */ \"./node_modules/@formio/core/node_modules/inputmask/dist/inputmask/global/window.js\") ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?\n\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n } else {}\n})(function(window) {\n var document = window.document;\n function indexOf(list, elem) {\n var i = 0, len = list.length;\n for (;i < len; i++) {\n if (list[i] === elem) {\n return i;\n }\n }\n return -1;\n }\n function isWindow(obj) {\n return obj != null && obj === obj.window;\n }\n function isArraylike(obj) {\n var length = \"length\" in obj && obj.length, ltype = typeof obj;\n if (ltype === \"function\" || isWindow(obj)) {\n return false;\n }\n if (obj.nodeType === 1 && length) {\n return true;\n }\n return ltype === \"array\" || length === 0 || typeof length === \"number\" && length > 0 && length - 1 in obj;\n }\n function isValidElement(elem) {\n return elem instanceof Element;\n }\n function DependencyLib(elem) {\n if (elem instanceof DependencyLib) {\n return elem;\n }\n if (!(this instanceof DependencyLib)) {\n return new DependencyLib(elem);\n }\n if (elem !== undefined && elem !== null && elem !== window) {\n this[0] = elem.nodeName ? elem : elem[0] !== undefined && elem[0].nodeName ? elem[0] : document.querySelector(elem);\n if (this[0] !== undefined && this[0] !== null) {\n this[0].eventRegistry = this[0].eventRegistry || {};\n }\n }\n }\n function getWindow(elem) {\n return isWindow(elem) ? elem : elem.nodeType === 9 ? elem.defaultView || elem.parentWindow : false;\n }\n DependencyLib.prototype = {\n on: function(events, handler) {\n if (isValidElement(this[0])) {\n var eventRegistry = this[0].eventRegistry, elem = this[0];\n var addEvent = function(ev, namespace) {\n if (elem.addEventListener) {\n elem.addEventListener(ev, handler, false);\n } else if (elem.attachEvent) {\n elem.attachEvent(\"on\" + ev, handler);\n }\n eventRegistry[ev] = eventRegistry[ev] || {};\n eventRegistry[ev][namespace] = eventRegistry[ev][namespace] || [];\n eventRegistry[ev][namespace].push(handler);\n };\n var _events = events.split(\" \");\n for (var endx = 0; endx < _events.length; endx++) {\n var nsEvent = _events[endx].split(\".\"), ev = nsEvent[0], namespace = nsEvent[1] || \"global\";\n addEvent(ev, namespace);\n }\n }\n return this;\n },\n off: function(events, handler) {\n if (isValidElement(this[0])) {\n var eventRegistry = this[0].eventRegistry, elem = this[0];\n var removeEvent = function(ev, namespace, handler) {\n if (ev in eventRegistry === true) {\n if (elem.removeEventListener) {\n elem.removeEventListener(ev, handler, false);\n } else if (elem.detachEvent) {\n elem.detachEvent(\"on\" + ev, handler);\n }\n if (namespace === \"global\") {\n for (var nmsp in eventRegistry[ev]) {\n eventRegistry[ev][nmsp].splice(eventRegistry[ev][nmsp].indexOf(handler), 1);\n }\n } else {\n eventRegistry[ev][namespace].splice(eventRegistry[ev][namespace].indexOf(handler), 1);\n }\n }\n };\n var resolveNamespace = function(ev, namespace) {\n var evts = [], hndx, hndL;\n if (ev.length > 0) {\n if (handler === undefined) {\n for (hndx = 0, hndL = eventRegistry[ev][namespace].length; hndx < hndL; hndx++) {\n evts.push({\n ev: ev,\n namespace: namespace && namespace.length > 0 ? namespace : \"global\",\n handler: eventRegistry[ev][namespace][hndx]\n });\n }\n } else {\n evts.push({\n ev: ev,\n namespace: namespace && namespace.length > 0 ? namespace : \"global\",\n handler: handler\n });\n }\n } else if (namespace.length > 0) {\n for (var evNdx in eventRegistry) {\n for (var nmsp in eventRegistry[evNdx]) {\n if (nmsp === namespace) {\n if (handler === undefined) {\n for (hndx = 0, hndL = eventRegistry[evNdx][nmsp].length; hndx < hndL; hndx++) {\n evts.push({\n ev: evNdx,\n namespace: nmsp,\n handler: eventRegistry[evNdx][nmsp][hndx]\n });\n }\n } else {\n evts.push({\n ev: evNdx,\n namespace: nmsp,\n handler: handler\n });\n }\n }\n }\n }\n }\n return evts;\n };\n var _events = events.split(\" \");\n for (var endx = 0; endx < _events.length; endx++) {\n var nsEvent = _events[endx].split(\".\"), offEvents = resolveNamespace(nsEvent[0], nsEvent[1]);\n for (var i = 0, offEventsL = offEvents.length; i < offEventsL; i++) {\n removeEvent(offEvents[i].ev, offEvents[i].namespace, offEvents[i].handler);\n }\n }\n }\n return this;\n },\n trigger: function(events) {\n if (isValidElement(this[0])) {\n var eventRegistry = this[0].eventRegistry, elem = this[0];\n var _events = typeof events === \"string\" ? events.split(\" \") : [ events.type ];\n for (var endx = 0; endx < _events.length; endx++) {\n var nsEvent = _events[endx].split(\".\"), ev = nsEvent[0], namespace = nsEvent[1] || \"global\";\n if (document !== undefined && namespace === \"global\") {\n var evnt, i, params = {\n bubbles: true,\n cancelable: true,\n detail: arguments[1]\n };\n if (document.createEvent) {\n try {\n evnt = new CustomEvent(ev, params);\n } catch (e) {\n evnt = document.createEvent(\"CustomEvent\");\n evnt.initCustomEvent(ev, params.bubbles, params.cancelable, params.detail);\n }\n if (events.type) DependencyLib.extend(evnt, events);\n elem.dispatchEvent(evnt);\n } else {\n evnt = document.createEventObject();\n evnt.eventType = ev;\n evnt.detail = arguments[1];\n if (events.type) DependencyLib.extend(evnt, events);\n elem.fireEvent(\"on\" + evnt.eventType, evnt);\n }\n } else if (eventRegistry[ev] !== undefined) {\n arguments[0] = arguments[0].type ? arguments[0] : DependencyLib.Event(arguments[0]);\n if (namespace === \"global\") {\n for (var nmsp in eventRegistry[ev]) {\n for (i = 0; i < eventRegistry[ev][nmsp].length; i++) {\n eventRegistry[ev][nmsp][i].apply(elem, arguments);\n }\n }\n } else {\n for (i = 0; i < eventRegistry[ev][namespace].length; i++) {\n eventRegistry[ev][namespace][i].apply(elem, arguments);\n }\n }\n }\n }\n }\n return this;\n }\n };\n DependencyLib.isFunction = function(obj) {\n return typeof obj === \"function\";\n };\n DependencyLib.noop = function() {};\n DependencyLib.isArray = Array.isArray;\n DependencyLib.inArray = function(elem, arr, i) {\n return arr == null ? -1 : indexOf(arr, elem, i);\n };\n DependencyLib.valHooks = undefined;\n DependencyLib.isPlainObject = function(obj) {\n if (typeof obj !== \"object\" || obj.nodeType || isWindow(obj)) {\n return false;\n }\n if (obj.constructor && !Object.hasOwnProperty.call(obj.constructor.prototype, \"isPrototypeOf\")) {\n return false;\n }\n return true;\n };\n DependencyLib.extend = function() {\n var options, name, src, copy, copyIsArray, clone, target = arguments[0] || {}, i = 1, length = arguments.length, deep = false;\n if (typeof target === \"boolean\") {\n deep = target;\n target = arguments[i] || {};\n i++;\n }\n if (typeof target !== \"object\" && !DependencyLib.isFunction(target)) {\n target = {};\n }\n if (i === length) {\n target = this;\n i--;\n }\n for (;i < length; i++) {\n if ((options = arguments[i]) != null) {\n for (name in options) {\n src = target[name];\n copy = options[name];\n if (target === copy) {\n continue;\n }\n if (deep && copy && (DependencyLib.isPlainObject(copy) || (copyIsArray = DependencyLib.isArray(copy)))) {\n if (copyIsArray) {\n copyIsArray = false;\n clone = src && DependencyLib.isArray(src) ? src : [];\n } else {\n clone = src && DependencyLib.isPlainObject(src) ? src : {};\n }\n target[name] = DependencyLib.extend(deep, clone, copy);\n } else if (copy !== undefined) {\n target[name] = copy;\n }\n }\n }\n }\n return target;\n };\n DependencyLib.each = function(obj, callback) {\n var value, i = 0;\n if (isArraylike(obj)) {\n for (var length = obj.length; i < length; i++) {\n value = callback.call(obj[i], i, obj[i]);\n if (value === false) {\n break;\n }\n }\n } else {\n for (i in obj) {\n value = callback.call(obj[i], i, obj[i]);\n if (value === false) {\n break;\n }\n }\n }\n return obj;\n };\n DependencyLib.data = function(owner, key, value) {\n if (value === undefined) {\n return owner.__data ? owner.__data[key] : null;\n } else {\n owner.__data = owner.__data || {};\n owner.__data[key] = value;\n }\n };\n if (typeof window.CustomEvent === \"function\") {\n DependencyLib.Event = window.CustomEvent;\n } else {\n DependencyLib.Event = function(event, params) {\n params = params || {\n bubbles: false,\n cancelable: false,\n detail: undefined\n };\n var evt = document.createEvent(\"CustomEvent\");\n evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);\n return evt;\n };\n DependencyLib.Event.prototype = window.Event.prototype;\n }\n return DependencyLib;\n});\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/node_modules/inputmask/dist/inputmask/dependencyLibs/inputmask.dependencyLib.js?");
|
1657
|
-
|
1658
|
-
/***/ }),
|
1659
|
-
|
1660
|
-
/***/ "./node_modules/@formio/core/node_modules/inputmask/dist/inputmask/global/window.js":
|
1661
|
-
/*!******************************************************************************************!*\
|
1662
|
-
!*** ./node_modules/@formio/core/node_modules/inputmask/dist/inputmask/global/window.js ***!
|
1663
|
-
\******************************************************************************************/
|
1664
|
-
/***/ (function(module, exports, __webpack_require__) {
|
1665
|
-
|
1666
|
-
eval("var __WEBPACK_AMD_DEFINE_RESULT__;/*!\n* global/window.js\n* https://github.com/RobinHerbots/Inputmask\n* Copyright (c) 2010 - 2019 Robin Herbots\n* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)\n* Version: 4.0.9\n*/\n\nif (true) !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {\n return typeof window !== \"undefined\" ? window : new (eval(\"require('jsdom').JSDOM\"))(\"\").window;\n}).call(exports, __webpack_require__, exports, module),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); else {}\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/node_modules/inputmask/dist/inputmask/global/window.js?");
|
1667
|
-
|
1668
|
-
/***/ }),
|
1669
|
-
|
1670
|
-
/***/ "./node_modules/@formio/core/node_modules/inputmask/dist/inputmask/inputmask.date.extensions.js":
|
1671
|
-
/*!******************************************************************************************************!*\
|
1672
|
-
!*** ./node_modules/@formio/core/node_modules/inputmask/dist/inputmask/inputmask.date.extensions.js ***!
|
1673
|
-
\******************************************************************************************************/
|
1674
|
-
/***/ (function(module, exports, __webpack_require__) {
|
1675
|
-
|
1676
|
-
eval("var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!\n* inputmask.date.extensions.js\n* https://github.com/RobinHerbots/Inputmask\n* Copyright (c) 2010 - 2019 Robin Herbots\n* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)\n* Version: 4.0.9\n*/\n\n(function(factory) {\n if (true) {\n !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ __webpack_require__(/*! ./inputmask */ \"./node_modules/@formio/core/node_modules/inputmask/dist/inputmask/inputmask.js\") ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?\n\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n } else {}\n})(function(Inputmask) {\n var $ = Inputmask.dependencyLib;\n var formatCode = {\n d: [ \"[1-9]|[12][0-9]|3[01]\", Date.prototype.setDate, \"day\", Date.prototype.getDate ],\n dd: [ \"0[1-9]|[12][0-9]|3[01]\", Date.prototype.setDate, \"day\", function() {\n return pad(Date.prototype.getDate.call(this), 2);\n } ],\n ddd: [ \"\" ],\n dddd: [ \"\" ],\n m: [ \"[1-9]|1[012]\", Date.prototype.setMonth, \"month\", function() {\n return Date.prototype.getMonth.call(this) + 1;\n } ],\n mm: [ \"0[1-9]|1[012]\", Date.prototype.setMonth, \"month\", function() {\n return pad(Date.prototype.getMonth.call(this) + 1, 2);\n } ],\n mmm: [ \"\" ],\n mmmm: [ \"\" ],\n yy: [ \"[0-9]{2}\", Date.prototype.setFullYear, \"year\", function() {\n return pad(Date.prototype.getFullYear.call(this), 2);\n } ],\n yyyy: [ \"[0-9]{4}\", Date.prototype.setFullYear, \"year\", function() {\n return pad(Date.prototype.getFullYear.call(this), 4);\n } ],\n h: [ \"[1-9]|1[0-2]\", Date.prototype.setHours, \"hours\", Date.prototype.getHours ],\n hh: [ \"0[1-9]|1[0-2]\", Date.prototype.setHours, \"hours\", function() {\n return pad(Date.prototype.getHours.call(this), 2);\n } ],\n hhh: [ \"[0-9]+\", Date.prototype.setHours, \"hours\", Date.prototype.getHours ],\n H: [ \"1?[0-9]|2[0-3]\", Date.prototype.setHours, \"hours\", Date.prototype.getHours ],\n HH: [ \"0[0-9]|1[0-9]|2[0-3]\", Date.prototype.setHours, \"hours\", function() {\n return pad(Date.prototype.getHours.call(this), 2);\n } ],\n HHH: [ \"[0-9]+\", Date.prototype.setHours, \"hours\", Date.prototype.getHours ],\n M: [ \"[1-5]?[0-9]\", Date.prototype.setMinutes, \"minutes\", Date.prototype.getMinutes ],\n MM: [ \"0[0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9]\", Date.prototype.setMinutes, \"minutes\", function() {\n return pad(Date.prototype.getMinutes.call(this), 2);\n } ],\n ss: [ \"[0-5][0-9]\", Date.prototype.setSeconds, \"seconds\", function() {\n return pad(Date.prototype.getSeconds.call(this), 2);\n } ],\n l: [ \"[0-9]{3}\", Date.prototype.setMilliseconds, \"milliseconds\", function() {\n return pad(Date.prototype.getMilliseconds.call(this), 3);\n } ],\n L: [ \"[0-9]{2}\", Date.prototype.setMilliseconds, \"milliseconds\", function() {\n return pad(Date.prototype.getMilliseconds.call(this), 2);\n } ],\n t: [ \"[ap]\" ],\n tt: [ \"[ap]m\" ],\n T: [ \"[AP]\" ],\n TT: [ \"[AP]M\" ],\n Z: [ \"\" ],\n o: [ \"\" ],\n S: [ \"\" ]\n }, formatAlias = {\n isoDate: \"yyyy-mm-dd\",\n isoTime: \"HH:MM:ss\",\n isoDateTime: \"yyyy-mm-dd'T'HH:MM:ss\",\n isoUtcDateTime: \"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'\"\n };\n function getTokenizer(opts) {\n if (!opts.tokenizer) {\n var tokens = [];\n for (var ndx in formatCode) {\n if (tokens.indexOf(ndx[0]) === -1) tokens.push(ndx[0]);\n }\n opts.tokenizer = \"(\" + tokens.join(\"+|\") + \")+?|.\";\n opts.tokenizer = new RegExp(opts.tokenizer, \"g\");\n }\n return opts.tokenizer;\n }\n function isValidDate(dateParts, currentResult) {\n return !isFinite(dateParts.rawday) || dateParts.day == \"29\" && !isFinite(dateParts.rawyear) || new Date(dateParts.date.getFullYear(), isFinite(dateParts.rawmonth) ? dateParts.month : dateParts.date.getMonth() + 1, 0).getDate() >= dateParts.day ? currentResult : false;\n }\n function isDateInRange(dateParts, opts) {\n var result = true;\n if (opts.min) {\n if (dateParts[\"rawyear\"]) {\n var rawYear = dateParts[\"rawyear\"].replace(/[^0-9]/g, \"\"), minYear = opts.min.year.substr(0, rawYear.length);\n result = minYear <= rawYear;\n }\n if (dateParts[\"year\"] === dateParts[\"rawyear\"]) {\n if (opts.min.date.getTime() === opts.min.date.getTime()) {\n result = opts.min.date.getTime() <= dateParts.date.getTime();\n }\n }\n }\n if (result && opts.max && opts.max.date.getTime() === opts.max.date.getTime()) {\n result = opts.max.date.getTime() >= dateParts.date.getTime();\n }\n return result;\n }\n function parse(format, dateObjValue, opts, raw) {\n var mask = \"\", match;\n while (match = getTokenizer(opts).exec(format)) {\n if (dateObjValue === undefined) {\n if (formatCode[match[0]]) {\n mask += \"(\" + formatCode[match[0]][0] + \")\";\n } else {\n switch (match[0]) {\n case \"[\":\n mask += \"(\";\n break;\n\n case \"]\":\n mask += \")?\";\n break;\n\n default:\n mask += Inputmask.escapeRegex(match[0]);\n }\n }\n } else {\n if (formatCode[match[0]]) {\n if (raw !== true && formatCode[match[0]][3]) {\n var getFn = formatCode[match[0]][3];\n mask += getFn.call(dateObjValue.date);\n } else if (formatCode[match[0]][2]) mask += dateObjValue[\"raw\" + formatCode[match[0]][2]]; else mask += match[0];\n } else mask += match[0];\n }\n }\n return mask;\n }\n function pad(val, len) {\n val = String(val);\n len = len || 2;\n while (val.length < len) val = \"0\" + val;\n return val;\n }\n function analyseMask(maskString, format, opts) {\n var dateObj = {\n date: new Date(1, 0, 1)\n }, targetProp, mask = maskString, match, dateOperation, targetValidator;\n function extendProperty(value) {\n var correctedValue = value.replace(/[^0-9]/g, \"0\");\n if (correctedValue != value) {\n var enteredPart = value.replace(/[^0-9]/g, \"\"), min = (opts.min && opts.min[targetProp] || value).toString(), max = (opts.max && opts.max[targetProp] || value).toString();\n correctedValue = enteredPart + (enteredPart < min.slice(0, enteredPart.length) ? min.slice(enteredPart.length) : enteredPart > max.slice(0, enteredPart.length) ? max.slice(enteredPart.length) : correctedValue.toString().slice(enteredPart.length));\n }\n return correctedValue;\n }\n function setValue(dateObj, value, opts) {\n dateObj[targetProp] = extendProperty(value);\n dateObj[\"raw\" + targetProp] = value;\n if (dateOperation !== undefined) dateOperation.call(dateObj.date, targetProp == \"month\" ? parseInt(dateObj[targetProp]) - 1 : dateObj[targetProp]);\n }\n if (typeof mask === \"string\") {\n while (match = getTokenizer(opts).exec(format)) {\n var value = mask.slice(0, match[0].length);\n if (formatCode.hasOwnProperty(match[0])) {\n targetValidator = formatCode[match[0]][0];\n targetProp = formatCode[match[0]][2];\n dateOperation = formatCode[match[0]][1];\n setValue(dateObj, value, opts);\n }\n mask = mask.slice(value.length);\n }\n return dateObj;\n } else if (mask && typeof mask === \"object\" && mask.hasOwnProperty(\"date\")) {\n return mask;\n }\n return undefined;\n }\n Inputmask.extendAliases({\n datetime: {\n mask: function(opts) {\n formatCode.S = opts.i18n.ordinalSuffix.join(\"|\");\n opts.inputFormat = formatAlias[opts.inputFormat] || opts.inputFormat;\n opts.displayFormat = formatAlias[opts.displayFormat] || opts.displayFormat || opts.inputFormat;\n opts.outputFormat = formatAlias[opts.outputFormat] || opts.outputFormat || opts.inputFormat;\n opts.placeholder = opts.placeholder !== \"\" ? opts.placeholder : opts.inputFormat.replace(/[\\[\\]]/, \"\");\n opts.regex = parse(opts.inputFormat, undefined, opts);\n return null;\n },\n placeholder: \"\",\n inputFormat: \"isoDateTime\",\n displayFormat: undefined,\n outputFormat: undefined,\n min: null,\n max: null,\n i18n: {\n dayNames: [ \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\", \"Sun\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\", \"Sunday\" ],\n monthNames: [ \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\", \"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\" ],\n ordinalSuffix: [ \"st\", \"nd\", \"rd\", \"th\" ]\n },\n postValidation: function(buffer, pos, currentResult, opts) {\n opts.min = analyseMask(opts.min, opts.inputFormat, opts);\n opts.max = analyseMask(opts.max, opts.inputFormat, opts);\n var result = currentResult, dateParts = analyseMask(buffer.join(\"\"), opts.inputFormat, opts);\n if (result && dateParts.date.getTime() === dateParts.date.getTime()) {\n result = isValidDate(dateParts, result);\n result = result && isDateInRange(dateParts, opts);\n }\n if (pos && result && currentResult.pos !== pos) {\n return {\n buffer: parse(opts.inputFormat, dateParts, opts),\n refreshFromBuffer: {\n start: pos,\n end: currentResult.pos\n }\n };\n }\n return result;\n },\n onKeyDown: function(e, buffer, caretPos, opts) {\n var input = this;\n if (e.ctrlKey && e.keyCode === Inputmask.keyCode.RIGHT) {\n var today = new Date(), match, date = \"\";\n while (match = getTokenizer(opts).exec(opts.inputFormat)) {\n if (match[0].charAt(0) === \"d\") {\n date += pad(today.getDate(), match[0].length);\n } else if (match[0].charAt(0) === \"m\") {\n date += pad(today.getMonth() + 1, match[0].length);\n } else if (match[0] === \"yyyy\") {\n date += today.getFullYear().toString();\n } else if (match[0].charAt(0) === \"y\") {\n date += pad(today.getYear(), match[0].length);\n }\n }\n input.inputmask._valueSet(date);\n $(input).trigger(\"setvalue\");\n }\n },\n onUnMask: function(maskedValue, unmaskedValue, opts) {\n return parse(opts.outputFormat, analyseMask(maskedValue, opts.inputFormat, opts), opts, true);\n },\n casing: function(elem, test, pos, validPositions) {\n if (test.nativeDef.indexOf(\"[ap]\") == 0) return elem.toLowerCase();\n if (test.nativeDef.indexOf(\"[AP]\") == 0) return elem.toUpperCase();\n return elem;\n },\n insertMode: false,\n shiftPositions: false\n }\n });\n return Inputmask;\n});\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/node_modules/inputmask/dist/inputmask/inputmask.date.extensions.js?");
|
1677
|
-
|
1678
|
-
/***/ }),
|
1679
|
-
|
1680
|
-
/***/ "./node_modules/@formio/core/node_modules/inputmask/dist/inputmask/inputmask.extensions.js":
|
1681
|
-
/*!*************************************************************************************************!*\
|
1682
|
-
!*** ./node_modules/@formio/core/node_modules/inputmask/dist/inputmask/inputmask.extensions.js ***!
|
1683
|
-
\*************************************************************************************************/
|
1684
|
-
/***/ (function(module, exports, __webpack_require__) {
|
1685
|
-
|
1686
|
-
eval("var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!\n* inputmask.extensions.js\n* https://github.com/RobinHerbots/Inputmask\n* Copyright (c) 2010 - 2019 Robin Herbots\n* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)\n* Version: 4.0.9\n*/\n\n(function(factory) {\n if (true) {\n !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ __webpack_require__(/*! ./inputmask */ \"./node_modules/@formio/core/node_modules/inputmask/dist/inputmask/inputmask.js\") ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?\n\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n } else {}\n})(function(Inputmask) {\n Inputmask.extendDefinitions({\n A: {\n validator: \"[A-Za-z\\u0410-\\u044f\\u0401\\u0451\\xc0-\\xff\\xb5]\",\n casing: \"upper\"\n },\n \"&\": {\n validator: \"[0-9A-Za-z\\u0410-\\u044f\\u0401\\u0451\\xc0-\\xff\\xb5]\",\n casing: \"upper\"\n },\n \"#\": {\n validator: \"[0-9A-Fa-f]\",\n casing: \"upper\"\n }\n });\n Inputmask.extendAliases({\n cssunit: {\n regex: \"[+-]?[0-9]+\\\\.?([0-9]+)?(px|em|rem|ex|%|in|cm|mm|pt|pc)\"\n },\n url: {\n regex: \"(https?|ftp)//.*\",\n autoUnmask: false\n },\n ip: {\n mask: \"i[i[i]].i[i[i]].i[i[i]].i[i[i]]\",\n definitions: {\n i: {\n validator: function(chrs, maskset, pos, strict, opts) {\n if (pos - 1 > -1 && maskset.buffer[pos - 1] !== \".\") {\n chrs = maskset.buffer[pos - 1] + chrs;\n if (pos - 2 > -1 && maskset.buffer[pos - 2] !== \".\") {\n chrs = maskset.buffer[pos - 2] + chrs;\n } else chrs = \"0\" + chrs;\n } else chrs = \"00\" + chrs;\n return new RegExp(\"25[0-5]|2[0-4][0-9]|[01][0-9][0-9]\").test(chrs);\n }\n }\n },\n onUnMask: function(maskedValue, unmaskedValue, opts) {\n return maskedValue;\n },\n inputmode: \"numeric\"\n },\n email: {\n mask: \"*{1,64}[.*{1,64}][.*{1,64}][.*{1,63}]@-{1,63}.-{1,63}[.-{1,63}][.-{1,63}]\",\n greedy: false,\n casing: \"lower\",\n onBeforePaste: function(pastedValue, opts) {\n pastedValue = pastedValue.toLowerCase();\n return pastedValue.replace(\"mailto:\", \"\");\n },\n definitions: {\n \"*\": {\n validator: \"[0-9\\uff11-\\uff19A-Za-z\\u0410-\\u044f\\u0401\\u0451\\xc0-\\xff\\xb5!#$%&'*+/=?^_`{|}~-]\"\n },\n \"-\": {\n validator: \"[0-9A-Za-z-]\"\n }\n },\n onUnMask: function(maskedValue, unmaskedValue, opts) {\n return maskedValue;\n },\n inputmode: \"email\"\n },\n mac: {\n mask: \"##:##:##:##:##:##\"\n },\n vin: {\n mask: \"V{13}9{4}\",\n definitions: {\n V: {\n validator: \"[A-HJ-NPR-Za-hj-npr-z\\\\d]\",\n casing: \"upper\"\n }\n },\n clearIncomplete: true,\n autoUnmask: true\n }\n });\n return Inputmask;\n});\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/node_modules/inputmask/dist/inputmask/inputmask.extensions.js?");
|
1687
|
-
|
1688
|
-
/***/ }),
|
1689
|
-
|
1690
|
-
/***/ "./node_modules/@formio/core/node_modules/inputmask/dist/inputmask/inputmask.js":
|
1691
|
-
/*!**************************************************************************************!*\
|
1692
|
-
!*** ./node_modules/@formio/core/node_modules/inputmask/dist/inputmask/inputmask.js ***!
|
1693
|
-
\**************************************************************************************/
|
1694
|
-
/***/ (function(module, exports, __webpack_require__) {
|
1695
|
-
|
1696
|
-
eval("var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!\n* inputmask.js\n* https://github.com/RobinHerbots/Inputmask\n* Copyright (c) 2010 - 2019 Robin Herbots\n* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)\n* Version: 4.0.9\n*/\n\n(function(factory) {\n if (true) {\n !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ __webpack_require__(/*! ./dependencyLibs/inputmask.dependencyLib */ \"./node_modules/@formio/core/node_modules/inputmask/dist/inputmask/dependencyLibs/inputmask.dependencyLib.js\"), __webpack_require__(/*! ./global/window */ \"./node_modules/@formio/core/node_modules/inputmask/dist/inputmask/global/window.js\") ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?\n\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n } else {}\n})(function($, window, undefined) {\n var document = window.document, ua = navigator.userAgent, ie = ua.indexOf(\"MSIE \") > 0 || ua.indexOf(\"Trident/\") > 0, mobile = isInputEventSupported(\"touchstart\"), iemobile = /iemobile/i.test(ua), iphone = /iphone/i.test(ua) && !iemobile;\n function Inputmask(alias, options, internal) {\n if (!(this instanceof Inputmask)) {\n return new Inputmask(alias, options, internal);\n }\n this.el = undefined;\n this.events = {};\n this.maskset = undefined;\n this.refreshValue = false;\n if (internal !== true) {\n if ($.isPlainObject(alias)) {\n options = alias;\n } else {\n options = options || {};\n if (alias) options.alias = alias;\n }\n this.opts = $.extend(true, {}, this.defaults, options);\n this.noMasksCache = options && options.definitions !== undefined;\n this.userOptions = options || {};\n this.isRTL = this.opts.numericInput;\n resolveAlias(this.opts.alias, options, this.opts);\n }\n }\n Inputmask.prototype = {\n dataAttribute: \"data-inputmask\",\n defaults: {\n placeholder: \"_\",\n optionalmarker: [ \"[\", \"]\" ],\n quantifiermarker: [ \"{\", \"}\" ],\n groupmarker: [ \"(\", \")\" ],\n alternatormarker: \"|\",\n escapeChar: \"\\\\\",\n mask: null,\n regex: null,\n oncomplete: $.noop,\n onincomplete: $.noop,\n oncleared: $.noop,\n repeat: 0,\n greedy: false,\n autoUnmask: false,\n removeMaskOnSubmit: false,\n clearMaskOnLostFocus: true,\n insertMode: true,\n clearIncomplete: false,\n alias: null,\n onKeyDown: $.noop,\n onBeforeMask: null,\n onBeforePaste: function(pastedValue, opts) {\n return $.isFunction(opts.onBeforeMask) ? opts.onBeforeMask.call(this, pastedValue, opts) : pastedValue;\n },\n onBeforeWrite: null,\n onUnMask: null,\n showMaskOnFocus: true,\n showMaskOnHover: true,\n onKeyValidation: $.noop,\n skipOptionalPartCharacter: \" \",\n numericInput: false,\n rightAlign: false,\n undoOnEscape: true,\n radixPoint: \"\",\n _radixDance: false,\n groupSeparator: \"\",\n keepStatic: null,\n positionCaretOnTab: true,\n tabThrough: false,\n supportsInputType: [ \"text\", \"tel\", \"url\", \"password\", \"search\" ],\n ignorables: [ 8, 9, 13, 19, 27, 33, 34, 35, 36, 37, 38, 39, 40, 45, 46, 93, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 0, 229 ],\n isComplete: null,\n preValidation: null,\n postValidation: null,\n staticDefinitionSymbol: undefined,\n jitMasking: false,\n nullable: true,\n inputEventOnly: false,\n noValuePatching: false,\n positionCaretOnClick: \"lvp\",\n casing: null,\n inputmode: \"verbatim\",\n colorMask: false,\n disablePredictiveText: false,\n importDataAttributes: true,\n shiftPositions: true\n },\n definitions: {\n 9: {\n validator: \"[0-9\\uff11-\\uff19]\",\n definitionSymbol: \"*\"\n },\n a: {\n validator: \"[A-Za-z\\u0410-\\u044f\\u0401\\u0451\\xc0-\\xff\\xb5]\",\n definitionSymbol: \"*\"\n },\n \"*\": {\n validator: \"[0-9\\uff11-\\uff19A-Za-z\\u0410-\\u044f\\u0401\\u0451\\xc0-\\xff\\xb5]\"\n }\n },\n aliases: {},\n masksCache: {},\n mask: function(elems) {\n var that = this;\n function importAttributeOptions(npt, opts, userOptions, dataAttribute) {\n if (opts.importDataAttributes === true) {\n var attrOptions = npt.getAttribute(dataAttribute), option, dataoptions, optionData, p;\n var importOption = function(option, optionData) {\n optionData = optionData !== undefined ? optionData : npt.getAttribute(dataAttribute + \"-\" + option);\n if (optionData !== null) {\n if (typeof optionData === \"string\") {\n if (option.indexOf(\"on\") === 0) optionData = window[optionData]; else if (optionData === \"false\") optionData = false; else if (optionData === \"true\") optionData = true;\n }\n userOptions[option] = optionData;\n }\n };\n if (attrOptions && attrOptions !== \"\") {\n attrOptions = attrOptions.replace(/'/g, '\"');\n dataoptions = JSON.parse(\"{\" + attrOptions + \"}\");\n }\n if (dataoptions) {\n optionData = undefined;\n for (p in dataoptions) {\n if (p.toLowerCase() === \"alias\") {\n optionData = dataoptions[p];\n break;\n }\n }\n }\n importOption(\"alias\", optionData);\n if (userOptions.alias) {\n resolveAlias(userOptions.alias, userOptions, opts);\n }\n for (option in opts) {\n if (dataoptions) {\n optionData = undefined;\n for (p in dataoptions) {\n if (p.toLowerCase() === option.toLowerCase()) {\n optionData = dataoptions[p];\n break;\n }\n }\n }\n importOption(option, optionData);\n }\n }\n $.extend(true, opts, userOptions);\n if (npt.dir === \"rtl\" || opts.rightAlign) {\n npt.style.textAlign = \"right\";\n }\n if (npt.dir === \"rtl\" || opts.numericInput) {\n npt.dir = \"ltr\";\n npt.removeAttribute(\"dir\");\n opts.isRTL = true;\n }\n return Object.keys(userOptions).length;\n }\n if (typeof elems === \"string\") {\n elems = document.getElementById(elems) || document.querySelectorAll(elems);\n }\n elems = elems.nodeName ? [ elems ] : elems;\n $.each(elems, function(ndx, el) {\n var scopedOpts = $.extend(true, {}, that.opts);\n if (importAttributeOptions(el, scopedOpts, $.extend(true, {}, that.userOptions), that.dataAttribute)) {\n var maskset = generateMaskSet(scopedOpts, that.noMasksCache);\n if (maskset !== undefined) {\n if (el.inputmask !== undefined) {\n el.inputmask.opts.autoUnmask = true;\n el.inputmask.remove();\n }\n el.inputmask = new Inputmask(undefined, undefined, true);\n el.inputmask.opts = scopedOpts;\n el.inputmask.noMasksCache = that.noMasksCache;\n el.inputmask.userOptions = $.extend(true, {}, that.userOptions);\n el.inputmask.isRTL = scopedOpts.isRTL || scopedOpts.numericInput;\n el.inputmask.el = el;\n el.inputmask.maskset = maskset;\n $.data(el, \"_inputmask_opts\", scopedOpts);\n maskScope.call(el.inputmask, {\n action: \"mask\"\n });\n }\n }\n });\n return elems && elems[0] ? elems[0].inputmask || this : this;\n },\n option: function(options, noremask) {\n if (typeof options === \"string\") {\n return this.opts[options];\n } else if (typeof options === \"object\") {\n $.extend(this.userOptions, options);\n if (this.el && noremask !== true) {\n this.mask(this.el);\n }\n return this;\n }\n },\n unmaskedvalue: function(value) {\n this.maskset = this.maskset || generateMaskSet(this.opts, this.noMasksCache);\n return maskScope.call(this, {\n action: \"unmaskedvalue\",\n value: value\n });\n },\n remove: function() {\n return maskScope.call(this, {\n action: \"remove\"\n });\n },\n getemptymask: function() {\n this.maskset = this.maskset || generateMaskSet(this.opts, this.noMasksCache);\n return maskScope.call(this, {\n action: \"getemptymask\"\n });\n },\n hasMaskedValue: function() {\n return !this.opts.autoUnmask;\n },\n isComplete: function() {\n this.maskset = this.maskset || generateMaskSet(this.opts, this.noMasksCache);\n return maskScope.call(this, {\n action: \"isComplete\"\n });\n },\n getmetadata: function() {\n this.maskset = this.maskset || generateMaskSet(this.opts, this.noMasksCache);\n return maskScope.call(this, {\n action: \"getmetadata\"\n });\n },\n isValid: function(value) {\n this.maskset = this.maskset || generateMaskSet(this.opts, this.noMasksCache);\n return maskScope.call(this, {\n action: \"isValid\",\n value: value\n });\n },\n format: function(value, metadata) {\n this.maskset = this.maskset || generateMaskSet(this.opts, this.noMasksCache);\n return maskScope.call(this, {\n action: \"format\",\n value: value,\n metadata: metadata\n });\n },\n setValue: function(value) {\n if (this.el) {\n $(this.el).trigger(\"setvalue\", [ value ]);\n }\n },\n analyseMask: function(mask, regexMask, opts) {\n var tokenizer = /(?:[?*+]|\\{[0-9\\+\\*]+(?:,[0-9\\+\\*]*)?(?:\\|[0-9\\+\\*]*)?\\})|[^.?*+^${[]()|\\\\]+|./g, regexTokenizer = /\\[\\^?]?(?:[^\\\\\\]]+|\\\\[\\S\\s]?)*]?|\\\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9][0-9]*|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|c[A-Za-z]|[\\S\\s]?)|\\((?:\\?[:=!]?)?|(?:[?*+]|\\{[0-9]+(?:,[0-9]*)?\\})\\??|[^.?*+^${[()|\\\\]+|./g, escaped = false, currentToken = new MaskToken(), match, m, openenings = [], maskTokens = [], openingToken, currentOpeningToken, alternator, lastMatch, groupToken;\n function MaskToken(isGroup, isOptional, isQuantifier, isAlternator) {\n this.matches = [];\n this.openGroup = isGroup || false;\n this.alternatorGroup = false;\n this.isGroup = isGroup || false;\n this.isOptional = isOptional || false;\n this.isQuantifier = isQuantifier || false;\n this.isAlternator = isAlternator || false;\n this.quantifier = {\n min: 1,\n max: 1\n };\n }\n function insertTestDefinition(mtoken, element, position) {\n position = position !== undefined ? position : mtoken.matches.length;\n var prevMatch = mtoken.matches[position - 1];\n if (regexMask) {\n if (element.indexOf(\"[\") === 0 || escaped && /\\\\d|\\\\s|\\\\w]/i.test(element) || element === \".\") {\n mtoken.matches.splice(position++, 0, {\n fn: new RegExp(element, opts.casing ? \"i\" : \"\"),\n optionality: false,\n newBlockMarker: prevMatch === undefined ? \"master\" : prevMatch.def !== element,\n casing: null,\n def: element,\n placeholder: undefined,\n nativeDef: element\n });\n } else {\n if (escaped) element = element[element.length - 1];\n $.each(element.split(\"\"), function(ndx, lmnt) {\n prevMatch = mtoken.matches[position - 1];\n mtoken.matches.splice(position++, 0, {\n fn: null,\n optionality: false,\n newBlockMarker: prevMatch === undefined ? \"master\" : prevMatch.def !== lmnt && prevMatch.fn !== null,\n casing: null,\n def: opts.staticDefinitionSymbol || lmnt,\n placeholder: opts.staticDefinitionSymbol !== undefined ? lmnt : undefined,\n nativeDef: (escaped ? \"'\" : \"\") + lmnt\n });\n });\n }\n escaped = false;\n } else {\n var maskdef = (opts.definitions ? opts.definitions[element] : undefined) || Inputmask.prototype.definitions[element];\n if (maskdef && !escaped) {\n mtoken.matches.splice(position++, 0, {\n fn: maskdef.validator ? typeof maskdef.validator == \"string\" ? new RegExp(maskdef.validator, opts.casing ? \"i\" : \"\") : new function() {\n this.test = maskdef.validator;\n }() : new RegExp(\".\"),\n optionality: false,\n newBlockMarker: prevMatch === undefined ? \"master\" : prevMatch.def !== (maskdef.definitionSymbol || element),\n casing: maskdef.casing,\n def: maskdef.definitionSymbol || element,\n placeholder: maskdef.placeholder,\n nativeDef: element\n });\n } else {\n mtoken.matches.splice(position++, 0, {\n fn: null,\n optionality: false,\n newBlockMarker: prevMatch === undefined ? \"master\" : prevMatch.def !== element && prevMatch.fn !== null,\n casing: null,\n def: opts.staticDefinitionSymbol || element,\n placeholder: opts.staticDefinitionSymbol !== undefined ? element : undefined,\n nativeDef: (escaped ? \"'\" : \"\") + element\n });\n escaped = false;\n }\n }\n }\n function verifyGroupMarker(maskToken) {\n if (maskToken && maskToken.matches) {\n $.each(maskToken.matches, function(ndx, token) {\n var nextToken = maskToken.matches[ndx + 1];\n if ((nextToken === undefined || (nextToken.matches === undefined || nextToken.isQuantifier === false)) && token && token.isGroup) {\n token.isGroup = false;\n if (!regexMask) {\n insertTestDefinition(token, opts.groupmarker[0], 0);\n if (token.openGroup !== true) {\n insertTestDefinition(token, opts.groupmarker[1]);\n }\n }\n }\n verifyGroupMarker(token);\n });\n }\n }\n function defaultCase() {\n if (openenings.length > 0) {\n currentOpeningToken = openenings[openenings.length - 1];\n insertTestDefinition(currentOpeningToken, m);\n if (currentOpeningToken.isAlternator) {\n alternator = openenings.pop();\n for (var mndx = 0; mndx < alternator.matches.length; mndx++) {\n if (alternator.matches[mndx].isGroup) alternator.matches[mndx].isGroup = false;\n }\n if (openenings.length > 0) {\n currentOpeningToken = openenings[openenings.length - 1];\n currentOpeningToken.matches.push(alternator);\n } else {\n currentToken.matches.push(alternator);\n }\n }\n } else {\n insertTestDefinition(currentToken, m);\n }\n }\n function reverseTokens(maskToken) {\n function reverseStatic(st) {\n if (st === opts.optionalmarker[0]) st = opts.optionalmarker[1]; else if (st === opts.optionalmarker[1]) st = opts.optionalmarker[0]; else if (st === opts.groupmarker[0]) st = opts.groupmarker[1]; else if (st === opts.groupmarker[1]) st = opts.groupmarker[0];\n return st;\n }\n maskToken.matches = maskToken.matches.reverse();\n for (var match in maskToken.matches) {\n if (maskToken.matches.hasOwnProperty(match)) {\n var intMatch = parseInt(match);\n if (maskToken.matches[match].isQuantifier && maskToken.matches[intMatch + 1] && maskToken.matches[intMatch + 1].isGroup) {\n var qt = maskToken.matches[match];\n maskToken.matches.splice(match, 1);\n maskToken.matches.splice(intMatch + 1, 0, qt);\n }\n if (maskToken.matches[match].matches !== undefined) {\n maskToken.matches[match] = reverseTokens(maskToken.matches[match]);\n } else {\n maskToken.matches[match] = reverseStatic(maskToken.matches[match]);\n }\n }\n }\n return maskToken;\n }\n function groupify(matches) {\n var groupToken = new MaskToken(true);\n groupToken.openGroup = false;\n groupToken.matches = matches;\n return groupToken;\n }\n if (regexMask) {\n opts.optionalmarker[0] = undefined;\n opts.optionalmarker[1] = undefined;\n }\n while (match = regexMask ? regexTokenizer.exec(mask) : tokenizer.exec(mask)) {\n m = match[0];\n if (regexMask) {\n switch (m.charAt(0)) {\n case \"?\":\n m = \"{0,1}\";\n break;\n\n case \"+\":\n case \"*\":\n m = \"{\" + m + \"}\";\n break;\n }\n }\n if (escaped) {\n defaultCase();\n continue;\n }\n switch (m.charAt(0)) {\n case \"(?=\":\n break;\n\n case \"(?!\":\n break;\n\n case \"(?<=\":\n break;\n\n case \"(?<!\":\n break;\n\n case opts.escapeChar:\n escaped = true;\n if (regexMask) {\n defaultCase();\n }\n break;\n\n case opts.optionalmarker[1]:\n case opts.groupmarker[1]:\n openingToken = openenings.pop();\n openingToken.openGroup = false;\n if (openingToken !== undefined) {\n if (openenings.length > 0) {\n currentOpeningToken = openenings[openenings.length - 1];\n currentOpeningToken.matches.push(openingToken);\n if (currentOpeningToken.isAlternator) {\n alternator = openenings.pop();\n for (var mndx = 0; mndx < alternator.matches.length; mndx++) {\n alternator.matches[mndx].isGroup = false;\n alternator.matches[mndx].alternatorGroup = false;\n }\n if (openenings.length > 0) {\n currentOpeningToken = openenings[openenings.length - 1];\n currentOpeningToken.matches.push(alternator);\n } else {\n currentToken.matches.push(alternator);\n }\n }\n } else {\n currentToken.matches.push(openingToken);\n }\n } else defaultCase();\n break;\n\n case opts.optionalmarker[0]:\n openenings.push(new MaskToken(false, true));\n break;\n\n case opts.groupmarker[0]:\n openenings.push(new MaskToken(true));\n break;\n\n case opts.quantifiermarker[0]:\n var quantifier = new MaskToken(false, false, true);\n m = m.replace(/[{}]/g, \"\");\n var mqj = m.split(\"|\"), mq = mqj[0].split(\",\"), mq0 = isNaN(mq[0]) ? mq[0] : parseInt(mq[0]), mq1 = mq.length === 1 ? mq0 : isNaN(mq[1]) ? mq[1] : parseInt(mq[1]);\n if (mq0 === \"*\" || mq0 === \"+\") {\n mq0 = mq1 === \"*\" ? 0 : 1;\n }\n quantifier.quantifier = {\n min: mq0,\n max: mq1,\n jit: mqj[1]\n };\n var matches = openenings.length > 0 ? openenings[openenings.length - 1].matches : currentToken.matches;\n match = matches.pop();\n if (match.isAlternator) {\n matches.push(match);\n matches = match.matches;\n var groupToken = new MaskToken(true);\n var tmpMatch = matches.pop();\n matches.push(groupToken);\n matches = groupToken.matches;\n match = tmpMatch;\n }\n if (!match.isGroup) {\n match = groupify([ match ]);\n }\n matches.push(match);\n matches.push(quantifier);\n break;\n\n case opts.alternatormarker:\n var groupQuantifier = function(matches) {\n var lastMatch = matches.pop();\n if (lastMatch.isQuantifier) {\n lastMatch = groupify([ matches.pop(), lastMatch ]);\n }\n return lastMatch;\n };\n if (openenings.length > 0) {\n currentOpeningToken = openenings[openenings.length - 1];\n var subToken = currentOpeningToken.matches[currentOpeningToken.matches.length - 1];\n if (currentOpeningToken.openGroup && (subToken.matches === undefined || subToken.isGroup === false && subToken.isAlternator === false)) {\n lastMatch = openenings.pop();\n } else {\n lastMatch = groupQuantifier(currentOpeningToken.matches);\n }\n } else {\n lastMatch = groupQuantifier(currentToken.matches);\n }\n if (lastMatch.isAlternator) {\n openenings.push(lastMatch);\n } else {\n if (lastMatch.alternatorGroup) {\n alternator = openenings.pop();\n lastMatch.alternatorGroup = false;\n } else {\n alternator = new MaskToken(false, false, false, true);\n }\n alternator.matches.push(lastMatch);\n openenings.push(alternator);\n if (lastMatch.openGroup) {\n lastMatch.openGroup = false;\n var alternatorGroup = new MaskToken(true);\n alternatorGroup.alternatorGroup = true;\n openenings.push(alternatorGroup);\n }\n }\n break;\n\n default:\n defaultCase();\n }\n }\n while (openenings.length > 0) {\n openingToken = openenings.pop();\n currentToken.matches.push(openingToken);\n }\n if (currentToken.matches.length > 0) {\n verifyGroupMarker(currentToken);\n maskTokens.push(currentToken);\n }\n if (opts.numericInput || opts.isRTL) {\n reverseTokens(maskTokens[0]);\n }\n return maskTokens;\n },\n positionColorMask: function(input, template) {\n input.style.left = template.offsetLeft + \"px\";\n }\n };\n Inputmask.extendDefaults = function(options) {\n $.extend(true, Inputmask.prototype.defaults, options);\n };\n Inputmask.extendDefinitions = function(definition) {\n $.extend(true, Inputmask.prototype.definitions, definition);\n };\n Inputmask.extendAliases = function(alias) {\n $.extend(true, Inputmask.prototype.aliases, alias);\n };\n Inputmask.format = function(value, options, metadata) {\n return Inputmask(options).format(value, metadata);\n };\n Inputmask.unmask = function(value, options) {\n return Inputmask(options).unmaskedvalue(value);\n };\n Inputmask.isValid = function(value, options) {\n return Inputmask(options).isValid(value);\n };\n Inputmask.remove = function(elems) {\n if (typeof elems === \"string\") {\n elems = document.getElementById(elems) || document.querySelectorAll(elems);\n }\n elems = elems.nodeName ? [ elems ] : elems;\n $.each(elems, function(ndx, el) {\n if (el.inputmask) el.inputmask.remove();\n });\n };\n Inputmask.setValue = function(elems, value) {\n if (typeof elems === \"string\") {\n elems = document.getElementById(elems) || document.querySelectorAll(elems);\n }\n elems = elems.nodeName ? [ elems ] : elems;\n $.each(elems, function(ndx, el) {\n if (el.inputmask) el.inputmask.setValue(value); else $(el).trigger(\"setvalue\", [ value ]);\n });\n };\n Inputmask.escapeRegex = function(str) {\n var specials = [ \"/\", \".\", \"*\", \"+\", \"?\", \"|\", \"(\", \")\", \"[\", \"]\", \"{\", \"}\", \"\\\\\", \"$\", \"^\" ];\n return str.replace(new RegExp(\"(\\\\\" + specials.join(\"|\\\\\") + \")\", \"gim\"), \"\\\\$1\");\n };\n Inputmask.keyCode = {\n BACKSPACE: 8,\n BACKSPACE_SAFARI: 127,\n DELETE: 46,\n DOWN: 40,\n END: 35,\n ENTER: 13,\n ESCAPE: 27,\n HOME: 36,\n INSERT: 45,\n LEFT: 37,\n PAGE_DOWN: 34,\n PAGE_UP: 33,\n RIGHT: 39,\n SPACE: 32,\n TAB: 9,\n UP: 38,\n X: 88,\n CONTROL: 17\n };\n Inputmask.dependencyLib = $;\n function resolveAlias(aliasStr, options, opts) {\n var aliasDefinition = Inputmask.prototype.aliases[aliasStr];\n if (aliasDefinition) {\n if (aliasDefinition.alias) resolveAlias(aliasDefinition.alias, undefined, opts);\n $.extend(true, opts, aliasDefinition);\n $.extend(true, opts, options);\n return true;\n } else if (opts.mask === null) {\n opts.mask = aliasStr;\n }\n return false;\n }\n function generateMaskSet(opts, nocache) {\n function generateMask(mask, metadata, opts) {\n var regexMask = false;\n if (mask === null || mask === \"\") {\n regexMask = opts.regex !== null;\n if (regexMask) {\n mask = opts.regex;\n mask = mask.replace(/^(\\^)(.*)(\\$)$/, \"$2\");\n } else {\n regexMask = true;\n mask = \".*\";\n }\n }\n if (mask.length === 1 && opts.greedy === false && opts.repeat !== 0) {\n opts.placeholder = \"\";\n }\n if (opts.repeat > 0 || opts.repeat === \"*\" || opts.repeat === \"+\") {\n var repeatStart = opts.repeat === \"*\" ? 0 : opts.repeat === \"+\" ? 1 : opts.repeat;\n mask = opts.groupmarker[0] + mask + opts.groupmarker[1] + opts.quantifiermarker[0] + repeatStart + \",\" + opts.repeat + opts.quantifiermarker[1];\n }\n var masksetDefinition, maskdefKey = regexMask ? \"regex_\" + opts.regex : opts.numericInput ? mask.split(\"\").reverse().join(\"\") : mask;\n if (Inputmask.prototype.masksCache[maskdefKey] === undefined || nocache === true) {\n masksetDefinition = {\n mask: mask,\n maskToken: Inputmask.prototype.analyseMask(mask, regexMask, opts),\n validPositions: {},\n _buffer: undefined,\n buffer: undefined,\n tests: {},\n excludes: {},\n metadata: metadata,\n maskLength: undefined,\n jitOffset: {}\n };\n if (nocache !== true) {\n Inputmask.prototype.masksCache[maskdefKey] = masksetDefinition;\n masksetDefinition = $.extend(true, {}, Inputmask.prototype.masksCache[maskdefKey]);\n }\n } else masksetDefinition = $.extend(true, {}, Inputmask.prototype.masksCache[maskdefKey]);\n return masksetDefinition;\n }\n var ms;\n if ($.isFunction(opts.mask)) {\n opts.mask = opts.mask(opts);\n }\n if ($.isArray(opts.mask)) {\n if (opts.mask.length > 1) {\n if (opts.keepStatic === null) {\n opts.keepStatic = \"auto\";\n for (var i = 0; i < opts.mask.length; i++) {\n if (opts.mask[i].charAt(0) !== opts.mask[0].charAt(0)) {\n opts.keepStatic = true;\n break;\n }\n }\n }\n var altMask = opts.groupmarker[0];\n $.each(opts.isRTL ? opts.mask.reverse() : opts.mask, function(ndx, msk) {\n if (altMask.length > 1) {\n altMask += opts.groupmarker[1] + opts.alternatormarker + opts.groupmarker[0];\n }\n if (msk.mask !== undefined && !$.isFunction(msk.mask)) {\n altMask += msk.mask;\n } else {\n altMask += msk;\n }\n });\n altMask += opts.groupmarker[1];\n return generateMask(altMask, opts.mask, opts);\n } else opts.mask = opts.mask.pop();\n }\n if (opts.mask && opts.mask.mask !== undefined && !$.isFunction(opts.mask.mask)) {\n ms = generateMask(opts.mask.mask, opts.mask, opts);\n } else {\n ms = generateMask(opts.mask, opts.mask, opts);\n }\n return ms;\n }\n function isInputEventSupported(eventName) {\n var el = document.createElement(\"input\"), evName = \"on\" + eventName, isSupported = evName in el;\n if (!isSupported) {\n el.setAttribute(evName, \"return;\");\n isSupported = typeof el[evName] === \"function\";\n }\n el = null;\n return isSupported;\n }\n function maskScope(actionObj, maskset, opts) {\n maskset = maskset || this.maskset;\n opts = opts || this.opts;\n var inputmask = this, el = this.el, isRTL = this.isRTL, undoValue, $el, skipKeyPressEvent = false, skipInputEvent = false, ignorable = false, maxLength, mouseEnter = false, colorMask, originalPlaceholder;\n var getMaskTemplate = function(baseOnInput, minimalPos, includeMode, noJit, clearOptionalTail) {\n var greedy = opts.greedy;\n if (clearOptionalTail) opts.greedy = false;\n minimalPos = minimalPos || 0;\n var maskTemplate = [], ndxIntlzr, pos = 0, test, testPos, lvp = getLastValidPosition();\n do {\n if (baseOnInput === true && getMaskSet().validPositions[pos]) {\n testPos = clearOptionalTail && getMaskSet().validPositions[pos].match.optionality === true && getMaskSet().validPositions[pos + 1] === undefined && (getMaskSet().validPositions[pos].generatedInput === true || getMaskSet().validPositions[pos].input == opts.skipOptionalPartCharacter && pos > 0) ? determineTestTemplate(pos, getTests(pos, ndxIntlzr, pos - 1)) : getMaskSet().validPositions[pos];\n test = testPos.match;\n ndxIntlzr = testPos.locator.slice();\n maskTemplate.push(includeMode === true ? testPos.input : includeMode === false ? test.nativeDef : getPlaceholder(pos, test));\n } else {\n testPos = getTestTemplate(pos, ndxIntlzr, pos - 1);\n test = testPos.match;\n ndxIntlzr = testPos.locator.slice();\n var jitMasking = noJit === true ? false : opts.jitMasking !== false ? opts.jitMasking : test.jit;\n if (jitMasking === false || jitMasking === undefined || typeof jitMasking === \"number\" && isFinite(jitMasking) && jitMasking > pos) {\n maskTemplate.push(includeMode === false ? test.nativeDef : getPlaceholder(pos, test));\n }\n }\n if (opts.keepStatic === \"auto\") {\n if (test.newBlockMarker && test.fn !== null) {\n opts.keepStatic = pos - 1;\n }\n }\n pos++;\n } while ((maxLength === undefined || pos < maxLength) && (test.fn !== null || test.def !== \"\") || minimalPos > pos);\n if (maskTemplate[maskTemplate.length - 1] === \"\") {\n maskTemplate.pop();\n }\n if (includeMode !== false || getMaskSet().maskLength === undefined) getMaskSet().maskLength = pos - 1;\n opts.greedy = greedy;\n return maskTemplate;\n };\n function getMaskSet() {\n return maskset;\n }\n function resetMaskSet(soft) {\n var maskset = getMaskSet();\n maskset.buffer = undefined;\n if (soft !== true) {\n maskset.validPositions = {};\n maskset.p = 0;\n }\n }\n function getLastValidPosition(closestTo, strict, validPositions) {\n var before = -1, after = -1, valids = validPositions || getMaskSet().validPositions;\n if (closestTo === undefined) closestTo = -1;\n for (var posNdx in valids) {\n var psNdx = parseInt(posNdx);\n if (valids[psNdx] && (strict || valids[psNdx].generatedInput !== true)) {\n if (psNdx <= closestTo) before = psNdx;\n if (psNdx >= closestTo) after = psNdx;\n }\n }\n return before === -1 || before == closestTo ? after : after == -1 ? before : closestTo - before < after - closestTo ? before : after;\n }\n function getDecisionTaker(tst) {\n var decisionTaker = tst.locator[tst.alternation];\n if (typeof decisionTaker == \"string\" && decisionTaker.length > 0) {\n decisionTaker = decisionTaker.split(\",\")[0];\n }\n return decisionTaker !== undefined ? decisionTaker.toString() : \"\";\n }\n function getLocator(tst, align) {\n var locator = (tst.alternation != undefined ? tst.mloc[getDecisionTaker(tst)] : tst.locator).join(\"\");\n if (locator !== \"\") while (locator.length < align) locator += \"0\";\n return locator;\n }\n function determineTestTemplate(pos, tests) {\n pos = pos > 0 ? pos - 1 : 0;\n var altTest = getTest(pos), targetLocator = getLocator(altTest), tstLocator, closest, bestMatch;\n for (var ndx = 0; ndx < tests.length; ndx++) {\n var tst = tests[ndx];\n tstLocator = getLocator(tst, targetLocator.length);\n var distance = Math.abs(tstLocator - targetLocator);\n if (closest === undefined || tstLocator !== \"\" && distance < closest || bestMatch && !opts.greedy && bestMatch.match.optionality && bestMatch.match.newBlockMarker === \"master\" && (!tst.match.optionality || !tst.match.newBlockMarker) || bestMatch && bestMatch.match.optionalQuantifier && !tst.match.optionalQuantifier) {\n closest = distance;\n bestMatch = tst;\n }\n }\n return bestMatch;\n }\n function getTestTemplate(pos, ndxIntlzr, tstPs) {\n return getMaskSet().validPositions[pos] || determineTestTemplate(pos, getTests(pos, ndxIntlzr ? ndxIntlzr.slice() : ndxIntlzr, tstPs));\n }\n function getTest(pos, tests) {\n if (getMaskSet().validPositions[pos]) {\n return getMaskSet().validPositions[pos];\n }\n return (tests || getTests(pos))[0];\n }\n function positionCanMatchDefinition(pos, def) {\n var valid = false, tests = getTests(pos);\n for (var tndx = 0; tndx < tests.length; tndx++) {\n if (tests[tndx].match && tests[tndx].match.def === def) {\n valid = true;\n break;\n }\n }\n return valid;\n }\n function getTests(pos, ndxIntlzr, tstPs) {\n var maskTokens = getMaskSet().maskToken, testPos = ndxIntlzr ? tstPs : 0, ndxInitializer = ndxIntlzr ? ndxIntlzr.slice() : [ 0 ], matches = [], insertStop = false, latestMatch, cacheDependency = ndxIntlzr ? ndxIntlzr.join(\"\") : \"\";\n function resolveTestFromToken(maskToken, ndxInitializer, loopNdx, quantifierRecurse) {\n function handleMatch(match, loopNdx, quantifierRecurse) {\n function isFirstMatch(latestMatch, tokenGroup) {\n var firstMatch = $.inArray(latestMatch, tokenGroup.matches) === 0;\n if (!firstMatch) {\n $.each(tokenGroup.matches, function(ndx, match) {\n if (match.isQuantifier === true) firstMatch = isFirstMatch(latestMatch, tokenGroup.matches[ndx - 1]); else if (match.hasOwnProperty(\"matches\")) firstMatch = isFirstMatch(latestMatch, match);\n if (firstMatch) return false;\n });\n }\n return firstMatch;\n }\n function resolveNdxInitializer(pos, alternateNdx, targetAlternation) {\n var bestMatch, indexPos;\n if (getMaskSet().tests[pos] || getMaskSet().validPositions[pos]) {\n $.each(getMaskSet().tests[pos] || [ getMaskSet().validPositions[pos] ], function(ndx, lmnt) {\n if (lmnt.mloc[alternateNdx]) {\n bestMatch = lmnt;\n return false;\n }\n var alternation = targetAlternation !== undefined ? targetAlternation : lmnt.alternation, ndxPos = lmnt.locator[alternation] !== undefined ? lmnt.locator[alternation].toString().indexOf(alternateNdx) : -1;\n if ((indexPos === undefined || ndxPos < indexPos) && ndxPos !== -1) {\n bestMatch = lmnt;\n indexPos = ndxPos;\n }\n });\n }\n if (bestMatch) {\n var bestMatchAltIndex = bestMatch.locator[bestMatch.alternation];\n var locator = bestMatch.mloc[alternateNdx] || bestMatch.mloc[bestMatchAltIndex] || bestMatch.locator;\n return locator.slice((targetAlternation !== undefined ? targetAlternation : bestMatch.alternation) + 1);\n } else {\n return targetAlternation !== undefined ? resolveNdxInitializer(pos, alternateNdx) : undefined;\n }\n }\n function isSubsetOf(source, target) {\n function expand(pattern) {\n var expanded = [], start, end;\n for (var i = 0, l = pattern.length; i < l; i++) {\n if (pattern.charAt(i) === \"-\") {\n end = pattern.charCodeAt(i + 1);\n while (++start < end) expanded.push(String.fromCharCode(start));\n } else {\n start = pattern.charCodeAt(i);\n expanded.push(pattern.charAt(i));\n }\n }\n return expanded.join(\"\");\n }\n if (opts.regex && source.match.fn !== null && target.match.fn !== null) {\n return expand(target.match.def.replace(/[\\[\\]]/g, \"\")).indexOf(expand(source.match.def.replace(/[\\[\\]]/g, \"\"))) !== -1;\n }\n return source.match.def === target.match.nativeDef;\n }\n function staticCanMatchDefinition(source, target) {\n var sloc = source.locator.slice(source.alternation).join(\"\"), tloc = target.locator.slice(target.alternation).join(\"\"), canMatch = sloc == tloc;\n canMatch = canMatch && source.match.fn === null && target.match.fn !== null ? target.match.fn.test(source.match.def, getMaskSet(), pos, false, opts, false) : false;\n return canMatch;\n }\n function setMergeLocators(targetMatch, altMatch) {\n if (altMatch === undefined || targetMatch.alternation === altMatch.alternation && targetMatch.locator[targetMatch.alternation].toString().indexOf(altMatch.locator[altMatch.alternation]) === -1) {\n targetMatch.mloc = targetMatch.mloc || {};\n var locNdx = targetMatch.locator[targetMatch.alternation];\n if (locNdx === undefined) targetMatch.alternation = undefined; else {\n if (typeof locNdx === \"string\") locNdx = locNdx.split(\",\")[0];\n if (targetMatch.mloc[locNdx] === undefined) targetMatch.mloc[locNdx] = targetMatch.locator.slice();\n if (altMatch !== undefined) {\n for (var ndx in altMatch.mloc) {\n if (typeof ndx === \"string\") ndx = ndx.split(\",\")[0];\n if (targetMatch.mloc[ndx] === undefined) targetMatch.mloc[ndx] = altMatch.mloc[ndx];\n }\n targetMatch.locator[targetMatch.alternation] = Object.keys(targetMatch.mloc).join(\",\");\n }\n return true;\n }\n }\n return false;\n }\n if (testPos > 500 && quantifierRecurse !== undefined) {\n throw \"Inputmask: There is probably an error in your mask definition or in the code. Create an issue on github with an example of the mask you are using. \" + getMaskSet().mask;\n }\n if (testPos === pos && match.matches === undefined) {\n matches.push({\n match: match,\n locator: loopNdx.reverse(),\n cd: cacheDependency,\n mloc: {}\n });\n return true;\n } else if (match.matches !== undefined) {\n if (match.isGroup && quantifierRecurse !== match) {\n match = handleMatch(maskToken.matches[$.inArray(match, maskToken.matches) + 1], loopNdx, quantifierRecurse);\n if (match) return true;\n } else if (match.isOptional) {\n var optionalToken = match;\n match = resolveTestFromToken(match, ndxInitializer, loopNdx, quantifierRecurse);\n if (match) {\n $.each(matches, function(ndx, mtch) {\n mtch.match.optionality = true;\n });\n latestMatch = matches[matches.length - 1].match;\n if (quantifierRecurse === undefined && isFirstMatch(latestMatch, optionalToken)) {\n insertStop = true;\n testPos = pos;\n } else return true;\n }\n } else if (match.isAlternator) {\n var alternateToken = match, malternateMatches = [], maltMatches, currentMatches = matches.slice(), loopNdxCnt = loopNdx.length;\n var altIndex = ndxInitializer.length > 0 ? ndxInitializer.shift() : -1;\n if (altIndex === -1 || typeof altIndex === \"string\") {\n var currentPos = testPos, ndxInitializerClone = ndxInitializer.slice(), altIndexArr = [], amndx;\n if (typeof altIndex == \"string\") {\n altIndexArr = altIndex.split(\",\");\n } else {\n for (amndx = 0; amndx < alternateToken.matches.length; amndx++) {\n altIndexArr.push(amndx.toString());\n }\n }\n if (getMaskSet().excludes[pos]) {\n var altIndexArrClone = altIndexArr.slice();\n for (var i = 0, el = getMaskSet().excludes[pos].length; i < el; i++) {\n altIndexArr.splice(altIndexArr.indexOf(getMaskSet().excludes[pos][i].toString()), 1);\n }\n if (altIndexArr.length === 0) {\n getMaskSet().excludes[pos] = undefined;\n altIndexArr = altIndexArrClone;\n }\n }\n if (opts.keepStatic === true || isFinite(parseInt(opts.keepStatic)) && currentPos >= opts.keepStatic) altIndexArr = altIndexArr.slice(0, 1);\n var unMatchedAlternation = false;\n for (var ndx = 0; ndx < altIndexArr.length; ndx++) {\n amndx = parseInt(altIndexArr[ndx]);\n matches = [];\n ndxInitializer = typeof altIndex === \"string\" ? resolveNdxInitializer(testPos, amndx, loopNdxCnt) || ndxInitializerClone.slice() : ndxInitializerClone.slice();\n if (alternateToken.matches[amndx] && handleMatch(alternateToken.matches[amndx], [ amndx ].concat(loopNdx), quantifierRecurse)) match = true; else if (ndx === 0) {\n unMatchedAlternation = true;\n }\n maltMatches = matches.slice();\n testPos = currentPos;\n matches = [];\n for (var ndx1 = 0; ndx1 < maltMatches.length; ndx1++) {\n var altMatch = maltMatches[ndx1], dropMatch = false;\n altMatch.match.jit = altMatch.match.jit || unMatchedAlternation;\n altMatch.alternation = altMatch.alternation || loopNdxCnt;\n setMergeLocators(altMatch);\n for (var ndx2 = 0; ndx2 < malternateMatches.length; ndx2++) {\n var altMatch2 = malternateMatches[ndx2];\n if (typeof altIndex !== \"string\" || altMatch.alternation !== undefined && $.inArray(altMatch.locator[altMatch.alternation].toString(), altIndexArr) !== -1) {\n if (altMatch.match.nativeDef === altMatch2.match.nativeDef) {\n dropMatch = true;\n setMergeLocators(altMatch2, altMatch);\n break;\n } else if (isSubsetOf(altMatch, altMatch2)) {\n if (setMergeLocators(altMatch, altMatch2)) {\n dropMatch = true;\n malternateMatches.splice(malternateMatches.indexOf(altMatch2), 0, altMatch);\n }\n break;\n } else if (isSubsetOf(altMatch2, altMatch)) {\n setMergeLocators(altMatch2, altMatch);\n break;\n } else if (staticCanMatchDefinition(altMatch, altMatch2)) {\n if (setMergeLocators(altMatch, altMatch2)) {\n dropMatch = true;\n malternateMatches.splice(malternateMatches.indexOf(altMatch2), 0, altMatch);\n }\n break;\n }\n }\n }\n if (!dropMatch) {\n malternateMatches.push(altMatch);\n }\n }\n }\n matches = currentMatches.concat(malternateMatches);\n testPos = pos;\n insertStop = matches.length > 0;\n match = malternateMatches.length > 0;\n ndxInitializer = ndxInitializerClone.slice();\n } else match = handleMatch(alternateToken.matches[altIndex] || maskToken.matches[altIndex], [ altIndex ].concat(loopNdx), quantifierRecurse);\n if (match) return true;\n } else if (match.isQuantifier && quantifierRecurse !== maskToken.matches[$.inArray(match, maskToken.matches) - 1]) {\n var qt = match;\n for (var qndx = ndxInitializer.length > 0 ? ndxInitializer.shift() : 0; qndx < (isNaN(qt.quantifier.max) ? qndx + 1 : qt.quantifier.max) && testPos <= pos; qndx++) {\n var tokenGroup = maskToken.matches[$.inArray(qt, maskToken.matches) - 1];\n match = handleMatch(tokenGroup, [ qndx ].concat(loopNdx), tokenGroup);\n if (match) {\n latestMatch = matches[matches.length - 1].match;\n latestMatch.optionalQuantifier = qndx >= qt.quantifier.min;\n latestMatch.jit = (qndx || 1) * tokenGroup.matches.indexOf(latestMatch) >= qt.quantifier.jit;\n if (latestMatch.optionalQuantifier && isFirstMatch(latestMatch, tokenGroup)) {\n insertStop = true;\n testPos = pos;\n break;\n }\n if (latestMatch.jit) {\n getMaskSet().jitOffset[pos] = tokenGroup.matches.indexOf(latestMatch);\n }\n return true;\n }\n }\n } else {\n match = resolveTestFromToken(match, ndxInitializer, loopNdx, quantifierRecurse);\n if (match) return true;\n }\n } else {\n testPos++;\n }\n }\n for (var tndx = ndxInitializer.length > 0 ? ndxInitializer.shift() : 0; tndx < maskToken.matches.length; tndx++) {\n if (maskToken.matches[tndx].isQuantifier !== true) {\n var match = handleMatch(maskToken.matches[tndx], [ tndx ].concat(loopNdx), quantifierRecurse);\n if (match && testPos === pos) {\n return match;\n } else if (testPos > pos) {\n break;\n }\n }\n }\n }\n function mergeLocators(pos, tests) {\n var locator = [];\n if (!$.isArray(tests)) tests = [ tests ];\n if (tests.length > 0) {\n if (tests[0].alternation === undefined) {\n locator = determineTestTemplate(pos, tests.slice()).locator.slice();\n if (locator.length === 0) locator = tests[0].locator.slice();\n } else {\n $.each(tests, function(ndx, tst) {\n if (tst.def !== \"\") {\n if (locator.length === 0) locator = tst.locator.slice(); else {\n for (var i = 0; i < locator.length; i++) {\n if (tst.locator[i] && locator[i].toString().indexOf(tst.locator[i]) === -1) {\n locator[i] += \",\" + tst.locator[i];\n }\n }\n }\n }\n });\n }\n }\n return locator;\n }\n if (pos > -1) {\n if (ndxIntlzr === undefined) {\n var previousPos = pos - 1, test;\n while ((test = getMaskSet().validPositions[previousPos] || getMaskSet().tests[previousPos]) === undefined && previousPos > -1) {\n previousPos--;\n }\n if (test !== undefined && previousPos > -1) {\n ndxInitializer = mergeLocators(previousPos, test);\n cacheDependency = ndxInitializer.join(\"\");\n testPos = previousPos;\n }\n }\n if (getMaskSet().tests[pos] && getMaskSet().tests[pos][0].cd === cacheDependency) {\n return getMaskSet().tests[pos];\n }\n for (var mtndx = ndxInitializer.shift(); mtndx < maskTokens.length; mtndx++) {\n var match = resolveTestFromToken(maskTokens[mtndx], ndxInitializer, [ mtndx ]);\n if (match && testPos === pos || testPos > pos) {\n break;\n }\n }\n }\n if (matches.length === 0 || insertStop) {\n matches.push({\n match: {\n fn: null,\n optionality: false,\n casing: null,\n def: \"\",\n placeholder: \"\"\n },\n locator: [],\n mloc: {},\n cd: cacheDependency\n });\n }\n if (ndxIntlzr !== undefined && getMaskSet().tests[pos]) {\n return $.extend(true, [], matches);\n }\n getMaskSet().tests[pos] = $.extend(true, [], matches);\n return getMaskSet().tests[pos];\n }\n function getBufferTemplate() {\n if (getMaskSet()._buffer === undefined) {\n getMaskSet()._buffer = getMaskTemplate(false, 1);\n if (getMaskSet().buffer === undefined) getMaskSet().buffer = getMaskSet()._buffer.slice();\n }\n return getMaskSet()._buffer;\n }\n function getBuffer(noCache) {\n if (getMaskSet().buffer === undefined || noCache === true) {\n getMaskSet().buffer = getMaskTemplate(true, getLastValidPosition(), true);\n if (getMaskSet()._buffer === undefined) getMaskSet()._buffer = getMaskSet().buffer.slice();\n }\n return getMaskSet().buffer;\n }\n function refreshFromBuffer(start, end, buffer) {\n var i, p;\n if (start === true) {\n resetMaskSet();\n start = 0;\n end = buffer.length;\n } else {\n for (i = start; i < end; i++) {\n delete getMaskSet().validPositions[i];\n }\n }\n p = start;\n for (i = start; i < end; i++) {\n resetMaskSet(true);\n if (buffer[i] !== opts.skipOptionalPartCharacter) {\n var valResult = isValid(p, buffer[i], true, true);\n if (valResult !== false) {\n resetMaskSet(true);\n p = valResult.caret !== undefined ? valResult.caret : valResult.pos + 1;\n }\n }\n }\n }\n function casing(elem, test, pos) {\n switch (opts.casing || test.casing) {\n case \"upper\":\n elem = elem.toUpperCase();\n break;\n\n case \"lower\":\n elem = elem.toLowerCase();\n break;\n\n case \"title\":\n var posBefore = getMaskSet().validPositions[pos - 1];\n if (pos === 0 || posBefore && posBefore.input === String.fromCharCode(Inputmask.keyCode.SPACE)) {\n elem = elem.toUpperCase();\n } else {\n elem = elem.toLowerCase();\n }\n break;\n\n default:\n if ($.isFunction(opts.casing)) {\n var args = Array.prototype.slice.call(arguments);\n args.push(getMaskSet().validPositions);\n elem = opts.casing.apply(this, args);\n }\n }\n return elem;\n }\n function checkAlternationMatch(altArr1, altArr2, na) {\n var altArrC = opts.greedy ? altArr2 : altArr2.slice(0, 1), isMatch = false, naArr = na !== undefined ? na.split(\",\") : [], naNdx;\n for (var i = 0; i < naArr.length; i++) {\n if ((naNdx = altArr1.indexOf(naArr[i])) !== -1) {\n altArr1.splice(naNdx, 1);\n }\n }\n for (var alndx = 0; alndx < altArr1.length; alndx++) {\n if ($.inArray(altArr1[alndx], altArrC) !== -1) {\n isMatch = true;\n break;\n }\n }\n return isMatch;\n }\n function alternate(pos, c, strict, fromSetValid, rAltPos) {\n var validPsClone = $.extend(true, {}, getMaskSet().validPositions), lastAlt, alternation, isValidRslt = false, altPos, prevAltPos, i, validPos, decisionPos, lAltPos = rAltPos !== undefined ? rAltPos : getLastValidPosition();\n if (lAltPos === -1 && rAltPos === undefined) {\n lastAlt = 0;\n prevAltPos = getTest(lastAlt);\n alternation = prevAltPos.alternation;\n } else {\n for (;lAltPos >= 0; lAltPos--) {\n altPos = getMaskSet().validPositions[lAltPos];\n if (altPos && altPos.alternation !== undefined) {\n if (prevAltPos && prevAltPos.locator[altPos.alternation] !== altPos.locator[altPos.alternation]) {\n break;\n }\n lastAlt = lAltPos;\n alternation = getMaskSet().validPositions[lastAlt].alternation;\n prevAltPos = altPos;\n }\n }\n }\n if (alternation !== undefined) {\n decisionPos = parseInt(lastAlt);\n getMaskSet().excludes[decisionPos] = getMaskSet().excludes[decisionPos] || [];\n if (pos !== true) {\n getMaskSet().excludes[decisionPos].push(getDecisionTaker(prevAltPos));\n }\n var validInputsClone = [], staticInputsBeforePos = 0;\n for (i = decisionPos; i < getLastValidPosition(undefined, true) + 1; i++) {\n validPos = getMaskSet().validPositions[i];\n if (validPos && validPos.generatedInput !== true) {\n validInputsClone.push(validPos.input);\n } else if (i < pos) staticInputsBeforePos++;\n delete getMaskSet().validPositions[i];\n }\n while (getMaskSet().excludes[decisionPos] && getMaskSet().excludes[decisionPos].length < 10) {\n var posOffset = staticInputsBeforePos * -1, validInputs = validInputsClone.slice();\n getMaskSet().tests[decisionPos] = undefined;\n resetMaskSet(true);\n isValidRslt = true;\n while (validInputs.length > 0) {\n var input = validInputs.shift();\n if (!(isValidRslt = isValid(getLastValidPosition(undefined, true) + 1, input, false, fromSetValid, true))) {\n break;\n }\n }\n if (isValidRslt && c !== undefined) {\n var targetLvp = getLastValidPosition(pos) + 1;\n for (i = decisionPos; i < getLastValidPosition() + 1; i++) {\n validPos = getMaskSet().validPositions[i];\n if ((validPos === undefined || validPos.match.fn == null) && i < pos + posOffset) {\n posOffset++;\n }\n }\n pos = pos + posOffset;\n isValidRslt = isValid(pos > targetLvp ? targetLvp : pos, c, strict, fromSetValid, true);\n }\n if (!isValidRslt) {\n resetMaskSet();\n prevAltPos = getTest(decisionPos);\n getMaskSet().validPositions = $.extend(true, {}, validPsClone);\n if (getMaskSet().excludes[decisionPos]) {\n var decisionTaker = getDecisionTaker(prevAltPos);\n if (getMaskSet().excludes[decisionPos].indexOf(decisionTaker) !== -1) {\n isValidRslt = alternate(pos, c, strict, fromSetValid, decisionPos - 1);\n break;\n }\n getMaskSet().excludes[decisionPos].push(decisionTaker);\n for (i = decisionPos; i < getLastValidPosition(undefined, true) + 1; i++) delete getMaskSet().validPositions[i];\n } else {\n isValidRslt = alternate(pos, c, strict, fromSetValid, decisionPos - 1);\n break;\n }\n } else break;\n }\n }\n getMaskSet().excludes[decisionPos] = undefined;\n return isValidRslt;\n }\n function isValid(pos, c, strict, fromSetValid, fromAlternate, validateOnly) {\n function isSelection(posObj) {\n return isRTL ? posObj.begin - posObj.end > 1 || posObj.begin - posObj.end === 1 : posObj.end - posObj.begin > 1 || posObj.end - posObj.begin === 1;\n }\n strict = strict === true;\n var maskPos = pos;\n if (pos.begin !== undefined) {\n maskPos = isRTL ? pos.end : pos.begin;\n }\n function _isValid(position, c, strict) {\n var rslt = false;\n $.each(getTests(position), function(ndx, tst) {\n var test = tst.match;\n getBuffer(true);\n rslt = test.fn != null ? test.fn.test(c, getMaskSet(), position, strict, opts, isSelection(pos)) : (c === test.def || c === opts.skipOptionalPartCharacter) && test.def !== \"\" ? {\n c: getPlaceholder(position, test, true) || test.def,\n pos: position\n } : false;\n if (rslt !== false) {\n var elem = rslt.c !== undefined ? rslt.c : c, validatedPos = position;\n elem = elem === opts.skipOptionalPartCharacter && test.fn === null ? getPlaceholder(position, test, true) || test.def : elem;\n if (rslt.remove !== undefined) {\n if (!$.isArray(rslt.remove)) rslt.remove = [ rslt.remove ];\n $.each(rslt.remove.sort(function(a, b) {\n return b - a;\n }), function(ndx, lmnt) {\n revalidateMask({\n begin: lmnt,\n end: lmnt + 1\n });\n });\n }\n if (rslt.insert !== undefined) {\n if (!$.isArray(rslt.insert)) rslt.insert = [ rslt.insert ];\n $.each(rslt.insert.sort(function(a, b) {\n return a - b;\n }), function(ndx, lmnt) {\n isValid(lmnt.pos, lmnt.c, true, fromSetValid);\n });\n }\n if (rslt !== true && rslt.pos !== undefined && rslt.pos !== position) {\n validatedPos = rslt.pos;\n }\n if (rslt !== true && rslt.pos === undefined && rslt.c === undefined) {\n return false;\n }\n if (!revalidateMask(pos, $.extend({}, tst, {\n input: casing(elem, test, validatedPos)\n }), fromSetValid, validatedPos)) {\n rslt = false;\n }\n return false;\n }\n });\n return rslt;\n }\n var result = true, positionsClone = $.extend(true, {}, getMaskSet().validPositions);\n if ($.isFunction(opts.preValidation) && !strict && fromSetValid !== true && validateOnly !== true) {\n result = opts.preValidation(getBuffer(), maskPos, c, isSelection(pos), opts, getMaskSet());\n }\n if (result === true) {\n trackbackPositions(undefined, maskPos, true);\n if (maxLength === undefined || maskPos < maxLength) {\n result = _isValid(maskPos, c, strict);\n if ((!strict || fromSetValid === true) && result === false && validateOnly !== true) {\n var currentPosValid = getMaskSet().validPositions[maskPos];\n if (currentPosValid && currentPosValid.match.fn === null && (currentPosValid.match.def === c || c === opts.skipOptionalPartCharacter)) {\n result = {\n caret: seekNext(maskPos)\n };\n } else {\n if ((opts.insertMode || getMaskSet().validPositions[seekNext(maskPos)] === undefined) && (!isMask(maskPos, true) || getMaskSet().jitOffset[maskPos])) {\n if (getMaskSet().jitOffset[maskPos] && getMaskSet().validPositions[seekNext(maskPos)] === undefined) {\n result = isValid(maskPos + getMaskSet().jitOffset[maskPos], c, strict);\n if (result !== false) result.caret = maskPos;\n } else for (var nPos = maskPos + 1, snPos = seekNext(maskPos); nPos <= snPos; nPos++) {\n result = _isValid(nPos, c, strict);\n if (result !== false) {\n result = trackbackPositions(maskPos, result.pos !== undefined ? result.pos : nPos) || result;\n maskPos = nPos;\n break;\n }\n }\n }\n }\n }\n }\n if (result === false && opts.keepStatic !== false && (opts.regex == null || isComplete(getBuffer())) && !strict && fromAlternate !== true) {\n result = alternate(maskPos, c, strict, fromSetValid);\n }\n if (result === true) {\n result = {\n pos: maskPos\n };\n }\n }\n if ($.isFunction(opts.postValidation) && result !== false && !strict && fromSetValid !== true && validateOnly !== true) {\n var postResult = opts.postValidation(getBuffer(true), pos.begin !== undefined ? isRTL ? pos.end : pos.begin : pos, result, opts);\n if (postResult !== undefined) {\n if (postResult.refreshFromBuffer && postResult.buffer) {\n var refresh = postResult.refreshFromBuffer;\n refreshFromBuffer(refresh === true ? refresh : refresh.start, refresh.end, postResult.buffer);\n }\n result = postResult === true ? result : postResult;\n }\n }\n if (result && result.pos === undefined) {\n result.pos = maskPos;\n }\n if (result === false || validateOnly === true) {\n resetMaskSet(true);\n getMaskSet().validPositions = $.extend(true, {}, positionsClone);\n }\n return result;\n }\n function trackbackPositions(originalPos, newPos, fillOnly) {\n var result;\n if (originalPos === undefined) {\n for (originalPos = newPos - 1; originalPos > 0; originalPos--) {\n if (getMaskSet().validPositions[originalPos]) break;\n }\n }\n for (var ps = originalPos; ps < newPos; ps++) {\n if (getMaskSet().validPositions[ps] === undefined && !isMask(ps, true)) {\n var vp = ps == 0 ? getTest(ps) : getMaskSet().validPositions[ps - 1];\n if (vp) {\n var tests = getTests(ps).slice();\n if (tests[tests.length - 1].match.def === \"\") tests.pop();\n var bestMatch = determineTestTemplate(ps, tests);\n bestMatch = $.extend({}, bestMatch, {\n input: getPlaceholder(ps, bestMatch.match, true) || bestMatch.match.def\n });\n bestMatch.generatedInput = true;\n revalidateMask(ps, bestMatch, true);\n if (fillOnly !== true) {\n var cvpInput = getMaskSet().validPositions[newPos].input;\n getMaskSet().validPositions[newPos] = undefined;\n result = isValid(newPos, cvpInput, true, true);\n }\n }\n }\n }\n return result;\n }\n function revalidateMask(pos, validTest, fromSetValid, validatedPos) {\n function IsEnclosedStatic(pos, valids, selection) {\n var posMatch = valids[pos];\n if (posMatch !== undefined && (posMatch.match.fn === null && posMatch.match.optionality !== true || posMatch.input === opts.radixPoint)) {\n var prevMatch = selection.begin <= pos - 1 ? valids[pos - 1] && valids[pos - 1].match.fn === null && valids[pos - 1] : valids[pos - 1], nextMatch = selection.end > pos + 1 ? valids[pos + 1] && valids[pos + 1].match.fn === null && valids[pos + 1] : valids[pos + 1];\n return prevMatch && nextMatch;\n }\n return false;\n }\n var begin = pos.begin !== undefined ? pos.begin : pos, end = pos.end !== undefined ? pos.end : pos;\n if (pos.begin > pos.end) {\n begin = pos.end;\n end = pos.begin;\n }\n validatedPos = validatedPos !== undefined ? validatedPos : begin;\n if (begin !== end || opts.insertMode && getMaskSet().validPositions[validatedPos] !== undefined && fromSetValid === undefined) {\n var positionsClone = $.extend(true, {}, getMaskSet().validPositions), lvp = getLastValidPosition(undefined, true), i;\n getMaskSet().p = begin;\n for (i = lvp; i >= begin; i--) {\n if (getMaskSet().validPositions[i] && getMaskSet().validPositions[i].match.nativeDef === \"+\") {\n opts.isNegative = false;\n }\n delete getMaskSet().validPositions[i];\n }\n var valid = true, j = validatedPos, vps = getMaskSet().validPositions, needsValidation = false, posMatch = j, i = j;\n if (validTest) {\n getMaskSet().validPositions[validatedPos] = $.extend(true, {}, validTest);\n posMatch++;\n j++;\n if (begin < end) i++;\n }\n for (;i <= lvp; i++) {\n var t = positionsClone[i];\n if (t !== undefined && (i >= end || i >= begin && t.generatedInput !== true && IsEnclosedStatic(i, positionsClone, {\n begin: begin,\n end: end\n }))) {\n while (getTest(posMatch).match.def !== \"\") {\n if (needsValidation === false && positionsClone[posMatch] && positionsClone[posMatch].match.nativeDef === t.match.nativeDef) {\n getMaskSet().validPositions[posMatch] = $.extend(true, {}, positionsClone[posMatch]);\n getMaskSet().validPositions[posMatch].input = t.input;\n trackbackPositions(undefined, posMatch, true);\n j = posMatch + 1;\n valid = true;\n } else if (opts.shiftPositions && positionCanMatchDefinition(posMatch, t.match.def)) {\n var result = isValid(posMatch, t.input, true, true);\n valid = result !== false;\n j = result.caret || result.insert ? getLastValidPosition() : posMatch + 1;\n needsValidation = true;\n } else {\n valid = t.generatedInput === true || t.input === opts.radixPoint && opts.numericInput === true;\n }\n if (valid) break;\n if (!valid && posMatch > end && isMask(posMatch, true) && (t.match.fn !== null || posMatch > getMaskSet().maskLength)) {\n break;\n }\n posMatch++;\n }\n if (getTest(posMatch).match.def == \"\") valid = false;\n posMatch = j;\n }\n if (!valid) break;\n }\n if (!valid) {\n getMaskSet().validPositions = $.extend(true, {}, positionsClone);\n resetMaskSet(true);\n return false;\n }\n } else if (validTest) {\n getMaskSet().validPositions[validatedPos] = $.extend(true, {}, validTest);\n }\n resetMaskSet(true);\n return true;\n }\n function isMask(pos, strict) {\n var test = getTestTemplate(pos).match;\n if (test.def === \"\") test = getTest(pos).match;\n if (test.fn != null) {\n return test.fn;\n }\n if (strict !== true && pos > -1) {\n var tests = getTests(pos);\n return tests.length > 1 + (tests[tests.length - 1].match.def === \"\" ? 1 : 0);\n }\n return false;\n }\n function seekNext(pos, newBlock) {\n var position = pos + 1;\n while (getTest(position).match.def !== \"\" && (newBlock === true && (getTest(position).match.newBlockMarker !== true || !isMask(position)) || newBlock !== true && !isMask(position))) {\n position++;\n }\n return position;\n }\n function seekPrevious(pos, newBlock) {\n var position = pos, tests;\n if (position <= 0) return 0;\n while (--position > 0 && (newBlock === true && getTest(position).match.newBlockMarker !== true || newBlock !== true && !isMask(position) && (tests = getTests(position), \n tests.length < 2 || tests.length === 2 && tests[1].match.def === \"\"))) {}\n return position;\n }\n function writeBuffer(input, buffer, caretPos, event, triggerEvents) {\n if (event && $.isFunction(opts.onBeforeWrite)) {\n var result = opts.onBeforeWrite.call(inputmask, event, buffer, caretPos, opts);\n if (result) {\n if (result.refreshFromBuffer) {\n var refresh = result.refreshFromBuffer;\n refreshFromBuffer(refresh === true ? refresh : refresh.start, refresh.end, result.buffer || buffer);\n buffer = getBuffer(true);\n }\n if (caretPos !== undefined) caretPos = result.caret !== undefined ? result.caret : caretPos;\n }\n }\n if (input !== undefined) {\n input.inputmask._valueSet(buffer.join(\"\"));\n if (caretPos !== undefined && (event === undefined || event.type !== \"blur\")) {\n caret(input, caretPos);\n } else renderColorMask(input, caretPos, buffer.length === 0);\n if (triggerEvents === true) {\n var $input = $(input), nptVal = input.inputmask._valueGet();\n skipInputEvent = true;\n $input.trigger(\"input\");\n setTimeout(function() {\n if (nptVal === getBufferTemplate().join(\"\")) {\n $input.trigger(\"cleared\");\n } else if (isComplete(buffer) === true) {\n $input.trigger(\"complete\");\n }\n }, 0);\n }\n }\n }\n function getPlaceholder(pos, test, returnPL) {\n test = test || getTest(pos).match;\n if (test.placeholder !== undefined || returnPL === true) {\n return $.isFunction(test.placeholder) ? test.placeholder(opts) : test.placeholder;\n } else if (test.fn === null) {\n if (pos > -1 && getMaskSet().validPositions[pos] === undefined) {\n var tests = getTests(pos), staticAlternations = [], prevTest;\n if (tests.length > 1 + (tests[tests.length - 1].match.def === \"\" ? 1 : 0)) {\n for (var i = 0; i < tests.length; i++) {\n if (tests[i].match.optionality !== true && tests[i].match.optionalQuantifier !== true && (tests[i].match.fn === null || (prevTest === undefined || tests[i].match.fn.test(prevTest.match.def, getMaskSet(), pos, true, opts) !== false))) {\n staticAlternations.push(tests[i]);\n if (tests[i].match.fn === null) prevTest = tests[i];\n if (staticAlternations.length > 1) {\n if (/[0-9a-bA-Z]/.test(staticAlternations[0].match.def)) {\n return opts.placeholder.charAt(pos % opts.placeholder.length);\n }\n }\n }\n }\n }\n }\n return test.def;\n }\n return opts.placeholder.charAt(pos % opts.placeholder.length);\n }\n function HandleNativePlaceholder(npt, value) {\n if (ie) {\n if (npt.inputmask._valueGet() !== value && (npt.placeholder !== value || npt.placeholder === \"\")) {\n var buffer = getBuffer().slice(), nptValue = npt.inputmask._valueGet();\n if (nptValue !== value) {\n var lvp = getLastValidPosition();\n if (lvp === -1 && nptValue === getBufferTemplate().join(\"\")) {\n buffer = [];\n } else if (lvp !== -1) {\n clearOptionalTail(buffer);\n }\n writeBuffer(npt, buffer);\n }\n }\n } else if (npt.placeholder !== value) {\n npt.placeholder = value;\n if (npt.placeholder === \"\") npt.removeAttribute(\"placeholder\");\n }\n }\n var EventRuler = {\n on: function(input, eventName, eventHandler) {\n var ev = function(e) {\n var that = this;\n if (that.inputmask === undefined && this.nodeName !== \"FORM\") {\n var imOpts = $.data(that, \"_inputmask_opts\");\n if (imOpts) new Inputmask(imOpts).mask(that); else EventRuler.off(that);\n } else if (e.type !== \"setvalue\" && this.nodeName !== \"FORM\" && (that.disabled || that.readOnly && !(e.type === \"keydown\" && (e.ctrlKey && e.keyCode === 67) || opts.tabThrough === false && e.keyCode === Inputmask.keyCode.TAB))) {\n e.preventDefault();\n } else {\n switch (e.type) {\n case \"input\":\n if (skipInputEvent === true) {\n skipInputEvent = false;\n return e.preventDefault();\n }\n if (mobile) {\n var args = arguments;\n setTimeout(function() {\n eventHandler.apply(that, args);\n caret(that, that.inputmask.caretPos, undefined, true);\n }, 0);\n return false;\n }\n break;\n\n case \"keydown\":\n skipKeyPressEvent = false;\n skipInputEvent = false;\n break;\n\n case \"keypress\":\n if (skipKeyPressEvent === true) {\n return e.preventDefault();\n }\n skipKeyPressEvent = true;\n break;\n\n case \"click\":\n if (iemobile || iphone) {\n var args = arguments;\n setTimeout(function() {\n eventHandler.apply(that, args);\n }, 0);\n return false;\n }\n break;\n }\n var returnVal = eventHandler.apply(that, arguments);\n if (returnVal === false) {\n e.preventDefault();\n e.stopPropagation();\n }\n return returnVal;\n }\n };\n input.inputmask.events[eventName] = input.inputmask.events[eventName] || [];\n input.inputmask.events[eventName].push(ev);\n if ($.inArray(eventName, [ \"submit\", \"reset\" ]) !== -1) {\n if (input.form !== null) $(input.form).on(eventName, ev);\n } else {\n $(input).on(eventName, ev);\n }\n },\n off: function(input, event) {\n if (input.inputmask && input.inputmask.events) {\n var events;\n if (event) {\n events = [];\n events[event] = input.inputmask.events[event];\n } else {\n events = input.inputmask.events;\n }\n $.each(events, function(eventName, evArr) {\n while (evArr.length > 0) {\n var ev = evArr.pop();\n if ($.inArray(eventName, [ \"submit\", \"reset\" ]) !== -1) {\n if (input.form !== null) $(input.form).off(eventName, ev);\n } else {\n $(input).off(eventName, ev);\n }\n }\n delete input.inputmask.events[eventName];\n });\n }\n }\n };\n var EventHandlers = {\n keydownEvent: function(e) {\n var input = this, $input = $(input), k = e.keyCode, pos = caret(input);\n if (k === Inputmask.keyCode.BACKSPACE || k === Inputmask.keyCode.DELETE || iphone && k === Inputmask.keyCode.BACKSPACE_SAFARI || e.ctrlKey && k === Inputmask.keyCode.X && !isInputEventSupported(\"cut\")) {\n e.preventDefault();\n handleRemove(input, k, pos);\n writeBuffer(input, getBuffer(true), getMaskSet().p, e, input.inputmask._valueGet() !== getBuffer().join(\"\"));\n } else if (k === Inputmask.keyCode.END || k === Inputmask.keyCode.PAGE_DOWN) {\n e.preventDefault();\n var caretPos = seekNext(getLastValidPosition());\n caret(input, e.shiftKey ? pos.begin : caretPos, caretPos, true);\n } else if (k === Inputmask.keyCode.HOME && !e.shiftKey || k === Inputmask.keyCode.PAGE_UP) {\n e.preventDefault();\n caret(input, 0, e.shiftKey ? pos.begin : 0, true);\n } else if ((opts.undoOnEscape && k === Inputmask.keyCode.ESCAPE || k === 90 && e.ctrlKey) && e.altKey !== true) {\n checkVal(input, true, false, undoValue.split(\"\"));\n $input.trigger(\"click\");\n } else if (k === Inputmask.keyCode.INSERT && !(e.shiftKey || e.ctrlKey)) {\n opts.insertMode = !opts.insertMode;\n input.setAttribute(\"im-insert\", opts.insertMode);\n } else if (opts.tabThrough === true && k === Inputmask.keyCode.TAB) {\n if (e.shiftKey === true) {\n if (getTest(pos.begin).match.fn === null) {\n pos.begin = seekNext(pos.begin);\n }\n pos.end = seekPrevious(pos.begin, true);\n pos.begin = seekPrevious(pos.end, true);\n } else {\n pos.begin = seekNext(pos.begin, true);\n pos.end = seekNext(pos.begin, true);\n if (pos.end < getMaskSet().maskLength) pos.end--;\n }\n if (pos.begin < getMaskSet().maskLength) {\n e.preventDefault();\n caret(input, pos.begin, pos.end);\n }\n }\n opts.onKeyDown.call(this, e, getBuffer(), caret(input).begin, opts);\n ignorable = $.inArray(k, opts.ignorables) !== -1;\n },\n keypressEvent: function(e, checkval, writeOut, strict, ndx) {\n var input = this, $input = $(input), k = e.which || e.charCode || e.keyCode;\n if (checkval !== true && (!(e.ctrlKey && e.altKey) && (e.ctrlKey || e.metaKey || ignorable))) {\n if (k === Inputmask.keyCode.ENTER && undoValue !== getBuffer().join(\"\")) {\n undoValue = getBuffer().join(\"\");\n setTimeout(function() {\n $input.trigger(\"change\");\n }, 0);\n }\n return true;\n } else {\n if (k) {\n if (k === 46 && e.shiftKey === false && opts.radixPoint !== \"\") k = opts.radixPoint.charCodeAt(0);\n var pos = checkval ? {\n begin: ndx,\n end: ndx\n } : caret(input), forwardPosition, c = String.fromCharCode(k), offset = 0;\n if (opts._radixDance && opts.numericInput) {\n var caretPos = getBuffer().indexOf(opts.radixPoint.charAt(0)) + 1;\n if (pos.begin <= caretPos) {\n if (k === opts.radixPoint.charCodeAt(0)) offset = 1;\n pos.begin -= 1;\n pos.end -= 1;\n }\n }\n getMaskSet().writeOutBuffer = true;\n var valResult = isValid(pos, c, strict);\n if (valResult !== false) {\n resetMaskSet(true);\n forwardPosition = valResult.caret !== undefined ? valResult.caret : seekNext(valResult.pos.begin ? valResult.pos.begin : valResult.pos);\n getMaskSet().p = forwardPosition;\n }\n forwardPosition = (opts.numericInput && valResult.caret === undefined ? seekPrevious(forwardPosition) : forwardPosition) + offset;\n if (writeOut !== false) {\n setTimeout(function() {\n opts.onKeyValidation.call(input, k, valResult, opts);\n }, 0);\n if (getMaskSet().writeOutBuffer && valResult !== false) {\n var buffer = getBuffer();\n writeBuffer(input, buffer, forwardPosition, e, checkval !== true);\n }\n }\n e.preventDefault();\n if (checkval) {\n if (valResult !== false) valResult.forwardPosition = forwardPosition;\n return valResult;\n }\n }\n }\n },\n pasteEvent: function(e) {\n var input = this, ev = e.originalEvent || e, $input = $(input), inputValue = input.inputmask._valueGet(true), caretPos = caret(input), tempValue;\n if (isRTL) {\n tempValue = caretPos.end;\n caretPos.end = caretPos.begin;\n caretPos.begin = tempValue;\n }\n var valueBeforeCaret = inputValue.substr(0, caretPos.begin), valueAfterCaret = inputValue.substr(caretPos.end, inputValue.length);\n if (valueBeforeCaret === (isRTL ? getBufferTemplate().reverse() : getBufferTemplate()).slice(0, caretPos.begin).join(\"\")) valueBeforeCaret = \"\";\n if (valueAfterCaret === (isRTL ? getBufferTemplate().reverse() : getBufferTemplate()).slice(caretPos.end).join(\"\")) valueAfterCaret = \"\";\n if (window.clipboardData && window.clipboardData.getData) {\n inputValue = valueBeforeCaret + window.clipboardData.getData(\"Text\") + valueAfterCaret;\n } else if (ev.clipboardData && ev.clipboardData.getData) {\n inputValue = valueBeforeCaret + ev.clipboardData.getData(\"text/plain\") + valueAfterCaret;\n } else return true;\n var pasteValue = inputValue;\n if ($.isFunction(opts.onBeforePaste)) {\n pasteValue = opts.onBeforePaste.call(inputmask, inputValue, opts);\n if (pasteValue === false) {\n return e.preventDefault();\n }\n if (!pasteValue) {\n pasteValue = inputValue;\n }\n }\n checkVal(input, false, false, pasteValue.toString().split(\"\"));\n writeBuffer(input, getBuffer(), seekNext(getLastValidPosition()), e, undoValue !== getBuffer().join(\"\"));\n return e.preventDefault();\n },\n inputFallBackEvent: function(e) {\n function radixPointHandler(input, inputValue, caretPos) {\n if (inputValue.charAt(caretPos.begin - 1) === \".\" && opts.radixPoint !== \"\") {\n inputValue = inputValue.split(\"\");\n inputValue[caretPos.begin - 1] = opts.radixPoint.charAt(0);\n inputValue = inputValue.join(\"\");\n }\n return inputValue;\n }\n function ieMobileHandler(input, inputValue, caretPos) {\n if (iemobile) {\n var inputChar = inputValue.replace(getBuffer().join(\"\"), \"\");\n if (inputChar.length === 1) {\n var iv = inputValue.split(\"\");\n iv.splice(caretPos.begin, 0, inputChar);\n inputValue = iv.join(\"\");\n }\n }\n return inputValue;\n }\n var input = this, inputValue = input.inputmask._valueGet();\n if (getBuffer().join(\"\") !== inputValue) {\n var caretPos = caret(input);\n inputValue = radixPointHandler(input, inputValue, caretPos);\n inputValue = ieMobileHandler(input, inputValue, caretPos);\n if (getBuffer().join(\"\") !== inputValue) {\n var buffer = getBuffer().join(\"\"), offset = !opts.numericInput && inputValue.length > buffer.length ? -1 : 0, frontPart = inputValue.substr(0, caretPos.begin), backPart = inputValue.substr(caretPos.begin), frontBufferPart = buffer.substr(0, caretPos.begin + offset), backBufferPart = buffer.substr(caretPos.begin + offset);\n var selection = caretPos, entries = \"\", isEntry = false;\n if (frontPart !== frontBufferPart) {\n var fpl = (isEntry = frontPart.length >= frontBufferPart.length) ? frontPart.length : frontBufferPart.length, i;\n for (i = 0; frontPart.charAt(i) === frontBufferPart.charAt(i) && i < fpl; i++) ;\n if (isEntry) {\n selection.begin = i - offset;\n entries += frontPart.slice(i, selection.end);\n }\n }\n if (backPart !== backBufferPart) {\n if (backPart.length > backBufferPart.length) {\n entries += backPart.slice(0, 1);\n } else {\n if (backPart.length < backBufferPart.length) {\n selection.end += backBufferPart.length - backPart.length;\n if (!isEntry && opts.radixPoint !== \"\" && backPart === \"\" && frontPart.charAt(selection.begin + offset - 1) === opts.radixPoint) {\n selection.begin--;\n entries = opts.radixPoint;\n }\n }\n }\n }\n writeBuffer(input, getBuffer(), {\n begin: selection.begin + offset,\n end: selection.end + offset\n });\n if (entries.length > 0) {\n $.each(entries.split(\"\"), function(ndx, entry) {\n var keypress = new $.Event(\"keypress\");\n keypress.which = entry.charCodeAt(0);\n ignorable = false;\n EventHandlers.keypressEvent.call(input, keypress);\n });\n } else {\n if (selection.begin === selection.end - 1) {\n selection.begin = seekPrevious(selection.begin + 1);\n if (selection.begin === selection.end - 1) {\n caret(input, selection.begin);\n } else {\n caret(input, selection.begin, selection.end);\n }\n }\n var keydown = new $.Event(\"keydown\");\n keydown.keyCode = opts.numericInput ? Inputmask.keyCode.BACKSPACE : Inputmask.keyCode.DELETE;\n EventHandlers.keydownEvent.call(input, keydown);\n }\n e.preventDefault();\n }\n }\n },\n beforeInputEvent: function(e) {\n if (e.cancelable) {\n var input = this;\n switch (e.inputType) {\n case \"insertText\":\n $.each(e.data.split(\"\"), function(ndx, entry) {\n var keypress = new $.Event(\"keypress\");\n keypress.which = entry.charCodeAt(0);\n ignorable = false;\n EventHandlers.keypressEvent.call(input, keypress);\n });\n return e.preventDefault();\n\n case \"deleteContentBackward\":\n var keydown = new $.Event(\"keydown\");\n keydown.keyCode = Inputmask.keyCode.BACKSPACE;\n EventHandlers.keydownEvent.call(input, keydown);\n return e.preventDefault();\n\n case \"deleteContentForward\":\n var keydown = new $.Event(\"keydown\");\n keydown.keyCode = Inputmask.keyCode.DELETE;\n EventHandlers.keydownEvent.call(input, keydown);\n return e.preventDefault();\n }\n }\n },\n setValueEvent: function(e) {\n this.inputmask.refreshValue = false;\n var input = this, value = e && e.detail ? e.detail[0] : arguments[1], value = value || input.inputmask._valueGet(true);\n if ($.isFunction(opts.onBeforeMask)) value = opts.onBeforeMask.call(inputmask, value, opts) || value;\n value = value.toString().split(\"\");\n checkVal(input, true, false, value);\n undoValue = getBuffer().join(\"\");\n if ((opts.clearMaskOnLostFocus || opts.clearIncomplete) && input.inputmask._valueGet() === getBufferTemplate().join(\"\")) {\n input.inputmask._valueSet(\"\");\n }\n },\n focusEvent: function(e) {\n var input = this, nptValue = input.inputmask._valueGet();\n if (opts.showMaskOnFocus) {\n if (nptValue !== getBuffer().join(\"\")) {\n writeBuffer(input, getBuffer(), seekNext(getLastValidPosition()));\n } else if (mouseEnter === false) {\n caret(input, seekNext(getLastValidPosition()));\n }\n }\n if (opts.positionCaretOnTab === true && mouseEnter === false) {\n EventHandlers.clickEvent.apply(input, [ e, true ]);\n }\n undoValue = getBuffer().join(\"\");\n },\n mouseleaveEvent: function(e) {\n var input = this;\n mouseEnter = false;\n if (opts.clearMaskOnLostFocus && document.activeElement !== input) {\n HandleNativePlaceholder(input, originalPlaceholder);\n }\n },\n clickEvent: function(e, tabbed) {\n function doRadixFocus(clickPos) {\n if (opts.radixPoint !== \"\") {\n var vps = getMaskSet().validPositions;\n if (vps[clickPos] === undefined || vps[clickPos].input === getPlaceholder(clickPos)) {\n if (clickPos < seekNext(-1)) return true;\n var radixPos = $.inArray(opts.radixPoint, getBuffer());\n if (radixPos !== -1) {\n for (var vp in vps) {\n if (radixPos < vp && vps[vp].input !== getPlaceholder(vp)) {\n return false;\n }\n }\n return true;\n }\n }\n }\n return false;\n }\n var input = this;\n setTimeout(function() {\n if (document.activeElement === input) {\n var selectedCaret = caret(input);\n if (tabbed) {\n if (isRTL) {\n selectedCaret.end = selectedCaret.begin;\n } else {\n selectedCaret.begin = selectedCaret.end;\n }\n }\n if (selectedCaret.begin === selectedCaret.end) {\n switch (opts.positionCaretOnClick) {\n case \"none\":\n break;\n\n case \"select\":\n caret(input, 0, getBuffer().length);\n break;\n\n case \"ignore\":\n caret(input, seekNext(getLastValidPosition()));\n break;\n\n case \"radixFocus\":\n if (doRadixFocus(selectedCaret.begin)) {\n var radixPos = getBuffer().join(\"\").indexOf(opts.radixPoint);\n caret(input, opts.numericInput ? seekNext(radixPos) : radixPos);\n break;\n }\n\n default:\n var clickPosition = selectedCaret.begin, lvclickPosition = getLastValidPosition(clickPosition, true), lastPosition = seekNext(lvclickPosition);\n if (clickPosition < lastPosition) {\n caret(input, !isMask(clickPosition, true) && !isMask(clickPosition - 1, true) ? seekNext(clickPosition) : clickPosition);\n } else {\n var lvp = getMaskSet().validPositions[lvclickPosition], tt = getTestTemplate(lastPosition, lvp ? lvp.match.locator : undefined, lvp), placeholder = getPlaceholder(lastPosition, tt.match);\n if (placeholder !== \"\" && getBuffer()[lastPosition] !== placeholder && tt.match.optionalQuantifier !== true && tt.match.newBlockMarker !== true || !isMask(lastPosition, opts.keepStatic) && tt.match.def === placeholder) {\n var newPos = seekNext(lastPosition);\n if (clickPosition >= newPos || clickPosition === lastPosition) {\n lastPosition = newPos;\n }\n }\n caret(input, lastPosition);\n }\n break;\n }\n }\n }\n }, 0);\n },\n cutEvent: function(e) {\n var input = this, $input = $(input), pos = caret(input), ev = e.originalEvent || e;\n var clipboardData = window.clipboardData || ev.clipboardData, clipData = isRTL ? getBuffer().slice(pos.end, pos.begin) : getBuffer().slice(pos.begin, pos.end);\n clipboardData.setData(\"text\", isRTL ? clipData.reverse().join(\"\") : clipData.join(\"\"));\n if (document.execCommand) document.execCommand(\"copy\");\n handleRemove(input, Inputmask.keyCode.DELETE, pos);\n writeBuffer(input, getBuffer(), getMaskSet().p, e, undoValue !== getBuffer().join(\"\"));\n },\n blurEvent: function(e) {\n var $input = $(this), input = this;\n if (input.inputmask) {\n HandleNativePlaceholder(input, originalPlaceholder);\n var nptValue = input.inputmask._valueGet(), buffer = getBuffer().slice();\n if (nptValue !== \"\" || colorMask !== undefined) {\n if (opts.clearMaskOnLostFocus) {\n if (getLastValidPosition() === -1 && nptValue === getBufferTemplate().join(\"\")) {\n buffer = [];\n } else {\n clearOptionalTail(buffer);\n }\n }\n if (isComplete(buffer) === false) {\n setTimeout(function() {\n $input.trigger(\"incomplete\");\n }, 0);\n if (opts.clearIncomplete) {\n resetMaskSet();\n if (opts.clearMaskOnLostFocus) {\n buffer = [];\n } else {\n buffer = getBufferTemplate().slice();\n }\n }\n }\n writeBuffer(input, buffer, undefined, e);\n }\n if (undoValue !== getBuffer().join(\"\")) {\n undoValue = buffer.join(\"\");\n $input.trigger(\"change\");\n }\n }\n },\n mouseenterEvent: function(e) {\n var input = this;\n mouseEnter = true;\n if (document.activeElement !== input && opts.showMaskOnHover) {\n HandleNativePlaceholder(input, (isRTL ? getBuffer().slice().reverse() : getBuffer()).join(\"\"));\n }\n },\n submitEvent: function(e) {\n if (undoValue !== getBuffer().join(\"\")) {\n $el.trigger(\"change\");\n }\n if (opts.clearMaskOnLostFocus && getLastValidPosition() === -1 && el.inputmask._valueGet && el.inputmask._valueGet() === getBufferTemplate().join(\"\")) {\n el.inputmask._valueSet(\"\");\n }\n if (opts.clearIncomplete && isComplete(getBuffer()) === false) {\n el.inputmask._valueSet(\"\");\n }\n if (opts.removeMaskOnSubmit) {\n el.inputmask._valueSet(el.inputmask.unmaskedvalue(), true);\n setTimeout(function() {\n writeBuffer(el, getBuffer());\n }, 0);\n }\n },\n resetEvent: function(e) {\n el.inputmask.refreshValue = true;\n setTimeout(function() {\n $el.trigger(\"setvalue\");\n }, 0);\n }\n };\n function checkVal(input, writeOut, strict, nptvl, initiatingEvent) {\n var inputmask = this || input.inputmask, inputValue = nptvl.slice(), charCodes = \"\", initialNdx = -1, result = undefined;\n function isTemplateMatch(ndx, charCodes) {\n var charCodeNdx = getMaskTemplate(true, 0, false).slice(ndx, seekNext(ndx)).join(\"\").replace(/'/g, \"\").indexOf(charCodes);\n return charCodeNdx !== -1 && !isMask(ndx) && (getTest(ndx).match.nativeDef === charCodes.charAt(0) || getTest(ndx).match.fn === null && getTest(ndx).match.nativeDef === \"'\" + charCodes.charAt(0) || getTest(ndx).match.nativeDef === \" \" && (getTest(ndx + 1).match.nativeDef === charCodes.charAt(0) || getTest(ndx + 1).match.fn === null && getTest(ndx + 1).match.nativeDef === \"'\" + charCodes.charAt(0)));\n }\n resetMaskSet();\n if (!strict && opts.autoUnmask !== true) {\n var staticInput = getBufferTemplate().slice(0, seekNext(-1)).join(\"\"), matches = inputValue.join(\"\").match(new RegExp(\"^\" + Inputmask.escapeRegex(staticInput), \"g\"));\n if (matches && matches.length > 0) {\n inputValue.splice(0, matches.length * staticInput.length);\n initialNdx = seekNext(initialNdx);\n }\n } else {\n initialNdx = seekNext(initialNdx);\n }\n if (initialNdx === -1) {\n getMaskSet().p = seekNext(initialNdx);\n initialNdx = 0;\n } else getMaskSet().p = initialNdx;\n inputmask.caretPos = {\n begin: initialNdx\n };\n $.each(inputValue, function(ndx, charCode) {\n if (charCode !== undefined) {\n if (getMaskSet().validPositions[ndx] === undefined && inputValue[ndx] === getPlaceholder(ndx) && isMask(ndx, true) && isValid(ndx, inputValue[ndx], true, undefined, undefined, true) === false) {\n getMaskSet().p++;\n } else {\n var keypress = new $.Event(\"_checkval\");\n keypress.which = charCode.charCodeAt(0);\n charCodes += charCode;\n var lvp = getLastValidPosition(undefined, true);\n if (!isTemplateMatch(initialNdx, charCodes)) {\n result = EventHandlers.keypressEvent.call(input, keypress, true, false, strict, inputmask.caretPos.begin);\n if (result) {\n initialNdx = inputmask.caretPos.begin + 1;\n charCodes = \"\";\n }\n } else {\n result = EventHandlers.keypressEvent.call(input, keypress, true, false, strict, lvp + 1);\n }\n if (result) {\n writeBuffer(undefined, getBuffer(), result.forwardPosition, keypress, false);\n inputmask.caretPos = {\n begin: result.forwardPosition,\n end: result.forwardPosition\n };\n }\n }\n }\n });\n if (writeOut) writeBuffer(input, getBuffer(), result ? result.forwardPosition : undefined, initiatingEvent || new $.Event(\"checkval\"), initiatingEvent && initiatingEvent.type === \"input\");\n }\n function unmaskedvalue(input) {\n if (input) {\n if (input.inputmask === undefined) {\n return input.value;\n }\n if (input.inputmask && input.inputmask.refreshValue) {\n EventHandlers.setValueEvent.call(input);\n }\n }\n var umValue = [], vps = getMaskSet().validPositions;\n for (var pndx in vps) {\n if (vps[pndx].match && vps[pndx].match.fn != null) {\n umValue.push(vps[pndx].input);\n }\n }\n var unmaskedValue = umValue.length === 0 ? \"\" : (isRTL ? umValue.reverse() : umValue).join(\"\");\n if ($.isFunction(opts.onUnMask)) {\n var bufferValue = (isRTL ? getBuffer().slice().reverse() : getBuffer()).join(\"\");\n unmaskedValue = opts.onUnMask.call(inputmask, bufferValue, unmaskedValue, opts);\n }\n return unmaskedValue;\n }\n function caret(input, begin, end, notranslate) {\n function translatePosition(pos) {\n if (isRTL && typeof pos === \"number\" && (!opts.greedy || opts.placeholder !== \"\") && el) {\n pos = el.inputmask._valueGet().length - pos;\n }\n return pos;\n }\n var range;\n if (begin !== undefined) {\n if ($.isArray(begin)) {\n end = isRTL ? begin[0] : begin[1];\n begin = isRTL ? begin[1] : begin[0];\n }\n if (begin.begin !== undefined) {\n end = isRTL ? begin.begin : begin.end;\n begin = isRTL ? begin.end : begin.begin;\n }\n if (typeof begin === \"number\") {\n begin = notranslate ? begin : translatePosition(begin);\n end = notranslate ? end : translatePosition(end);\n end = typeof end == \"number\" ? end : begin;\n var scrollCalc = parseInt(((input.ownerDocument.defaultView || window).getComputedStyle ? (input.ownerDocument.defaultView || window).getComputedStyle(input, null) : input.currentStyle).fontSize) * end;\n input.scrollLeft = scrollCalc > input.scrollWidth ? scrollCalc : 0;\n input.inputmask.caretPos = {\n begin: begin,\n end: end\n };\n if (input === document.activeElement) {\n if (\"selectionStart\" in input) {\n input.selectionStart = begin;\n input.selectionEnd = end;\n } else if (window.getSelection) {\n range = document.createRange();\n if (input.firstChild === undefined || input.firstChild === null) {\n var textNode = document.createTextNode(\"\");\n input.appendChild(textNode);\n }\n range.setStart(input.firstChild, begin < input.inputmask._valueGet().length ? begin : input.inputmask._valueGet().length);\n range.setEnd(input.firstChild, end < input.inputmask._valueGet().length ? end : input.inputmask._valueGet().length);\n range.collapse(true);\n var sel = window.getSelection();\n sel.removeAllRanges();\n sel.addRange(range);\n } else if (input.createTextRange) {\n range = input.createTextRange();\n range.collapse(true);\n range.moveEnd(\"character\", end);\n range.moveStart(\"character\", begin);\n range.select();\n }\n renderColorMask(input, {\n begin: begin,\n end: end\n });\n }\n }\n } else {\n if (\"selectionStart\" in input) {\n begin = input.selectionStart;\n end = input.selectionEnd;\n } else if (window.getSelection) {\n range = window.getSelection().getRangeAt(0);\n if (range.commonAncestorContainer.parentNode === input || range.commonAncestorContainer === input) {\n begin = range.startOffset;\n end = range.endOffset;\n }\n } else if (document.selection && document.selection.createRange) {\n range = document.selection.createRange();\n begin = 0 - range.duplicate().moveStart(\"character\", -input.inputmask._valueGet().length);\n end = begin + range.text.length;\n }\n return {\n begin: notranslate ? begin : translatePosition(begin),\n end: notranslate ? end : translatePosition(end)\n };\n }\n }\n function determineLastRequiredPosition(returnDefinition) {\n var buffer = getMaskTemplate(true, getLastValidPosition(), true, true), bl = buffer.length, pos, lvp = getLastValidPosition(), positions = {}, lvTest = getMaskSet().validPositions[lvp], ndxIntlzr = lvTest !== undefined ? lvTest.locator.slice() : undefined, testPos;\n for (pos = lvp + 1; pos < buffer.length; pos++) {\n testPos = getTestTemplate(pos, ndxIntlzr, pos - 1);\n ndxIntlzr = testPos.locator.slice();\n positions[pos] = $.extend(true, {}, testPos);\n }\n var lvTestAlt = lvTest && lvTest.alternation !== undefined ? lvTest.locator[lvTest.alternation] : undefined;\n for (pos = bl - 1; pos > lvp; pos--) {\n testPos = positions[pos];\n if ((testPos.match.optionality || testPos.match.optionalQuantifier && testPos.match.newBlockMarker || lvTestAlt && (lvTestAlt !== positions[pos].locator[lvTest.alternation] && testPos.match.fn != null || testPos.match.fn === null && testPos.locator[lvTest.alternation] && checkAlternationMatch(testPos.locator[lvTest.alternation].toString().split(\",\"), lvTestAlt.toString().split(\",\")) && getTests(pos)[0].def !== \"\")) && buffer[pos] === getPlaceholder(pos, testPos.match)) {\n bl--;\n } else break;\n }\n return returnDefinition ? {\n l: bl,\n def: positions[bl] ? positions[bl].match : undefined\n } : bl;\n }\n function clearOptionalTail(buffer) {\n buffer.length = 0;\n var template = getMaskTemplate(true, 0, true, undefined, true), lmnt, validPos;\n while (lmnt = template.shift(), lmnt !== undefined) buffer.push(lmnt);\n return buffer;\n }\n function isComplete(buffer) {\n if ($.isFunction(opts.isComplete)) return opts.isComplete(buffer, opts);\n if (opts.repeat === \"*\") return undefined;\n var complete = false, lrp = determineLastRequiredPosition(true), aml = seekPrevious(lrp.l);\n if (lrp.def === undefined || lrp.def.newBlockMarker || lrp.def.optionality || lrp.def.optionalQuantifier) {\n complete = true;\n for (var i = 0; i <= aml; i++) {\n var test = getTestTemplate(i).match;\n if (test.fn !== null && getMaskSet().validPositions[i] === undefined && test.optionality !== true && test.optionalQuantifier !== true || test.fn === null && buffer[i] !== getPlaceholder(i, test)) {\n complete = false;\n break;\n }\n }\n }\n return complete;\n }\n function handleRemove(input, k, pos, strict, fromIsValid) {\n if (opts.numericInput || isRTL) {\n if (k === Inputmask.keyCode.BACKSPACE) {\n k = Inputmask.keyCode.DELETE;\n } else if (k === Inputmask.keyCode.DELETE) {\n k = Inputmask.keyCode.BACKSPACE;\n }\n if (isRTL) {\n var pend = pos.end;\n pos.end = pos.begin;\n pos.begin = pend;\n }\n }\n if (k === Inputmask.keyCode.BACKSPACE && pos.end - pos.begin < 1) {\n pos.begin = seekPrevious(pos.begin);\n if (getMaskSet().validPositions[pos.begin] !== undefined && getMaskSet().validPositions[pos.begin].input === opts.groupSeparator) {\n pos.begin--;\n }\n } else if (k === Inputmask.keyCode.DELETE && pos.begin === pos.end) {\n pos.end = isMask(pos.end, true) && (getMaskSet().validPositions[pos.end] && getMaskSet().validPositions[pos.end].input !== opts.radixPoint) ? pos.end + 1 : seekNext(pos.end) + 1;\n if (getMaskSet().validPositions[pos.begin] !== undefined && getMaskSet().validPositions[pos.begin].input === opts.groupSeparator) {\n pos.end++;\n }\n }\n revalidateMask(pos);\n if (strict !== true && opts.keepStatic !== false || opts.regex !== null) {\n var result = alternate(true);\n if (result) {\n var newPos = result.caret !== undefined ? result.caret : result.pos ? seekNext(result.pos.begin ? result.pos.begin : result.pos) : getLastValidPosition(-1, true);\n if (k !== Inputmask.keyCode.DELETE || pos.begin > newPos) {\n pos.begin == newPos;\n }\n }\n }\n var lvp = getLastValidPosition(pos.begin, true);\n if (lvp < pos.begin || pos.begin === -1) {\n getMaskSet().p = seekNext(lvp);\n } else if (strict !== true) {\n getMaskSet().p = pos.begin;\n if (fromIsValid !== true) {\n while (getMaskSet().p < lvp && getMaskSet().validPositions[getMaskSet().p] === undefined) {\n getMaskSet().p++;\n }\n }\n }\n }\n function initializeColorMask(input) {\n var computedStyle = (input.ownerDocument.defaultView || window).getComputedStyle(input, null);\n function findCaretPos(clientx) {\n var e = document.createElement(\"span\"), caretPos;\n for (var style in computedStyle) {\n if (isNaN(style) && style.indexOf(\"font\") !== -1) {\n e.style[style] = computedStyle[style];\n }\n }\n e.style.textTransform = computedStyle.textTransform;\n e.style.letterSpacing = computedStyle.letterSpacing;\n e.style.position = \"absolute\";\n e.style.height = \"auto\";\n e.style.width = \"auto\";\n e.style.visibility = \"hidden\";\n e.style.whiteSpace = \"nowrap\";\n document.body.appendChild(e);\n var inputText = input.inputmask._valueGet(), previousWidth = 0, itl;\n for (caretPos = 0, itl = inputText.length; caretPos <= itl; caretPos++) {\n e.innerHTML += inputText.charAt(caretPos) || \"_\";\n if (e.offsetWidth >= clientx) {\n var offset1 = clientx - previousWidth;\n var offset2 = e.offsetWidth - clientx;\n e.innerHTML = inputText.charAt(caretPos);\n offset1 -= e.offsetWidth / 3;\n caretPos = offset1 < offset2 ? caretPos - 1 : caretPos;\n break;\n }\n previousWidth = e.offsetWidth;\n }\n document.body.removeChild(e);\n return caretPos;\n }\n var template = document.createElement(\"div\");\n template.style.width = computedStyle.width;\n template.style.textAlign = computedStyle.textAlign;\n colorMask = document.createElement(\"div\");\n input.inputmask.colorMask = colorMask;\n colorMask.className = \"im-colormask\";\n input.parentNode.insertBefore(colorMask, input);\n input.parentNode.removeChild(input);\n colorMask.appendChild(input);\n colorMask.appendChild(template);\n input.style.left = template.offsetLeft + \"px\";\n $(colorMask).on(\"mouseleave\", function(e) {\n return EventHandlers.mouseleaveEvent.call(input, [ e ]);\n });\n $(colorMask).on(\"mouseenter\", function(e) {\n return EventHandlers.mouseenterEvent.call(input, [ e ]);\n });\n $(colorMask).on(\"click\", function(e) {\n caret(input, findCaretPos(e.clientX));\n return EventHandlers.clickEvent.call(input, [ e ]);\n });\n }\n function renderColorMask(input, caretPos, clear) {\n var maskTemplate = [], isStatic = false, test, testPos, ndxIntlzr, pos = 0;\n function setEntry(entry) {\n if (entry === undefined) entry = \"\";\n if (!isStatic && (test.fn === null || testPos.input === undefined)) {\n isStatic = true;\n maskTemplate.push(\"<span class='im-static'>\" + entry);\n } else if (isStatic && (test.fn !== null && testPos.input !== undefined || test.def === \"\")) {\n isStatic = false;\n var mtl = maskTemplate.length;\n maskTemplate[mtl - 1] = maskTemplate[mtl - 1] + \"</span>\";\n maskTemplate.push(entry);\n } else maskTemplate.push(entry);\n }\n function setCaret() {\n if (document.activeElement === input) {\n maskTemplate.splice(caretPos.begin, 0, caretPos.begin === caretPos.end || caretPos.end > getMaskSet().maskLength ? '<mark class=\"im-caret\" style=\"border-right-width: 1px;border-right-style: solid;\">' : '<mark class=\"im-caret-select\">');\n maskTemplate.splice(caretPos.end + 1, 0, \"</mark>\");\n }\n }\n if (colorMask !== undefined) {\n var buffer = getBuffer();\n if (caretPos === undefined) {\n caretPos = caret(input);\n } else if (caretPos.begin === undefined) {\n caretPos = {\n begin: caretPos,\n end: caretPos\n };\n }\n if (clear !== true) {\n var lvp = getLastValidPosition();\n do {\n if (getMaskSet().validPositions[pos]) {\n testPos = getMaskSet().validPositions[pos];\n test = testPos.match;\n ndxIntlzr = testPos.locator.slice();\n setEntry(buffer[pos]);\n } else {\n testPos = getTestTemplate(pos, ndxIntlzr, pos - 1);\n test = testPos.match;\n ndxIntlzr = testPos.locator.slice();\n if (opts.jitMasking === false || pos < lvp || typeof opts.jitMasking === \"number\" && isFinite(opts.jitMasking) && opts.jitMasking > pos) {\n setEntry(getPlaceholder(pos, test));\n } else isStatic = false;\n }\n pos++;\n } while ((maxLength === undefined || pos < maxLength) && (test.fn !== null || test.def !== \"\") || lvp > pos || isStatic);\n if (isStatic) setEntry();\n setCaret();\n }\n var template = colorMask.getElementsByTagName(\"div\")[0];\n template.innerHTML = maskTemplate.join(\"\");\n input.inputmask.positionColorMask(input, template);\n }\n }\n function mask(elem) {\n function isElementTypeSupported(input, opts) {\n function patchValueProperty(npt) {\n var valueGet;\n var valueSet;\n function patchValhook(type) {\n if ($.valHooks && ($.valHooks[type] === undefined || $.valHooks[type].inputmaskpatch !== true)) {\n var valhookGet = $.valHooks[type] && $.valHooks[type].get ? $.valHooks[type].get : function(elem) {\n return elem.value;\n };\n var valhookSet = $.valHooks[type] && $.valHooks[type].set ? $.valHooks[type].set : function(elem, value) {\n elem.value = value;\n return elem;\n };\n $.valHooks[type] = {\n get: function(elem) {\n if (elem.inputmask) {\n if (elem.inputmask.opts.autoUnmask) {\n return elem.inputmask.unmaskedvalue();\n } else {\n var result = valhookGet(elem);\n return getLastValidPosition(undefined, undefined, elem.inputmask.maskset.validPositions) !== -1 || opts.nullable !== true ? result : \"\";\n }\n } else return valhookGet(elem);\n },\n set: function(elem, value) {\n var $elem = $(elem), result;\n result = valhookSet(elem, value);\n if (elem.inputmask) {\n $elem.trigger(\"setvalue\", [ value ]);\n }\n return result;\n },\n inputmaskpatch: true\n };\n }\n }\n function getter() {\n if (this.inputmask) {\n return this.inputmask.opts.autoUnmask ? this.inputmask.unmaskedvalue() : getLastValidPosition() !== -1 || opts.nullable !== true ? document.activeElement === this && opts.clearMaskOnLostFocus ? (isRTL ? clearOptionalTail(getBuffer().slice()).reverse() : clearOptionalTail(getBuffer().slice())).join(\"\") : valueGet.call(this) : \"\";\n } else return valueGet.call(this);\n }\n function setter(value) {\n valueSet.call(this, value);\n if (this.inputmask) {\n $(this).trigger(\"setvalue\", [ value ]);\n }\n }\n function installNativeValueSetFallback(npt) {\n EventRuler.on(npt, \"mouseenter\", function(event) {\n var $input = $(this), input = this, value = input.inputmask._valueGet();\n if (value !== getBuffer().join(\"\")) {\n $input.trigger(\"setvalue\");\n }\n });\n }\n if (!npt.inputmask.__valueGet) {\n if (opts.noValuePatching !== true) {\n if (Object.getOwnPropertyDescriptor) {\n if (typeof Object.getPrototypeOf !== \"function\") {\n Object.getPrototypeOf = typeof \"test\".__proto__ === \"object\" ? function(object) {\n return object.__proto__;\n } : function(object) {\n return object.constructor.prototype;\n };\n }\n var valueProperty = Object.getPrototypeOf ? Object.getOwnPropertyDescriptor(Object.getPrototypeOf(npt), \"value\") : undefined;\n if (valueProperty && valueProperty.get && valueProperty.set) {\n valueGet = valueProperty.get;\n valueSet = valueProperty.set;\n Object.defineProperty(npt, \"value\", {\n get: getter,\n set: setter,\n configurable: true\n });\n } else if (npt.tagName !== \"INPUT\") {\n valueGet = function() {\n return this.textContent;\n };\n valueSet = function(value) {\n this.textContent = value;\n };\n Object.defineProperty(npt, \"value\", {\n get: getter,\n set: setter,\n configurable: true\n });\n }\n } else if (document.__lookupGetter__ && npt.__lookupGetter__(\"value\")) {\n valueGet = npt.__lookupGetter__(\"value\");\n valueSet = npt.__lookupSetter__(\"value\");\n npt.__defineGetter__(\"value\", getter);\n npt.__defineSetter__(\"value\", setter);\n }\n npt.inputmask.__valueGet = valueGet;\n npt.inputmask.__valueSet = valueSet;\n }\n npt.inputmask._valueGet = function(overruleRTL) {\n return isRTL && overruleRTL !== true ? valueGet.call(this.el).split(\"\").reverse().join(\"\") : valueGet.call(this.el);\n };\n npt.inputmask._valueSet = function(value, overruleRTL) {\n valueSet.call(this.el, value === null || value === undefined ? \"\" : overruleRTL !== true && isRTL ? value.split(\"\").reverse().join(\"\") : value);\n };\n if (valueGet === undefined) {\n valueGet = function() {\n return this.value;\n };\n valueSet = function(value) {\n this.value = value;\n };\n patchValhook(npt.type);\n installNativeValueSetFallback(npt);\n }\n }\n }\n var elementType = input.getAttribute(\"type\");\n var isSupported = input.tagName === \"INPUT\" && $.inArray(elementType, opts.supportsInputType) !== -1 || input.isContentEditable || input.tagName === \"TEXTAREA\";\n if (!isSupported) {\n if (input.tagName === \"INPUT\") {\n var el = document.createElement(\"input\");\n el.setAttribute(\"type\", elementType);\n isSupported = el.type === \"text\";\n el = null;\n } else isSupported = \"partial\";\n }\n if (isSupported !== false) {\n patchValueProperty(input);\n } else input.inputmask = undefined;\n return isSupported;\n }\n EventRuler.off(elem);\n var isSupported = isElementTypeSupported(elem, opts);\n if (isSupported !== false) {\n el = elem;\n $el = $(el);\n originalPlaceholder = el.placeholder;\n maxLength = el !== undefined ? el.maxLength : undefined;\n if (maxLength === -1) maxLength = undefined;\n if (opts.colorMask === true) {\n initializeColorMask(el);\n }\n if (mobile) {\n if (\"inputMode\" in el) {\n el.inputmode = opts.inputmode;\n el.setAttribute(\"inputmode\", opts.inputmode);\n }\n if (opts.disablePredictiveText === true) {\n if (\"autocorrect\" in el) {\n el.autocorrect = false;\n } else {\n if (opts.colorMask !== true) {\n initializeColorMask(el);\n }\n el.type = \"password\";\n }\n }\n }\n if (isSupported === true) {\n el.setAttribute(\"im-insert\", opts.insertMode);\n EventRuler.on(el, \"submit\", EventHandlers.submitEvent);\n EventRuler.on(el, \"reset\", EventHandlers.resetEvent);\n EventRuler.on(el, \"blur\", EventHandlers.blurEvent);\n EventRuler.on(el, \"focus\", EventHandlers.focusEvent);\n if (opts.colorMask !== true) {\n EventRuler.on(el, \"click\", EventHandlers.clickEvent);\n EventRuler.on(el, \"mouseleave\", EventHandlers.mouseleaveEvent);\n EventRuler.on(el, \"mouseenter\", EventHandlers.mouseenterEvent);\n }\n EventRuler.on(el, \"paste\", EventHandlers.pasteEvent);\n EventRuler.on(el, \"cut\", EventHandlers.cutEvent);\n EventRuler.on(el, \"complete\", opts.oncomplete);\n EventRuler.on(el, \"incomplete\", opts.onincomplete);\n EventRuler.on(el, \"cleared\", opts.oncleared);\n if (!mobile && opts.inputEventOnly !== true) {\n EventRuler.on(el, \"keydown\", EventHandlers.keydownEvent);\n EventRuler.on(el, \"keypress\", EventHandlers.keypressEvent);\n } else {\n el.removeAttribute(\"maxLength\");\n }\n EventRuler.on(el, \"input\", EventHandlers.inputFallBackEvent);\n EventRuler.on(el, \"beforeinput\", EventHandlers.beforeInputEvent);\n }\n EventRuler.on(el, \"setvalue\", EventHandlers.setValueEvent);\n undoValue = getBufferTemplate().join(\"\");\n if (el.inputmask._valueGet(true) !== \"\" || opts.clearMaskOnLostFocus === false || document.activeElement === el) {\n var initialValue = $.isFunction(opts.onBeforeMask) ? opts.onBeforeMask.call(inputmask, el.inputmask._valueGet(true), opts) || el.inputmask._valueGet(true) : el.inputmask._valueGet(true);\n if (initialValue !== \"\") checkVal(el, true, false, initialValue.split(\"\"));\n var buffer = getBuffer().slice();\n undoValue = buffer.join(\"\");\n if (isComplete(buffer) === false) {\n if (opts.clearIncomplete) {\n resetMaskSet();\n }\n }\n if (opts.clearMaskOnLostFocus && document.activeElement !== el) {\n if (getLastValidPosition() === -1) {\n buffer = [];\n } else {\n clearOptionalTail(buffer);\n }\n }\n if (opts.clearMaskOnLostFocus === false || opts.showMaskOnFocus && document.activeElement === el || el.inputmask._valueGet(true) !== \"\") writeBuffer(el, buffer);\n if (document.activeElement === el) {\n caret(el, seekNext(getLastValidPosition()));\n }\n }\n }\n }\n var valueBuffer;\n if (actionObj !== undefined) {\n switch (actionObj.action) {\n case \"isComplete\":\n el = actionObj.el;\n return isComplete(getBuffer());\n\n case \"unmaskedvalue\":\n if (el === undefined || actionObj.value !== undefined) {\n valueBuffer = actionObj.value;\n valueBuffer = ($.isFunction(opts.onBeforeMask) ? opts.onBeforeMask.call(inputmask, valueBuffer, opts) || valueBuffer : valueBuffer).split(\"\");\n checkVal.call(this, undefined, false, false, valueBuffer);\n if ($.isFunction(opts.onBeforeWrite)) opts.onBeforeWrite.call(inputmask, undefined, getBuffer(), 0, opts);\n }\n return unmaskedvalue(el);\n\n case \"mask\":\n mask(el);\n break;\n\n case \"format\":\n valueBuffer = ($.isFunction(opts.onBeforeMask) ? opts.onBeforeMask.call(inputmask, actionObj.value, opts) || actionObj.value : actionObj.value).split(\"\");\n checkVal.call(this, undefined, true, false, valueBuffer);\n if (actionObj.metadata) {\n return {\n value: isRTL ? getBuffer().slice().reverse().join(\"\") : getBuffer().join(\"\"),\n metadata: maskScope.call(this, {\n action: \"getmetadata\"\n }, maskset, opts)\n };\n }\n return isRTL ? getBuffer().slice().reverse().join(\"\") : getBuffer().join(\"\");\n\n case \"isValid\":\n if (actionObj.value) {\n valueBuffer = actionObj.value.split(\"\");\n checkVal.call(this, undefined, true, true, valueBuffer);\n } else {\n actionObj.value = getBuffer().join(\"\");\n }\n var buffer = getBuffer();\n var rl = determineLastRequiredPosition(), lmib = buffer.length - 1;\n for (;lmib > rl; lmib--) {\n if (isMask(lmib)) break;\n }\n buffer.splice(rl, lmib + 1 - rl);\n return isComplete(buffer) && actionObj.value === getBuffer().join(\"\");\n\n case \"getemptymask\":\n return getBufferTemplate().join(\"\");\n\n case \"remove\":\n if (el && el.inputmask) {\n $.data(el, \"_inputmask_opts\", null);\n $el = $(el);\n el.inputmask._valueSet(opts.autoUnmask ? unmaskedvalue(el) : el.inputmask._valueGet(true));\n EventRuler.off(el);\n if (el.inputmask.colorMask) {\n colorMask = el.inputmask.colorMask;\n colorMask.removeChild(el);\n colorMask.parentNode.insertBefore(el, colorMask);\n colorMask.parentNode.removeChild(colorMask);\n }\n var valueProperty;\n if (Object.getOwnPropertyDescriptor && Object.getPrototypeOf) {\n valueProperty = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(el), \"value\");\n if (valueProperty) {\n if (el.inputmask.__valueGet) {\n Object.defineProperty(el, \"value\", {\n get: el.inputmask.__valueGet,\n set: el.inputmask.__valueSet,\n configurable: true\n });\n }\n }\n } else if (document.__lookupGetter__ && el.__lookupGetter__(\"value\")) {\n if (el.inputmask.__valueGet) {\n el.__defineGetter__(\"value\", el.inputmask.__valueGet);\n el.__defineSetter__(\"value\", el.inputmask.__valueSet);\n }\n }\n el.inputmask = undefined;\n }\n return el;\n break;\n\n case \"getmetadata\":\n if ($.isArray(maskset.metadata)) {\n var maskTarget = getMaskTemplate(true, 0, false).join(\"\");\n $.each(maskset.metadata, function(ndx, mtdt) {\n if (mtdt.mask === maskTarget) {\n maskTarget = mtdt;\n return false;\n }\n });\n return maskTarget;\n }\n return maskset.metadata;\n }\n }\n }\n return Inputmask;\n});\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/node_modules/inputmask/dist/inputmask/inputmask.js?");
|
1697
|
-
|
1698
|
-
/***/ }),
|
1699
|
-
|
1700
|
-
/***/ "./node_modules/@formio/core/node_modules/inputmask/dist/inputmask/inputmask.numeric.extensions.js":
|
1701
|
-
/*!*********************************************************************************************************!*\
|
1702
|
-
!*** ./node_modules/@formio/core/node_modules/inputmask/dist/inputmask/inputmask.numeric.extensions.js ***!
|
1703
|
-
\*********************************************************************************************************/
|
1704
|
-
/***/ (function(module, exports, __webpack_require__) {
|
1705
|
-
|
1706
|
-
eval("var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!\n* inputmask.numeric.extensions.js\n* https://github.com/RobinHerbots/Inputmask\n* Copyright (c) 2010 - 2019 Robin Herbots\n* Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php)\n* Version: 4.0.9\n*/\n\n(function(factory) {\n if (true) {\n !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ __webpack_require__(/*! ./inputmask */ \"./node_modules/@formio/core/node_modules/inputmask/dist/inputmask/inputmask.js\") ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?\n\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n } else {}\n})(function(Inputmask) {\n var $ = Inputmask.dependencyLib;\n function autoEscape(txt, opts) {\n var escapedTxt = \"\";\n for (var i = 0; i < txt.length; i++) {\n if (Inputmask.prototype.definitions[txt.charAt(i)] || opts.definitions[txt.charAt(i)] || opts.optionalmarker.start === txt.charAt(i) || opts.optionalmarker.end === txt.charAt(i) || opts.quantifiermarker.start === txt.charAt(i) || opts.quantifiermarker.end === txt.charAt(i) || opts.groupmarker.start === txt.charAt(i) || opts.groupmarker.end === txt.charAt(i) || opts.alternatormarker === txt.charAt(i)) {\n escapedTxt += \"\\\\\" + txt.charAt(i);\n } else escapedTxt += txt.charAt(i);\n }\n return escapedTxt;\n }\n function alignDigits(buffer, digits, opts) {\n if (digits > 0) {\n var radixPosition = $.inArray(opts.radixPoint, buffer);\n if (radixPosition === -1) {\n buffer.push(opts.radixPoint);\n radixPosition = buffer.length - 1;\n }\n for (var i = 1; i <= digits; i++) {\n buffer[radixPosition + i] = buffer[radixPosition + i] || \"0\";\n }\n }\n return buffer;\n }\n Inputmask.extendAliases({\n numeric: {\n mask: function(opts) {\n if (opts.repeat !== 0 && isNaN(opts.integerDigits)) {\n opts.integerDigits = opts.repeat;\n }\n opts.repeat = 0;\n if (opts.groupSeparator === opts.radixPoint && opts.digits && opts.digits !== \"0\") {\n if (opts.radixPoint === \".\") {\n opts.groupSeparator = \",\";\n } else if (opts.radixPoint === \",\") {\n opts.groupSeparator = \".\";\n } else opts.groupSeparator = \"\";\n }\n if (opts.groupSeparator === \" \") {\n opts.skipOptionalPartCharacter = undefined;\n }\n opts.autoGroup = opts.autoGroup && opts.groupSeparator !== \"\";\n if (opts.autoGroup) {\n if (typeof opts.groupSize == \"string\" && isFinite(opts.groupSize)) opts.groupSize = parseInt(opts.groupSize);\n if (isFinite(opts.integerDigits)) {\n var seps = Math.floor(opts.integerDigits / opts.groupSize);\n var mod = opts.integerDigits % opts.groupSize;\n opts.integerDigits = parseInt(opts.integerDigits) + (mod === 0 ? seps - 1 : seps);\n if (opts.integerDigits < 1) {\n opts.integerDigits = \"*\";\n }\n }\n }\n if (opts.placeholder.length > 1) {\n opts.placeholder = opts.placeholder.charAt(0);\n }\n if (opts.positionCaretOnClick === \"radixFocus\" && (opts.placeholder === \"\" && opts.integerOptional === false)) {\n opts.positionCaretOnClick = \"lvp\";\n }\n opts.definitions[\";\"] = opts.definitions[\"~\"];\n opts.definitions[\";\"].definitionSymbol = \"~\";\n if (opts.numericInput === true) {\n opts.positionCaretOnClick = opts.positionCaretOnClick === \"radixFocus\" ? \"lvp\" : opts.positionCaretOnClick;\n opts.digitsOptional = false;\n if (isNaN(opts.digits)) opts.digits = 2;\n opts.decimalProtect = false;\n }\n var mask = \"[+]\";\n mask += autoEscape(opts.prefix, opts);\n if (opts.integerOptional === true) {\n mask += \"~{1,\" + opts.integerDigits + \"}\";\n } else mask += \"~{\" + opts.integerDigits + \"}\";\n if (opts.digits !== undefined) {\n var radixDef = opts.decimalProtect ? \":\" : opts.radixPoint;\n var dq = opts.digits.toString().split(\",\");\n if (isFinite(dq[0]) && dq[1] && isFinite(dq[1])) {\n mask += radixDef + \";{\" + opts.digits + \"}\";\n } else if (isNaN(opts.digits) || parseInt(opts.digits) > 0) {\n if (opts.digitsOptional) {\n mask += \"[\" + radixDef + \";{1,\" + opts.digits + \"}]\";\n } else mask += radixDef + \";{\" + opts.digits + \"}\";\n }\n }\n mask += autoEscape(opts.suffix, opts);\n mask += \"[-]\";\n opts.greedy = false;\n return mask;\n },\n placeholder: \"\",\n greedy: false,\n digits: \"*\",\n digitsOptional: true,\n enforceDigitsOnBlur: false,\n radixPoint: \".\",\n positionCaretOnClick: \"radixFocus\",\n groupSize: 3,\n groupSeparator: \"\",\n autoGroup: false,\n allowMinus: true,\n negationSymbol: {\n front: \"-\",\n back: \"\"\n },\n integerDigits: \"+\",\n integerOptional: true,\n prefix: \"\",\n suffix: \"\",\n rightAlign: true,\n decimalProtect: true,\n min: null,\n max: null,\n step: 1,\n insertMode: true,\n autoUnmask: false,\n unmaskAsNumber: false,\n inputType: \"text\",\n inputmode: \"numeric\",\n preValidation: function(buffer, pos, c, isSelection, opts, maskset) {\n if (c === \"-\" || c === opts.negationSymbol.front) {\n if (opts.allowMinus !== true) return false;\n opts.isNegative = opts.isNegative === undefined ? true : !opts.isNegative;\n if (buffer.join(\"\") === \"\") return true;\n return {\n caret: maskset.validPositions[pos] ? pos : undefined,\n dopost: true\n };\n }\n if (isSelection === false && c === opts.radixPoint && (opts.digits !== undefined && (isNaN(opts.digits) || parseInt(opts.digits) > 0))) {\n var radixPos = $.inArray(opts.radixPoint, buffer);\n if (radixPos !== -1 && maskset.validPositions[radixPos] !== undefined) {\n if (opts.numericInput === true) {\n return pos === radixPos;\n }\n return {\n caret: radixPos + 1\n };\n }\n }\n return true;\n },\n postValidation: function(buffer, pos, currentResult, opts) {\n function buildPostMask(buffer, opts) {\n var postMask = \"\";\n postMask += \"(\" + opts.groupSeparator + \"*{\" + opts.groupSize + \"}){*}\";\n if (opts.radixPoint !== \"\") {\n var radixSplit = buffer.join(\"\").split(opts.radixPoint);\n if (radixSplit[1]) {\n postMask += opts.radixPoint + \"*{\" + radixSplit[1].match(/^\\d*\\??\\d*/)[0].length + \"}\";\n }\n }\n return postMask;\n }\n var suffix = opts.suffix.split(\"\"), prefix = opts.prefix.split(\"\");\n if (currentResult.pos === undefined && currentResult.caret !== undefined && currentResult.dopost !== true) return currentResult;\n var caretPos = currentResult.caret !== undefined ? currentResult.caret : currentResult.pos;\n var maskedValue = buffer.slice();\n if (opts.numericInput) {\n caretPos = maskedValue.length - caretPos - 1;\n maskedValue = maskedValue.reverse();\n }\n var charAtPos = maskedValue[caretPos];\n if (charAtPos === opts.groupSeparator) {\n caretPos += 1;\n charAtPos = maskedValue[caretPos];\n }\n if (caretPos === maskedValue.length - opts.suffix.length - 1 && charAtPos === opts.radixPoint) return currentResult;\n if (charAtPos !== undefined) {\n if (charAtPos !== opts.radixPoint && charAtPos !== opts.negationSymbol.front && charAtPos !== opts.negationSymbol.back) {\n maskedValue[caretPos] = \"?\";\n if (opts.prefix.length > 0 && caretPos >= (opts.isNegative === false ? 1 : 0) && caretPos < opts.prefix.length - 1 + (opts.isNegative === false ? 1 : 0)) {\n prefix[caretPos - (opts.isNegative === false ? 1 : 0)] = \"?\";\n } else if (opts.suffix.length > 0 && caretPos >= maskedValue.length - opts.suffix.length - (opts.isNegative === false ? 1 : 0)) {\n suffix[caretPos - (maskedValue.length - opts.suffix.length - (opts.isNegative === false ? 1 : 0))] = \"?\";\n }\n }\n }\n prefix = prefix.join(\"\");\n suffix = suffix.join(\"\");\n var processValue = maskedValue.join(\"\").replace(prefix, \"\");\n processValue = processValue.replace(suffix, \"\");\n processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), \"g\"), \"\");\n processValue = processValue.replace(new RegExp(\"[-\" + Inputmask.escapeRegex(opts.negationSymbol.front) + \"]\", \"g\"), \"\");\n processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.negationSymbol.back) + \"$\"), \"\");\n if (isNaN(opts.placeholder)) {\n processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.placeholder), \"g\"), \"\");\n }\n if (processValue.length > 1 && processValue.indexOf(opts.radixPoint) !== 1) {\n if (charAtPos === \"0\") {\n processValue = processValue.replace(/^\\?/g, \"\");\n }\n processValue = processValue.replace(/^0/g, \"\");\n }\n if (processValue.charAt(0) === opts.radixPoint && opts.radixPoint !== \"\" && opts.numericInput !== true) {\n processValue = \"0\" + processValue;\n }\n if (processValue !== \"\") {\n processValue = processValue.split(\"\");\n if ((!opts.digitsOptional || opts.enforceDigitsOnBlur && currentResult.event === \"blur\") && isFinite(opts.digits)) {\n var radixPosition = $.inArray(opts.radixPoint, processValue);\n var rpb = $.inArray(opts.radixPoint, maskedValue);\n if (radixPosition === -1) {\n processValue.push(opts.radixPoint);\n radixPosition = processValue.length - 1;\n }\n for (var i = 1; i <= opts.digits; i++) {\n if ((!opts.digitsOptional || opts.enforceDigitsOnBlur && currentResult.event === \"blur\") && (processValue[radixPosition + i] === undefined || processValue[radixPosition + i] === opts.placeholder.charAt(0))) {\n processValue[radixPosition + i] = currentResult.placeholder || opts.placeholder.charAt(0);\n } else if (rpb !== -1 && maskedValue[rpb + i] !== undefined) {\n processValue[radixPosition + i] = processValue[radixPosition + i] || maskedValue[rpb + i];\n }\n }\n }\n if (opts.autoGroup === true && opts.groupSeparator !== \"\" && (charAtPos !== opts.radixPoint || currentResult.pos !== undefined || currentResult.dopost)) {\n var addRadix = processValue[processValue.length - 1] === opts.radixPoint && currentResult.c === opts.radixPoint;\n processValue = Inputmask(buildPostMask(processValue, opts), {\n numericInput: true,\n jitMasking: true,\n definitions: {\n \"*\": {\n validator: \"[0-9?]\",\n cardinality: 1\n }\n }\n }).format(processValue.join(\"\"));\n if (addRadix) processValue += opts.radixPoint;\n if (processValue.charAt(0) === opts.groupSeparator) {\n processValue.substr(1);\n }\n } else processValue = processValue.join(\"\");\n }\n if (opts.isNegative && currentResult.event === \"blur\") {\n opts.isNegative = processValue !== \"0\";\n }\n processValue = prefix + processValue;\n processValue += suffix;\n if (opts.isNegative) {\n processValue = opts.negationSymbol.front + processValue;\n processValue += opts.negationSymbol.back;\n }\n processValue = processValue.split(\"\");\n if (charAtPos !== undefined) {\n if (charAtPos !== opts.radixPoint && charAtPos !== opts.negationSymbol.front && charAtPos !== opts.negationSymbol.back) {\n caretPos = $.inArray(\"?\", processValue);\n if (caretPos > -1) {\n processValue[caretPos] = charAtPos;\n } else caretPos = currentResult.caret || 0;\n } else if (charAtPos === opts.radixPoint || charAtPos === opts.negationSymbol.front || charAtPos === opts.negationSymbol.back) {\n var newCaretPos = $.inArray(charAtPos, processValue);\n if (newCaretPos !== -1) caretPos = newCaretPos;\n }\n }\n if (opts.numericInput) {\n caretPos = processValue.length - caretPos - 1;\n processValue = processValue.reverse();\n }\n var rslt = {\n caret: (charAtPos === undefined || currentResult.pos !== undefined) && caretPos !== undefined ? caretPos + (opts.numericInput ? -1 : 1) : caretPos,\n buffer: processValue,\n refreshFromBuffer: currentResult.dopost || buffer.join(\"\") !== processValue.join(\"\")\n };\n return rslt.refreshFromBuffer ? rslt : currentResult;\n },\n onBeforeWrite: function(e, buffer, caretPos, opts) {\n function parseMinMaxOptions(opts) {\n if (opts.parseMinMaxOptions === undefined) {\n if (opts.min !== null) {\n opts.min = opts.min.toString().replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), \"g\"), \"\");\n if (opts.radixPoint === \",\") opts.min = opts.min.replace(opts.radixPoint, \".\");\n opts.min = isFinite(opts.min) ? parseFloat(opts.min) : NaN;\n if (isNaN(opts.min)) opts.min = Number.MIN_VALUE;\n }\n if (opts.max !== null) {\n opts.max = opts.max.toString().replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), \"g\"), \"\");\n if (opts.radixPoint === \",\") opts.max = opts.max.replace(opts.radixPoint, \".\");\n opts.max = isFinite(opts.max) ? parseFloat(opts.max) : NaN;\n if (isNaN(opts.max)) opts.max = Number.MAX_VALUE;\n }\n opts.parseMinMaxOptions = \"done\";\n }\n }\n if (e) {\n switch (e.type) {\n case \"keydown\":\n return opts.postValidation(buffer, caretPos, {\n caret: caretPos,\n dopost: true\n }, opts);\n\n case \"blur\":\n case \"checkval\":\n var unmasked;\n parseMinMaxOptions(opts);\n if (opts.min !== null || opts.max !== null) {\n unmasked = opts.onUnMask(buffer.join(\"\"), undefined, $.extend({}, opts, {\n unmaskAsNumber: true\n }));\n if (opts.min !== null && unmasked < opts.min) {\n opts.isNegative = opts.min < 0;\n return opts.postValidation(opts.min.toString().replace(\".\", opts.radixPoint).split(\"\"), caretPos, {\n caret: caretPos,\n dopost: true,\n placeholder: \"0\"\n }, opts);\n } else if (opts.max !== null && unmasked > opts.max) {\n opts.isNegative = opts.max < 0;\n return opts.postValidation(opts.max.toString().replace(\".\", opts.radixPoint).split(\"\"), caretPos, {\n caret: caretPos,\n dopost: true,\n placeholder: \"0\"\n }, opts);\n }\n }\n return opts.postValidation(buffer, caretPos, {\n caret: caretPos,\n placeholder: \"0\",\n event: \"blur\"\n }, opts);\n\n case \"_checkval\":\n return {\n caret: caretPos\n };\n\n default:\n break;\n }\n }\n },\n regex: {\n integerPart: function(opts, emptyCheck) {\n return emptyCheck ? new RegExp(\"[\" + Inputmask.escapeRegex(opts.negationSymbol.front) + \"+]?\") : new RegExp(\"[\" + Inputmask.escapeRegex(opts.negationSymbol.front) + \"+]?\\\\d+\");\n },\n integerNPart: function(opts) {\n return new RegExp(\"[\\\\d\" + Inputmask.escapeRegex(opts.groupSeparator) + Inputmask.escapeRegex(opts.placeholder.charAt(0)) + \"]+\");\n }\n },\n definitions: {\n \"~\": {\n validator: function(chrs, maskset, pos, strict, opts, isSelection) {\n var isValid, l;\n if (chrs === \"k\" || chrs === \"m\") {\n isValid = {\n insert: [],\n c: 0\n };\n for (var i = 0, l = chrs === \"k\" ? 2 : 5; i < l; i++) {\n isValid.insert.push({\n pos: pos + i,\n c: 0\n });\n }\n isValid.pos = pos + l;\n return isValid;\n }\n isValid = strict ? new RegExp(\"[0-9\" + Inputmask.escapeRegex(opts.groupSeparator) + \"]\").test(chrs) : new RegExp(\"[0-9]\").test(chrs);\n if (isValid === true) {\n if (opts.numericInput !== true && maskset.validPositions[pos] !== undefined && maskset.validPositions[pos].match.def === \"~\" && !isSelection) {\n var processValue = maskset.buffer.join(\"\");\n processValue = processValue.replace(new RegExp(\"[-\" + Inputmask.escapeRegex(opts.negationSymbol.front) + \"]\", \"g\"), \"\");\n processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.negationSymbol.back) + \"$\"), \"\");\n var pvRadixSplit = processValue.split(opts.radixPoint);\n if (pvRadixSplit.length > 1) {\n pvRadixSplit[1] = pvRadixSplit[1].replace(/0/g, opts.placeholder.charAt(0));\n }\n if (pvRadixSplit[0] === \"0\") {\n pvRadixSplit[0] = pvRadixSplit[0].replace(/0/g, opts.placeholder.charAt(0));\n }\n processValue = pvRadixSplit[0] + opts.radixPoint + pvRadixSplit[1] || \"\";\n var bufferTemplate = maskset._buffer.join(\"\");\n if (processValue === opts.radixPoint) {\n processValue = bufferTemplate;\n }\n while (processValue.match(Inputmask.escapeRegex(bufferTemplate) + \"$\") === null) {\n bufferTemplate = bufferTemplate.slice(1);\n }\n processValue = processValue.replace(bufferTemplate, \"\");\n processValue = processValue.split(\"\");\n if (processValue[pos] === undefined) {\n isValid = {\n pos: pos,\n remove: pos\n };\n } else {\n isValid = {\n pos: pos\n };\n }\n }\n } else if (!strict && chrs === opts.radixPoint && maskset.validPositions[pos - 1] === undefined) {\n isValid = {\n insert: {\n pos: pos,\n c: 0\n },\n pos: pos + 1\n };\n }\n return isValid;\n },\n cardinality: 1\n },\n \"+\": {\n validator: function(chrs, maskset, pos, strict, opts) {\n return opts.allowMinus && (chrs === \"-\" || chrs === opts.negationSymbol.front);\n },\n cardinality: 1,\n placeholder: \"\"\n },\n \"-\": {\n validator: function(chrs, maskset, pos, strict, opts) {\n return opts.allowMinus && chrs === opts.negationSymbol.back;\n },\n cardinality: 1,\n placeholder: \"\"\n },\n \":\": {\n validator: function(chrs, maskset, pos, strict, opts) {\n var radix = \"[\" + Inputmask.escapeRegex(opts.radixPoint) + \"]\";\n var isValid = new RegExp(radix).test(chrs);\n if (isValid && maskset.validPositions[pos] && maskset.validPositions[pos].match.placeholder === opts.radixPoint) {\n isValid = {\n caret: pos + 1\n };\n }\n return isValid;\n },\n cardinality: 1,\n placeholder: function(opts) {\n return opts.radixPoint;\n }\n }\n },\n onUnMask: function(maskedValue, unmaskedValue, opts) {\n if (unmaskedValue === \"\" && opts.nullable === true) {\n return unmaskedValue;\n }\n var processValue = maskedValue.replace(opts.prefix, \"\");\n processValue = processValue.replace(opts.suffix, \"\");\n processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator), \"g\"), \"\");\n if (opts.placeholder.charAt(0) !== \"\") {\n processValue = processValue.replace(new RegExp(opts.placeholder.charAt(0), \"g\"), \"0\");\n }\n if (opts.unmaskAsNumber) {\n if (opts.radixPoint !== \"\" && processValue.indexOf(opts.radixPoint) !== -1) processValue = processValue.replace(Inputmask.escapeRegex.call(this, opts.radixPoint), \".\");\n processValue = processValue.replace(new RegExp(\"^\" + Inputmask.escapeRegex(opts.negationSymbol.front)), \"-\");\n processValue = processValue.replace(new RegExp(Inputmask.escapeRegex(opts.negationSymbol.back) + \"$\"), \"\");\n return Number(processValue);\n }\n return processValue;\n },\n isComplete: function(buffer, opts) {\n var maskedValue = (opts.numericInput ? buffer.slice().reverse() : buffer).join(\"\");\n maskedValue = maskedValue.replace(new RegExp(\"^\" + Inputmask.escapeRegex(opts.negationSymbol.front)), \"-\");\n maskedValue = maskedValue.replace(new RegExp(Inputmask.escapeRegex(opts.negationSymbol.back) + \"$\"), \"\");\n maskedValue = maskedValue.replace(opts.prefix, \"\");\n maskedValue = maskedValue.replace(opts.suffix, \"\");\n maskedValue = maskedValue.replace(new RegExp(Inputmask.escapeRegex(opts.groupSeparator) + \"([0-9]{3})\", \"g\"), \"$1\");\n if (opts.radixPoint === \",\") maskedValue = maskedValue.replace(Inputmask.escapeRegex(opts.radixPoint), \".\");\n return isFinite(maskedValue);\n },\n onBeforeMask: function(initialValue, opts) {\n opts.isNegative = undefined;\n var radixPoint = opts.radixPoint || \",\";\n if ((typeof initialValue == \"number\" || opts.inputType === \"number\") && radixPoint !== \"\") {\n initialValue = initialValue.toString().replace(\".\", radixPoint);\n }\n var valueParts = initialValue.split(radixPoint), integerPart = valueParts[0].replace(/[^\\-0-9]/g, \"\"), decimalPart = valueParts.length > 1 ? valueParts[1].replace(/[^0-9]/g, \"\") : \"\";\n initialValue = integerPart + (decimalPart !== \"\" ? radixPoint + decimalPart : decimalPart);\n var digits = 0;\n if (radixPoint !== \"\") {\n digits = decimalPart.length;\n if (decimalPart !== \"\") {\n var digitsFactor = Math.pow(10, digits || 1);\n if (isFinite(opts.digits)) {\n digits = parseInt(opts.digits);\n digitsFactor = Math.pow(10, digits);\n }\n initialValue = initialValue.replace(Inputmask.escapeRegex(radixPoint), \".\");\n if (isFinite(initialValue)) initialValue = Math.round(parseFloat(initialValue) * digitsFactor) / digitsFactor;\n initialValue = initialValue.toString().replace(\".\", radixPoint);\n }\n }\n if (opts.digits === 0 && initialValue.indexOf(Inputmask.escapeRegex(radixPoint)) !== -1) {\n initialValue = initialValue.substring(0, initialValue.indexOf(Inputmask.escapeRegex(radixPoint)));\n }\n return alignDigits(initialValue.toString().split(\"\"), digits, opts).join(\"\");\n },\n onKeyDown: function(e, buffer, caretPos, opts) {\n var $input = $(this);\n if (e.ctrlKey) {\n switch (e.keyCode) {\n case Inputmask.keyCode.UP:\n $input.val(parseFloat(this.inputmask.unmaskedvalue()) + parseInt(opts.step));\n $input.trigger(\"setvalue\");\n break;\n\n case Inputmask.keyCode.DOWN:\n $input.val(parseFloat(this.inputmask.unmaskedvalue()) - parseInt(opts.step));\n $input.trigger(\"setvalue\");\n break;\n }\n }\n }\n },\n currency: {\n prefix: \"$ \",\n groupSeparator: \",\",\n alias: \"numeric\",\n placeholder: \"0\",\n autoGroup: true,\n digits: 2,\n digitsOptional: false,\n clearMaskOnLostFocus: false\n },\n decimal: {\n alias: \"numeric\"\n },\n integer: {\n alias: \"numeric\",\n digits: 0,\n radixPoint: \"\"\n },\n percentage: {\n alias: \"numeric\",\n digits: 2,\n digitsOptional: true,\n radixPoint: \".\",\n placeholder: \"0\",\n autoGroup: false,\n min: 0,\n max: 100,\n suffix: \" %\",\n allowMinus: false\n }\n });\n return Inputmask;\n});\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/node_modules/inputmask/dist/inputmask/inputmask.numeric.extensions.js?");
|
1707
|
-
|
1708
|
-
/***/ }),
|
1709
|
-
|
1710
|
-
/***/ "./node_modules/@formio/core/node_modules/inputmask/index.js":
|
1711
|
-
/*!*******************************************************************!*\
|
1712
|
-
!*** ./node_modules/@formio/core/node_modules/inputmask/index.js ***!
|
1713
|
-
\*******************************************************************/
|
1714
|
-
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
1650
|
+
/***/ "./node_modules/@formio/core/node_modules/dompurify/dist/purify.js":
|
1651
|
+
/*!*************************************************************************!*\
|
1652
|
+
!*** ./node_modules/@formio/core/node_modules/dompurify/dist/purify.js ***!
|
1653
|
+
\*************************************************************************/
|
1654
|
+
/***/ (function(module) {
|
1715
1655
|
|
1716
|
-
eval("__webpack_require__(/*! ./dist/inputmask/inputmask.extensions */ \"./node_modules/@formio/core/node_modules/inputmask/dist/inputmask/inputmask.extensions.js\");\r\n__webpack_require__(/*! ./dist/inputmask/inputmask.date.extensions */ \"./node_modules/@formio/core/node_modules/inputmask/dist/inputmask/inputmask.date.extensions.js\");\r\n__webpack_require__(/*! ./dist/inputmask/inputmask.numeric.extensions */ \"./node_modules/@formio/core/node_modules/inputmask/dist/inputmask/inputmask.numeric.extensions.js\");\r\n\r\nmodule.exports = __webpack_require__(/*! ./dist/inputmask/inputmask.js */ \"./node_modules/@formio/core/node_modules/inputmask/dist/inputmask/inputmask.js\");\r\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/node_modules/inputmask/index.js?");
|
1656
|
+
eval("/*! @license DOMPurify 3.1.2 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.2/LICENSE */\n\n(function (global, factory) {\n true ? module.exports = factory() :\n 0;\n})(this, (function () { 'use strict';\n\n const {\n entries,\n setPrototypeOf,\n isFrozen,\n getPrototypeOf,\n getOwnPropertyDescriptor\n } = Object;\n let {\n freeze,\n seal,\n create\n } = Object; // eslint-disable-line import/no-mutable-exports\n let {\n apply,\n construct\n } = typeof Reflect !== 'undefined' && Reflect;\n if (!freeze) {\n freeze = function freeze(x) {\n return x;\n };\n }\n if (!seal) {\n seal = function seal(x) {\n return x;\n };\n }\n if (!apply) {\n apply = function apply(fun, thisValue, args) {\n return fun.apply(thisValue, args);\n };\n }\n if (!construct) {\n construct = function construct(Func, args) {\n return new Func(...args);\n };\n }\n const arrayForEach = unapply(Array.prototype.forEach);\n const arrayPop = unapply(Array.prototype.pop);\n const arrayPush = unapply(Array.prototype.push);\n const stringToLowerCase = unapply(String.prototype.toLowerCase);\n const stringToString = unapply(String.prototype.toString);\n const stringMatch = unapply(String.prototype.match);\n const stringReplace = unapply(String.prototype.replace);\n const stringIndexOf = unapply(String.prototype.indexOf);\n const stringTrim = unapply(String.prototype.trim);\n const objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);\n const regExpTest = unapply(RegExp.prototype.test);\n const typeErrorCreate = unconstruct(TypeError);\n\n /**\n * Creates a new function that calls the given function with a specified thisArg and arguments.\n *\n * @param {Function} func - The function to be wrapped and called.\n * @returns {Function} A new function that calls the given function with a specified thisArg and arguments.\n */\n function unapply(func) {\n return function (thisArg) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n return apply(func, thisArg, args);\n };\n }\n\n /**\n * Creates a new function that constructs an instance of the given constructor function with the provided arguments.\n *\n * @param {Function} func - The constructor function to be wrapped and called.\n * @returns {Function} A new function that constructs an instance of the given constructor function with the provided arguments.\n */\n function unconstruct(func) {\n return function () {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n return construct(func, args);\n };\n }\n\n /**\n * Add properties to a lookup table\n *\n * @param {Object} set - The set to which elements will be added.\n * @param {Array} array - The array containing elements to be added to the set.\n * @param {Function} transformCaseFunc - An optional function to transform the case of each element before adding to the set.\n * @returns {Object} The modified set with added elements.\n */\n function addToSet(set, array) {\n let transformCaseFunc = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : stringToLowerCase;\n if (setPrototypeOf) {\n // Make 'in' and truthy checks like Boolean(set.constructor)\n // independent of any properties defined on Object.prototype.\n // Prevent prototype setters from intercepting set as a this value.\n setPrototypeOf(set, null);\n }\n let l = array.length;\n while (l--) {\n let element = array[l];\n if (typeof element === 'string') {\n const lcElement = transformCaseFunc(element);\n if (lcElement !== element) {\n // Config presets (e.g. tags.js, attrs.js) are immutable.\n if (!isFrozen(array)) {\n array[l] = lcElement;\n }\n element = lcElement;\n }\n }\n set[element] = true;\n }\n return set;\n }\n\n /**\n * Clean up an array to harden against CSPP\n *\n * @param {Array} array - The array to be cleaned.\n * @returns {Array} The cleaned version of the array\n */\n function cleanArray(array) {\n for (let index = 0; index < array.length; index++) {\n const isPropertyExist = objectHasOwnProperty(array, index);\n if (!isPropertyExist) {\n array[index] = null;\n }\n }\n return array;\n }\n\n /**\n * Shallow clone an object\n *\n * @param {Object} object - The object to be cloned.\n * @returns {Object} A new object that copies the original.\n */\n function clone(object) {\n const newObject = create(null);\n for (const [property, value] of entries(object)) {\n const isPropertyExist = objectHasOwnProperty(object, property);\n if (isPropertyExist) {\n if (Array.isArray(value)) {\n newObject[property] = cleanArray(value);\n } else if (value && typeof value === 'object' && value.constructor === Object) {\n newObject[property] = clone(value);\n } else {\n newObject[property] = value;\n }\n }\n }\n return newObject;\n }\n\n /**\n * This method automatically checks if the prop is function or getter and behaves accordingly.\n *\n * @param {Object} object - The object to look up the getter function in its prototype chain.\n * @param {String} prop - The property name for which to find the getter function.\n * @returns {Function} The getter function found in the prototype chain or a fallback function.\n */\n function lookupGetter(object, prop) {\n while (object !== null) {\n const desc = getOwnPropertyDescriptor(object, prop);\n if (desc) {\n if (desc.get) {\n return unapply(desc.get);\n }\n if (typeof desc.value === 'function') {\n return unapply(desc.value);\n }\n }\n object = getPrototypeOf(object);\n }\n function fallbackValue() {\n return null;\n }\n return fallbackValue;\n }\n\n const html$1 = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'section', 'select', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']);\n\n // SVG\n const svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']);\n const svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feDropShadow', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']);\n\n // List of SVG elements that are disallowed by default.\n // We still need to know them so that we can do namespace\n // checks properly in case one wants to add them to\n // allow-list.\n const svgDisallowed = freeze(['animate', 'color-profile', 'cursor', 'discard', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'foreignobject', 'hatch', 'hatchpath', 'mesh', 'meshgradient', 'meshpatch', 'meshrow', 'missing-glyph', 'script', 'set', 'solidcolor', 'unknown', 'use']);\n const mathMl$1 = freeze(['math', 'menclose', 'merror', 'mfenced', 'mfrac', 'mglyph', 'mi', 'mlabeledtr', 'mmultiscripts', 'mn', 'mo', 'mover', 'mpadded', 'mphantom', 'mroot', 'mrow', 'ms', 'mspace', 'msqrt', 'mstyle', 'msub', 'msup', 'msubsup', 'mtable', 'mtd', 'mtext', 'mtr', 'munder', 'munderover', 'mprescripts']);\n\n // Similarly to SVG, we want to know all MathML elements,\n // even those that we disallow by default.\n const mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']);\n const text = freeze(['#text']);\n\n const html = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'nonce', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'pattern', 'placeholder', 'playsinline', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'wrap', 'xmlns', 'slot']);\n const svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'targetx', 'targety', 'transform', 'transform-origin', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']);\n const mathMl = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnsalign', 'columnlines', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lspace', 'lquote', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns']);\n const xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);\n\n // eslint-disable-next-line unicorn/better-regex\n const MUSTACHE_EXPR = seal(/\\{\\{[\\w\\W]*|[\\w\\W]*\\}\\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode\n const ERB_EXPR = seal(/<%[\\w\\W]*|[\\w\\W]*%>/gm);\n const TMPLIT_EXPR = seal(/\\${[\\w\\W]*}/gm);\n const DATA_ATTR = seal(/^data-[\\-\\w.\\u00B7-\\uFFFF]/); // eslint-disable-line no-useless-escape\n const ARIA_ATTR = seal(/^aria-[\\-\\w]+$/); // eslint-disable-line no-useless-escape\n const IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\\-]+(?:[^a-z+.\\-:]|$))/i // eslint-disable-line no-useless-escape\n );\n\n const IS_SCRIPT_OR_DATA = seal(/^(?:\\w+script|data):/i);\n const ATTR_WHITESPACE = seal(/[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205F\\u3000]/g // eslint-disable-line no-control-regex\n );\n\n const DOCTYPE_NAME = seal(/^html$/i);\n const CUSTOM_ELEMENT = seal(/^[a-z][.\\w]*(-[.\\w]+)+$/i);\n\n var EXPRESSIONS = /*#__PURE__*/Object.freeze({\n __proto__: null,\n MUSTACHE_EXPR: MUSTACHE_EXPR,\n ERB_EXPR: ERB_EXPR,\n TMPLIT_EXPR: TMPLIT_EXPR,\n DATA_ATTR: DATA_ATTR,\n ARIA_ATTR: ARIA_ATTR,\n IS_ALLOWED_URI: IS_ALLOWED_URI,\n IS_SCRIPT_OR_DATA: IS_SCRIPT_OR_DATA,\n ATTR_WHITESPACE: ATTR_WHITESPACE,\n DOCTYPE_NAME: DOCTYPE_NAME,\n CUSTOM_ELEMENT: CUSTOM_ELEMENT\n });\n\n const getGlobal = function getGlobal() {\n return typeof window === 'undefined' ? null : window;\n };\n\n /**\n * Creates a no-op policy for internal use only.\n * Don't export this function outside this module!\n * @param {TrustedTypePolicyFactory} trustedTypes The policy factory.\n * @param {HTMLScriptElement} purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).\n * @return {TrustedTypePolicy} The policy created (or null, if Trusted Types\n * are not supported or creating the policy failed).\n */\n const _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement) {\n if (typeof trustedTypes !== 'object' || typeof trustedTypes.createPolicy !== 'function') {\n return null;\n }\n\n // Allow the callers to control the unique policy name\n // by adding a data-tt-policy-suffix to the script element with the DOMPurify.\n // Policy creation with duplicate names throws in Trusted Types.\n let suffix = null;\n const ATTR_NAME = 'data-tt-policy-suffix';\n if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) {\n suffix = purifyHostElement.getAttribute(ATTR_NAME);\n }\n const policyName = 'dompurify' + (suffix ? '#' + suffix : '');\n try {\n return trustedTypes.createPolicy(policyName, {\n createHTML(html) {\n return html;\n },\n createScriptURL(scriptUrl) {\n return scriptUrl;\n }\n });\n } catch (_) {\n // Policy creation failed (most likely another DOMPurify script has\n // already run). Skip creating the policy, as this will only cause errors\n // if TT are enforced.\n console.warn('TrustedTypes policy ' + policyName + ' could not be created.');\n return null;\n }\n };\n function createDOMPurify() {\n let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();\n const DOMPurify = root => createDOMPurify(root);\n\n /**\n * Version label, exposed for easier checks\n * if DOMPurify is up to date or not\n */\n DOMPurify.version = '3.1.2';\n\n /**\n * Array of elements that DOMPurify removed during sanitation.\n * Empty if nothing was removed.\n */\n DOMPurify.removed = [];\n if (!window || !window.document || window.document.nodeType !== 9) {\n // Not running in a browser, provide a factory function\n // so that you can pass your own Window\n DOMPurify.isSupported = false;\n return DOMPurify;\n }\n let {\n document\n } = window;\n const originalDocument = document;\n const currentScript = originalDocument.currentScript;\n const {\n DocumentFragment,\n HTMLTemplateElement,\n Node,\n Element,\n NodeFilter,\n NamedNodeMap = window.NamedNodeMap || window.MozNamedAttrMap,\n HTMLFormElement,\n DOMParser,\n trustedTypes\n } = window;\n const ElementPrototype = Element.prototype;\n const cloneNode = lookupGetter(ElementPrototype, 'cloneNode');\n const getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');\n const getChildNodes = lookupGetter(ElementPrototype, 'childNodes');\n const getParentNode = lookupGetter(ElementPrototype, 'parentNode');\n\n // As per issue #47, the web-components registry is inherited by a\n // new document created via createHTMLDocument. As per the spec\n // (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)\n // a new empty registry is used when creating a template contents owner\n // document, so we use that as our parent document to ensure nothing\n // is inherited.\n if (typeof HTMLTemplateElement === 'function') {\n const template = document.createElement('template');\n if (template.content && template.content.ownerDocument) {\n document = template.content.ownerDocument;\n }\n }\n let trustedTypesPolicy;\n let emptyHTML = '';\n const {\n implementation,\n createNodeIterator,\n createDocumentFragment,\n getElementsByTagName\n } = document;\n const {\n importNode\n } = originalDocument;\n let hooks = {};\n\n /**\n * Expose whether this browser supports running the full DOMPurify.\n */\n DOMPurify.isSupported = typeof entries === 'function' && typeof getParentNode === 'function' && implementation && implementation.createHTMLDocument !== undefined;\n const {\n MUSTACHE_EXPR,\n ERB_EXPR,\n TMPLIT_EXPR,\n DATA_ATTR,\n ARIA_ATTR,\n IS_SCRIPT_OR_DATA,\n ATTR_WHITESPACE,\n CUSTOM_ELEMENT\n } = EXPRESSIONS;\n let {\n IS_ALLOWED_URI: IS_ALLOWED_URI$1\n } = EXPRESSIONS;\n\n /**\n * We consider the elements and attributes below to be safe. Ideally\n * don't add any new ones but feel free to remove unwanted ones.\n */\n\n /* allowed element names */\n let ALLOWED_TAGS = null;\n const DEFAULT_ALLOWED_TAGS = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text]);\n\n /* Allowed attribute names */\n let ALLOWED_ATTR = null;\n const DEFAULT_ALLOWED_ATTR = addToSet({}, [...html, ...svg, ...mathMl, ...xml]);\n\n /*\n * Configure how DOMPUrify should handle custom elements and their attributes as well as customized built-in elements.\n * @property {RegExp|Function|null} tagNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any custom elements)\n * @property {RegExp|Function|null} attributeNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any attributes not on the allow list)\n * @property {boolean} allowCustomizedBuiltInElements allow custom elements derived from built-ins if they pass CUSTOM_ELEMENT_HANDLING.tagNameCheck. Default: `false`.\n */\n let CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, {\n tagNameCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null\n },\n attributeNameCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null\n },\n allowCustomizedBuiltInElements: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: false\n }\n }));\n\n /* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */\n let FORBID_TAGS = null;\n\n /* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */\n let FORBID_ATTR = null;\n\n /* Decide if ARIA attributes are okay */\n let ALLOW_ARIA_ATTR = true;\n\n /* Decide if custom data attributes are okay */\n let ALLOW_DATA_ATTR = true;\n\n /* Decide if unknown protocols are okay */\n let ALLOW_UNKNOWN_PROTOCOLS = false;\n\n /* Decide if self-closing tags in attributes are allowed.\n * Usually removed due to a mXSS issue in jQuery 3.0 */\n let ALLOW_SELF_CLOSE_IN_ATTR = true;\n\n /* Output should be safe for common template engines.\n * This means, DOMPurify removes data attributes, mustaches and ERB\n */\n let SAFE_FOR_TEMPLATES = false;\n\n /* Output should be safe even for XML used within HTML and alike.\n * This means, DOMPurify removes comments when containing risky content.\n */\n let SAFE_FOR_XML = true;\n\n /* Decide if document with <html>... should be returned */\n let WHOLE_DOCUMENT = false;\n\n /* Track whether config is already set on this instance of DOMPurify. */\n let SET_CONFIG = false;\n\n /* Decide if all elements (e.g. style, script) must be children of\n * document.body. By default, browsers might move them to document.head */\n let FORCE_BODY = false;\n\n /* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html\n * string (or a TrustedHTML object if Trusted Types are supported).\n * If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead\n */\n let RETURN_DOM = false;\n\n /* Decide if a DOM `DocumentFragment` should be returned, instead of a html\n * string (or a TrustedHTML object if Trusted Types are supported) */\n let RETURN_DOM_FRAGMENT = false;\n\n /* Try to return a Trusted Type object instead of a string, return a string in\n * case Trusted Types are not supported */\n let RETURN_TRUSTED_TYPE = false;\n\n /* Output should be free from DOM clobbering attacks?\n * This sanitizes markups named with colliding, clobberable built-in DOM APIs.\n */\n let SANITIZE_DOM = true;\n\n /* Achieve full DOM Clobbering protection by isolating the namespace of named\n * properties and JS variables, mitigating attacks that abuse the HTML/DOM spec rules.\n *\n * HTML/DOM spec rules that enable DOM Clobbering:\n * - Named Access on Window (§7.3.3)\n * - DOM Tree Accessors (§3.1.5)\n * - Form Element Parent-Child Relations (§4.10.3)\n * - Iframe srcdoc / Nested WindowProxies (§4.8.5)\n * - HTMLCollection (§4.2.10.2)\n *\n * Namespace isolation is implemented by prefixing `id` and `name` attributes\n * with a constant string, i.e., `user-content-`\n */\n let SANITIZE_NAMED_PROPS = false;\n const SANITIZE_NAMED_PROPS_PREFIX = 'user-content-';\n\n /* Keep element content when removing element? */\n let KEEP_CONTENT = true;\n\n /* If a `Node` is passed to sanitize(), then performs sanitization in-place instead\n * of importing it into a new Document and returning a sanitized copy */\n let IN_PLACE = false;\n\n /* Allow usage of profiles like html, svg and mathMl */\n let USE_PROFILES = {};\n\n /* Tags to ignore content of when KEEP_CONTENT is true */\n let FORBID_CONTENTS = null;\n const DEFAULT_FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'noscript', 'plaintext', 'script', 'style', 'svg', 'template', 'thead', 'title', 'video', 'xmp']);\n\n /* Tags that are safe for data: URIs */\n let DATA_URI_TAGS = null;\n const DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']);\n\n /* Attributes safe for values like \"javascript:\" */\n let URI_SAFE_ATTRIBUTES = null;\n const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'role', 'summary', 'title', 'value', 'style', 'xmlns']);\n const MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\n const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\n const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\n /* Document namespace */\n let NAMESPACE = HTML_NAMESPACE;\n let IS_EMPTY_INPUT = false;\n\n /* Allowed XHTML+XML namespaces */\n let ALLOWED_NAMESPACES = null;\n const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);\n\n /* Parsing of strict XHTML documents */\n let PARSER_MEDIA_TYPE = null;\n const SUPPORTED_PARSER_MEDIA_TYPES = ['application/xhtml+xml', 'text/html'];\n const DEFAULT_PARSER_MEDIA_TYPE = 'text/html';\n let transformCaseFunc = null;\n\n /* Keep a reference to config to pass to hooks */\n let CONFIG = null;\n\n /* Specify the maximum element nesting depth to prevent mXSS */\n const MAX_NESTING_DEPTH = 255;\n\n /* Ideally, do not touch anything below this line */\n /* ______________________________________________ */\n\n const formElement = document.createElement('form');\n const isRegexOrFunction = function isRegexOrFunction(testValue) {\n return testValue instanceof RegExp || testValue instanceof Function;\n };\n\n /**\n * _parseConfig\n *\n * @param {Object} cfg optional config literal\n */\n // eslint-disable-next-line complexity\n const _parseConfig = function _parseConfig() {\n let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n if (CONFIG && CONFIG === cfg) {\n return;\n }\n\n /* Shield configuration object from tampering */\n if (!cfg || typeof cfg !== 'object') {\n cfg = {};\n }\n\n /* Shield configuration object from prototype pollution */\n cfg = clone(cfg);\n PARSER_MEDIA_TYPE =\n // eslint-disable-next-line unicorn/prefer-includes\n SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;\n\n // HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is.\n transformCaseFunc = PARSER_MEDIA_TYPE === 'application/xhtml+xml' ? stringToString : stringToLowerCase;\n\n /* Set configuration parameters */\n ALLOWED_TAGS = objectHasOwnProperty(cfg, 'ALLOWED_TAGS') ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS;\n ALLOWED_ATTR = objectHasOwnProperty(cfg, 'ALLOWED_ATTR') ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR;\n ALLOWED_NAMESPACES = objectHasOwnProperty(cfg, 'ALLOWED_NAMESPACES') ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES;\n URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, 'ADD_URI_SAFE_ATTR') ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES),\n // eslint-disable-line indent\n cfg.ADD_URI_SAFE_ATTR,\n // eslint-disable-line indent\n transformCaseFunc // eslint-disable-line indent\n ) // eslint-disable-line indent\n : DEFAULT_URI_SAFE_ATTRIBUTES;\n DATA_URI_TAGS = objectHasOwnProperty(cfg, 'ADD_DATA_URI_TAGS') ? addToSet(clone(DEFAULT_DATA_URI_TAGS),\n // eslint-disable-line indent\n cfg.ADD_DATA_URI_TAGS,\n // eslint-disable-line indent\n transformCaseFunc // eslint-disable-line indent\n ) // eslint-disable-line indent\n : DEFAULT_DATA_URI_TAGS;\n FORBID_CONTENTS = objectHasOwnProperty(cfg, 'FORBID_CONTENTS') ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS;\n FORBID_TAGS = objectHasOwnProperty(cfg, 'FORBID_TAGS') ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : {};\n FORBID_ATTR = objectHasOwnProperty(cfg, 'FORBID_ATTR') ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : {};\n USE_PROFILES = objectHasOwnProperty(cfg, 'USE_PROFILES') ? cfg.USE_PROFILES : false;\n ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true\n ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true\n ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false\n ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; // Default true\n SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false\n SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false; // Default true\n WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false\n RETURN_DOM = cfg.RETURN_DOM || false; // Default false\n RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false\n RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false\n FORCE_BODY = cfg.FORCE_BODY || false; // Default false\n SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true\n SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; // Default false\n KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true\n IN_PLACE = cfg.IN_PLACE || false; // Default false\n IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI;\n NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;\n CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {};\n if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) {\n CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;\n }\n if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)) {\n CUSTOM_ELEMENT_HANDLING.attributeNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck;\n }\n if (cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements === 'boolean') {\n CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements;\n }\n if (SAFE_FOR_TEMPLATES) {\n ALLOW_DATA_ATTR = false;\n }\n if (RETURN_DOM_FRAGMENT) {\n RETURN_DOM = true;\n }\n\n /* Parse profile info */\n if (USE_PROFILES) {\n ALLOWED_TAGS = addToSet({}, text);\n ALLOWED_ATTR = [];\n if (USE_PROFILES.html === true) {\n addToSet(ALLOWED_TAGS, html$1);\n addToSet(ALLOWED_ATTR, html);\n }\n if (USE_PROFILES.svg === true) {\n addToSet(ALLOWED_TAGS, svg$1);\n addToSet(ALLOWED_ATTR, svg);\n addToSet(ALLOWED_ATTR, xml);\n }\n if (USE_PROFILES.svgFilters === true) {\n addToSet(ALLOWED_TAGS, svgFilters);\n addToSet(ALLOWED_ATTR, svg);\n addToSet(ALLOWED_ATTR, xml);\n }\n if (USE_PROFILES.mathMl === true) {\n addToSet(ALLOWED_TAGS, mathMl$1);\n addToSet(ALLOWED_ATTR, mathMl);\n addToSet(ALLOWED_ATTR, xml);\n }\n }\n\n /* Merge configuration parameters */\n if (cfg.ADD_TAGS) {\n if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {\n ALLOWED_TAGS = clone(ALLOWED_TAGS);\n }\n addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);\n }\n if (cfg.ADD_ATTR) {\n if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {\n ALLOWED_ATTR = clone(ALLOWED_ATTR);\n }\n addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);\n }\n if (cfg.ADD_URI_SAFE_ATTR) {\n addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);\n }\n if (cfg.FORBID_CONTENTS) {\n if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {\n FORBID_CONTENTS = clone(FORBID_CONTENTS);\n }\n addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);\n }\n\n /* Add #text in case KEEP_CONTENT is set to true */\n if (KEEP_CONTENT) {\n ALLOWED_TAGS['#text'] = true;\n }\n\n /* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */\n if (WHOLE_DOCUMENT) {\n addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);\n }\n\n /* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */\n if (ALLOWED_TAGS.table) {\n addToSet(ALLOWED_TAGS, ['tbody']);\n delete FORBID_TAGS.tbody;\n }\n if (cfg.TRUSTED_TYPES_POLICY) {\n if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== 'function') {\n throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.');\n }\n if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== 'function') {\n throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.');\n }\n\n // Overwrite existing TrustedTypes policy.\n trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;\n\n // Sign local variables required by `sanitize`.\n emptyHTML = trustedTypesPolicy.createHTML('');\n } else {\n // Uninitialized policy, attempt to initialize the internal dompurify policy.\n if (trustedTypesPolicy === undefined) {\n trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);\n }\n\n // If creating the internal policy succeeded sign internal variables.\n if (trustedTypesPolicy !== null && typeof emptyHTML === 'string') {\n emptyHTML = trustedTypesPolicy.createHTML('');\n }\n }\n\n // Prevent further manipulation of configuration.\n // Not available in IE8, Safari 5, etc.\n if (freeze) {\n freeze(cfg);\n }\n CONFIG = cfg;\n };\n const MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']);\n const HTML_INTEGRATION_POINTS = addToSet({}, ['foreignobject', 'annotation-xml']);\n\n // Certain elements are allowed in both SVG and HTML\n // namespace. We need to specify them explicitly\n // so that they don't get erroneously deleted from\n // HTML namespace.\n const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ['title', 'style', 'font', 'a', 'script']);\n\n /* Keep track of all possible SVG and MathML tags\n * so that we can perform the namespace checks\n * correctly. */\n const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]);\n const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);\n\n /**\n * @param {Element} element a DOM element whose namespace is being checked\n * @returns {boolean} Return false if the element has a\n * namespace that a spec-compliant parser would never\n * return. Return true otherwise.\n */\n const _checkValidNamespace = function _checkValidNamespace(element) {\n let parent = getParentNode(element);\n\n // In JSDOM, if we're inside shadow DOM, then parentNode\n // can be null. We just simulate parent in this case.\n if (!parent || !parent.tagName) {\n parent = {\n namespaceURI: NAMESPACE,\n tagName: 'template'\n };\n }\n const tagName = stringToLowerCase(element.tagName);\n const parentTagName = stringToLowerCase(parent.tagName);\n if (!ALLOWED_NAMESPACES[element.namespaceURI]) {\n return false;\n }\n if (element.namespaceURI === SVG_NAMESPACE) {\n // The only way to switch from HTML namespace to SVG\n // is via <svg>. If it happens via any other tag, then\n // it should be killed.\n if (parent.namespaceURI === HTML_NAMESPACE) {\n return tagName === 'svg';\n }\n\n // The only way to switch from MathML to SVG is via`\n // svg if parent is either <annotation-xml> or MathML\n // text integration points.\n if (parent.namespaceURI === MATHML_NAMESPACE) {\n return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);\n }\n\n // We only allow elements that are defined in SVG\n // spec. All others are disallowed in SVG namespace.\n return Boolean(ALL_SVG_TAGS[tagName]);\n }\n if (element.namespaceURI === MATHML_NAMESPACE) {\n // The only way to switch from HTML namespace to MathML\n // is via <math>. If it happens via any other tag, then\n // it should be killed.\n if (parent.namespaceURI === HTML_NAMESPACE) {\n return tagName === 'math';\n }\n\n // The only way to switch from SVG to MathML is via\n // <math> and HTML integration points\n if (parent.namespaceURI === SVG_NAMESPACE) {\n return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];\n }\n\n // We only allow elements that are defined in MathML\n // spec. All others are disallowed in MathML namespace.\n return Boolean(ALL_MATHML_TAGS[tagName]);\n }\n if (element.namespaceURI === HTML_NAMESPACE) {\n // The only way to switch from SVG to HTML is via\n // HTML integration points, and from MathML to HTML\n // is via MathML text integration points\n if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {\n return false;\n }\n if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {\n return false;\n }\n\n // We disallow tags that are specific for MathML\n // or SVG and should never appear in HTML namespace\n return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);\n }\n\n // For XHTML and XML documents that support custom namespaces\n if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && ALLOWED_NAMESPACES[element.namespaceURI]) {\n return true;\n }\n\n // The code should never reach this place (this means\n // that the element somehow got namespace that is not\n // HTML, SVG, MathML or allowed via ALLOWED_NAMESPACES).\n // Return false just in case.\n return false;\n };\n\n /**\n * _forceRemove\n *\n * @param {Node} node a DOM node\n */\n const _forceRemove = function _forceRemove(node) {\n arrayPush(DOMPurify.removed, {\n element: node\n });\n try {\n // eslint-disable-next-line unicorn/prefer-dom-node-remove\n node.parentNode.removeChild(node);\n } catch (_) {\n node.remove();\n }\n };\n\n /**\n * _removeAttribute\n *\n * @param {String} name an Attribute name\n * @param {Node} node a DOM node\n */\n const _removeAttribute = function _removeAttribute(name, node) {\n try {\n arrayPush(DOMPurify.removed, {\n attribute: node.getAttributeNode(name),\n from: node\n });\n } catch (_) {\n arrayPush(DOMPurify.removed, {\n attribute: null,\n from: node\n });\n }\n node.removeAttribute(name);\n\n // We void attribute values for unremovable \"is\"\" attributes\n if (name === 'is' && !ALLOWED_ATTR[name]) {\n if (RETURN_DOM || RETURN_DOM_FRAGMENT) {\n try {\n _forceRemove(node);\n } catch (_) {}\n } else {\n try {\n node.setAttribute(name, '');\n } catch (_) {}\n }\n }\n };\n\n /**\n * _initDocument\n *\n * @param {String} dirty a string of dirty markup\n * @return {Document} a DOM, filled with the dirty markup\n */\n const _initDocument = function _initDocument(dirty) {\n /* Create a HTML document */\n let doc = null;\n let leadingWhitespace = null;\n if (FORCE_BODY) {\n dirty = '<remove></remove>' + dirty;\n } else {\n /* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */\n const matches = stringMatch(dirty, /^[\\r\\n\\t ]+/);\n leadingWhitespace = matches && matches[0];\n }\n if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && NAMESPACE === HTML_NAMESPACE) {\n // Root of XHTML doc must contain xmlns declaration (see https://www.w3.org/TR/xhtml1/normative.html#strict)\n dirty = '<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>' + dirty + '</body></html>';\n }\n const dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty;\n /*\n * Use the DOMParser API by default, fallback later if needs be\n * DOMParser not work for svg when has multiple root element.\n */\n if (NAMESPACE === HTML_NAMESPACE) {\n try {\n doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);\n } catch (_) {}\n }\n\n /* Use createHTMLDocument in case DOMParser is not available */\n if (!doc || !doc.documentElement) {\n doc = implementation.createDocument(NAMESPACE, 'template', null);\n try {\n doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;\n } catch (_) {\n // Syntax error if dirtyPayload is invalid xml\n }\n }\n const body = doc.body || doc.documentElement;\n if (dirty && leadingWhitespace) {\n body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);\n }\n\n /* Work on whole document or just its body */\n if (NAMESPACE === HTML_NAMESPACE) {\n return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? 'html' : 'body')[0];\n }\n return WHOLE_DOCUMENT ? doc.documentElement : body;\n };\n\n /**\n * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.\n *\n * @param {Node} root The root element or node to start traversing on.\n * @return {NodeIterator} The created NodeIterator\n */\n const _createNodeIterator = function _createNodeIterator(root) {\n return createNodeIterator.call(root.ownerDocument || root, root,\n // eslint-disable-next-line no-bitwise\n NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, null);\n };\n\n /**\n * _isClobbered\n *\n * @param {Node} elm element to check for clobbering attacks\n * @return {Boolean} true if clobbered, false if safe\n */\n const _isClobbered = function _isClobbered(elm) {\n return elm instanceof HTMLFormElement && (\n // eslint-disable-next-line unicorn/no-typeof-undefined\n typeof elm.__depth !== 'undefined' && typeof elm.__depth !== 'number' ||\n // eslint-disable-next-line unicorn/no-typeof-undefined\n typeof elm.__removalCount !== 'undefined' && typeof elm.__removalCount !== 'number' || typeof elm.nodeName !== 'string' || typeof elm.textContent !== 'string' || typeof elm.removeChild !== 'function' || !(elm.attributes instanceof NamedNodeMap) || typeof elm.removeAttribute !== 'function' || typeof elm.setAttribute !== 'function' || typeof elm.namespaceURI !== 'string' || typeof elm.insertBefore !== 'function' || typeof elm.hasChildNodes !== 'function');\n };\n\n /**\n * Checks whether the given object is a DOM node.\n *\n * @param {Node} object object to check whether it's a DOM node\n * @return {Boolean} true is object is a DOM node\n */\n const _isNode = function _isNode(object) {\n return typeof Node === 'function' && object instanceof Node;\n };\n\n /**\n * _executeHook\n * Execute user configurable hooks\n *\n * @param {String} entryPoint Name of the hook's entry point\n * @param {Node} currentNode node to work on with the hook\n * @param {Object} data additional hook parameters\n */\n const _executeHook = function _executeHook(entryPoint, currentNode, data) {\n if (!hooks[entryPoint]) {\n return;\n }\n arrayForEach(hooks[entryPoint], hook => {\n hook.call(DOMPurify, currentNode, data, CONFIG);\n });\n };\n\n /**\n * _sanitizeElements\n *\n * @protect nodeName\n * @protect textContent\n * @protect removeChild\n *\n * @param {Node} currentNode to check for permission to exist\n * @return {Boolean} true if node was killed, false if left alive\n */\n const _sanitizeElements = function _sanitizeElements(currentNode) {\n let content = null;\n\n /* Execute a hook if present */\n _executeHook('beforeSanitizeElements', currentNode, null);\n\n /* Check if element is clobbered or can clobber */\n if (_isClobbered(currentNode)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Now let's check the element's type and name */\n const tagName = transformCaseFunc(currentNode.nodeName);\n\n /* Execute a hook if present */\n _executeHook('uponSanitizeElement', currentNode, {\n tagName,\n allowedTags: ALLOWED_TAGS\n });\n\n /* Detect mXSS attempts abusing namespace confusion */\n if (currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\\w]/g, currentNode.innerHTML) && regExpTest(/<[/\\w]/g, currentNode.textContent)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Remove any ocurrence of processing instructions */\n if (currentNode.nodeType === 7) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Remove any kind of possibly harmful comments */\n if (SAFE_FOR_XML && currentNode.nodeType === 8 && regExpTest(/<[/\\w]/g, currentNode.data)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Remove element if anything forbids its presence */\n if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n /* Check if we have a custom element to handle */\n if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {\n if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) {\n return false;\n }\n if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) {\n return false;\n }\n }\n\n /* Keep content except for bad-listed elements */\n if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {\n const parentNode = getParentNode(currentNode) || currentNode.parentNode;\n const childNodes = getChildNodes(currentNode) || currentNode.childNodes;\n if (childNodes && parentNode) {\n const childCount = childNodes.length;\n for (let i = childCount - 1; i >= 0; --i) {\n const childClone = cloneNode(childNodes[i], true);\n childClone.__removalCount = (currentNode.__removalCount || 0) + 1;\n parentNode.insertBefore(childClone, getNextSibling(currentNode));\n }\n }\n }\n _forceRemove(currentNode);\n return true;\n }\n\n /* Check whether element has a valid namespace */\n if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Make sure that older browsers don't get fallback-tag mXSS */\n if ((tagName === 'noscript' || tagName === 'noembed' || tagName === 'noframes') && regExpTest(/<\\/no(script|embed|frames)/i, currentNode.innerHTML)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Sanitize element content to be template-safe */\n if (SAFE_FOR_TEMPLATES && currentNode.nodeType === 3) {\n /* Get the element's text content */\n content = currentNode.textContent;\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {\n content = stringReplace(content, expr, ' ');\n });\n if (currentNode.textContent !== content) {\n arrayPush(DOMPurify.removed, {\n element: currentNode.cloneNode()\n });\n currentNode.textContent = content;\n }\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeElements', currentNode, null);\n return false;\n };\n\n /**\n * _isValidAttribute\n *\n * @param {string} lcTag Lowercase tag name of containing element.\n * @param {string} lcName Lowercase attribute name.\n * @param {string} value Attribute value.\n * @return {Boolean} Returns true if `value` is valid, otherwise false.\n */\n // eslint-disable-next-line complexity\n const _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {\n /* Make sure attribute cannot clobber */\n if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) {\n return false;\n }\n\n /* Allow valid data-* attributes: At least one character after \"-\"\n (https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)\n XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)\n We don't need to check the value; it's always URI safe. */\n if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName)) ; else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {\n if (\n // First condition does a very basic check if a) it's basically a valid custom element tagname AND\n // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck\n // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck\n _isBasicCustomElement(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName)) ||\n // Alternative, second condition checks if it's an `is`-attribute, AND\n // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck\n lcName === 'is' && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value))) ; else {\n return false;\n }\n /* Check value is safe. First, is attr inert? If so, is safe */\n } else if (URI_SAFE_ATTRIBUTES[lcName]) ; else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if ((lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') && lcTag !== 'script' && stringIndexOf(value, 'data:') === 0 && DATA_URI_TAGS[lcTag]) ; else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if (value) {\n return false;\n } else ;\n return true;\n };\n\n /**\n * _isBasicCustomElement\n * checks if at least one dash is included in tagName, and it's not the first char\n * for more sophisticated checking see https://github.com/sindresorhus/validate-element-name\n *\n * @param {string} tagName name of the tag of the node to sanitize\n * @returns {boolean} Returns true if the tag name meets the basic criteria for a custom element, otherwise false.\n */\n const _isBasicCustomElement = function _isBasicCustomElement(tagName) {\n return tagName !== 'annotation-xml' && stringMatch(tagName, CUSTOM_ELEMENT);\n };\n\n /**\n * _sanitizeAttributes\n *\n * @protect attributes\n * @protect nodeName\n * @protect removeAttribute\n * @protect setAttribute\n *\n * @param {Node} currentNode to sanitize\n */\n const _sanitizeAttributes = function _sanitizeAttributes(currentNode) {\n /* Execute a hook if present */\n _executeHook('beforeSanitizeAttributes', currentNode, null);\n const {\n attributes\n } = currentNode;\n\n /* Check if we have attributes; if not we might have a text node */\n if (!attributes) {\n return;\n }\n const hookEvent = {\n attrName: '',\n attrValue: '',\n keepAttr: true,\n allowedAttributes: ALLOWED_ATTR\n };\n let l = attributes.length;\n\n /* Go backwards over all attributes; safely remove bad ones */\n while (l--) {\n const attr = attributes[l];\n const {\n name,\n namespaceURI,\n value: attrValue\n } = attr;\n const lcName = transformCaseFunc(name);\n let value = name === 'value' ? attrValue : stringTrim(attrValue);\n\n /* Execute a hook if present */\n hookEvent.attrName = lcName;\n hookEvent.attrValue = value;\n hookEvent.keepAttr = true;\n hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set\n _executeHook('uponSanitizeAttribute', currentNode, hookEvent);\n value = hookEvent.attrValue;\n /* Did the hooks approve of the attribute? */\n if (hookEvent.forceKeepAttr) {\n continue;\n }\n\n /* Remove attribute */\n _removeAttribute(name, currentNode);\n\n /* Did the hooks approve of the attribute? */\n if (!hookEvent.keepAttr) {\n continue;\n }\n\n /* Work around a security issue in jQuery 3.0 */\n if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\\/>/i, value)) {\n _removeAttribute(name, currentNode);\n continue;\n }\n\n /* Sanitize attribute content to be template-safe */\n if (SAFE_FOR_TEMPLATES) {\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {\n value = stringReplace(value, expr, ' ');\n });\n }\n\n /* Is `value` valid for this attribute? */\n const lcTag = transformCaseFunc(currentNode.nodeName);\n if (!_isValidAttribute(lcTag, lcName, value)) {\n continue;\n }\n\n /* Full DOM Clobbering protection via namespace isolation,\n * Prefix id and name attributes with `user-content-`\n */\n if (SANITIZE_NAMED_PROPS && (lcName === 'id' || lcName === 'name')) {\n // Remove the attribute with this value\n _removeAttribute(name, currentNode);\n\n // Prefix the value and later re-create the attribute with the sanitized value\n value = SANITIZE_NAMED_PROPS_PREFIX + value;\n }\n\n /* Handle attributes that require Trusted Types */\n if (trustedTypesPolicy && typeof trustedTypes === 'object' && typeof trustedTypes.getAttributeType === 'function') {\n if (namespaceURI) ; else {\n switch (trustedTypes.getAttributeType(lcTag, lcName)) {\n case 'TrustedHTML':\n {\n value = trustedTypesPolicy.createHTML(value);\n break;\n }\n case 'TrustedScriptURL':\n {\n value = trustedTypesPolicy.createScriptURL(value);\n break;\n }\n }\n }\n }\n\n /* Handle invalid data-* attribute set by try-catching it */\n try {\n if (namespaceURI) {\n currentNode.setAttributeNS(namespaceURI, name, value);\n } else {\n /* Fallback to setAttribute() for browser-unrecognized namespaces e.g. \"x-schema\". */\n currentNode.setAttribute(name, value);\n }\n arrayPop(DOMPurify.removed);\n } catch (_) {}\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeAttributes', currentNode, null);\n };\n\n /**\n * _sanitizeShadowDOM\n *\n * @param {DocumentFragment} fragment to iterate over recursively\n */\n const _sanitizeShadowDOM = function _sanitizeShadowDOM(fragment) {\n let shadowNode = null;\n const shadowIterator = _createNodeIterator(fragment);\n\n /* Execute a hook if present */\n _executeHook('beforeSanitizeShadowDOM', fragment, null);\n while (shadowNode = shadowIterator.nextNode()) {\n /* Execute a hook if present */\n _executeHook('uponSanitizeShadowNode', shadowNode, null);\n\n /* Sanitize tags and elements */\n if (_sanitizeElements(shadowNode)) {\n continue;\n }\n const parentNode = getParentNode(shadowNode);\n\n /* Set the nesting depth of an element */\n if (shadowNode.nodeType === 1) {\n if (parentNode && parentNode.__depth) {\n /*\n We want the depth of the node in the original tree, which can\n change when it's removed from its parent.\n */\n shadowNode.__depth = (shadowNode.__removalCount || 0) + parentNode.__depth + 1;\n } else {\n shadowNode.__depth = 1;\n }\n }\n\n /* Remove an element if nested too deeply to avoid mXSS */\n if (shadowNode.__depth >= MAX_NESTING_DEPTH) {\n _forceRemove(shadowNode);\n }\n\n /* Deep shadow DOM detected */\n if (shadowNode.content instanceof DocumentFragment) {\n shadowNode.content.__depth = shadowNode.__depth;\n _sanitizeShadowDOM(shadowNode.content);\n }\n\n /* Check attributes, sanitize if necessary */\n _sanitizeAttributes(shadowNode);\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeShadowDOM', fragment, null);\n };\n\n /**\n * Sanitize\n * Public method providing core sanitation functionality\n *\n * @param {String|Node} dirty string or DOM node\n * @param {Object} cfg object\n */\n // eslint-disable-next-line complexity\n DOMPurify.sanitize = function (dirty) {\n let cfg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n let body = null;\n let importedNode = null;\n let currentNode = null;\n let returnNode = null;\n /* Make sure we have a string to sanitize.\n DO NOT return early, as this will return the wrong type if\n the user has requested a DOM object rather than a string */\n IS_EMPTY_INPUT = !dirty;\n if (IS_EMPTY_INPUT) {\n dirty = '<!-->';\n }\n\n /* Stringify, in case dirty is an object */\n if (typeof dirty !== 'string' && !_isNode(dirty)) {\n if (typeof dirty.toString === 'function') {\n dirty = dirty.toString();\n if (typeof dirty !== 'string') {\n throw typeErrorCreate('dirty is not a string, aborting');\n }\n } else {\n throw typeErrorCreate('toString is not a function');\n }\n }\n\n /* Return dirty HTML if DOMPurify cannot run */\n if (!DOMPurify.isSupported) {\n return dirty;\n }\n\n /* Assign config vars */\n if (!SET_CONFIG) {\n _parseConfig(cfg);\n }\n\n /* Clean up removed elements */\n DOMPurify.removed = [];\n\n /* Check if dirty is correctly typed for IN_PLACE */\n if (typeof dirty === 'string') {\n IN_PLACE = false;\n }\n if (IN_PLACE) {\n /* Do some early pre-sanitization to avoid unsafe root nodes */\n if (dirty.nodeName) {\n const tagName = transformCaseFunc(dirty.nodeName);\n if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n throw typeErrorCreate('root node is forbidden and cannot be sanitized in-place');\n }\n }\n } else if (dirty instanceof Node) {\n /* If dirty is a DOM element, append to an empty document to avoid\n elements being stripped by the parser */\n body = _initDocument('<!---->');\n importedNode = body.ownerDocument.importNode(dirty, true);\n if (importedNode.nodeType === 1 && importedNode.nodeName === 'BODY') {\n /* Node is already a body, use as is */\n body = importedNode;\n } else if (importedNode.nodeName === 'HTML') {\n body = importedNode;\n } else {\n // eslint-disable-next-line unicorn/prefer-dom-node-append\n body.appendChild(importedNode);\n }\n } else {\n /* Exit directly if we have nothing to do */\n if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT &&\n // eslint-disable-next-line unicorn/prefer-includes\n dirty.indexOf('<') === -1) {\n return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty;\n }\n\n /* Initialize the document to work on */\n body = _initDocument(dirty);\n\n /* Check we have a DOM node from the data */\n if (!body) {\n return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : '';\n }\n }\n\n /* Remove first element node (ours) if FORCE_BODY is set */\n if (body && FORCE_BODY) {\n _forceRemove(body.firstChild);\n }\n\n /* Get node iterator */\n const nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body);\n\n /* Now start iterating over the created document */\n while (currentNode = nodeIterator.nextNode()) {\n /* Sanitize tags and elements */\n if (_sanitizeElements(currentNode)) {\n continue;\n }\n const parentNode = getParentNode(currentNode);\n\n /* Set the nesting depth of an element */\n if (currentNode.nodeType === 1) {\n if (parentNode && parentNode.__depth) {\n /*\n We want the depth of the node in the original tree, which can\n change when it's removed from its parent.\n */\n currentNode.__depth = (currentNode.__removalCount || 0) + parentNode.__depth + 1;\n } else {\n currentNode.__depth = 1;\n }\n }\n\n /* Remove an element if nested too deeply to avoid mXSS */\n if (currentNode.__depth >= MAX_NESTING_DEPTH) {\n _forceRemove(currentNode);\n }\n\n /* Shadow DOM detected, sanitize it */\n if (currentNode.content instanceof DocumentFragment) {\n currentNode.content.__depth = currentNode.__depth;\n _sanitizeShadowDOM(currentNode.content);\n }\n\n /* Check attributes, sanitize if necessary */\n _sanitizeAttributes(currentNode);\n }\n\n /* If we sanitized `dirty` in-place, return it. */\n if (IN_PLACE) {\n return dirty;\n }\n\n /* Return sanitized string or DOM */\n if (RETURN_DOM) {\n if (RETURN_DOM_FRAGMENT) {\n returnNode = createDocumentFragment.call(body.ownerDocument);\n while (body.firstChild) {\n // eslint-disable-next-line unicorn/prefer-dom-node-append\n returnNode.appendChild(body.firstChild);\n }\n } else {\n returnNode = body;\n }\n if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) {\n /*\n AdoptNode() is not used because internal state is not reset\n (e.g. the past names map of a HTMLFormElement), this is safe\n in theory but we would rather not risk another attack vector.\n The state that is cloned by importNode() is explicitly defined\n by the specs.\n */\n returnNode = importNode.call(originalDocument, returnNode, true);\n }\n return returnNode;\n }\n let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;\n\n /* Serialize doctype if allowed */\n if (WHOLE_DOCUMENT && ALLOWED_TAGS['!doctype'] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) {\n serializedHTML = '<!DOCTYPE ' + body.ownerDocument.doctype.name + '>\\n' + serializedHTML;\n }\n\n /* Sanitize final string template-safe */\n if (SAFE_FOR_TEMPLATES) {\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {\n serializedHTML = stringReplace(serializedHTML, expr, ' ');\n });\n }\n return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML;\n };\n\n /**\n * Public method to set the configuration once\n * setConfig\n *\n * @param {Object} cfg configuration object\n */\n DOMPurify.setConfig = function () {\n let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _parseConfig(cfg);\n SET_CONFIG = true;\n };\n\n /**\n * Public method to remove the configuration\n * clearConfig\n *\n */\n DOMPurify.clearConfig = function () {\n CONFIG = null;\n SET_CONFIG = false;\n };\n\n /**\n * Public method to check if an attribute value is valid.\n * Uses last set config, if any. Otherwise, uses config defaults.\n * isValidAttribute\n *\n * @param {String} tag Tag name of containing element.\n * @param {String} attr Attribute name.\n * @param {String} value Attribute value.\n * @return {Boolean} Returns true if `value` is valid. Otherwise, returns false.\n */\n DOMPurify.isValidAttribute = function (tag, attr, value) {\n /* Initialize shared config vars if necessary. */\n if (!CONFIG) {\n _parseConfig({});\n }\n const lcTag = transformCaseFunc(tag);\n const lcName = transformCaseFunc(attr);\n return _isValidAttribute(lcTag, lcName, value);\n };\n\n /**\n * AddHook\n * Public method to add DOMPurify hooks\n *\n * @param {String} entryPoint entry point for the hook to add\n * @param {Function} hookFunction function to execute\n */\n DOMPurify.addHook = function (entryPoint, hookFunction) {\n if (typeof hookFunction !== 'function') {\n return;\n }\n hooks[entryPoint] = hooks[entryPoint] || [];\n arrayPush(hooks[entryPoint], hookFunction);\n };\n\n /**\n * RemoveHook\n * Public method to remove a DOMPurify hook at a given entryPoint\n * (pops it from the stack of hooks if more are present)\n *\n * @param {String} entryPoint entry point for the hook to remove\n * @return {Function} removed(popped) hook\n */\n DOMPurify.removeHook = function (entryPoint) {\n if (hooks[entryPoint]) {\n return arrayPop(hooks[entryPoint]);\n }\n };\n\n /**\n * RemoveHooks\n * Public method to remove all DOMPurify hooks at a given entryPoint\n *\n * @param {String} entryPoint entry point for the hooks to remove\n */\n DOMPurify.removeHooks = function (entryPoint) {\n if (hooks[entryPoint]) {\n hooks[entryPoint] = [];\n }\n };\n\n /**\n * RemoveAllHooks\n * Public method to remove all DOMPurify hooks\n */\n DOMPurify.removeAllHooks = function () {\n hooks = {};\n };\n return DOMPurify;\n }\n var purify = createDOMPurify();\n\n return purify;\n\n}));\n//# sourceMappingURL=purify.js.map\n\n\n//# sourceURL=webpack://Formio/./node_modules/@formio/core/node_modules/dompurify/dist/purify.js?");
|
1717
1657
|
|
1718
1658
|
/***/ }),
|
1719
1659
|
|
@@ -1773,7 +1713,7 @@ eval("!function(t,i){ true?module.exports=i():0}(this,(function(){\"use strict\"
|
|
1773
1713
|
\***********************************************/
|
1774
1714
|
/***/ (function(module) {
|
1775
1715
|
|
1776
|
-
eval("/*! @license DOMPurify 3.1.2 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.2/LICENSE */\n\n(function (global, factory) {\n true ? module.exports = factory() :\n 0;\n})(this, (function () { 'use strict';\n\n const {\n entries,\n setPrototypeOf,\n isFrozen,\n getPrototypeOf,\n getOwnPropertyDescriptor\n } = Object;\n let {\n freeze,\n seal,\n create\n } = Object; // eslint-disable-line import/no-mutable-exports\n let {\n apply,\n construct\n } = typeof Reflect !== 'undefined' && Reflect;\n if (!freeze) {\n freeze = function freeze(x) {\n return x;\n };\n }\n if (!seal) {\n seal = function seal(x) {\n return x;\n };\n }\n if (!apply) {\n apply = function apply(fun, thisValue, args) {\n return fun.apply(thisValue, args);\n };\n }\n if (!construct) {\n construct = function construct(Func, args) {\n return new Func(...args);\n };\n }\n const arrayForEach = unapply(Array.prototype.forEach);\n const arrayPop = unapply(Array.prototype.pop);\n const arrayPush = unapply(Array.prototype.push);\n const stringToLowerCase = unapply(String.prototype.toLowerCase);\n const stringToString = unapply(String.prototype.toString);\n const stringMatch = unapply(String.prototype.match);\n const stringReplace = unapply(String.prototype.replace);\n const stringIndexOf = unapply(String.prototype.indexOf);\n const stringTrim = unapply(String.prototype.trim);\n const objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);\n const regExpTest = unapply(RegExp.prototype.test);\n const typeErrorCreate = unconstruct(TypeError);\n\n /**\n * Creates a new function that calls the given function with a specified thisArg and arguments.\n *\n * @param {Function} func - The function to be wrapped and called.\n * @returns {Function} A new function that calls the given function with a specified thisArg and arguments.\n */\n function unapply(func) {\n return function (thisArg) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n return apply(func, thisArg, args);\n };\n }\n\n /**\n * Creates a new function that constructs an instance of the given constructor function with the provided arguments.\n *\n * @param {Function} func - The constructor function to be wrapped and called.\n * @returns {Function} A new function that constructs an instance of the given constructor function with the provided arguments.\n */\n function unconstruct(func) {\n return function () {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n return construct(func, args);\n };\n }\n\n /**\n * Add properties to a lookup table\n *\n * @param {Object} set - The set to which elements will be added.\n * @param {Array} array - The array containing elements to be added to the set.\n * @param {Function} transformCaseFunc - An optional function to transform the case of each element before adding to the set.\n * @returns {Object} The modified set with added elements.\n */\n function addToSet(set, array) {\n let transformCaseFunc = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : stringToLowerCase;\n if (setPrototypeOf) {\n // Make 'in' and truthy checks like Boolean(set.constructor)\n // independent of any properties defined on Object.prototype.\n // Prevent prototype setters from intercepting set as a this value.\n setPrototypeOf(set, null);\n }\n let l = array.length;\n while (l--) {\n let element = array[l];\n if (typeof element === 'string') {\n const lcElement = transformCaseFunc(element);\n if (lcElement !== element) {\n // Config presets (e.g. tags.js, attrs.js) are immutable.\n if (!isFrozen(array)) {\n array[l] = lcElement;\n }\n element = lcElement;\n }\n }\n set[element] = true;\n }\n return set;\n }\n\n /**\n * Clean up an array to harden against CSPP\n *\n * @param {Array} array - The array to be cleaned.\n * @returns {Array} The cleaned version of the array\n */\n function cleanArray(array) {\n for (let index = 0; index < array.length; index++) {\n const isPropertyExist = objectHasOwnProperty(array, index);\n if (!isPropertyExist) {\n array[index] = null;\n }\n }\n return array;\n }\n\n /**\n * Shallow clone an object\n *\n * @param {Object} object - The object to be cloned.\n * @returns {Object} A new object that copies the original.\n */\n function clone(object) {\n const newObject = create(null);\n for (const [property, value] of entries(object)) {\n const isPropertyExist = objectHasOwnProperty(object, property);\n if (isPropertyExist) {\n if (Array.isArray(value)) {\n newObject[property] = cleanArray(value);\n } else if (value && typeof value === 'object' && value.constructor === Object) {\n newObject[property] = clone(value);\n } else {\n newObject[property] = value;\n }\n }\n }\n return newObject;\n }\n\n /**\n * This method automatically checks if the prop is function or getter and behaves accordingly.\n *\n * @param {Object} object - The object to look up the getter function in its prototype chain.\n * @param {String} prop - The property name for which to find the getter function.\n * @returns {Function} The getter function found in the prototype chain or a fallback function.\n */\n function lookupGetter(object, prop) {\n while (object !== null) {\n const desc = getOwnPropertyDescriptor(object, prop);\n if (desc) {\n if (desc.get) {\n return unapply(desc.get);\n }\n if (typeof desc.value === 'function') {\n return unapply(desc.value);\n }\n }\n object = getPrototypeOf(object);\n }\n function fallbackValue() {\n return null;\n }\n return fallbackValue;\n }\n\n const html$1 = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'section', 'select', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']);\n\n // SVG\n const svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']);\n const svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feDropShadow', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']);\n\n // List of SVG elements that are disallowed by default.\n // We still need to know them so that we can do namespace\n // checks properly in case one wants to add them to\n // allow-list.\n const svgDisallowed = freeze(['animate', 'color-profile', 'cursor', 'discard', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'foreignobject', 'hatch', 'hatchpath', 'mesh', 'meshgradient', 'meshpatch', 'meshrow', 'missing-glyph', 'script', 'set', 'solidcolor', 'unknown', 'use']);\n const mathMl$1 = freeze(['math', 'menclose', 'merror', 'mfenced', 'mfrac', 'mglyph', 'mi', 'mlabeledtr', 'mmultiscripts', 'mn', 'mo', 'mover', 'mpadded', 'mphantom', 'mroot', 'mrow', 'ms', 'mspace', 'msqrt', 'mstyle', 'msub', 'msup', 'msubsup', 'mtable', 'mtd', 'mtext', 'mtr', 'munder', 'munderover', 'mprescripts']);\n\n // Similarly to SVG, we want to know all MathML elements,\n // even those that we disallow by default.\n const mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']);\n const text = freeze(['#text']);\n\n const html = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'nonce', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'pattern', 'placeholder', 'playsinline', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'wrap', 'xmlns', 'slot']);\n const svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'targetx', 'targety', 'transform', 'transform-origin', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']);\n const mathMl = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnsalign', 'columnlines', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lspace', 'lquote', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns']);\n const xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);\n\n // eslint-disable-next-line unicorn/better-regex\n const MUSTACHE_EXPR = seal(/\\{\\{[\\w\\W]*|[\\w\\W]*\\}\\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode\n const ERB_EXPR = seal(/<%[\\w\\W]*|[\\w\\W]*%>/gm);\n const TMPLIT_EXPR = seal(/\\${[\\w\\W]*}/gm);\n const DATA_ATTR = seal(/^data-[\\-\\w.\\u00B7-\\uFFFF]/); // eslint-disable-line no-useless-escape\n const ARIA_ATTR = seal(/^aria-[\\-\\w]+$/); // eslint-disable-line no-useless-escape\n const IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\\-]+(?:[^a-z+.\\-:]|$))/i // eslint-disable-line no-useless-escape\n );\n\n const IS_SCRIPT_OR_DATA = seal(/^(?:\\w+script|data):/i);\n const ATTR_WHITESPACE = seal(/[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205F\\u3000]/g // eslint-disable-line no-control-regex\n );\n\n const DOCTYPE_NAME = seal(/^html$/i);\n const CUSTOM_ELEMENT = seal(/^[a-z][.\\w]*(-[.\\w]+)+$/i);\n\n var EXPRESSIONS = /*#__PURE__*/Object.freeze({\n __proto__: null,\n MUSTACHE_EXPR: MUSTACHE_EXPR,\n ERB_EXPR: ERB_EXPR,\n TMPLIT_EXPR: TMPLIT_EXPR,\n DATA_ATTR: DATA_ATTR,\n ARIA_ATTR: ARIA_ATTR,\n IS_ALLOWED_URI: IS_ALLOWED_URI,\n IS_SCRIPT_OR_DATA: IS_SCRIPT_OR_DATA,\n ATTR_WHITESPACE: ATTR_WHITESPACE,\n DOCTYPE_NAME: DOCTYPE_NAME,\n CUSTOM_ELEMENT: CUSTOM_ELEMENT\n });\n\n const getGlobal = function getGlobal() {\n return typeof window === 'undefined' ? null : window;\n };\n\n /**\n * Creates a no-op policy for internal use only.\n * Don't export this function outside this module!\n * @param {TrustedTypePolicyFactory} trustedTypes The policy factory.\n * @param {HTMLScriptElement} purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).\n * @return {TrustedTypePolicy} The policy created (or null, if Trusted Types\n * are not supported or creating the policy failed).\n */\n const _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement) {\n if (typeof trustedTypes !== 'object' || typeof trustedTypes.createPolicy !== 'function') {\n return null;\n }\n\n // Allow the callers to control the unique policy name\n // by adding a data-tt-policy-suffix to the script element with the DOMPurify.\n // Policy creation with duplicate names throws in Trusted Types.\n let suffix = null;\n const ATTR_NAME = 'data-tt-policy-suffix';\n if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) {\n suffix = purifyHostElement.getAttribute(ATTR_NAME);\n }\n const policyName = 'dompurify' + (suffix ? '#' + suffix : '');\n try {\n return trustedTypes.createPolicy(policyName, {\n createHTML(html) {\n return html;\n },\n createScriptURL(scriptUrl) {\n return scriptUrl;\n }\n });\n } catch (_) {\n // Policy creation failed (most likely another DOMPurify script has\n // already run). Skip creating the policy, as this will only cause errors\n // if TT are enforced.\n console.warn('TrustedTypes policy ' + policyName + ' could not be created.');\n return null;\n }\n };\n function createDOMPurify() {\n let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();\n const DOMPurify = root => createDOMPurify(root);\n\n /**\n * Version label, exposed for easier checks\n * if DOMPurify is up to date or not\n */\n DOMPurify.version = '3.1.2';\n\n /**\n * Array of elements that DOMPurify removed during sanitation.\n * Empty if nothing was removed.\n */\n DOMPurify.removed = [];\n if (!window || !window.document || window.document.nodeType !== 9) {\n // Not running in a browser, provide a factory function\n // so that you can pass your own Window\n DOMPurify.isSupported = false;\n return DOMPurify;\n }\n let {\n document\n } = window;\n const originalDocument = document;\n const currentScript = originalDocument.currentScript;\n const {\n DocumentFragment,\n HTMLTemplateElement,\n Node,\n Element,\n NodeFilter,\n NamedNodeMap = window.NamedNodeMap || window.MozNamedAttrMap,\n HTMLFormElement,\n DOMParser,\n trustedTypes\n } = window;\n const ElementPrototype = Element.prototype;\n const cloneNode = lookupGetter(ElementPrototype, 'cloneNode');\n const getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');\n const getChildNodes = lookupGetter(ElementPrototype, 'childNodes');\n const getParentNode = lookupGetter(ElementPrototype, 'parentNode');\n\n // As per issue #47, the web-components registry is inherited by a\n // new document created via createHTMLDocument. As per the spec\n // (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)\n // a new empty registry is used when creating a template contents owner\n // document, so we use that as our parent document to ensure nothing\n // is inherited.\n if (typeof HTMLTemplateElement === 'function') {\n const template = document.createElement('template');\n if (template.content && template.content.ownerDocument) {\n document = template.content.ownerDocument;\n }\n }\n let trustedTypesPolicy;\n let emptyHTML = '';\n const {\n implementation,\n createNodeIterator,\n createDocumentFragment,\n getElementsByTagName\n } = document;\n const {\n importNode\n } = originalDocument;\n let hooks = {};\n\n /**\n * Expose whether this browser supports running the full DOMPurify.\n */\n DOMPurify.isSupported = typeof entries === 'function' && typeof getParentNode === 'function' && implementation && implementation.createHTMLDocument !== undefined;\n const {\n MUSTACHE_EXPR,\n ERB_EXPR,\n TMPLIT_EXPR,\n DATA_ATTR,\n ARIA_ATTR,\n IS_SCRIPT_OR_DATA,\n ATTR_WHITESPACE,\n CUSTOM_ELEMENT\n } = EXPRESSIONS;\n let {\n IS_ALLOWED_URI: IS_ALLOWED_URI$1\n } = EXPRESSIONS;\n\n /**\n * We consider the elements and attributes below to be safe. Ideally\n * don't add any new ones but feel free to remove unwanted ones.\n */\n\n /* allowed element names */\n let ALLOWED_TAGS = null;\n const DEFAULT_ALLOWED_TAGS = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text]);\n\n /* Allowed attribute names */\n let ALLOWED_ATTR = null;\n const DEFAULT_ALLOWED_ATTR = addToSet({}, [...html, ...svg, ...mathMl, ...xml]);\n\n /*\n * Configure how DOMPUrify should handle custom elements and their attributes as well as customized built-in elements.\n * @property {RegExp|Function|null} tagNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any custom elements)\n * @property {RegExp|Function|null} attributeNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any attributes not on the allow list)\n * @property {boolean} allowCustomizedBuiltInElements allow custom elements derived from built-ins if they pass CUSTOM_ELEMENT_HANDLING.tagNameCheck. Default: `false`.\n */\n let CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, {\n tagNameCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null\n },\n attributeNameCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null\n },\n allowCustomizedBuiltInElements: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: false\n }\n }));\n\n /* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */\n let FORBID_TAGS = null;\n\n /* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */\n let FORBID_ATTR = null;\n\n /* Decide if ARIA attributes are okay */\n let ALLOW_ARIA_ATTR = true;\n\n /* Decide if custom data attributes are okay */\n let ALLOW_DATA_ATTR = true;\n\n /* Decide if unknown protocols are okay */\n let ALLOW_UNKNOWN_PROTOCOLS = false;\n\n /* Decide if self-closing tags in attributes are allowed.\n * Usually removed due to a mXSS issue in jQuery 3.0 */\n let ALLOW_SELF_CLOSE_IN_ATTR = true;\n\n /* Output should be safe for common template engines.\n * This means, DOMPurify removes data attributes, mustaches and ERB\n */\n let SAFE_FOR_TEMPLATES = false;\n\n /* Output should be safe even for XML used within HTML and alike.\n * This means, DOMPurify removes comments when containing risky content.\n */\n let SAFE_FOR_XML = true;\n\n /* Decide if document with <html>... should be returned */\n let WHOLE_DOCUMENT = false;\n\n /* Track whether config is already set on this instance of DOMPurify. */\n let SET_CONFIG = false;\n\n /* Decide if all elements (e.g. style, script) must be children of\n * document.body. By default, browsers might move them to document.head */\n let FORCE_BODY = false;\n\n /* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html\n * string (or a TrustedHTML object if Trusted Types are supported).\n * If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead\n */\n let RETURN_DOM = false;\n\n /* Decide if a DOM `DocumentFragment` should be returned, instead of a html\n * string (or a TrustedHTML object if Trusted Types are supported) */\n let RETURN_DOM_FRAGMENT = false;\n\n /* Try to return a Trusted Type object instead of a string, return a string in\n * case Trusted Types are not supported */\n let RETURN_TRUSTED_TYPE = false;\n\n /* Output should be free from DOM clobbering attacks?\n * This sanitizes markups named with colliding, clobberable built-in DOM APIs.\n */\n let SANITIZE_DOM = true;\n\n /* Achieve full DOM Clobbering protection by isolating the namespace of named\n * properties and JS variables, mitigating attacks that abuse the HTML/DOM spec rules.\n *\n * HTML/DOM spec rules that enable DOM Clobbering:\n * - Named Access on Window (§7.3.3)\n * - DOM Tree Accessors (§3.1.5)\n * - Form Element Parent-Child Relations (§4.10.3)\n * - Iframe srcdoc / Nested WindowProxies (§4.8.5)\n * - HTMLCollection (§4.2.10.2)\n *\n * Namespace isolation is implemented by prefixing `id` and `name` attributes\n * with a constant string, i.e., `user-content-`\n */\n let SANITIZE_NAMED_PROPS = false;\n const SANITIZE_NAMED_PROPS_PREFIX = 'user-content-';\n\n /* Keep element content when removing element? */\n let KEEP_CONTENT = true;\n\n /* If a `Node` is passed to sanitize(), then performs sanitization in-place instead\n * of importing it into a new Document and returning a sanitized copy */\n let IN_PLACE = false;\n\n /* Allow usage of profiles like html, svg and mathMl */\n let USE_PROFILES = {};\n\n /* Tags to ignore content of when KEEP_CONTENT is true */\n let FORBID_CONTENTS = null;\n const DEFAULT_FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'noscript', 'plaintext', 'script', 'style', 'svg', 'template', 'thead', 'title', 'video', 'xmp']);\n\n /* Tags that are safe for data: URIs */\n let DATA_URI_TAGS = null;\n const DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']);\n\n /* Attributes safe for values like \"javascript:\" */\n let URI_SAFE_ATTRIBUTES = null;\n const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'role', 'summary', 'title', 'value', 'style', 'xmlns']);\n const MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\n const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\n const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\n /* Document namespace */\n let NAMESPACE = HTML_NAMESPACE;\n let IS_EMPTY_INPUT = false;\n\n /* Allowed XHTML+XML namespaces */\n let ALLOWED_NAMESPACES = null;\n const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);\n\n /* Parsing of strict XHTML documents */\n let PARSER_MEDIA_TYPE = null;\n const SUPPORTED_PARSER_MEDIA_TYPES = ['application/xhtml+xml', 'text/html'];\n const DEFAULT_PARSER_MEDIA_TYPE = 'text/html';\n let transformCaseFunc = null;\n\n /* Keep a reference to config to pass to hooks */\n let CONFIG = null;\n\n /* Specify the maximum element nesting depth to prevent mXSS */\n const MAX_NESTING_DEPTH = 255;\n\n /* Ideally, do not touch anything below this line */\n /* ______________________________________________ */\n\n const formElement = document.createElement('form');\n const isRegexOrFunction = function isRegexOrFunction(testValue) {\n return testValue instanceof RegExp || testValue instanceof Function;\n };\n\n /**\n * _parseConfig\n *\n * @param {Object} cfg optional config literal\n */\n // eslint-disable-next-line complexity\n const _parseConfig = function _parseConfig() {\n let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n if (CONFIG && CONFIG === cfg) {\n return;\n }\n\n /* Shield configuration object from tampering */\n if (!cfg || typeof cfg !== 'object') {\n cfg = {};\n }\n\n /* Shield configuration object from prototype pollution */\n cfg = clone(cfg);\n PARSER_MEDIA_TYPE =\n // eslint-disable-next-line unicorn/prefer-includes\n SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;\n\n // HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is.\n transformCaseFunc = PARSER_MEDIA_TYPE === 'application/xhtml+xml' ? stringToString : stringToLowerCase;\n\n /* Set configuration parameters */\n ALLOWED_TAGS = objectHasOwnProperty(cfg, 'ALLOWED_TAGS') ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS;\n ALLOWED_ATTR = objectHasOwnProperty(cfg, 'ALLOWED_ATTR') ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR;\n ALLOWED_NAMESPACES = objectHasOwnProperty(cfg, 'ALLOWED_NAMESPACES') ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES;\n URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, 'ADD_URI_SAFE_ATTR') ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES),\n // eslint-disable-line indent\n cfg.ADD_URI_SAFE_ATTR,\n // eslint-disable-line indent\n transformCaseFunc // eslint-disable-line indent\n ) // eslint-disable-line indent\n : DEFAULT_URI_SAFE_ATTRIBUTES;\n DATA_URI_TAGS = objectHasOwnProperty(cfg, 'ADD_DATA_URI_TAGS') ? addToSet(clone(DEFAULT_DATA_URI_TAGS),\n // eslint-disable-line indent\n cfg.ADD_DATA_URI_TAGS,\n // eslint-disable-line indent\n transformCaseFunc // eslint-disable-line indent\n ) // eslint-disable-line indent\n : DEFAULT_DATA_URI_TAGS;\n FORBID_CONTENTS = objectHasOwnProperty(cfg, 'FORBID_CONTENTS') ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS;\n FORBID_TAGS = objectHasOwnProperty(cfg, 'FORBID_TAGS') ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : {};\n FORBID_ATTR = objectHasOwnProperty(cfg, 'FORBID_ATTR') ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : {};\n USE_PROFILES = objectHasOwnProperty(cfg, 'USE_PROFILES') ? cfg.USE_PROFILES : false;\n ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true\n ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true\n ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false\n ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; // Default true\n SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false\n SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false; // Default true\n WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false\n RETURN_DOM = cfg.RETURN_DOM || false; // Default false\n RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false\n RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false\n FORCE_BODY = cfg.FORCE_BODY || false; // Default false\n SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true\n SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; // Default false\n KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true\n IN_PLACE = cfg.IN_PLACE || false; // Default false\n IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI;\n NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;\n CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {};\n if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) {\n CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;\n }\n if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)) {\n CUSTOM_ELEMENT_HANDLING.attributeNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck;\n }\n if (cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements === 'boolean') {\n CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements;\n }\n if (SAFE_FOR_TEMPLATES) {\n ALLOW_DATA_ATTR = false;\n }\n if (RETURN_DOM_FRAGMENT) {\n RETURN_DOM = true;\n }\n\n /* Parse profile info */\n if (USE_PROFILES) {\n ALLOWED_TAGS = addToSet({}, text);\n ALLOWED_ATTR = [];\n if (USE_PROFILES.html === true) {\n addToSet(ALLOWED_TAGS, html$1);\n addToSet(ALLOWED_ATTR, html);\n }\n if (USE_PROFILES.svg === true) {\n addToSet(ALLOWED_TAGS, svg$1);\n addToSet(ALLOWED_ATTR, svg);\n addToSet(ALLOWED_ATTR, xml);\n }\n if (USE_PROFILES.svgFilters === true) {\n addToSet(ALLOWED_TAGS, svgFilters);\n addToSet(ALLOWED_ATTR, svg);\n addToSet(ALLOWED_ATTR, xml);\n }\n if (USE_PROFILES.mathMl === true) {\n addToSet(ALLOWED_TAGS, mathMl$1);\n addToSet(ALLOWED_ATTR, mathMl);\n addToSet(ALLOWED_ATTR, xml);\n }\n }\n\n /* Merge configuration parameters */\n if (cfg.ADD_TAGS) {\n if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {\n ALLOWED_TAGS = clone(ALLOWED_TAGS);\n }\n addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);\n }\n if (cfg.ADD_ATTR) {\n if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {\n ALLOWED_ATTR = clone(ALLOWED_ATTR);\n }\n addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);\n }\n if (cfg.ADD_URI_SAFE_ATTR) {\n addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);\n }\n if (cfg.FORBID_CONTENTS) {\n if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {\n FORBID_CONTENTS = clone(FORBID_CONTENTS);\n }\n addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);\n }\n\n /* Add #text in case KEEP_CONTENT is set to true */\n if (KEEP_CONTENT) {\n ALLOWED_TAGS['#text'] = true;\n }\n\n /* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */\n if (WHOLE_DOCUMENT) {\n addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);\n }\n\n /* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */\n if (ALLOWED_TAGS.table) {\n addToSet(ALLOWED_TAGS, ['tbody']);\n delete FORBID_TAGS.tbody;\n }\n if (cfg.TRUSTED_TYPES_POLICY) {\n if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== 'function') {\n throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.');\n }\n if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== 'function') {\n throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.');\n }\n\n // Overwrite existing TrustedTypes policy.\n trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;\n\n // Sign local variables required by `sanitize`.\n emptyHTML = trustedTypesPolicy.createHTML('');\n } else {\n // Uninitialized policy, attempt to initialize the internal dompurify policy.\n if (trustedTypesPolicy === undefined) {\n trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);\n }\n\n // If creating the internal policy succeeded sign internal variables.\n if (trustedTypesPolicy !== null && typeof emptyHTML === 'string') {\n emptyHTML = trustedTypesPolicy.createHTML('');\n }\n }\n\n // Prevent further manipulation of configuration.\n // Not available in IE8, Safari 5, etc.\n if (freeze) {\n freeze(cfg);\n }\n CONFIG = cfg;\n };\n const MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']);\n const HTML_INTEGRATION_POINTS = addToSet({}, ['foreignobject', 'annotation-xml']);\n\n // Certain elements are allowed in both SVG and HTML\n // namespace. We need to specify them explicitly\n // so that they don't get erroneously deleted from\n // HTML namespace.\n const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ['title', 'style', 'font', 'a', 'script']);\n\n /* Keep track of all possible SVG and MathML tags\n * so that we can perform the namespace checks\n * correctly. */\n const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]);\n const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);\n\n /**\n * @param {Element} element a DOM element whose namespace is being checked\n * @returns {boolean} Return false if the element has a\n * namespace that a spec-compliant parser would never\n * return. Return true otherwise.\n */\n const _checkValidNamespace = function _checkValidNamespace(element) {\n let parent = getParentNode(element);\n\n // In JSDOM, if we're inside shadow DOM, then parentNode\n // can be null. We just simulate parent in this case.\n if (!parent || !parent.tagName) {\n parent = {\n namespaceURI: NAMESPACE,\n tagName: 'template'\n };\n }\n const tagName = stringToLowerCase(element.tagName);\n const parentTagName = stringToLowerCase(parent.tagName);\n if (!ALLOWED_NAMESPACES[element.namespaceURI]) {\n return false;\n }\n if (element.namespaceURI === SVG_NAMESPACE) {\n // The only way to switch from HTML namespace to SVG\n // is via <svg>. If it happens via any other tag, then\n // it should be killed.\n if (parent.namespaceURI === HTML_NAMESPACE) {\n return tagName === 'svg';\n }\n\n // The only way to switch from MathML to SVG is via`\n // svg if parent is either <annotation-xml> or MathML\n // text integration points.\n if (parent.namespaceURI === MATHML_NAMESPACE) {\n return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);\n }\n\n // We only allow elements that are defined in SVG\n // spec. All others are disallowed in SVG namespace.\n return Boolean(ALL_SVG_TAGS[tagName]);\n }\n if (element.namespaceURI === MATHML_NAMESPACE) {\n // The only way to switch from HTML namespace to MathML\n // is via <math>. If it happens via any other tag, then\n // it should be killed.\n if (parent.namespaceURI === HTML_NAMESPACE) {\n return tagName === 'math';\n }\n\n // The only way to switch from SVG to MathML is via\n // <math> and HTML integration points\n if (parent.namespaceURI === SVG_NAMESPACE) {\n return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];\n }\n\n // We only allow elements that are defined in MathML\n // spec. All others are disallowed in MathML namespace.\n return Boolean(ALL_MATHML_TAGS[tagName]);\n }\n if (element.namespaceURI === HTML_NAMESPACE) {\n // The only way to switch from SVG to HTML is via\n // HTML integration points, and from MathML to HTML\n // is via MathML text integration points\n if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {\n return false;\n }\n if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {\n return false;\n }\n\n // We disallow tags that are specific for MathML\n // or SVG and should never appear in HTML namespace\n return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);\n }\n\n // For XHTML and XML documents that support custom namespaces\n if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && ALLOWED_NAMESPACES[element.namespaceURI]) {\n return true;\n }\n\n // The code should never reach this place (this means\n // that the element somehow got namespace that is not\n // HTML, SVG, MathML or allowed via ALLOWED_NAMESPACES).\n // Return false just in case.\n return false;\n };\n\n /**\n * _forceRemove\n *\n * @param {Node} node a DOM node\n */\n const _forceRemove = function _forceRemove(node) {\n arrayPush(DOMPurify.removed, {\n element: node\n });\n try {\n // eslint-disable-next-line unicorn/prefer-dom-node-remove\n node.parentNode.removeChild(node);\n } catch (_) {\n node.remove();\n }\n };\n\n /**\n * _removeAttribute\n *\n * @param {String} name an Attribute name\n * @param {Node} node a DOM node\n */\n const _removeAttribute = function _removeAttribute(name, node) {\n try {\n arrayPush(DOMPurify.removed, {\n attribute: node.getAttributeNode(name),\n from: node\n });\n } catch (_) {\n arrayPush(DOMPurify.removed, {\n attribute: null,\n from: node\n });\n }\n node.removeAttribute(name);\n\n // We void attribute values for unremovable \"is\"\" attributes\n if (name === 'is' && !ALLOWED_ATTR[name]) {\n if (RETURN_DOM || RETURN_DOM_FRAGMENT) {\n try {\n _forceRemove(node);\n } catch (_) {}\n } else {\n try {\n node.setAttribute(name, '');\n } catch (_) {}\n }\n }\n };\n\n /**\n * _initDocument\n *\n * @param {String} dirty a string of dirty markup\n * @return {Document} a DOM, filled with the dirty markup\n */\n const _initDocument = function _initDocument(dirty) {\n /* Create a HTML document */\n let doc = null;\n let leadingWhitespace = null;\n if (FORCE_BODY) {\n dirty = '<remove></remove>' + dirty;\n } else {\n /* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */\n const matches = stringMatch(dirty, /^[\\r\\n\\t ]+/);\n leadingWhitespace = matches && matches[0];\n }\n if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && NAMESPACE === HTML_NAMESPACE) {\n // Root of XHTML doc must contain xmlns declaration (see https://www.w3.org/TR/xhtml1/normative.html#strict)\n dirty = '<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>' + dirty + '</body></html>';\n }\n const dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty;\n /*\n * Use the DOMParser API by default, fallback later if needs be\n * DOMParser not work for svg when has multiple root element.\n */\n if (NAMESPACE === HTML_NAMESPACE) {\n try {\n doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);\n } catch (_) {}\n }\n\n /* Use createHTMLDocument in case DOMParser is not available */\n if (!doc || !doc.documentElement) {\n doc = implementation.createDocument(NAMESPACE, 'template', null);\n try {\n doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;\n } catch (_) {\n // Syntax error if dirtyPayload is invalid xml\n }\n }\n const body = doc.body || doc.documentElement;\n if (dirty && leadingWhitespace) {\n body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);\n }\n\n /* Work on whole document or just its body */\n if (NAMESPACE === HTML_NAMESPACE) {\n return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? 'html' : 'body')[0];\n }\n return WHOLE_DOCUMENT ? doc.documentElement : body;\n };\n\n /**\n * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.\n *\n * @param {Node} root The root element or node to start traversing on.\n * @return {NodeIterator} The created NodeIterator\n */\n const _createNodeIterator = function _createNodeIterator(root) {\n return createNodeIterator.call(root.ownerDocument || root, root,\n // eslint-disable-next-line no-bitwise\n NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, null);\n };\n\n /**\n * _isClobbered\n *\n * @param {Node} elm element to check for clobbering attacks\n * @return {Boolean} true if clobbered, false if safe\n */\n const _isClobbered = function _isClobbered(elm) {\n return elm instanceof HTMLFormElement && (\n // eslint-disable-next-line unicorn/no-typeof-undefined\n typeof elm.__depth !== 'undefined' && typeof elm.__depth !== 'number' ||\n // eslint-disable-next-line unicorn/no-typeof-undefined\n typeof elm.__removalCount !== 'undefined' && typeof elm.__removalCount !== 'number' || typeof elm.nodeName !== 'string' || typeof elm.textContent !== 'string' || typeof elm.removeChild !== 'function' || !(elm.attributes instanceof NamedNodeMap) || typeof elm.removeAttribute !== 'function' || typeof elm.setAttribute !== 'function' || typeof elm.namespaceURI !== 'string' || typeof elm.insertBefore !== 'function' || typeof elm.hasChildNodes !== 'function');\n };\n\n /**\n * Checks whether the given object is a DOM node.\n *\n * @param {Node} object object to check whether it's a DOM node\n * @return {Boolean} true is object is a DOM node\n */\n const _isNode = function _isNode(object) {\n return typeof Node === 'function' && object instanceof Node;\n };\n\n /**\n * _executeHook\n * Execute user configurable hooks\n *\n * @param {String} entryPoint Name of the hook's entry point\n * @param {Node} currentNode node to work on with the hook\n * @param {Object} data additional hook parameters\n */\n const _executeHook = function _executeHook(entryPoint, currentNode, data) {\n if (!hooks[entryPoint]) {\n return;\n }\n arrayForEach(hooks[entryPoint], hook => {\n hook.call(DOMPurify, currentNode, data, CONFIG);\n });\n };\n\n /**\n * _sanitizeElements\n *\n * @protect nodeName\n * @protect textContent\n * @protect removeChild\n *\n * @param {Node} currentNode to check for permission to exist\n * @return {Boolean} true if node was killed, false if left alive\n */\n const _sanitizeElements = function _sanitizeElements(currentNode) {\n let content = null;\n\n /* Execute a hook if present */\n _executeHook('beforeSanitizeElements', currentNode, null);\n\n /* Check if element is clobbered or can clobber */\n if (_isClobbered(currentNode)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Now let's check the element's type and name */\n const tagName = transformCaseFunc(currentNode.nodeName);\n\n /* Execute a hook if present */\n _executeHook('uponSanitizeElement', currentNode, {\n tagName,\n allowedTags: ALLOWED_TAGS\n });\n\n /* Detect mXSS attempts abusing namespace confusion */\n if (currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\\w]/g, currentNode.innerHTML) && regExpTest(/<[/\\w]/g, currentNode.textContent)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Remove any ocurrence of processing instructions */\n if (currentNode.nodeType === 7) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Remove any kind of possibly harmful comments */\n if (SAFE_FOR_XML && currentNode.nodeType === 8 && regExpTest(/<[/\\w]/g, currentNode.data)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Remove element if anything forbids its presence */\n if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n /* Check if we have a custom element to handle */\n if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {\n if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) {\n return false;\n }\n if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) {\n return false;\n }\n }\n\n /* Keep content except for bad-listed elements */\n if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {\n const parentNode = getParentNode(currentNode) || currentNode.parentNode;\n const childNodes = getChildNodes(currentNode) || currentNode.childNodes;\n if (childNodes && parentNode) {\n const childCount = childNodes.length;\n for (let i = childCount - 1; i >= 0; --i) {\n const childClone = cloneNode(childNodes[i], true);\n childClone.__removalCount = (currentNode.__removalCount || 0) + 1;\n parentNode.insertBefore(childClone, getNextSibling(currentNode));\n }\n }\n }\n _forceRemove(currentNode);\n return true;\n }\n\n /* Check whether element has a valid namespace */\n if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Make sure that older browsers don't get fallback-tag mXSS */\n if ((tagName === 'noscript' || tagName === 'noembed' || tagName === 'noframes') && regExpTest(/<\\/no(script|embed|frames)/i, currentNode.innerHTML)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Sanitize element content to be template-safe */\n if (SAFE_FOR_TEMPLATES && currentNode.nodeType === 3) {\n /* Get the element's text content */\n content = currentNode.textContent;\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {\n content = stringReplace(content, expr, ' ');\n });\n if (currentNode.textContent !== content) {\n arrayPush(DOMPurify.removed, {\n element: currentNode.cloneNode()\n });\n currentNode.textContent = content;\n }\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeElements', currentNode, null);\n return false;\n };\n\n /**\n * _isValidAttribute\n *\n * @param {string} lcTag Lowercase tag name of containing element.\n * @param {string} lcName Lowercase attribute name.\n * @param {string} value Attribute value.\n * @return {Boolean} Returns true if `value` is valid, otherwise false.\n */\n // eslint-disable-next-line complexity\n const _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {\n /* Make sure attribute cannot clobber */\n if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) {\n return false;\n }\n\n /* Allow valid data-* attributes: At least one character after \"-\"\n (https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)\n XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)\n We don't need to check the value; it's always URI safe. */\n if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName)) ; else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {\n if (\n // First condition does a very basic check if a) it's basically a valid custom element tagname AND\n // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck\n // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck\n _isBasicCustomElement(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName)) ||\n // Alternative, second condition checks if it's an `is`-attribute, AND\n // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck\n lcName === 'is' && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value))) ; else {\n return false;\n }\n /* Check value is safe. First, is attr inert? If so, is safe */\n } else if (URI_SAFE_ATTRIBUTES[lcName]) ; else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if ((lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') && lcTag !== 'script' && stringIndexOf(value, 'data:') === 0 && DATA_URI_TAGS[lcTag]) ; else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if (value) {\n return false;\n } else ;\n return true;\n };\n\n /**\n * _isBasicCustomElement\n * checks if at least one dash is included in tagName, and it's not the first char\n * for more sophisticated checking see https://github.com/sindresorhus/validate-element-name\n *\n * @param {string} tagName name of the tag of the node to sanitize\n * @returns {boolean} Returns true if the tag name meets the basic criteria for a custom element, otherwise false.\n */\n const _isBasicCustomElement = function _isBasicCustomElement(tagName) {\n return tagName !== 'annotation-xml' && stringMatch(tagName, CUSTOM_ELEMENT);\n };\n\n /**\n * _sanitizeAttributes\n *\n * @protect attributes\n * @protect nodeName\n * @protect removeAttribute\n * @protect setAttribute\n *\n * @param {Node} currentNode to sanitize\n */\n const _sanitizeAttributes = function _sanitizeAttributes(currentNode) {\n /* Execute a hook if present */\n _executeHook('beforeSanitizeAttributes', currentNode, null);\n const {\n attributes\n } = currentNode;\n\n /* Check if we have attributes; if not we might have a text node */\n if (!attributes) {\n return;\n }\n const hookEvent = {\n attrName: '',\n attrValue: '',\n keepAttr: true,\n allowedAttributes: ALLOWED_ATTR\n };\n let l = attributes.length;\n\n /* Go backwards over all attributes; safely remove bad ones */\n while (l--) {\n const attr = attributes[l];\n const {\n name,\n namespaceURI,\n value: attrValue\n } = attr;\n const lcName = transformCaseFunc(name);\n let value = name === 'value' ? attrValue : stringTrim(attrValue);\n\n /* Execute a hook if present */\n hookEvent.attrName = lcName;\n hookEvent.attrValue = value;\n hookEvent.keepAttr = true;\n hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set\n _executeHook('uponSanitizeAttribute', currentNode, hookEvent);\n value = hookEvent.attrValue;\n /* Did the hooks approve of the attribute? */\n if (hookEvent.forceKeepAttr) {\n continue;\n }\n\n /* Remove attribute */\n _removeAttribute(name, currentNode);\n\n /* Did the hooks approve of the attribute? */\n if (!hookEvent.keepAttr) {\n continue;\n }\n\n /* Work around a security issue in jQuery 3.0 */\n if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\\/>/i, value)) {\n _removeAttribute(name, currentNode);\n continue;\n }\n\n /* Sanitize attribute content to be template-safe */\n if (SAFE_FOR_TEMPLATES) {\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {\n value = stringReplace(value, expr, ' ');\n });\n }\n\n /* Is `value` valid for this attribute? */\n const lcTag = transformCaseFunc(currentNode.nodeName);\n if (!_isValidAttribute(lcTag, lcName, value)) {\n continue;\n }\n\n /* Full DOM Clobbering protection via namespace isolation,\n * Prefix id and name attributes with `user-content-`\n */\n if (SANITIZE_NAMED_PROPS && (lcName === 'id' || lcName === 'name')) {\n // Remove the attribute with this value\n _removeAttribute(name, currentNode);\n\n // Prefix the value and later re-create the attribute with the sanitized value\n value = SANITIZE_NAMED_PROPS_PREFIX + value;\n }\n\n /* Handle attributes that require Trusted Types */\n if (trustedTypesPolicy && typeof trustedTypes === 'object' && typeof trustedTypes.getAttributeType === 'function') {\n if (namespaceURI) ; else {\n switch (trustedTypes.getAttributeType(lcTag, lcName)) {\n case 'TrustedHTML':\n {\n value = trustedTypesPolicy.createHTML(value);\n break;\n }\n case 'TrustedScriptURL':\n {\n value = trustedTypesPolicy.createScriptURL(value);\n break;\n }\n }\n }\n }\n\n /* Handle invalid data-* attribute set by try-catching it */\n try {\n if (namespaceURI) {\n currentNode.setAttributeNS(namespaceURI, name, value);\n } else {\n /* Fallback to setAttribute() for browser-unrecognized namespaces e.g. \"x-schema\". */\n currentNode.setAttribute(name, value);\n }\n arrayPop(DOMPurify.removed);\n } catch (_) {}\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeAttributes', currentNode, null);\n };\n\n /**\n * _sanitizeShadowDOM\n *\n * @param {DocumentFragment} fragment to iterate over recursively\n */\n const _sanitizeShadowDOM = function _sanitizeShadowDOM(fragment) {\n let shadowNode = null;\n const shadowIterator = _createNodeIterator(fragment);\n\n /* Execute a hook if present */\n _executeHook('beforeSanitizeShadowDOM', fragment, null);\n while (shadowNode = shadowIterator.nextNode()) {\n /* Execute a hook if present */\n _executeHook('uponSanitizeShadowNode', shadowNode, null);\n\n /* Sanitize tags and elements */\n if (_sanitizeElements(shadowNode)) {\n continue;\n }\n const parentNode = getParentNode(shadowNode);\n\n /* Set the nesting depth of an element */\n if (shadowNode.nodeType === 1) {\n if (parentNode && parentNode.__depth) {\n /*\n We want the depth of the node in the original tree, which can\n change when it's removed from its parent.\n */\n shadowNode.__depth = (shadowNode.__removalCount || 0) + parentNode.__depth + 1;\n } else {\n shadowNode.__depth = 1;\n }\n }\n\n /* Remove an element if nested too deeply to avoid mXSS */\n if (shadowNode.__depth >= MAX_NESTING_DEPTH) {\n _forceRemove(shadowNode);\n }\n\n /* Deep shadow DOM detected */\n if (shadowNode.content instanceof DocumentFragment) {\n shadowNode.content.__depth = shadowNode.__depth;\n _sanitizeShadowDOM(shadowNode.content);\n }\n\n /* Check attributes, sanitize if necessary */\n _sanitizeAttributes(shadowNode);\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeShadowDOM', fragment, null);\n };\n\n /**\n * Sanitize\n * Public method providing core sanitation functionality\n *\n * @param {String|Node} dirty string or DOM node\n * @param {Object} cfg object\n */\n // eslint-disable-next-line complexity\n DOMPurify.sanitize = function (dirty) {\n let cfg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n let body = null;\n let importedNode = null;\n let currentNode = null;\n let returnNode = null;\n /* Make sure we have a string to sanitize.\n DO NOT return early, as this will return the wrong type if\n the user has requested a DOM object rather than a string */\n IS_EMPTY_INPUT = !dirty;\n if (IS_EMPTY_INPUT) {\n dirty = '<!-->';\n }\n\n /* Stringify, in case dirty is an object */\n if (typeof dirty !== 'string' && !_isNode(dirty)) {\n if (typeof dirty.toString === 'function') {\n dirty = dirty.toString();\n if (typeof dirty !== 'string') {\n throw typeErrorCreate('dirty is not a string, aborting');\n }\n } else {\n throw typeErrorCreate('toString is not a function');\n }\n }\n\n /* Return dirty HTML if DOMPurify cannot run */\n if (!DOMPurify.isSupported) {\n return dirty;\n }\n\n /* Assign config vars */\n if (!SET_CONFIG) {\n _parseConfig(cfg);\n }\n\n /* Clean up removed elements */\n DOMPurify.removed = [];\n\n /* Check if dirty is correctly typed for IN_PLACE */\n if (typeof dirty === 'string') {\n IN_PLACE = false;\n }\n if (IN_PLACE) {\n /* Do some early pre-sanitization to avoid unsafe root nodes */\n if (dirty.nodeName) {\n const tagName = transformCaseFunc(dirty.nodeName);\n if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n throw typeErrorCreate('root node is forbidden and cannot be sanitized in-place');\n }\n }\n } else if (dirty instanceof Node) {\n /* If dirty is a DOM element, append to an empty document to avoid\n elements being stripped by the parser */\n body = _initDocument('<!---->');\n importedNode = body.ownerDocument.importNode(dirty, true);\n if (importedNode.nodeType === 1 && importedNode.nodeName === 'BODY') {\n /* Node is already a body, use as is */\n body = importedNode;\n } else if (importedNode.nodeName === 'HTML') {\n body = importedNode;\n } else {\n // eslint-disable-next-line unicorn/prefer-dom-node-append\n body.appendChild(importedNode);\n }\n } else {\n /* Exit directly if we have nothing to do */\n if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT &&\n // eslint-disable-next-line unicorn/prefer-includes\n dirty.indexOf('<') === -1) {\n return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty;\n }\n\n /* Initialize the document to work on */\n body = _initDocument(dirty);\n\n /* Check we have a DOM node from the data */\n if (!body) {\n return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : '';\n }\n }\n\n /* Remove first element node (ours) if FORCE_BODY is set */\n if (body && FORCE_BODY) {\n _forceRemove(body.firstChild);\n }\n\n /* Get node iterator */\n const nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body);\n\n /* Now start iterating over the created document */\n while (currentNode = nodeIterator.nextNode()) {\n /* Sanitize tags and elements */\n if (_sanitizeElements(currentNode)) {\n continue;\n }\n const parentNode = getParentNode(currentNode);\n\n /* Set the nesting depth of an element */\n if (currentNode.nodeType === 1) {\n if (parentNode && parentNode.__depth) {\n /*\n We want the depth of the node in the original tree, which can\n change when it's removed from its parent.\n */\n currentNode.__depth = (currentNode.__removalCount || 0) + parentNode.__depth + 1;\n } else {\n currentNode.__depth = 1;\n }\n }\n\n /* Remove an element if nested too deeply to avoid mXSS */\n if (currentNode.__depth >= MAX_NESTING_DEPTH) {\n _forceRemove(currentNode);\n }\n\n /* Shadow DOM detected, sanitize it */\n if (currentNode.content instanceof DocumentFragment) {\n currentNode.content.__depth = currentNode.__depth;\n _sanitizeShadowDOM(currentNode.content);\n }\n\n /* Check attributes, sanitize if necessary */\n _sanitizeAttributes(currentNode);\n }\n\n /* If we sanitized `dirty` in-place, return it. */\n if (IN_PLACE) {\n return dirty;\n }\n\n /* Return sanitized string or DOM */\n if (RETURN_DOM) {\n if (RETURN_DOM_FRAGMENT) {\n returnNode = createDocumentFragment.call(body.ownerDocument);\n while (body.firstChild) {\n // eslint-disable-next-line unicorn/prefer-dom-node-append\n returnNode.appendChild(body.firstChild);\n }\n } else {\n returnNode = body;\n }\n if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) {\n /*\n AdoptNode() is not used because internal state is not reset\n (e.g. the past names map of a HTMLFormElement), this is safe\n in theory but we would rather not risk another attack vector.\n The state that is cloned by importNode() is explicitly defined\n by the specs.\n */\n returnNode = importNode.call(originalDocument, returnNode, true);\n }\n return returnNode;\n }\n let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;\n\n /* Serialize doctype if allowed */\n if (WHOLE_DOCUMENT && ALLOWED_TAGS['!doctype'] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) {\n serializedHTML = '<!DOCTYPE ' + body.ownerDocument.doctype.name + '>\\n' + serializedHTML;\n }\n\n /* Sanitize final string template-safe */\n if (SAFE_FOR_TEMPLATES) {\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {\n serializedHTML = stringReplace(serializedHTML, expr, ' ');\n });\n }\n return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML;\n };\n\n /**\n * Public method to set the configuration once\n * setConfig\n *\n * @param {Object} cfg configuration object\n */\n DOMPurify.setConfig = function () {\n let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _parseConfig(cfg);\n SET_CONFIG = true;\n };\n\n /**\n * Public method to remove the configuration\n * clearConfig\n *\n */\n DOMPurify.clearConfig = function () {\n CONFIG = null;\n SET_CONFIG = false;\n };\n\n /**\n * Public method to check if an attribute value is valid.\n * Uses last set config, if any. Otherwise, uses config defaults.\n * isValidAttribute\n *\n * @param {String} tag Tag name of containing element.\n * @param {String} attr Attribute name.\n * @param {String} value Attribute value.\n * @return {Boolean} Returns true if `value` is valid. Otherwise, returns false.\n */\n DOMPurify.isValidAttribute = function (tag, attr, value) {\n /* Initialize shared config vars if necessary. */\n if (!CONFIG) {\n _parseConfig({});\n }\n const lcTag = transformCaseFunc(tag);\n const lcName = transformCaseFunc(attr);\n return _isValidAttribute(lcTag, lcName, value);\n };\n\n /**\n * AddHook\n * Public method to add DOMPurify hooks\n *\n * @param {String} entryPoint entry point for the hook to add\n * @param {Function} hookFunction function to execute\n */\n DOMPurify.addHook = function (entryPoint, hookFunction) {\n if (typeof hookFunction !== 'function') {\n return;\n }\n hooks[entryPoint] = hooks[entryPoint] || [];\n arrayPush(hooks[entryPoint], hookFunction);\n };\n\n /**\n * RemoveHook\n * Public method to remove a DOMPurify hook at a given entryPoint\n * (pops it from the stack of hooks if more are present)\n *\n * @param {String} entryPoint entry point for the hook to remove\n * @return {Function} removed(popped) hook\n */\n DOMPurify.removeHook = function (entryPoint) {\n if (hooks[entryPoint]) {\n return arrayPop(hooks[entryPoint]);\n }\n };\n\n /**\n * RemoveHooks\n * Public method to remove all DOMPurify hooks at a given entryPoint\n *\n * @param {String} entryPoint entry point for the hooks to remove\n */\n DOMPurify.removeHooks = function (entryPoint) {\n if (hooks[entryPoint]) {\n hooks[entryPoint] = [];\n }\n };\n\n /**\n * RemoveAllHooks\n * Public method to remove all DOMPurify hooks\n */\n DOMPurify.removeAllHooks = function () {\n hooks = {};\n };\n return DOMPurify;\n }\n var purify = createDOMPurify();\n\n return purify;\n\n}));\n//# sourceMappingURL=purify.js.map\n\n\n//# sourceURL=webpack://Formio/./node_modules/dompurify/dist/purify.js?");
|
1716
|
+
eval("/*! @license DOMPurify 3.1.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.3/LICENSE */\n\n(function (global, factory) {\n true ? module.exports = factory() :\n 0;\n})(this, (function () { 'use strict';\n\n const {\n entries,\n setPrototypeOf,\n isFrozen,\n getPrototypeOf,\n getOwnPropertyDescriptor\n } = Object;\n let {\n freeze,\n seal,\n create\n } = Object; // eslint-disable-line import/no-mutable-exports\n let {\n apply,\n construct\n } = typeof Reflect !== 'undefined' && Reflect;\n if (!freeze) {\n freeze = function freeze(x) {\n return x;\n };\n }\n if (!seal) {\n seal = function seal(x) {\n return x;\n };\n }\n if (!apply) {\n apply = function apply(fun, thisValue, args) {\n return fun.apply(thisValue, args);\n };\n }\n if (!construct) {\n construct = function construct(Func, args) {\n return new Func(...args);\n };\n }\n const arrayForEach = unapply(Array.prototype.forEach);\n const arrayPop = unapply(Array.prototype.pop);\n const arrayPush = unapply(Array.prototype.push);\n const stringToLowerCase = unapply(String.prototype.toLowerCase);\n const stringToString = unapply(String.prototype.toString);\n const stringMatch = unapply(String.prototype.match);\n const stringReplace = unapply(String.prototype.replace);\n const stringIndexOf = unapply(String.prototype.indexOf);\n const stringTrim = unapply(String.prototype.trim);\n const objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);\n const regExpTest = unapply(RegExp.prototype.test);\n const typeErrorCreate = unconstruct(TypeError);\n const numberIsNaN = unapply(Number.isNaN);\n\n /**\n * Creates a new function that calls the given function with a specified thisArg and arguments.\n *\n * @param {Function} func - The function to be wrapped and called.\n * @returns {Function} A new function that calls the given function with a specified thisArg and arguments.\n */\n function unapply(func) {\n return function (thisArg) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n return apply(func, thisArg, args);\n };\n }\n\n /**\n * Creates a new function that constructs an instance of the given constructor function with the provided arguments.\n *\n * @param {Function} func - The constructor function to be wrapped and called.\n * @returns {Function} A new function that constructs an instance of the given constructor function with the provided arguments.\n */\n function unconstruct(func) {\n return function () {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n return construct(func, args);\n };\n }\n\n /**\n * Add properties to a lookup table\n *\n * @param {Object} set - The set to which elements will be added.\n * @param {Array} array - The array containing elements to be added to the set.\n * @param {Function} transformCaseFunc - An optional function to transform the case of each element before adding to the set.\n * @returns {Object} The modified set with added elements.\n */\n function addToSet(set, array) {\n let transformCaseFunc = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : stringToLowerCase;\n if (setPrototypeOf) {\n // Make 'in' and truthy checks like Boolean(set.constructor)\n // independent of any properties defined on Object.prototype.\n // Prevent prototype setters from intercepting set as a this value.\n setPrototypeOf(set, null);\n }\n let l = array.length;\n while (l--) {\n let element = array[l];\n if (typeof element === 'string') {\n const lcElement = transformCaseFunc(element);\n if (lcElement !== element) {\n // Config presets (e.g. tags.js, attrs.js) are immutable.\n if (!isFrozen(array)) {\n array[l] = lcElement;\n }\n element = lcElement;\n }\n }\n set[element] = true;\n }\n return set;\n }\n\n /**\n * Clean up an array to harden against CSPP\n *\n * @param {Array} array - The array to be cleaned.\n * @returns {Array} The cleaned version of the array\n */\n function cleanArray(array) {\n for (let index = 0; index < array.length; index++) {\n const isPropertyExist = objectHasOwnProperty(array, index);\n if (!isPropertyExist) {\n array[index] = null;\n }\n }\n return array;\n }\n\n /**\n * Shallow clone an object\n *\n * @param {Object} object - The object to be cloned.\n * @returns {Object} A new object that copies the original.\n */\n function clone(object) {\n const newObject = create(null);\n for (const [property, value] of entries(object)) {\n const isPropertyExist = objectHasOwnProperty(object, property);\n if (isPropertyExist) {\n if (Array.isArray(value)) {\n newObject[property] = cleanArray(value);\n } else if (value && typeof value === 'object' && value.constructor === Object) {\n newObject[property] = clone(value);\n } else {\n newObject[property] = value;\n }\n }\n }\n return newObject;\n }\n\n /**\n * This method automatically checks if the prop is function or getter and behaves accordingly.\n *\n * @param {Object} object - The object to look up the getter function in its prototype chain.\n * @param {String} prop - The property name for which to find the getter function.\n * @returns {Function} The getter function found in the prototype chain or a fallback function.\n */\n function lookupGetter(object, prop) {\n while (object !== null) {\n const desc = getOwnPropertyDescriptor(object, prop);\n if (desc) {\n if (desc.get) {\n return unapply(desc.get);\n }\n if (typeof desc.value === 'function') {\n return unapply(desc.value);\n }\n }\n object = getPrototypeOf(object);\n }\n function fallbackValue() {\n return null;\n }\n return fallbackValue;\n }\n\n const html$1 = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'section', 'select', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']);\n\n // SVG\n const svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']);\n const svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feDropShadow', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']);\n\n // List of SVG elements that are disallowed by default.\n // We still need to know them so that we can do namespace\n // checks properly in case one wants to add them to\n // allow-list.\n const svgDisallowed = freeze(['animate', 'color-profile', 'cursor', 'discard', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'foreignobject', 'hatch', 'hatchpath', 'mesh', 'meshgradient', 'meshpatch', 'meshrow', 'missing-glyph', 'script', 'set', 'solidcolor', 'unknown', 'use']);\n const mathMl$1 = freeze(['math', 'menclose', 'merror', 'mfenced', 'mfrac', 'mglyph', 'mi', 'mlabeledtr', 'mmultiscripts', 'mn', 'mo', 'mover', 'mpadded', 'mphantom', 'mroot', 'mrow', 'ms', 'mspace', 'msqrt', 'mstyle', 'msub', 'msup', 'msubsup', 'mtable', 'mtd', 'mtext', 'mtr', 'munder', 'munderover', 'mprescripts']);\n\n // Similarly to SVG, we want to know all MathML elements,\n // even those that we disallow by default.\n const mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']);\n const text = freeze(['#text']);\n\n const html = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'nonce', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'pattern', 'placeholder', 'playsinline', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'wrap', 'xmlns', 'slot']);\n const svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'targetx', 'targety', 'transform', 'transform-origin', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']);\n const mathMl = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnsalign', 'columnlines', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lspace', 'lquote', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns']);\n const xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);\n\n // eslint-disable-next-line unicorn/better-regex\n const MUSTACHE_EXPR = seal(/\\{\\{[\\w\\W]*|[\\w\\W]*\\}\\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode\n const ERB_EXPR = seal(/<%[\\w\\W]*|[\\w\\W]*%>/gm);\n const TMPLIT_EXPR = seal(/\\${[\\w\\W]*}/gm);\n const DATA_ATTR = seal(/^data-[\\-\\w.\\u00B7-\\uFFFF]/); // eslint-disable-line no-useless-escape\n const ARIA_ATTR = seal(/^aria-[\\-\\w]+$/); // eslint-disable-line no-useless-escape\n const IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\\-]+(?:[^a-z+.\\-:]|$))/i // eslint-disable-line no-useless-escape\n );\n\n const IS_SCRIPT_OR_DATA = seal(/^(?:\\w+script|data):/i);\n const ATTR_WHITESPACE = seal(/[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205F\\u3000]/g // eslint-disable-line no-control-regex\n );\n\n const DOCTYPE_NAME = seal(/^html$/i);\n const CUSTOM_ELEMENT = seal(/^[a-z][.\\w]*(-[.\\w]+)+$/i);\n\n var EXPRESSIONS = /*#__PURE__*/Object.freeze({\n __proto__: null,\n MUSTACHE_EXPR: MUSTACHE_EXPR,\n ERB_EXPR: ERB_EXPR,\n TMPLIT_EXPR: TMPLIT_EXPR,\n DATA_ATTR: DATA_ATTR,\n ARIA_ATTR: ARIA_ATTR,\n IS_ALLOWED_URI: IS_ALLOWED_URI,\n IS_SCRIPT_OR_DATA: IS_SCRIPT_OR_DATA,\n ATTR_WHITESPACE: ATTR_WHITESPACE,\n DOCTYPE_NAME: DOCTYPE_NAME,\n CUSTOM_ELEMENT: CUSTOM_ELEMENT\n });\n\n // https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType\n const NODE_TYPE = {\n element: 1,\n attribute: 2,\n text: 3,\n cdataSection: 4,\n entityReference: 5,\n // Deprecated\n entityNode: 6,\n // Deprecated\n progressingInstruction: 7,\n comment: 8,\n document: 9,\n documentType: 10,\n documentFragment: 11,\n notation: 12 // Deprecated\n };\n\n const getGlobal = function getGlobal() {\n return typeof window === 'undefined' ? null : window;\n };\n\n /**\n * Creates a no-op policy for internal use only.\n * Don't export this function outside this module!\n * @param {TrustedTypePolicyFactory} trustedTypes The policy factory.\n * @param {HTMLScriptElement} purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).\n * @return {TrustedTypePolicy} The policy created (or null, if Trusted Types\n * are not supported or creating the policy failed).\n */\n const _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement) {\n if (typeof trustedTypes !== 'object' || typeof trustedTypes.createPolicy !== 'function') {\n return null;\n }\n\n // Allow the callers to control the unique policy name\n // by adding a data-tt-policy-suffix to the script element with the DOMPurify.\n // Policy creation with duplicate names throws in Trusted Types.\n let suffix = null;\n const ATTR_NAME = 'data-tt-policy-suffix';\n if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) {\n suffix = purifyHostElement.getAttribute(ATTR_NAME);\n }\n const policyName = 'dompurify' + (suffix ? '#' + suffix : '');\n try {\n return trustedTypes.createPolicy(policyName, {\n createHTML(html) {\n return html;\n },\n createScriptURL(scriptUrl) {\n return scriptUrl;\n }\n });\n } catch (_) {\n // Policy creation failed (most likely another DOMPurify script has\n // already run). Skip creating the policy, as this will only cause errors\n // if TT are enforced.\n console.warn('TrustedTypes policy ' + policyName + ' could not be created.');\n return null;\n }\n };\n function createDOMPurify() {\n let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();\n const DOMPurify = root => createDOMPurify(root);\n\n /**\n * Version label, exposed for easier checks\n * if DOMPurify is up to date or not\n */\n DOMPurify.version = '3.1.3';\n\n /**\n * Array of elements that DOMPurify removed during sanitation.\n * Empty if nothing was removed.\n */\n DOMPurify.removed = [];\n if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document) {\n // Not running in a browser, provide a factory function\n // so that you can pass your own Window\n DOMPurify.isSupported = false;\n return DOMPurify;\n }\n let {\n document\n } = window;\n const originalDocument = document;\n const currentScript = originalDocument.currentScript;\n const {\n DocumentFragment,\n HTMLTemplateElement,\n Node,\n Element,\n NodeFilter,\n NamedNodeMap = window.NamedNodeMap || window.MozNamedAttrMap,\n HTMLFormElement,\n DOMParser,\n trustedTypes\n } = window;\n const ElementPrototype = Element.prototype;\n const cloneNode = lookupGetter(ElementPrototype, 'cloneNode');\n const getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');\n const getChildNodes = lookupGetter(ElementPrototype, 'childNodes');\n const getParentNode = lookupGetter(ElementPrototype, 'parentNode');\n\n // As per issue #47, the web-components registry is inherited by a\n // new document created via createHTMLDocument. As per the spec\n // (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)\n // a new empty registry is used when creating a template contents owner\n // document, so we use that as our parent document to ensure nothing\n // is inherited.\n if (typeof HTMLTemplateElement === 'function') {\n const template = document.createElement('template');\n if (template.content && template.content.ownerDocument) {\n document = template.content.ownerDocument;\n }\n }\n let trustedTypesPolicy;\n let emptyHTML = '';\n const {\n implementation,\n createNodeIterator,\n createDocumentFragment,\n getElementsByTagName\n } = document;\n const {\n importNode\n } = originalDocument;\n let hooks = {};\n\n /**\n * Expose whether this browser supports running the full DOMPurify.\n */\n DOMPurify.isSupported = typeof entries === 'function' && typeof getParentNode === 'function' && implementation && implementation.createHTMLDocument !== undefined;\n const {\n MUSTACHE_EXPR,\n ERB_EXPR,\n TMPLIT_EXPR,\n DATA_ATTR,\n ARIA_ATTR,\n IS_SCRIPT_OR_DATA,\n ATTR_WHITESPACE,\n CUSTOM_ELEMENT\n } = EXPRESSIONS;\n let {\n IS_ALLOWED_URI: IS_ALLOWED_URI$1\n } = EXPRESSIONS;\n\n /**\n * We consider the elements and attributes below to be safe. Ideally\n * don't add any new ones but feel free to remove unwanted ones.\n */\n\n /* allowed element names */\n let ALLOWED_TAGS = null;\n const DEFAULT_ALLOWED_TAGS = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text]);\n\n /* Allowed attribute names */\n let ALLOWED_ATTR = null;\n const DEFAULT_ALLOWED_ATTR = addToSet({}, [...html, ...svg, ...mathMl, ...xml]);\n\n /*\n * Configure how DOMPUrify should handle custom elements and their attributes as well as customized built-in elements.\n * @property {RegExp|Function|null} tagNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any custom elements)\n * @property {RegExp|Function|null} attributeNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any attributes not on the allow list)\n * @property {boolean} allowCustomizedBuiltInElements allow custom elements derived from built-ins if they pass CUSTOM_ELEMENT_HANDLING.tagNameCheck. Default: `false`.\n */\n let CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, {\n tagNameCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null\n },\n attributeNameCheck: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: null\n },\n allowCustomizedBuiltInElements: {\n writable: true,\n configurable: false,\n enumerable: true,\n value: false\n }\n }));\n\n /* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */\n let FORBID_TAGS = null;\n\n /* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */\n let FORBID_ATTR = null;\n\n /* Decide if ARIA attributes are okay */\n let ALLOW_ARIA_ATTR = true;\n\n /* Decide if custom data attributes are okay */\n let ALLOW_DATA_ATTR = true;\n\n /* Decide if unknown protocols are okay */\n let ALLOW_UNKNOWN_PROTOCOLS = false;\n\n /* Decide if self-closing tags in attributes are allowed.\n * Usually removed due to a mXSS issue in jQuery 3.0 */\n let ALLOW_SELF_CLOSE_IN_ATTR = true;\n\n /* Output should be safe for common template engines.\n * This means, DOMPurify removes data attributes, mustaches and ERB\n */\n let SAFE_FOR_TEMPLATES = false;\n\n /* Output should be safe even for XML used within HTML and alike.\n * This means, DOMPurify removes comments when containing risky content.\n */\n let SAFE_FOR_XML = true;\n\n /* Decide if document with <html>... should be returned */\n let WHOLE_DOCUMENT = false;\n\n /* Track whether config is already set on this instance of DOMPurify. */\n let SET_CONFIG = false;\n\n /* Decide if all elements (e.g. style, script) must be children of\n * document.body. By default, browsers might move them to document.head */\n let FORCE_BODY = false;\n\n /* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html\n * string (or a TrustedHTML object if Trusted Types are supported).\n * If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead\n */\n let RETURN_DOM = false;\n\n /* Decide if a DOM `DocumentFragment` should be returned, instead of a html\n * string (or a TrustedHTML object if Trusted Types are supported) */\n let RETURN_DOM_FRAGMENT = false;\n\n /* Try to return a Trusted Type object instead of a string, return a string in\n * case Trusted Types are not supported */\n let RETURN_TRUSTED_TYPE = false;\n\n /* Output should be free from DOM clobbering attacks?\n * This sanitizes markups named with colliding, clobberable built-in DOM APIs.\n */\n let SANITIZE_DOM = true;\n\n /* Achieve full DOM Clobbering protection by isolating the namespace of named\n * properties and JS variables, mitigating attacks that abuse the HTML/DOM spec rules.\n *\n * HTML/DOM spec rules that enable DOM Clobbering:\n * - Named Access on Window (§7.3.3)\n * - DOM Tree Accessors (§3.1.5)\n * - Form Element Parent-Child Relations (§4.10.3)\n * - Iframe srcdoc / Nested WindowProxies (§4.8.5)\n * - HTMLCollection (§4.2.10.2)\n *\n * Namespace isolation is implemented by prefixing `id` and `name` attributes\n * with a constant string, i.e., `user-content-`\n */\n let SANITIZE_NAMED_PROPS = false;\n const SANITIZE_NAMED_PROPS_PREFIX = 'user-content-';\n\n /* Keep element content when removing element? */\n let KEEP_CONTENT = true;\n\n /* If a `Node` is passed to sanitize(), then performs sanitization in-place instead\n * of importing it into a new Document and returning a sanitized copy */\n let IN_PLACE = false;\n\n /* Allow usage of profiles like html, svg and mathMl */\n let USE_PROFILES = {};\n\n /* Tags to ignore content of when KEEP_CONTENT is true */\n let FORBID_CONTENTS = null;\n const DEFAULT_FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'noscript', 'plaintext', 'script', 'style', 'svg', 'template', 'thead', 'title', 'video', 'xmp']);\n\n /* Tags that are safe for data: URIs */\n let DATA_URI_TAGS = null;\n const DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']);\n\n /* Attributes safe for values like \"javascript:\" */\n let URI_SAFE_ATTRIBUTES = null;\n const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'role', 'summary', 'title', 'value', 'style', 'xmlns']);\n const MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\n const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\n const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\n /* Document namespace */\n let NAMESPACE = HTML_NAMESPACE;\n let IS_EMPTY_INPUT = false;\n\n /* Allowed XHTML+XML namespaces */\n let ALLOWED_NAMESPACES = null;\n const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);\n\n /* Parsing of strict XHTML documents */\n let PARSER_MEDIA_TYPE = null;\n const SUPPORTED_PARSER_MEDIA_TYPES = ['application/xhtml+xml', 'text/html'];\n const DEFAULT_PARSER_MEDIA_TYPE = 'text/html';\n let transformCaseFunc = null;\n\n /* Keep a reference to config to pass to hooks */\n let CONFIG = null;\n\n /* Specify the maximum element nesting depth to prevent mXSS */\n const MAX_NESTING_DEPTH = 255;\n\n /* Ideally, do not touch anything below this line */\n /* ______________________________________________ */\n\n const formElement = document.createElement('form');\n const isRegexOrFunction = function isRegexOrFunction(testValue) {\n return testValue instanceof RegExp || testValue instanceof Function;\n };\n\n /**\n * _parseConfig\n *\n * @param {Object} cfg optional config literal\n */\n // eslint-disable-next-line complexity\n const _parseConfig = function _parseConfig() {\n let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n if (CONFIG && CONFIG === cfg) {\n return;\n }\n\n /* Shield configuration object from tampering */\n if (!cfg || typeof cfg !== 'object') {\n cfg = {};\n }\n\n /* Shield configuration object from prototype pollution */\n cfg = clone(cfg);\n PARSER_MEDIA_TYPE =\n // eslint-disable-next-line unicorn/prefer-includes\n SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;\n\n // HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is.\n transformCaseFunc = PARSER_MEDIA_TYPE === 'application/xhtml+xml' ? stringToString : stringToLowerCase;\n\n /* Set configuration parameters */\n ALLOWED_TAGS = objectHasOwnProperty(cfg, 'ALLOWED_TAGS') ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS;\n ALLOWED_ATTR = objectHasOwnProperty(cfg, 'ALLOWED_ATTR') ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR;\n ALLOWED_NAMESPACES = objectHasOwnProperty(cfg, 'ALLOWED_NAMESPACES') ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES;\n URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, 'ADD_URI_SAFE_ATTR') ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES),\n // eslint-disable-line indent\n cfg.ADD_URI_SAFE_ATTR,\n // eslint-disable-line indent\n transformCaseFunc // eslint-disable-line indent\n ) // eslint-disable-line indent\n : DEFAULT_URI_SAFE_ATTRIBUTES;\n DATA_URI_TAGS = objectHasOwnProperty(cfg, 'ADD_DATA_URI_TAGS') ? addToSet(clone(DEFAULT_DATA_URI_TAGS),\n // eslint-disable-line indent\n cfg.ADD_DATA_URI_TAGS,\n // eslint-disable-line indent\n transformCaseFunc // eslint-disable-line indent\n ) // eslint-disable-line indent\n : DEFAULT_DATA_URI_TAGS;\n FORBID_CONTENTS = objectHasOwnProperty(cfg, 'FORBID_CONTENTS') ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS;\n FORBID_TAGS = objectHasOwnProperty(cfg, 'FORBID_TAGS') ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : {};\n FORBID_ATTR = objectHasOwnProperty(cfg, 'FORBID_ATTR') ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : {};\n USE_PROFILES = objectHasOwnProperty(cfg, 'USE_PROFILES') ? cfg.USE_PROFILES : false;\n ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true\n ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true\n ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false\n ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; // Default true\n SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false\n SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false; // Default true\n WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false\n RETURN_DOM = cfg.RETURN_DOM || false; // Default false\n RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false\n RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false\n FORCE_BODY = cfg.FORCE_BODY || false; // Default false\n SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true\n SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; // Default false\n KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true\n IN_PLACE = cfg.IN_PLACE || false; // Default false\n IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI;\n NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;\n CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {};\n if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) {\n CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;\n }\n if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)) {\n CUSTOM_ELEMENT_HANDLING.attributeNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck;\n }\n if (cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements === 'boolean') {\n CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements;\n }\n if (SAFE_FOR_TEMPLATES) {\n ALLOW_DATA_ATTR = false;\n }\n if (RETURN_DOM_FRAGMENT) {\n RETURN_DOM = true;\n }\n\n /* Parse profile info */\n if (USE_PROFILES) {\n ALLOWED_TAGS = addToSet({}, text);\n ALLOWED_ATTR = [];\n if (USE_PROFILES.html === true) {\n addToSet(ALLOWED_TAGS, html$1);\n addToSet(ALLOWED_ATTR, html);\n }\n if (USE_PROFILES.svg === true) {\n addToSet(ALLOWED_TAGS, svg$1);\n addToSet(ALLOWED_ATTR, svg);\n addToSet(ALLOWED_ATTR, xml);\n }\n if (USE_PROFILES.svgFilters === true) {\n addToSet(ALLOWED_TAGS, svgFilters);\n addToSet(ALLOWED_ATTR, svg);\n addToSet(ALLOWED_ATTR, xml);\n }\n if (USE_PROFILES.mathMl === true) {\n addToSet(ALLOWED_TAGS, mathMl$1);\n addToSet(ALLOWED_ATTR, mathMl);\n addToSet(ALLOWED_ATTR, xml);\n }\n }\n\n /* Merge configuration parameters */\n if (cfg.ADD_TAGS) {\n if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {\n ALLOWED_TAGS = clone(ALLOWED_TAGS);\n }\n addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);\n }\n if (cfg.ADD_ATTR) {\n if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {\n ALLOWED_ATTR = clone(ALLOWED_ATTR);\n }\n addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);\n }\n if (cfg.ADD_URI_SAFE_ATTR) {\n addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);\n }\n if (cfg.FORBID_CONTENTS) {\n if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {\n FORBID_CONTENTS = clone(FORBID_CONTENTS);\n }\n addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);\n }\n\n /* Add #text in case KEEP_CONTENT is set to true */\n if (KEEP_CONTENT) {\n ALLOWED_TAGS['#text'] = true;\n }\n\n /* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */\n if (WHOLE_DOCUMENT) {\n addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);\n }\n\n /* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */\n if (ALLOWED_TAGS.table) {\n addToSet(ALLOWED_TAGS, ['tbody']);\n delete FORBID_TAGS.tbody;\n }\n if (cfg.TRUSTED_TYPES_POLICY) {\n if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== 'function') {\n throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.');\n }\n if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== 'function') {\n throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.');\n }\n\n // Overwrite existing TrustedTypes policy.\n trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;\n\n // Sign local variables required by `sanitize`.\n emptyHTML = trustedTypesPolicy.createHTML('');\n } else {\n // Uninitialized policy, attempt to initialize the internal dompurify policy.\n if (trustedTypesPolicy === undefined) {\n trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);\n }\n\n // If creating the internal policy succeeded sign internal variables.\n if (trustedTypesPolicy !== null && typeof emptyHTML === 'string') {\n emptyHTML = trustedTypesPolicy.createHTML('');\n }\n }\n\n // Prevent further manipulation of configuration.\n // Not available in IE8, Safari 5, etc.\n if (freeze) {\n freeze(cfg);\n }\n CONFIG = cfg;\n };\n const MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']);\n const HTML_INTEGRATION_POINTS = addToSet({}, ['foreignobject', 'annotation-xml']);\n\n // Certain elements are allowed in both SVG and HTML\n // namespace. We need to specify them explicitly\n // so that they don't get erroneously deleted from\n // HTML namespace.\n const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ['title', 'style', 'font', 'a', 'script']);\n\n /* Keep track of all possible SVG and MathML tags\n * so that we can perform the namespace checks\n * correctly. */\n const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]);\n const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);\n\n /**\n * @param {Element} element a DOM element whose namespace is being checked\n * @returns {boolean} Return false if the element has a\n * namespace that a spec-compliant parser would never\n * return. Return true otherwise.\n */\n const _checkValidNamespace = function _checkValidNamespace(element) {\n let parent = getParentNode(element);\n\n // In JSDOM, if we're inside shadow DOM, then parentNode\n // can be null. We just simulate parent in this case.\n if (!parent || !parent.tagName) {\n parent = {\n namespaceURI: NAMESPACE,\n tagName: 'template'\n };\n }\n const tagName = stringToLowerCase(element.tagName);\n const parentTagName = stringToLowerCase(parent.tagName);\n if (!ALLOWED_NAMESPACES[element.namespaceURI]) {\n return false;\n }\n if (element.namespaceURI === SVG_NAMESPACE) {\n // The only way to switch from HTML namespace to SVG\n // is via <svg>. If it happens via any other tag, then\n // it should be killed.\n if (parent.namespaceURI === HTML_NAMESPACE) {\n return tagName === 'svg';\n }\n\n // The only way to switch from MathML to SVG is via`\n // svg if parent is either <annotation-xml> or MathML\n // text integration points.\n if (parent.namespaceURI === MATHML_NAMESPACE) {\n return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);\n }\n\n // We only allow elements that are defined in SVG\n // spec. All others are disallowed in SVG namespace.\n return Boolean(ALL_SVG_TAGS[tagName]);\n }\n if (element.namespaceURI === MATHML_NAMESPACE) {\n // The only way to switch from HTML namespace to MathML\n // is via <math>. If it happens via any other tag, then\n // it should be killed.\n if (parent.namespaceURI === HTML_NAMESPACE) {\n return tagName === 'math';\n }\n\n // The only way to switch from SVG to MathML is via\n // <math> and HTML integration points\n if (parent.namespaceURI === SVG_NAMESPACE) {\n return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];\n }\n\n // We only allow elements that are defined in MathML\n // spec. All others are disallowed in MathML namespace.\n return Boolean(ALL_MATHML_TAGS[tagName]);\n }\n if (element.namespaceURI === HTML_NAMESPACE) {\n // The only way to switch from SVG to HTML is via\n // HTML integration points, and from MathML to HTML\n // is via MathML text integration points\n if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {\n return false;\n }\n if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {\n return false;\n }\n\n // We disallow tags that are specific for MathML\n // or SVG and should never appear in HTML namespace\n return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);\n }\n\n // For XHTML and XML documents that support custom namespaces\n if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && ALLOWED_NAMESPACES[element.namespaceURI]) {\n return true;\n }\n\n // The code should never reach this place (this means\n // that the element somehow got namespace that is not\n // HTML, SVG, MathML or allowed via ALLOWED_NAMESPACES).\n // Return false just in case.\n return false;\n };\n\n /**\n * _forceRemove\n *\n * @param {Node} node a DOM node\n */\n const _forceRemove = function _forceRemove(node) {\n arrayPush(DOMPurify.removed, {\n element: node\n });\n try {\n // eslint-disable-next-line unicorn/prefer-dom-node-remove\n node.parentNode.removeChild(node);\n } catch (_) {\n node.remove();\n }\n };\n\n /**\n * _removeAttribute\n *\n * @param {String} name an Attribute name\n * @param {Node} node a DOM node\n */\n const _removeAttribute = function _removeAttribute(name, node) {\n try {\n arrayPush(DOMPurify.removed, {\n attribute: node.getAttributeNode(name),\n from: node\n });\n } catch (_) {\n arrayPush(DOMPurify.removed, {\n attribute: null,\n from: node\n });\n }\n node.removeAttribute(name);\n\n // We void attribute values for unremovable \"is\"\" attributes\n if (name === 'is' && !ALLOWED_ATTR[name]) {\n if (RETURN_DOM || RETURN_DOM_FRAGMENT) {\n try {\n _forceRemove(node);\n } catch (_) {}\n } else {\n try {\n node.setAttribute(name, '');\n } catch (_) {}\n }\n }\n };\n\n /**\n * _initDocument\n *\n * @param {String} dirty a string of dirty markup\n * @return {Document} a DOM, filled with the dirty markup\n */\n const _initDocument = function _initDocument(dirty) {\n /* Create a HTML document */\n let doc = null;\n let leadingWhitespace = null;\n if (FORCE_BODY) {\n dirty = '<remove></remove>' + dirty;\n } else {\n /* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */\n const matches = stringMatch(dirty, /^[\\r\\n\\t ]+/);\n leadingWhitespace = matches && matches[0];\n }\n if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && NAMESPACE === HTML_NAMESPACE) {\n // Root of XHTML doc must contain xmlns declaration (see https://www.w3.org/TR/xhtml1/normative.html#strict)\n dirty = '<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>' + dirty + '</body></html>';\n }\n const dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty;\n /*\n * Use the DOMParser API by default, fallback later if needs be\n * DOMParser not work for svg when has multiple root element.\n */\n if (NAMESPACE === HTML_NAMESPACE) {\n try {\n doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);\n } catch (_) {}\n }\n\n /* Use createHTMLDocument in case DOMParser is not available */\n if (!doc || !doc.documentElement) {\n doc = implementation.createDocument(NAMESPACE, 'template', null);\n try {\n doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;\n } catch (_) {\n // Syntax error if dirtyPayload is invalid xml\n }\n }\n const body = doc.body || doc.documentElement;\n if (dirty && leadingWhitespace) {\n body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);\n }\n\n /* Work on whole document or just its body */\n if (NAMESPACE === HTML_NAMESPACE) {\n return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? 'html' : 'body')[0];\n }\n return WHOLE_DOCUMENT ? doc.documentElement : body;\n };\n\n /**\n * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.\n *\n * @param {Node} root The root element or node to start traversing on.\n * @return {NodeIterator} The created NodeIterator\n */\n const _createNodeIterator = function _createNodeIterator(root) {\n return createNodeIterator.call(root.ownerDocument || root, root,\n // eslint-disable-next-line no-bitwise\n NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, null);\n };\n\n /**\n * _isClobbered\n *\n * @param {Node} elm element to check for clobbering attacks\n * @return {Boolean} true if clobbered, false if safe\n */\n const _isClobbered = function _isClobbered(elm) {\n return elm instanceof HTMLFormElement && (\n // eslint-disable-next-line unicorn/no-typeof-undefined\n typeof elm.__depth !== 'undefined' && typeof elm.__depth !== 'number' ||\n // eslint-disable-next-line unicorn/no-typeof-undefined\n typeof elm.__removalCount !== 'undefined' && typeof elm.__removalCount !== 'number' || typeof elm.nodeName !== 'string' || typeof elm.textContent !== 'string' || typeof elm.removeChild !== 'function' || !(elm.attributes instanceof NamedNodeMap) || typeof elm.removeAttribute !== 'function' || typeof elm.setAttribute !== 'function' || typeof elm.namespaceURI !== 'string' || typeof elm.insertBefore !== 'function' || typeof elm.hasChildNodes !== 'function');\n };\n\n /**\n * Checks whether the given object is a DOM node.\n *\n * @param {Node} object object to check whether it's a DOM node\n * @return {Boolean} true is object is a DOM node\n */\n const _isNode = function _isNode(object) {\n return typeof Node === 'function' && object instanceof Node;\n };\n\n /**\n * _executeHook\n * Execute user configurable hooks\n *\n * @param {String} entryPoint Name of the hook's entry point\n * @param {Node} currentNode node to work on with the hook\n * @param {Object} data additional hook parameters\n */\n const _executeHook = function _executeHook(entryPoint, currentNode, data) {\n if (!hooks[entryPoint]) {\n return;\n }\n arrayForEach(hooks[entryPoint], hook => {\n hook.call(DOMPurify, currentNode, data, CONFIG);\n });\n };\n\n /**\n * _sanitizeElements\n *\n * @protect nodeName\n * @protect textContent\n * @protect removeChild\n *\n * @param {Node} currentNode to check for permission to exist\n * @return {Boolean} true if node was killed, false if left alive\n */\n const _sanitizeElements = function _sanitizeElements(currentNode) {\n let content = null;\n\n /* Execute a hook if present */\n _executeHook('beforeSanitizeElements', currentNode, null);\n\n /* Check if element is clobbered or can clobber */\n if (_isClobbered(currentNode)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Now let's check the element's type and name */\n const tagName = transformCaseFunc(currentNode.nodeName);\n\n /* Execute a hook if present */\n _executeHook('uponSanitizeElement', currentNode, {\n tagName,\n allowedTags: ALLOWED_TAGS\n });\n\n /* Detect mXSS attempts abusing namespace confusion */\n if (currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\\w]/g, currentNode.innerHTML) && regExpTest(/<[/\\w]/g, currentNode.textContent)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Remove any ocurrence of processing instructions */\n if (currentNode.nodeType === NODE_TYPE.progressingInstruction) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Remove any kind of possibly harmful comments */\n if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(/<[/\\w]/g, currentNode.data)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Remove element if anything forbids its presence */\n if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n /* Check if we have a custom element to handle */\n if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {\n if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) {\n return false;\n }\n if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) {\n return false;\n }\n }\n\n /* Keep content except for bad-listed elements */\n if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {\n const parentNode = getParentNode(currentNode) || currentNode.parentNode;\n const childNodes = getChildNodes(currentNode) || currentNode.childNodes;\n if (childNodes && parentNode) {\n const childCount = childNodes.length;\n for (let i = childCount - 1; i >= 0; --i) {\n const childClone = cloneNode(childNodes[i], true);\n childClone.__removalCount = (currentNode.__removalCount || 0) + 1;\n parentNode.insertBefore(childClone, getNextSibling(currentNode));\n }\n }\n }\n _forceRemove(currentNode);\n return true;\n }\n\n /* Check whether element has a valid namespace */\n if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Make sure that older browsers don't get fallback-tag mXSS */\n if ((tagName === 'noscript' || tagName === 'noembed' || tagName === 'noframes') && regExpTest(/<\\/no(script|embed|frames)/i, currentNode.innerHTML)) {\n _forceRemove(currentNode);\n return true;\n }\n\n /* Sanitize element content to be template-safe */\n if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {\n /* Get the element's text content */\n content = currentNode.textContent;\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {\n content = stringReplace(content, expr, ' ');\n });\n if (currentNode.textContent !== content) {\n arrayPush(DOMPurify.removed, {\n element: currentNode.cloneNode()\n });\n currentNode.textContent = content;\n }\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeElements', currentNode, null);\n return false;\n };\n\n /**\n * _isValidAttribute\n *\n * @param {string} lcTag Lowercase tag name of containing element.\n * @param {string} lcName Lowercase attribute name.\n * @param {string} value Attribute value.\n * @return {Boolean} Returns true if `value` is valid, otherwise false.\n */\n // eslint-disable-next-line complexity\n const _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {\n /* Make sure attribute cannot clobber */\n if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement || value === '__depth' || value === '__removalCount')) {\n return false;\n }\n\n /* Allow valid data-* attributes: At least one character after \"-\"\n (https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)\n XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)\n We don't need to check the value; it's always URI safe. */\n if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName)) ; else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {\n if (\n // First condition does a very basic check if a) it's basically a valid custom element tagname AND\n // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck\n // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck\n _isBasicCustomElement(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName)) ||\n // Alternative, second condition checks if it's an `is`-attribute, AND\n // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck\n lcName === 'is' && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value))) ; else {\n return false;\n }\n /* Check value is safe. First, is attr inert? If so, is safe */\n } else if (URI_SAFE_ATTRIBUTES[lcName]) ; else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if ((lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') && lcTag !== 'script' && stringIndexOf(value, 'data:') === 0 && DATA_URI_TAGS[lcTag]) ; else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if (value) {\n return false;\n } else ;\n return true;\n };\n\n /**\n * _isBasicCustomElement\n * checks if at least one dash is included in tagName, and it's not the first char\n * for more sophisticated checking see https://github.com/sindresorhus/validate-element-name\n *\n * @param {string} tagName name of the tag of the node to sanitize\n * @returns {boolean} Returns true if the tag name meets the basic criteria for a custom element, otherwise false.\n */\n const _isBasicCustomElement = function _isBasicCustomElement(tagName) {\n return tagName !== 'annotation-xml' && stringMatch(tagName, CUSTOM_ELEMENT);\n };\n\n /**\n * _sanitizeAttributes\n *\n * @protect attributes\n * @protect nodeName\n * @protect removeAttribute\n * @protect setAttribute\n *\n * @param {Node} currentNode to sanitize\n */\n const _sanitizeAttributes = function _sanitizeAttributes(currentNode) {\n /* Execute a hook if present */\n _executeHook('beforeSanitizeAttributes', currentNode, null);\n const {\n attributes\n } = currentNode;\n\n /* Check if we have attributes; if not we might have a text node */\n if (!attributes) {\n return;\n }\n const hookEvent = {\n attrName: '',\n attrValue: '',\n keepAttr: true,\n allowedAttributes: ALLOWED_ATTR\n };\n let l = attributes.length;\n\n /* Go backwards over all attributes; safely remove bad ones */\n while (l--) {\n const attr = attributes[l];\n const {\n name,\n namespaceURI,\n value: attrValue\n } = attr;\n const lcName = transformCaseFunc(name);\n let value = name === 'value' ? attrValue : stringTrim(attrValue);\n\n /* Execute a hook if present */\n hookEvent.attrName = lcName;\n hookEvent.attrValue = value;\n hookEvent.keepAttr = true;\n hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set\n _executeHook('uponSanitizeAttribute', currentNode, hookEvent);\n value = hookEvent.attrValue;\n /* Did the hooks approve of the attribute? */\n if (hookEvent.forceKeepAttr) {\n continue;\n }\n\n /* Remove attribute */\n _removeAttribute(name, currentNode);\n\n /* Did the hooks approve of the attribute? */\n if (!hookEvent.keepAttr) {\n continue;\n }\n\n /* Work around a security issue in jQuery 3.0 */\n if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\\/>/i, value)) {\n _removeAttribute(name, currentNode);\n continue;\n }\n\n /* Work around a security issue with comments inside attributes */\n if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\\/(style|title)/i, value)) {\n _removeAttribute(name, currentNode);\n continue;\n }\n\n /* Sanitize attribute content to be template-safe */\n if (SAFE_FOR_TEMPLATES) {\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {\n value = stringReplace(value, expr, ' ');\n });\n }\n\n /* Is `value` valid for this attribute? */\n const lcTag = transformCaseFunc(currentNode.nodeName);\n if (!_isValidAttribute(lcTag, lcName, value)) {\n continue;\n }\n\n /* Full DOM Clobbering protection via namespace isolation,\n * Prefix id and name attributes with `user-content-`\n */\n if (SANITIZE_NAMED_PROPS && (lcName === 'id' || lcName === 'name')) {\n // Remove the attribute with this value\n _removeAttribute(name, currentNode);\n\n // Prefix the value and later re-create the attribute with the sanitized value\n value = SANITIZE_NAMED_PROPS_PREFIX + value;\n }\n\n /* Handle attributes that require Trusted Types */\n if (trustedTypesPolicy && typeof trustedTypes === 'object' && typeof trustedTypes.getAttributeType === 'function') {\n if (namespaceURI) ; else {\n switch (trustedTypes.getAttributeType(lcTag, lcName)) {\n case 'TrustedHTML':\n {\n value = trustedTypesPolicy.createHTML(value);\n break;\n }\n case 'TrustedScriptURL':\n {\n value = trustedTypesPolicy.createScriptURL(value);\n break;\n }\n }\n }\n }\n\n /* Handle invalid data-* attribute set by try-catching it */\n try {\n if (namespaceURI) {\n currentNode.setAttributeNS(namespaceURI, name, value);\n } else {\n /* Fallback to setAttribute() for browser-unrecognized namespaces e.g. \"x-schema\". */\n currentNode.setAttribute(name, value);\n }\n if (_isClobbered(currentNode)) {\n _forceRemove(currentNode);\n } else {\n arrayPop(DOMPurify.removed);\n }\n } catch (_) {}\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeAttributes', currentNode, null);\n };\n\n /**\n * _sanitizeShadowDOM\n *\n * @param {DocumentFragment} fragment to iterate over recursively\n */\n const _sanitizeShadowDOM = function _sanitizeShadowDOM(fragment) {\n let shadowNode = null;\n const shadowIterator = _createNodeIterator(fragment);\n\n /* Execute a hook if present */\n _executeHook('beforeSanitizeShadowDOM', fragment, null);\n while (shadowNode = shadowIterator.nextNode()) {\n /* Execute a hook if present */\n _executeHook('uponSanitizeShadowNode', shadowNode, null);\n\n /* Sanitize tags and elements */\n if (_sanitizeElements(shadowNode)) {\n continue;\n }\n const parentNode = getParentNode(shadowNode);\n\n /* Set the nesting depth of an element */\n if (shadowNode.nodeType === NODE_TYPE.element) {\n if (parentNode && parentNode.__depth) {\n /*\n We want the depth of the node in the original tree, which can\n change when it's removed from its parent.\n */\n shadowNode.__depth = (shadowNode.__removalCount || 0) + parentNode.__depth + 1;\n } else {\n shadowNode.__depth = 1;\n }\n }\n\n /*\n * Remove an element if nested too deeply to avoid mXSS\n * or if the __depth might have been tampered with\n */\n if (shadowNode.__depth >= MAX_NESTING_DEPTH || shadowNode.__depth < 0 || numberIsNaN(shadowNode.__depth)) {\n _forceRemove(shadowNode);\n }\n\n /* Deep shadow DOM detected */\n if (shadowNode.content instanceof DocumentFragment) {\n shadowNode.content.__depth = shadowNode.__depth;\n _sanitizeShadowDOM(shadowNode.content);\n }\n\n /* Check attributes, sanitize if necessary */\n _sanitizeAttributes(shadowNode);\n }\n\n /* Execute a hook if present */\n _executeHook('afterSanitizeShadowDOM', fragment, null);\n };\n\n /**\n * Sanitize\n * Public method providing core sanitation functionality\n *\n * @param {String|Node} dirty string or DOM node\n * @param {Object} cfg object\n */\n // eslint-disable-next-line complexity\n DOMPurify.sanitize = function (dirty) {\n let cfg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n let body = null;\n let importedNode = null;\n let currentNode = null;\n let returnNode = null;\n /* Make sure we have a string to sanitize.\n DO NOT return early, as this will return the wrong type if\n the user has requested a DOM object rather than a string */\n IS_EMPTY_INPUT = !dirty;\n if (IS_EMPTY_INPUT) {\n dirty = '<!-->';\n }\n\n /* Stringify, in case dirty is an object */\n if (typeof dirty !== 'string' && !_isNode(dirty)) {\n if (typeof dirty.toString === 'function') {\n dirty = dirty.toString();\n if (typeof dirty !== 'string') {\n throw typeErrorCreate('dirty is not a string, aborting');\n }\n } else {\n throw typeErrorCreate('toString is not a function');\n }\n }\n\n /* Return dirty HTML if DOMPurify cannot run */\n if (!DOMPurify.isSupported) {\n return dirty;\n }\n\n /* Assign config vars */\n if (!SET_CONFIG) {\n _parseConfig(cfg);\n }\n\n /* Clean up removed elements */\n DOMPurify.removed = [];\n\n /* Check if dirty is correctly typed for IN_PLACE */\n if (typeof dirty === 'string') {\n IN_PLACE = false;\n }\n if (IN_PLACE) {\n /* Do some early pre-sanitization to avoid unsafe root nodes */\n if (dirty.nodeName) {\n const tagName = transformCaseFunc(dirty.nodeName);\n if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n throw typeErrorCreate('root node is forbidden and cannot be sanitized in-place');\n }\n }\n } else if (dirty instanceof Node) {\n /* If dirty is a DOM element, append to an empty document to avoid\n elements being stripped by the parser */\n body = _initDocument('<!---->');\n importedNode = body.ownerDocument.importNode(dirty, true);\n if (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === 'BODY') {\n /* Node is already a body, use as is */\n body = importedNode;\n } else if (importedNode.nodeName === 'HTML') {\n body = importedNode;\n } else {\n // eslint-disable-next-line unicorn/prefer-dom-node-append\n body.appendChild(importedNode);\n }\n } else {\n /* Exit directly if we have nothing to do */\n if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT &&\n // eslint-disable-next-line unicorn/prefer-includes\n dirty.indexOf('<') === -1) {\n return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty;\n }\n\n /* Initialize the document to work on */\n body = _initDocument(dirty);\n\n /* Check we have a DOM node from the data */\n if (!body) {\n return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : '';\n }\n }\n\n /* Remove first element node (ours) if FORCE_BODY is set */\n if (body && FORCE_BODY) {\n _forceRemove(body.firstChild);\n }\n\n /* Get node iterator */\n const nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body);\n\n /* Now start iterating over the created document */\n while (currentNode = nodeIterator.nextNode()) {\n /* Sanitize tags and elements */\n if (_sanitizeElements(currentNode)) {\n continue;\n }\n const parentNode = getParentNode(currentNode);\n\n /* Set the nesting depth of an element */\n if (currentNode.nodeType === NODE_TYPE.element) {\n if (parentNode && parentNode.__depth) {\n /*\n We want the depth of the node in the original tree, which can\n change when it's removed from its parent.\n */\n currentNode.__depth = (currentNode.__removalCount || 0) + parentNode.__depth + 1;\n } else {\n currentNode.__depth = 1;\n }\n }\n\n /*\n * Remove an element if nested too deeply to avoid mXSS\n * or if the __depth might have been tampered with\n */\n if (currentNode.__depth >= MAX_NESTING_DEPTH || currentNode.__depth < 0 || numberIsNaN(currentNode.__depth)) {\n _forceRemove(currentNode);\n }\n\n /* Shadow DOM detected, sanitize it */\n if (currentNode.content instanceof DocumentFragment) {\n currentNode.content.__depth = currentNode.__depth;\n _sanitizeShadowDOM(currentNode.content);\n }\n\n /* Check attributes, sanitize if necessary */\n _sanitizeAttributes(currentNode);\n }\n\n /* If we sanitized `dirty` in-place, return it. */\n if (IN_PLACE) {\n return dirty;\n }\n\n /* Return sanitized string or DOM */\n if (RETURN_DOM) {\n if (RETURN_DOM_FRAGMENT) {\n returnNode = createDocumentFragment.call(body.ownerDocument);\n while (body.firstChild) {\n // eslint-disable-next-line unicorn/prefer-dom-node-append\n returnNode.appendChild(body.firstChild);\n }\n } else {\n returnNode = body;\n }\n if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) {\n /*\n AdoptNode() is not used because internal state is not reset\n (e.g. the past names map of a HTMLFormElement), this is safe\n in theory but we would rather not risk another attack vector.\n The state that is cloned by importNode() is explicitly defined\n by the specs.\n */\n returnNode = importNode.call(originalDocument, returnNode, true);\n }\n return returnNode;\n }\n let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;\n\n /* Serialize doctype if allowed */\n if (WHOLE_DOCUMENT && ALLOWED_TAGS['!doctype'] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) {\n serializedHTML = '<!DOCTYPE ' + body.ownerDocument.doctype.name + '>\\n' + serializedHTML;\n }\n\n /* Sanitize final string template-safe */\n if (SAFE_FOR_TEMPLATES) {\n arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {\n serializedHTML = stringReplace(serializedHTML, expr, ' ');\n });\n }\n return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML;\n };\n\n /**\n * Public method to set the configuration once\n * setConfig\n *\n * @param {Object} cfg configuration object\n */\n DOMPurify.setConfig = function () {\n let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n _parseConfig(cfg);\n SET_CONFIG = true;\n };\n\n /**\n * Public method to remove the configuration\n * clearConfig\n *\n */\n DOMPurify.clearConfig = function () {\n CONFIG = null;\n SET_CONFIG = false;\n };\n\n /**\n * Public method to check if an attribute value is valid.\n * Uses last set config, if any. Otherwise, uses config defaults.\n * isValidAttribute\n *\n * @param {String} tag Tag name of containing element.\n * @param {String} attr Attribute name.\n * @param {String} value Attribute value.\n * @return {Boolean} Returns true if `value` is valid. Otherwise, returns false.\n */\n DOMPurify.isValidAttribute = function (tag, attr, value) {\n /* Initialize shared config vars if necessary. */\n if (!CONFIG) {\n _parseConfig({});\n }\n const lcTag = transformCaseFunc(tag);\n const lcName = transformCaseFunc(attr);\n return _isValidAttribute(lcTag, lcName, value);\n };\n\n /**\n * AddHook\n * Public method to add DOMPurify hooks\n *\n * @param {String} entryPoint entry point for the hook to add\n * @param {Function} hookFunction function to execute\n */\n DOMPurify.addHook = function (entryPoint, hookFunction) {\n if (typeof hookFunction !== 'function') {\n return;\n }\n hooks[entryPoint] = hooks[entryPoint] || [];\n arrayPush(hooks[entryPoint], hookFunction);\n };\n\n /**\n * RemoveHook\n * Public method to remove a DOMPurify hook at a given entryPoint\n * (pops it from the stack of hooks if more are present)\n *\n * @param {String} entryPoint entry point for the hook to remove\n * @return {Function} removed(popped) hook\n */\n DOMPurify.removeHook = function (entryPoint) {\n if (hooks[entryPoint]) {\n return arrayPop(hooks[entryPoint]);\n }\n };\n\n /**\n * RemoveHooks\n * Public method to remove all DOMPurify hooks at a given entryPoint\n *\n * @param {String} entryPoint entry point for the hooks to remove\n */\n DOMPurify.removeHooks = function (entryPoint) {\n if (hooks[entryPoint]) {\n hooks[entryPoint] = [];\n }\n };\n\n /**\n * RemoveAllHooks\n * Public method to remove all DOMPurify hooks\n */\n DOMPurify.removeAllHooks = function () {\n hooks = {};\n };\n return DOMPurify;\n }\n var purify = createDOMPurify();\n\n return purify;\n\n}));\n//# sourceMappingURL=purify.js.map\n\n\n//# sourceURL=webpack://Formio/./node_modules/dompurify/dist/purify.js?");
|
1777
1717
|
|
1778
1718
|
/***/ }),
|
1779
1719
|
|
@@ -1798,6 +1738,16 @@ eval("var __WEBPACK_AMD_DEFINE_RESULT__;(function (global) {\n 'use strict';\n\
|
|
1798
1738
|
|
1799
1739
|
/***/ }),
|
1800
1740
|
|
1741
|
+
/***/ "./node_modules/inputmask/dist/inputmask.js":
|
1742
|
+
/*!**************************************************!*\
|
1743
|
+
!*** ./node_modules/inputmask/dist/inputmask.js ***!
|
1744
|
+
\**************************************************/
|
1745
|
+
/***/ (function(module) {
|
1746
|
+
|
1747
|
+
eval("/*!\n * dist/inputmask\n * https://github.com/RobinHerbots/Inputmask\n * Copyright (c) 2010 - 2023 Robin Herbots\n * Licensed under the MIT license\n * Version: 5.0.8\n */\n!function(e, t) {\n if (true) module.exports = t(); else { var n, i; }\n}(\"undefined\" != typeof self ? self : this, (function() {\n return function() {\n \"use strict\";\n var e = {\n 8741: function(e, t) {\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.default = void 0;\n var i = !(\"undefined\" == typeof window || !window.document || !window.document.createElement);\n t.default = i;\n },\n 3976: function(e, t, i) {\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.default = void 0;\n var n = i(2839), a = {\n _maxTestPos: 500,\n placeholder: \"_\",\n optionalmarker: [ \"[\", \"]\" ],\n quantifiermarker: [ \"{\", \"}\" ],\n groupmarker: [ \"(\", \")\" ],\n alternatormarker: \"|\",\n escapeChar: \"\\\\\",\n mask: null,\n regex: null,\n oncomplete: function() {},\n onincomplete: function() {},\n oncleared: function() {},\n repeat: 0,\n greedy: !1,\n autoUnmask: !1,\n removeMaskOnSubmit: !1,\n clearMaskOnLostFocus: !0,\n insertMode: !0,\n insertModeVisual: !0,\n clearIncomplete: !1,\n alias: null,\n onKeyDown: function() {},\n onBeforeMask: null,\n onBeforePaste: function(e, t) {\n return \"function\" == typeof t.onBeforeMask ? t.onBeforeMask.call(this, e, t) : e;\n },\n onBeforeWrite: null,\n onUnMask: null,\n showMaskOnFocus: !0,\n showMaskOnHover: !0,\n onKeyValidation: function() {},\n skipOptionalPartCharacter: \" \",\n numericInput: !1,\n rightAlign: !1,\n undoOnEscape: !0,\n radixPoint: \"\",\n _radixDance: !1,\n groupSeparator: \"\",\n keepStatic: null,\n positionCaretOnTab: !0,\n tabThrough: !1,\n supportsInputType: [ \"text\", \"tel\", \"url\", \"password\", \"search\" ],\n ignorables: [ n.keys.Backspace, n.keys.Tab, n.keys.Pause, n.keys.Escape, n.keys.PageUp, n.keys.PageDown, n.keys.End, n.keys.Home, n.keys.ArrowLeft, n.keys.ArrowUp, n.keys.ArrowRight, n.keys.ArrowDown, n.keys.Insert, n.keys.Delete, n.keys.ContextMenu, n.keys.F1, n.keys.F2, n.keys.F3, n.keys.F4, n.keys.F5, n.keys.F6, n.keys.F7, n.keys.F8, n.keys.F9, n.keys.F10, n.keys.F11, n.keys.F12, n.keys.Process, n.keys.Unidentified, n.keys.Shift, n.keys.Control, n.keys.Alt, n.keys.Tab, n.keys.AltGraph, n.keys.CapsLock ],\n isComplete: null,\n preValidation: null,\n postValidation: null,\n staticDefinitionSymbol: void 0,\n jitMasking: !1,\n nullable: !0,\n inputEventOnly: !1,\n noValuePatching: !1,\n positionCaretOnClick: \"lvp\",\n casing: null,\n inputmode: \"text\",\n importDataAttributes: !0,\n shiftPositions: !0,\n usePrototypeDefinitions: !0,\n validationEventTimeOut: 3e3,\n substitutes: {}\n };\n t.default = a;\n },\n 7392: function(e, t) {\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.default = void 0;\n t.default = {\n 9: {\n validator: \"[0-9\\uff10-\\uff19]\",\n definitionSymbol: \"*\"\n },\n a: {\n validator: \"[A-Za-z\\u0410-\\u044f\\u0401\\u0451\\xc0-\\xff\\xb5]\",\n definitionSymbol: \"*\"\n },\n \"*\": {\n validator: \"[0-9\\uff10-\\uff19A-Za-z\\u0410-\\u044f\\u0401\\u0451\\xc0-\\xff\\xb5]\"\n }\n };\n },\n 253: function(e, t) {\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.default = function(e, t, i) {\n if (void 0 === i) return e.__data ? e.__data[t] : null;\n e.__data = e.__data || {}, e.__data[t] = i;\n };\n },\n 3776: function(e, t, i) {\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.Event = void 0, t.off = function(e, t) {\n var i, n;\n f(this[0]) && e && (i = this[0].eventRegistry, n = this[0], e.split(\" \").forEach((function(e) {\n var a = l(e.split(\".\"), 2);\n (function(e, n) {\n var a, r, o = [];\n if (e.length > 0) if (void 0 === t) for (a = 0, r = i[e][n].length; a < r; a++) o.push({\n ev: e,\n namespace: n && n.length > 0 ? n : \"global\",\n handler: i[e][n][a]\n }); else o.push({\n ev: e,\n namespace: n && n.length > 0 ? n : \"global\",\n handler: t\n }); else if (n.length > 0) for (var s in i) for (var l in i[s]) if (l === n) if (void 0 === t) for (a = 0, \n r = i[s][l].length; a < r; a++) o.push({\n ev: s,\n namespace: l,\n handler: i[s][l][a]\n }); else o.push({\n ev: s,\n namespace: l,\n handler: t\n });\n return o;\n })(a[0], a[1]).forEach((function(e) {\n var t = e.ev, a = e.handler;\n !function(e, t, a) {\n if (e in i == 1) if (n.removeEventListener ? n.removeEventListener(e, a, !1) : n.detachEvent && n.detachEvent(\"on\".concat(e), a), \n \"global\" === t) for (var r in i[e]) i[e][r].splice(i[e][r].indexOf(a), 1); else i[e][t].splice(i[e][t].indexOf(a), 1);\n }(t, e.namespace, a);\n }));\n })));\n return this;\n }, t.on = function(e, t) {\n if (f(this[0])) {\n var i = this[0].eventRegistry, n = this[0];\n e.split(\" \").forEach((function(e) {\n var a = l(e.split(\".\"), 2), r = a[0], o = a[1];\n !function(e, a) {\n n.addEventListener ? n.addEventListener(e, t, !1) : n.attachEvent && n.attachEvent(\"on\".concat(e), t), \n i[e] = i[e] || {}, i[e][a] = i[e][a] || [], i[e][a].push(t);\n }(r, void 0 === o ? \"global\" : o);\n }));\n }\n return this;\n }, t.trigger = function(e) {\n var t = arguments;\n if (f(this[0])) for (var i = this[0].eventRegistry, n = this[0], r = \"string\" == typeof e ? e.split(\" \") : [ e.type ], s = 0; s < r.length; s++) {\n var l = r[s].split(\".\"), c = l[0], u = l[1] || \"global\";\n if (void 0 !== document && \"global\" === u) {\n var d, p = {\n bubbles: !0,\n cancelable: !0,\n composed: !0,\n detail: arguments[1]\n };\n if (document.createEvent) {\n try {\n if (\"input\" === c) p.inputType = \"insertText\", d = new InputEvent(c, p); else d = new CustomEvent(c, p);\n } catch (e) {\n (d = document.createEvent(\"CustomEvent\")).initCustomEvent(c, p.bubbles, p.cancelable, p.detail);\n }\n e.type && (0, a.default)(d, e), n.dispatchEvent(d);\n } else (d = document.createEventObject()).eventType = c, d.detail = arguments[1], \n e.type && (0, a.default)(d, e), n.fireEvent(\"on\" + d.eventType, d);\n } else if (void 0 !== i[c]) {\n arguments[0] = arguments[0].type ? arguments[0] : o.default.Event(arguments[0]), \n arguments[0].detail = arguments.slice(1);\n var h = i[c];\n (\"global\" === u ? Object.values(h).flat() : h[u]).forEach((function(e) {\n return e.apply(n, t);\n }));\n }\n }\n return this;\n };\n var n, a = u(i(600)), r = u(i(9380)), o = u(i(4963)), s = u(i(8741));\n function l(e, t) {\n return function(e) {\n if (Array.isArray(e)) return e;\n }(e) || function(e, t) {\n var i = null == e ? null : \"undefined\" != typeof Symbol && e[Symbol.iterator] || e[\"@@iterator\"];\n if (null != i) {\n var n, a, r, o, s = [], l = !0, c = !1;\n try {\n if (r = (i = i.call(e)).next, 0 === t) {\n if (Object(i) !== i) return;\n l = !1;\n } else for (;!(l = (n = r.call(i)).done) && (s.push(n.value), s.length !== t); l = !0) ;\n } catch (e) {\n c = !0, a = e;\n } finally {\n try {\n if (!l && null != i.return && (o = i.return(), Object(o) !== o)) return;\n } finally {\n if (c) throw a;\n }\n }\n return s;\n }\n }(e, t) || function(e, t) {\n if (!e) return;\n if (\"string\" == typeof e) return c(e, t);\n var i = Object.prototype.toString.call(e).slice(8, -1);\n \"Object\" === i && e.constructor && (i = e.constructor.name);\n if (\"Map\" === i || \"Set\" === i) return Array.from(e);\n if (\"Arguments\" === i || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)) return c(e, t);\n }(e, t) || function() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n }();\n }\n function c(e, t) {\n (null == t || t > e.length) && (t = e.length);\n for (var i = 0, n = new Array(t); i < t; i++) n[i] = e[i];\n return n;\n }\n function u(e) {\n return e && e.__esModule ? e : {\n default: e\n };\n }\n function f(e) {\n return e instanceof Element;\n }\n t.Event = n, \"function\" == typeof r.default.CustomEvent ? t.Event = n = r.default.CustomEvent : s.default && (t.Event = n = function(e, t) {\n t = t || {\n bubbles: !1,\n cancelable: !1,\n composed: !0,\n detail: void 0\n };\n var i = document.createEvent(\"CustomEvent\");\n return i.initCustomEvent(e, t.bubbles, t.cancelable, t.detail), i;\n }, n.prototype = r.default.Event.prototype);\n },\n 600: function(e, t) {\n function i(e) {\n return i = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function(e) {\n return typeof e;\n } : function(e) {\n return e && \"function\" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? \"symbol\" : typeof e;\n }, i(e);\n }\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.default = function e() {\n var t, n, a, r, o, s, l = arguments[0] || {}, c = 1, u = arguments.length, f = !1;\n \"boolean\" == typeof l && (f = l, l = arguments[c] || {}, c++);\n \"object\" !== i(l) && \"function\" != typeof l && (l = {});\n for (;c < u; c++) if (null != (t = arguments[c])) for (n in t) a = l[n], l !== (r = t[n]) && (f && r && (\"[object Object]\" === Object.prototype.toString.call(r) || (o = Array.isArray(r))) ? (o ? (o = !1, \n s = a && Array.isArray(a) ? a : []) : s = a && \"[object Object]\" === Object.prototype.toString.call(a) ? a : {}, \n l[n] = e(f, s, r)) : void 0 !== r && (l[n] = r));\n return l;\n };\n },\n 4963: function(e, t, i) {\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.default = void 0;\n var n = s(i(600)), a = s(i(9380)), r = s(i(253)), o = i(3776);\n function s(e) {\n return e && e.__esModule ? e : {\n default: e\n };\n }\n var l = a.default.document;\n function c(e) {\n return e instanceof c ? e : this instanceof c ? void (null != e && e !== a.default && (this[0] = e.nodeName ? e : void 0 !== e[0] && e[0].nodeName ? e[0] : l.querySelector(e), \n void 0 !== this[0] && null !== this[0] && (this[0].eventRegistry = this[0].eventRegistry || {}))) : new c(e);\n }\n c.prototype = {\n on: o.on,\n off: o.off,\n trigger: o.trigger\n }, c.extend = n.default, c.data = r.default, c.Event = o.Event;\n var u = c;\n t.default = u;\n },\n 9845: function(e, t, i) {\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.mobile = t.iphone = t.ie = void 0;\n var n, a = (n = i(9380)) && n.__esModule ? n : {\n default: n\n };\n var r = a.default.navigator && a.default.navigator.userAgent || \"\", o = r.indexOf(\"MSIE \") > 0 || r.indexOf(\"Trident/\") > 0, s = navigator.userAgentData && navigator.userAgentData.mobile || a.default.navigator && a.default.navigator.maxTouchPoints || \"ontouchstart\" in a.default, l = /iphone/i.test(r);\n t.iphone = l, t.mobile = s, t.ie = o;\n },\n 7184: function(e, t) {\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.default = function(e) {\n return e.replace(i, \"\\\\$1\");\n };\n var i = new RegExp(\"(\\\\\" + [ \"/\", \".\", \"*\", \"+\", \"?\", \"|\", \"(\", \")\", \"[\", \"]\", \"{\", \"}\", \"\\\\\", \"$\", \"^\" ].join(\"|\\\\\") + \")\", \"gim\");\n },\n 6030: function(e, t, i) {\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.EventHandlers = void 0;\n var n = i(8711), a = i(2839), r = i(9845), o = i(7215), s = i(7760), l = i(4713);\n function c(e, t) {\n var i = \"undefined\" != typeof Symbol && e[Symbol.iterator] || e[\"@@iterator\"];\n if (!i) {\n if (Array.isArray(e) || (i = function(e, t) {\n if (!e) return;\n if (\"string\" == typeof e) return u(e, t);\n var i = Object.prototype.toString.call(e).slice(8, -1);\n \"Object\" === i && e.constructor && (i = e.constructor.name);\n if (\"Map\" === i || \"Set\" === i) return Array.from(e);\n if (\"Arguments\" === i || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)) return u(e, t);\n }(e)) || t && e && \"number\" == typeof e.length) {\n i && (e = i);\n var n = 0, a = function() {};\n return {\n s: a,\n n: function() {\n return n >= e.length ? {\n done: !0\n } : {\n done: !1,\n value: e[n++]\n };\n },\n e: function(e) {\n throw e;\n },\n f: a\n };\n }\n throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n }\n var r, o = !0, s = !1;\n return {\n s: function() {\n i = i.call(e);\n },\n n: function() {\n var e = i.next();\n return o = e.done, e;\n },\n e: function(e) {\n s = !0, r = e;\n },\n f: function() {\n try {\n o || null == i.return || i.return();\n } finally {\n if (s) throw r;\n }\n }\n };\n }\n function u(e, t) {\n (null == t || t > e.length) && (t = e.length);\n for (var i = 0, n = new Array(t); i < t; i++) n[i] = e[i];\n return n;\n }\n var f = {\n keyEvent: function(e, t, i, c, u) {\n var d = this.inputmask, p = d.opts, h = d.dependencyLib, v = d.maskset, m = this, g = h(m), y = e.key, k = n.caret.call(d, m), b = p.onKeyDown.call(this, e, n.getBuffer.call(d), k, p);\n if (void 0 !== b) return b;\n if (y === a.keys.Backspace || y === a.keys.Delete || r.iphone && y === a.keys.BACKSPACE_SAFARI || e.ctrlKey && y === a.keys.x && !(\"oncut\" in m)) e.preventDefault(), \n o.handleRemove.call(d, m, y, k), (0, s.writeBuffer)(m, n.getBuffer.call(d, !0), v.p, e, m.inputmask._valueGet() !== n.getBuffer.call(d).join(\"\")); else if (y === a.keys.End || y === a.keys.PageDown) {\n e.preventDefault();\n var x = n.seekNext.call(d, n.getLastValidPosition.call(d));\n n.caret.call(d, m, e.shiftKey ? k.begin : x, x, !0);\n } else y === a.keys.Home && !e.shiftKey || y === a.keys.PageUp ? (e.preventDefault(), \n n.caret.call(d, m, 0, e.shiftKey ? k.begin : 0, !0)) : p.undoOnEscape && y === a.keys.Escape && !0 !== e.altKey ? ((0, \n s.checkVal)(m, !0, !1, d.undoValue.split(\"\")), g.trigger(\"click\")) : y !== a.keys.Insert || e.shiftKey || e.ctrlKey || void 0 !== d.userOptions.insertMode ? !0 === p.tabThrough && y === a.keys.Tab ? !0 === e.shiftKey ? (k.end = n.seekPrevious.call(d, k.end, !0), \n !0 === l.getTest.call(d, k.end - 1).match.static && k.end--, k.begin = n.seekPrevious.call(d, k.end, !0), \n k.begin >= 0 && k.end > 0 && (e.preventDefault(), n.caret.call(d, m, k.begin, k.end))) : (k.begin = n.seekNext.call(d, k.begin, !0), \n k.end = n.seekNext.call(d, k.begin, !0), k.end < v.maskLength && k.end--, k.begin <= v.maskLength && (e.preventDefault(), \n n.caret.call(d, m, k.begin, k.end))) : e.shiftKey || p.insertModeVisual && !1 === p.insertMode && (y === a.keys.ArrowRight ? setTimeout((function() {\n var e = n.caret.call(d, m);\n n.caret.call(d, m, e.begin);\n }), 0) : y === a.keys.ArrowLeft && setTimeout((function() {\n var e = n.translatePosition.call(d, m.inputmask.caretPos.begin);\n n.translatePosition.call(d, m.inputmask.caretPos.end);\n d.isRTL ? n.caret.call(d, m, e + (e === v.maskLength ? 0 : 1)) : n.caret.call(d, m, e - (0 === e ? 0 : 1));\n }), 0)) : o.isSelection.call(d, k) ? p.insertMode = !p.insertMode : (p.insertMode = !p.insertMode, \n n.caret.call(d, m, k.begin, k.begin));\n return d.isComposing = y == a.keys.Process || y == a.keys.Unidentified, d.ignorable = p.ignorables.includes(y), \n f.keypressEvent.call(this, e, t, i, c, u);\n },\n keypressEvent: function(e, t, i, r, l) {\n var c = this.inputmask || this, u = c.opts, f = c.dependencyLib, d = c.maskset, p = c.el, h = f(p), v = e.key;\n if (!0 === t || e.ctrlKey && e.altKey || !(e.ctrlKey || e.metaKey || c.ignorable)) {\n if (v) {\n var m, g = t ? {\n begin: l,\n end: l\n } : n.caret.call(c, p);\n v = u.substitutes[v] || v, d.writeOutBuffer = !0;\n var y = o.isValid.call(c, g, v, r, void 0, void 0, void 0, t);\n if (!1 !== y && (n.resetMaskSet.call(c, !0), m = void 0 !== y.caret ? y.caret : n.seekNext.call(c, y.pos.begin ? y.pos.begin : y.pos), \n d.p = m), m = u.numericInput && void 0 === y.caret ? n.seekPrevious.call(c, m) : m, \n !1 !== i && (setTimeout((function() {\n u.onKeyValidation.call(p, v, y);\n }), 0), d.writeOutBuffer && !1 !== y)) {\n var k = n.getBuffer.call(c);\n (0, s.writeBuffer)(p, k, m, e, !0 !== t);\n }\n if (e.preventDefault(), t) return !1 !== y && (y.forwardPosition = m), y;\n }\n } else v === a.keys.Enter && c.undoValue !== c._valueGet(!0) && (c.undoValue = c._valueGet(!0), \n setTimeout((function() {\n h.trigger(\"change\");\n }), 0));\n },\n pasteEvent: function(e) {\n var t, i = this.inputmask, a = i.opts, r = i._valueGet(!0), o = n.caret.call(i, this);\n i.isRTL && (t = o.end, o.end = n.translatePosition.call(i, o.begin), o.begin = n.translatePosition.call(i, t));\n var l = r.substr(0, o.begin), u = r.substr(o.end, r.length);\n if (l == (i.isRTL ? n.getBufferTemplate.call(i).slice().reverse() : n.getBufferTemplate.call(i)).slice(0, o.begin).join(\"\") && (l = \"\"), \n u == (i.isRTL ? n.getBufferTemplate.call(i).slice().reverse() : n.getBufferTemplate.call(i)).slice(o.end).join(\"\") && (u = \"\"), \n window.clipboardData && window.clipboardData.getData) r = l + window.clipboardData.getData(\"Text\") + u; else {\n if (!e.clipboardData || !e.clipboardData.getData) return !0;\n r = l + e.clipboardData.getData(\"text/plain\") + u;\n }\n var f = r;\n if (i.isRTL) {\n f = f.split(\"\");\n var d, p = c(n.getBufferTemplate.call(i));\n try {\n for (p.s(); !(d = p.n()).done; ) {\n var h = d.value;\n f[0] === h && f.shift();\n }\n } catch (e) {\n p.e(e);\n } finally {\n p.f();\n }\n f = f.join(\"\");\n }\n if (\"function\" == typeof a.onBeforePaste) {\n if (!1 === (f = a.onBeforePaste.call(i, f, a))) return !1;\n f || (f = r);\n }\n (0, s.checkVal)(this, !0, !1, f.toString().split(\"\"), e), e.preventDefault();\n },\n inputFallBackEvent: function(e) {\n var t = this.inputmask, i = t.opts, o = t.dependencyLib;\n var c, u = this, d = u.inputmask._valueGet(!0), p = (t.isRTL ? n.getBuffer.call(t).slice().reverse() : n.getBuffer.call(t)).join(\"\"), h = n.caret.call(t, u, void 0, void 0, !0);\n if (p !== d) {\n if (c = function(e, a, r) {\n for (var o, s, c, u = e.substr(0, r.begin).split(\"\"), f = e.substr(r.begin).split(\"\"), d = a.substr(0, r.begin).split(\"\"), p = a.substr(r.begin).split(\"\"), h = u.length >= d.length ? u.length : d.length, v = f.length >= p.length ? f.length : p.length, m = \"\", g = [], y = \"~\"; u.length < h; ) u.push(y);\n for (;d.length < h; ) d.push(y);\n for (;f.length < v; ) f.unshift(y);\n for (;p.length < v; ) p.unshift(y);\n var k = u.concat(f), b = d.concat(p);\n for (s = 0, o = k.length; s < o; s++) switch (c = l.getPlaceholder.call(t, n.translatePosition.call(t, s)), \n m) {\n case \"insertText\":\n b[s - 1] === k[s] && r.begin == k.length - 1 && g.push(k[s]), s = o;\n break;\n\n case \"insertReplacementText\":\n case \"deleteContentBackward\":\n k[s] === y ? r.end++ : s = o;\n break;\n\n default:\n k[s] !== b[s] && (k[s + 1] !== y && k[s + 1] !== c && void 0 !== k[s + 1] || (b[s] !== c || b[s + 1] !== y) && b[s] !== y ? b[s + 1] === y && b[s] === k[s + 1] ? (m = \"insertText\", \n g.push(k[s]), r.begin--, r.end--) : k[s] !== c && k[s] !== y && (k[s + 1] === y || b[s] !== k[s] && b[s + 1] === k[s + 1]) ? (m = \"insertReplacementText\", \n g.push(k[s]), r.begin--) : k[s] === y ? (m = \"deleteContentBackward\", (n.isMask.call(t, n.translatePosition.call(t, s), !0) || b[s] === i.radixPoint) && r.end++) : s = o : (m = \"insertText\", \n g.push(k[s]), r.begin--, r.end--));\n }\n return {\n action: m,\n data: g,\n caret: r\n };\n }(d, p, h), (u.inputmask.shadowRoot || u.ownerDocument).activeElement !== u && u.focus(), \n (0, s.writeBuffer)(u, n.getBuffer.call(t)), n.caret.call(t, u, h.begin, h.end, !0), \n !r.mobile && t.skipNextInsert && \"insertText\" === e.inputType && \"insertText\" === c.action && t.isComposing) return !1;\n switch (\"insertCompositionText\" === e.inputType && \"insertText\" === c.action && t.isComposing ? t.skipNextInsert = !0 : t.skipNextInsert = !1, \n c.action) {\n case \"insertText\":\n case \"insertReplacementText\":\n c.data.forEach((function(e, i) {\n var n = new o.Event(\"keypress\");\n n.key = e, t.ignorable = !1, f.keypressEvent.call(u, n);\n })), setTimeout((function() {\n t.$el.trigger(\"keyup\");\n }), 0);\n break;\n\n case \"deleteContentBackward\":\n var v = new o.Event(\"keydown\");\n v.key = a.keys.Backspace, f.keyEvent.call(u, v);\n break;\n\n default:\n (0, s.applyInputValue)(u, d), n.caret.call(t, u, h.begin, h.end, !0);\n }\n e.preventDefault();\n }\n },\n setValueEvent: function(e) {\n var t = this.inputmask, i = this, a = e && e.detail ? e.detail[0] : arguments[1];\n void 0 === a && (a = i.inputmask._valueGet(!0)), (0, s.applyInputValue)(i, a), (e.detail && void 0 !== e.detail[1] || void 0 !== arguments[2]) && n.caret.call(t, i, e.detail ? e.detail[1] : arguments[2]);\n },\n focusEvent: function(e) {\n var t = this.inputmask, i = t.opts, a = null == t ? void 0 : t._valueGet();\n i.showMaskOnFocus && a !== n.getBuffer.call(t).join(\"\") && (0, s.writeBuffer)(this, n.getBuffer.call(t), n.seekNext.call(t, n.getLastValidPosition.call(t))), \n !0 !== i.positionCaretOnTab || !1 !== t.mouseEnter || o.isComplete.call(t, n.getBuffer.call(t)) && -1 !== n.getLastValidPosition.call(t) || f.clickEvent.apply(this, [ e, !0 ]), \n t.undoValue = null == t ? void 0 : t._valueGet(!0);\n },\n invalidEvent: function(e) {\n this.inputmask.validationEvent = !0;\n },\n mouseleaveEvent: function() {\n var e = this.inputmask, t = e.opts, i = this;\n e.mouseEnter = !1, t.clearMaskOnLostFocus && (i.inputmask.shadowRoot || i.ownerDocument).activeElement !== i && (0, \n s.HandleNativePlaceholder)(i, e.originalPlaceholder);\n },\n clickEvent: function(e, t) {\n var i = this.inputmask;\n i.clicked++;\n var a = this;\n if ((a.inputmask.shadowRoot || a.ownerDocument).activeElement === a) {\n var r = n.determineNewCaretPosition.call(i, n.caret.call(i, a), t);\n void 0 !== r && n.caret.call(i, a, r);\n }\n },\n cutEvent: function(e) {\n var t = this.inputmask, i = t.maskset, r = this, l = n.caret.call(t, r), c = t.isRTL ? n.getBuffer.call(t).slice(l.end, l.begin) : n.getBuffer.call(t).slice(l.begin, l.end), u = t.isRTL ? c.reverse().join(\"\") : c.join(\"\");\n window.navigator.clipboard ? window.navigator.clipboard.writeText(u) : window.clipboardData && window.clipboardData.getData && window.clipboardData.setData(\"Text\", u), \n o.handleRemove.call(t, r, a.keys.Delete, l), (0, s.writeBuffer)(r, n.getBuffer.call(t), i.p, e, t.undoValue !== t._valueGet(!0));\n },\n blurEvent: function(e) {\n var t = this.inputmask, i = t.opts, a = t.dependencyLib;\n t.clicked = 0;\n var r = a(this), l = this;\n if (l.inputmask) {\n (0, s.HandleNativePlaceholder)(l, t.originalPlaceholder);\n var c = l.inputmask._valueGet(), u = n.getBuffer.call(t).slice();\n \"\" !== c && (i.clearMaskOnLostFocus && (-1 === n.getLastValidPosition.call(t) && c === n.getBufferTemplate.call(t).join(\"\") ? u = [] : s.clearOptionalTail.call(t, u)), \n !1 === o.isComplete.call(t, u) && (setTimeout((function() {\n r.trigger(\"incomplete\");\n }), 0), i.clearIncomplete && (n.resetMaskSet.call(t), u = i.clearMaskOnLostFocus ? [] : n.getBufferTemplate.call(t).slice())), \n (0, s.writeBuffer)(l, u, void 0, e)), t.undoValue !== t._valueGet(!0) && (t.undoValue = t._valueGet(!0), \n r.trigger(\"change\"));\n }\n },\n mouseenterEvent: function() {\n var e = this.inputmask, t = e.opts.showMaskOnHover, i = this;\n if (e.mouseEnter = !0, (i.inputmask.shadowRoot || i.ownerDocument).activeElement !== i) {\n var a = (e.isRTL ? n.getBufferTemplate.call(e).slice().reverse() : n.getBufferTemplate.call(e)).join(\"\");\n t && (0, s.HandleNativePlaceholder)(i, a);\n }\n },\n submitEvent: function() {\n var e = this.inputmask, t = e.opts;\n e.undoValue !== e._valueGet(!0) && e.$el.trigger(\"change\"), -1 === n.getLastValidPosition.call(e) && e._valueGet && e._valueGet() === n.getBufferTemplate.call(e).join(\"\") && e._valueSet(\"\"), \n t.clearIncomplete && !1 === o.isComplete.call(e, n.getBuffer.call(e)) && e._valueSet(\"\"), \n t.removeMaskOnSubmit && (e._valueSet(e.unmaskedvalue(), !0), setTimeout((function() {\n (0, s.writeBuffer)(e.el, n.getBuffer.call(e));\n }), 0));\n },\n resetEvent: function() {\n var e = this.inputmask;\n e.refreshValue = !0, setTimeout((function() {\n (0, s.applyInputValue)(e.el, e._valueGet(!0));\n }), 0);\n }\n };\n t.EventHandlers = f;\n },\n 9716: function(e, t, i) {\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.EventRuler = void 0;\n var n, a = (n = i(2394)) && n.__esModule ? n : {\n default: n\n }, r = i(2839), o = i(8711), s = i(7760);\n var l = {\n on: function(e, t, i) {\n var n = e.inputmask.dependencyLib, l = function(t) {\n t.originalEvent && (t = t.originalEvent || t, arguments[0] = t);\n var l, c = this, u = c.inputmask, f = u ? u.opts : void 0;\n if (void 0 === u && \"FORM\" !== this.nodeName) {\n var d = n.data(c, \"_inputmask_opts\");\n n(c).off(), d && new a.default(d).mask(c);\n } else {\n if ([ \"submit\", \"reset\", \"setvalue\" ].includes(t.type) || \"FORM\" === this.nodeName || !(c.disabled || c.readOnly && !(\"keydown\" === t.type && t.ctrlKey && t.key === r.keys.c || !1 === f.tabThrough && t.key === r.keys.Tab))) {\n switch (t.type) {\n case \"input\":\n if (!0 === u.skipInputEvent) return u.skipInputEvent = !1, t.preventDefault();\n break;\n\n case \"click\":\n case \"focus\":\n return u.validationEvent ? (u.validationEvent = !1, e.blur(), (0, s.HandleNativePlaceholder)(e, (u.isRTL ? o.getBufferTemplate.call(u).slice().reverse() : o.getBufferTemplate.call(u)).join(\"\")), \n setTimeout((function() {\n e.focus();\n }), f.validationEventTimeOut), !1) : (l = arguments, void setTimeout((function() {\n e.inputmask && i.apply(c, l);\n }), 0));\n }\n var p = i.apply(c, arguments);\n return !1 === p && (t.preventDefault(), t.stopPropagation()), p;\n }\n t.preventDefault();\n }\n };\n [ \"submit\", \"reset\" ].includes(t) ? (l = l.bind(e), null !== e.form && n(e.form).on(t, l)) : n(e).on(t, l), \n e.inputmask.events[t] = e.inputmask.events[t] || [], e.inputmask.events[t].push(l);\n },\n off: function(e, t) {\n if (e.inputmask && e.inputmask.events) {\n var i = e.inputmask.dependencyLib, n = e.inputmask.events;\n for (var a in t && ((n = [])[t] = e.inputmask.events[t]), n) {\n for (var r = n[a]; r.length > 0; ) {\n var o = r.pop();\n [ \"submit\", \"reset\" ].includes(a) ? null !== e.form && i(e.form).off(a, o) : i(e).off(a, o);\n }\n delete e.inputmask.events[a];\n }\n }\n }\n };\n t.EventRuler = l;\n },\n 219: function(e, t, i) {\n var n = d(i(2394)), a = i(2839), r = d(i(7184)), o = i(8711), s = i(4713);\n function l(e, t) {\n return function(e) {\n if (Array.isArray(e)) return e;\n }(e) || function(e, t) {\n var i = null == e ? null : \"undefined\" != typeof Symbol && e[Symbol.iterator] || e[\"@@iterator\"];\n if (null != i) {\n var n, a, r, o, s = [], l = !0, c = !1;\n try {\n if (r = (i = i.call(e)).next, 0 === t) {\n if (Object(i) !== i) return;\n l = !1;\n } else for (;!(l = (n = r.call(i)).done) && (s.push(n.value), s.length !== t); l = !0) ;\n } catch (e) {\n c = !0, a = e;\n } finally {\n try {\n if (!l && null != i.return && (o = i.return(), Object(o) !== o)) return;\n } finally {\n if (c) throw a;\n }\n }\n return s;\n }\n }(e, t) || function(e, t) {\n if (!e) return;\n if (\"string\" == typeof e) return c(e, t);\n var i = Object.prototype.toString.call(e).slice(8, -1);\n \"Object\" === i && e.constructor && (i = e.constructor.name);\n if (\"Map\" === i || \"Set\" === i) return Array.from(e);\n if (\"Arguments\" === i || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)) return c(e, t);\n }(e, t) || function() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n }();\n }\n function c(e, t) {\n (null == t || t > e.length) && (t = e.length);\n for (var i = 0, n = new Array(t); i < t; i++) n[i] = e[i];\n return n;\n }\n function u(e) {\n return u = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function(e) {\n return typeof e;\n } : function(e) {\n return e && \"function\" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? \"symbol\" : typeof e;\n }, u(e);\n }\n function f(e, t) {\n for (var i = 0; i < t.length; i++) {\n var n = t[i];\n n.enumerable = n.enumerable || !1, n.configurable = !0, \"value\" in n && (n.writable = !0), \n Object.defineProperty(e, (a = n.key, r = void 0, r = function(e, t) {\n if (\"object\" !== u(e) || null === e) return e;\n var i = e[Symbol.toPrimitive];\n if (void 0 !== i) {\n var n = i.call(e, t || \"default\");\n if (\"object\" !== u(n)) return n;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === t ? String : Number)(e);\n }(a, \"string\"), \"symbol\" === u(r) ? r : String(r)), n);\n }\n var a, r;\n }\n function d(e) {\n return e && e.__esModule ? e : {\n default: e\n };\n }\n var p = n.default.dependencyLib, h = function() {\n function e(t, i, n) {\n !function(e, t) {\n if (!(e instanceof t)) throw new TypeError(\"Cannot call a class as a function\");\n }(this, e), this.mask = t, this.format = i, this.opts = n, this._date = new Date(1, 0, 1), \n this.initDateObject(t, this.opts);\n }\n var t, i, n;\n return t = e, (i = [ {\n key: \"date\",\n get: function() {\n return void 0 === this._date && (this._date = new Date(1, 0, 1), this.initDateObject(void 0, this.opts)), \n this._date;\n }\n }, {\n key: \"initDateObject\",\n value: function(e, t) {\n var i;\n for (P(t).lastIndex = 0; i = P(t).exec(this.format); ) {\n var n = new RegExp(\"\\\\d+$\").exec(i[0]), a = n ? i[0][0] + \"x\" : i[0], r = void 0;\n if (void 0 !== e) {\n if (n) {\n var o = P(t).lastIndex, s = E(i.index, t);\n P(t).lastIndex = o, r = e.slice(0, e.indexOf(s.nextMatch[0]));\n } else r = e.slice(0, g[a] && g[a][4] || a.length);\n e = e.slice(r.length);\n }\n Object.prototype.hasOwnProperty.call(g, a) && this.setValue(this, r, a, g[a][2], g[a][1]);\n }\n }\n }, {\n key: \"setValue\",\n value: function(e, t, i, n, a) {\n if (void 0 !== t && (e[n] = \"ampm\" === n ? t : t.replace(/[^0-9]/g, \"0\"), e[\"raw\" + n] = t.replace(/\\s/g, \"_\")), \n void 0 !== a) {\n var r = e[n];\n (\"day\" === n && 29 === parseInt(r) || \"month\" === n && 2 === parseInt(r)) && (29 !== parseInt(e.day) || 2 !== parseInt(e.month) || \"\" !== e.year && void 0 !== e.year || e._date.setFullYear(2012, 1, 29)), \n \"day\" === n && (m = !0, 0 === parseInt(r) && (r = 1)), \"month\" === n && (m = !0), \n \"year\" === n && (m = !0, r.length < 4 && (r = M(r, 4, !0))), \"\" === r || isNaN(r) || a.call(e._date, r), \n \"ampm\" === n && a.call(e._date, r);\n }\n }\n }, {\n key: \"reset\",\n value: function() {\n this._date = new Date(1, 0, 1);\n }\n }, {\n key: \"reInit\",\n value: function() {\n this._date = void 0, this.date;\n }\n } ]) && f(t.prototype, i), n && f(t, n), Object.defineProperty(t, \"prototype\", {\n writable: !1\n }), e;\n }(), v = (new Date).getFullYear(), m = !1, g = {\n d: [ \"[1-9]|[12][0-9]|3[01]\", Date.prototype.setDate, \"day\", Date.prototype.getDate ],\n dd: [ \"0[1-9]|[12][0-9]|3[01]\", Date.prototype.setDate, \"day\", function() {\n return M(Date.prototype.getDate.call(this), 2);\n } ],\n ddd: [ \"\" ],\n dddd: [ \"\" ],\n m: [ \"[1-9]|1[012]\", function(e) {\n var t = e ? parseInt(e) : 0;\n return t > 0 && t--, Date.prototype.setMonth.call(this, t);\n }, \"month\", function() {\n return Date.prototype.getMonth.call(this) + 1;\n } ],\n mm: [ \"0[1-9]|1[012]\", function(e) {\n var t = e ? parseInt(e) : 0;\n return t > 0 && t--, Date.prototype.setMonth.call(this, t);\n }, \"month\", function() {\n return M(Date.prototype.getMonth.call(this) + 1, 2);\n } ],\n mmm: [ \"\" ],\n mmmm: [ \"\" ],\n yy: [ \"[0-9]{2}\", Date.prototype.setFullYear, \"year\", function() {\n return M(Date.prototype.getFullYear.call(this), 2);\n } ],\n yyyy: [ \"[0-9]{4}\", Date.prototype.setFullYear, \"year\", function() {\n return M(Date.prototype.getFullYear.call(this), 4);\n } ],\n h: [ \"[1-9]|1[0-2]\", Date.prototype.setHours, \"hours\", Date.prototype.getHours ],\n hh: [ \"0[1-9]|1[0-2]\", Date.prototype.setHours, \"hours\", function() {\n return M(Date.prototype.getHours.call(this), 2);\n } ],\n hx: [ function(e) {\n return \"[0-9]{\".concat(e, \"}\");\n }, Date.prototype.setHours, \"hours\", function(e) {\n return Date.prototype.getHours;\n } ],\n H: [ \"1?[0-9]|2[0-3]\", Date.prototype.setHours, \"hours\", Date.prototype.getHours ],\n HH: [ \"0[0-9]|1[0-9]|2[0-3]\", Date.prototype.setHours, \"hours\", function() {\n return M(Date.prototype.getHours.call(this), 2);\n } ],\n Hx: [ function(e) {\n return \"[0-9]{\".concat(e, \"}\");\n }, Date.prototype.setHours, \"hours\", function(e) {\n return function() {\n return M(Date.prototype.getHours.call(this), e);\n };\n } ],\n M: [ \"[1-5]?[0-9]\", Date.prototype.setMinutes, \"minutes\", Date.prototype.getMinutes ],\n MM: [ \"0[0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9]\", Date.prototype.setMinutes, \"minutes\", function() {\n return M(Date.prototype.getMinutes.call(this), 2);\n } ],\n s: [ \"[1-5]?[0-9]\", Date.prototype.setSeconds, \"seconds\", Date.prototype.getSeconds ],\n ss: [ \"0[0-9]|1[0-9]|2[0-9]|3[0-9]|4[0-9]|5[0-9]\", Date.prototype.setSeconds, \"seconds\", function() {\n return M(Date.prototype.getSeconds.call(this), 2);\n } ],\n l: [ \"[0-9]{3}\", Date.prototype.setMilliseconds, \"milliseconds\", function() {\n return M(Date.prototype.getMilliseconds.call(this), 3);\n }, 3 ],\n L: [ \"[0-9]{2}\", Date.prototype.setMilliseconds, \"milliseconds\", function() {\n return M(Date.prototype.getMilliseconds.call(this), 2);\n }, 2 ],\n t: [ \"[ap]\", k, \"ampm\", b, 1 ],\n tt: [ \"[ap]m\", k, \"ampm\", b, 2 ],\n T: [ \"[AP]\", k, \"ampm\", b, 1 ],\n TT: [ \"[AP]M\", k, \"ampm\", b, 2 ],\n Z: [ \".*\", void 0, \"Z\", function() {\n var e = this.toString().match(/\\((.+)\\)/)[1];\n e.includes(\" \") && (e = (e = e.replace(\"-\", \" \").toUpperCase()).split(\" \").map((function(e) {\n return l(e, 1)[0];\n })).join(\"\"));\n return e;\n } ],\n o: [ \"\" ],\n S: [ \"\" ]\n }, y = {\n isoDate: \"yyyy-mm-dd\",\n isoTime: \"HH:MM:ss\",\n isoDateTime: \"yyyy-mm-dd'T'HH:MM:ss\",\n isoUtcDateTime: \"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'\"\n };\n function k(e) {\n var t = this.getHours();\n e.toLowerCase().includes(\"p\") ? this.setHours(t + 12) : e.toLowerCase().includes(\"a\") && t >= 12 && this.setHours(t - 12);\n }\n function b() {\n var e = this.getHours();\n return (e = e || 12) >= 12 ? \"PM\" : \"AM\";\n }\n function x(e) {\n var t = new RegExp(\"\\\\d+$\").exec(e[0]);\n if (t && void 0 !== t[0]) {\n var i = g[e[0][0] + \"x\"].slice(\"\");\n return i[0] = i[0](t[0]), i[3] = i[3](t[0]), i;\n }\n if (g[e[0]]) return g[e[0]];\n }\n function P(e) {\n if (!e.tokenizer) {\n var t = [], i = [];\n for (var n in g) if (/\\.*x$/.test(n)) {\n var a = n[0] + \"\\\\d+\";\n -1 === i.indexOf(a) && i.push(a);\n } else -1 === t.indexOf(n[0]) && t.push(n[0]);\n e.tokenizer = \"(\" + (i.length > 0 ? i.join(\"|\") + \"|\" : \"\") + t.join(\"+|\") + \")+?|.\", \n e.tokenizer = new RegExp(e.tokenizer, \"g\");\n }\n return e.tokenizer;\n }\n function w(e, t, i) {\n if (!m) return !0;\n if (void 0 === e.rawday || !isFinite(e.rawday) && new Date(e.date.getFullYear(), isFinite(e.rawmonth) ? e.month : e.date.getMonth() + 1, 0).getDate() >= e.day || \"29\" == e.day && (!isFinite(e.rawyear) || void 0 === e.rawyear || \"\" === e.rawyear) || new Date(e.date.getFullYear(), isFinite(e.rawmonth) ? e.month : e.date.getMonth() + 1, 0).getDate() >= e.day) return t;\n if (\"29\" == e.day) {\n var n = E(t.pos, i);\n if (\"yyyy\" === n.targetMatch[0] && t.pos - n.targetMatchIndex == 2) return t.remove = t.pos + 1, \n t;\n } else if (\"02\" == e.month && \"30\" == e.day && void 0 !== t.c) return e.day = \"03\", \n e.date.setDate(3), e.date.setMonth(1), t.insert = [ {\n pos: t.pos,\n c: \"0\"\n }, {\n pos: t.pos + 1,\n c: t.c\n } ], t.caret = o.seekNext.call(this, t.pos + 1), t;\n return !1;\n }\n function S(e, t, i, n) {\n var a, o, s = \"\";\n for (P(i).lastIndex = 0; a = P(i).exec(e); ) {\n if (void 0 === t) if (o = x(a)) s += \"(\" + o[0] + \")\"; else switch (a[0]) {\n case \"[\":\n s += \"(\";\n break;\n\n case \"]\":\n s += \")?\";\n break;\n\n default:\n s += (0, r.default)(a[0]);\n } else if (o = x(a)) if (!0 !== n && o[3]) s += o[3].call(t.date); else o[2] ? s += t[\"raw\" + o[2]] : s += a[0]; else s += a[0];\n }\n return s;\n }\n function M(e, t, i) {\n for (e = String(e), t = t || 2; e.length < t; ) e = i ? e + \"0\" : \"0\" + e;\n return e;\n }\n function _(e, t, i) {\n return \"string\" == typeof e ? new h(e, t, i) : e && \"object\" === u(e) && Object.prototype.hasOwnProperty.call(e, \"date\") ? e : void 0;\n }\n function O(e, t) {\n return S(t.inputFormat, {\n date: e\n }, t);\n }\n function E(e, t) {\n var i, n, a = 0, r = 0;\n for (P(t).lastIndex = 0; n = P(t).exec(t.inputFormat); ) {\n var o = new RegExp(\"\\\\d+$\").exec(n[0]);\n if ((a += r = o ? parseInt(o[0]) : n[0].length) >= e + 1) {\n i = n, n = P(t).exec(t.inputFormat);\n break;\n }\n }\n return {\n targetMatchIndex: a - r,\n nextMatch: n,\n targetMatch: i\n };\n }\n n.default.extendAliases({\n datetime: {\n mask: function(e) {\n return e.numericInput = !1, g.S = e.i18n.ordinalSuffix.join(\"|\"), e.inputFormat = y[e.inputFormat] || e.inputFormat, \n e.displayFormat = y[e.displayFormat] || e.displayFormat || e.inputFormat, e.outputFormat = y[e.outputFormat] || e.outputFormat || e.inputFormat, \n e.placeholder = \"\" !== e.placeholder ? e.placeholder : e.inputFormat.replace(/[[\\]]/, \"\"), \n e.regex = S(e.inputFormat, void 0, e), e.min = _(e.min, e.inputFormat, e), e.max = _(e.max, e.inputFormat, e), \n null;\n },\n placeholder: \"\",\n inputFormat: \"isoDateTime\",\n displayFormat: null,\n outputFormat: null,\n min: null,\n max: null,\n skipOptionalPartCharacter: \"\",\n i18n: {\n dayNames: [ \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\", \"Sun\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\", \"Sunday\" ],\n monthNames: [ \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\", \"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\" ],\n ordinalSuffix: [ \"st\", \"nd\", \"rd\", \"th\" ]\n },\n preValidation: function(e, t, i, n, a, r, o, s) {\n if (s) return !0;\n if (isNaN(i) && e[t] !== i) {\n var l = E(t, a);\n if (l.nextMatch && l.nextMatch[0] === i && l.targetMatch[0].length > 1) {\n var c = g[l.targetMatch[0]][0];\n if (new RegExp(c).test(\"0\" + e[t - 1])) return e[t] = e[t - 1], e[t - 1] = \"0\", \n {\n fuzzy: !0,\n buffer: e,\n refreshFromBuffer: {\n start: t - 1,\n end: t + 1\n },\n pos: t + 1\n };\n }\n }\n return !0;\n },\n postValidation: function(e, t, i, n, a, r, o, l) {\n var c, u;\n if (o) return !0;\n if (!1 === n && (((c = E(t + 1, a)).targetMatch && c.targetMatchIndex === t && c.targetMatch[0].length > 1 && void 0 !== g[c.targetMatch[0]] || (c = E(t + 2, a)).targetMatch && c.targetMatchIndex === t + 1 && c.targetMatch[0].length > 1 && void 0 !== g[c.targetMatch[0]]) && (u = g[c.targetMatch[0]][0]), \n void 0 !== u && (void 0 !== r.validPositions[t + 1] && new RegExp(u).test(i + \"0\") ? (e[t] = i, \n e[t + 1] = \"0\", n = {\n pos: t + 2,\n caret: t\n }) : new RegExp(u).test(\"0\" + i) && (e[t] = \"0\", e[t + 1] = i, n = {\n pos: t + 2\n })), !1 === n)) return n;\n if (n.fuzzy && (e = n.buffer, t = n.pos), (c = E(t, a)).targetMatch && c.targetMatch[0] && void 0 !== g[c.targetMatch[0]]) {\n var f = g[c.targetMatch[0]];\n u = f[0];\n var d = e.slice(c.targetMatchIndex, c.targetMatchIndex + c.targetMatch[0].length);\n if (!1 === new RegExp(u).test(d.join(\"\")) && 2 === c.targetMatch[0].length && r.validPositions[c.targetMatchIndex] && r.validPositions[c.targetMatchIndex + 1] && (r.validPositions[c.targetMatchIndex + 1].input = \"0\"), \n \"year\" == f[2]) for (var p = s.getMaskTemplate.call(this, !1, 1, void 0, !0), h = t + 1; h < e.length; h++) e[h] = p[h], \n delete r.validPositions[h];\n }\n var m = n, y = _(e.join(\"\"), a.inputFormat, a);\n return m && !isNaN(y.date.getTime()) && (a.prefillYear && (m = function(e, t, i) {\n if (e.year !== e.rawyear) {\n var n = v.toString(), a = e.rawyear.replace(/[^0-9]/g, \"\"), r = n.slice(0, a.length), o = n.slice(a.length);\n if (2 === a.length && a === r) {\n var s = new Date(v, e.month - 1, e.day);\n e.day == s.getDate() && (!i.max || i.max.date.getTime() >= s.getTime()) && (e.date.setFullYear(v), \n e.year = n, t.insert = [ {\n pos: t.pos + 1,\n c: o[0]\n }, {\n pos: t.pos + 2,\n c: o[1]\n } ]);\n }\n }\n return t;\n }(y, m, a)), m = function(e, t, i, n, a) {\n if (!t) return t;\n if (t && i.min && !isNaN(i.min.date.getTime())) {\n var r;\n for (e.reset(), P(i).lastIndex = 0; r = P(i).exec(i.inputFormat); ) {\n var o;\n if ((o = x(r)) && o[3]) {\n for (var s = o[1], l = e[o[2]], c = i.min[o[2]], u = i.max ? i.max[o[2]] : c, f = [], d = !1, p = 0; p < c.length; p++) void 0 !== n.validPositions[p + r.index] || d ? (f[p] = l[p], \n d = d || l[p] > c[p]) : (f[p] = c[p], \"year\" === o[2] && l.length - 1 == p && c != u && (f = (parseInt(f.join(\"\")) + 1).toString().split(\"\")), \n \"ampm\" === o[2] && c != u && i.min.date.getTime() > e.date.getTime() && (f[p] = u[p]));\n s.call(e._date, f.join(\"\"));\n }\n }\n t = i.min.date.getTime() <= e.date.getTime(), e.reInit();\n }\n return t && i.max && (isNaN(i.max.date.getTime()) || (t = i.max.date.getTime() >= e.date.getTime())), \n t;\n }(y, m = w.call(this, y, m, a), a, r)), void 0 !== t && m && n.pos !== t ? {\n buffer: S(a.inputFormat, y, a).split(\"\"),\n refreshFromBuffer: {\n start: t,\n end: n.pos\n },\n pos: n.caret || n.pos\n } : m;\n },\n onKeyDown: function(e, t, i, n) {\n e.ctrlKey && e.key === a.keys.ArrowRight && (this.inputmask._valueSet(O(new Date, n)), \n p(this).trigger(\"setvalue\"));\n },\n onUnMask: function(e, t, i) {\n return t ? S(i.outputFormat, _(e, i.inputFormat, i), i, !0) : t;\n },\n casing: function(e, t, i, n) {\n return 0 == t.nativeDef.indexOf(\"[ap]\") ? e.toLowerCase() : 0 == t.nativeDef.indexOf(\"[AP]\") ? e.toUpperCase() : e;\n },\n onBeforeMask: function(e, t) {\n return \"[object Date]\" === Object.prototype.toString.call(e) && (e = O(e, t)), e;\n },\n insertMode: !1,\n insertModeVisual: !1,\n shiftPositions: !1,\n keepStatic: !1,\n inputmode: \"numeric\",\n prefillYear: !0\n }\n });\n },\n 3851: function(e, t, i) {\n var n, a = (n = i(2394)) && n.__esModule ? n : {\n default: n\n }, r = i(8711), o = i(4713);\n a.default.extendDefinitions({\n A: {\n validator: \"[A-Za-z\\u0410-\\u044f\\u0401\\u0451\\xc0-\\xff\\xb5]\",\n casing: \"upper\"\n },\n \"&\": {\n validator: \"[0-9A-Za-z\\u0410-\\u044f\\u0401\\u0451\\xc0-\\xff\\xb5]\",\n casing: \"upper\"\n },\n \"#\": {\n validator: \"[0-9A-Fa-f]\",\n casing: \"upper\"\n }\n });\n var s = new RegExp(\"25[0-5]|2[0-4][0-9]|[01][0-9][0-9]\");\n function l(e, t, i, n, a) {\n return i - 1 > -1 && \".\" !== t.buffer[i - 1] ? (e = t.buffer[i - 1] + e, e = i - 2 > -1 && \".\" !== t.buffer[i - 2] ? t.buffer[i - 2] + e : \"0\" + e) : e = \"00\" + e, \n s.test(e);\n }\n a.default.extendAliases({\n cssunit: {\n regex: \"[+-]?[0-9]+\\\\.?([0-9]+)?(px|em|rem|ex|%|in|cm|mm|pt|pc)\"\n },\n url: {\n regex: \"(https?|ftp)://.*\",\n autoUnmask: !1,\n keepStatic: !1,\n tabThrough: !0\n },\n ip: {\n mask: \"i{1,3}.j{1,3}.k{1,3}.l{1,3}\",\n definitions: {\n i: {\n validator: l\n },\n j: {\n validator: l\n },\n k: {\n validator: l\n },\n l: {\n validator: l\n }\n },\n onUnMask: function(e, t, i) {\n return e;\n },\n inputmode: \"decimal\",\n substitutes: {\n \",\": \".\"\n }\n },\n email: {\n mask: function(e) {\n var t = e.separator, i = e.quantifier, n = \"*{1,64}[.*{1,64}][.*{1,64}][.*{1,63}]@-{1,63}.-{1,63}[.-{1,63}][.-{1,63}]\", a = n;\n if (t) for (var r = 0; r < i; r++) a += \"[\".concat(t).concat(n, \"]\");\n return a;\n },\n greedy: !1,\n casing: \"lower\",\n separator: null,\n quantifier: 5,\n skipOptionalPartCharacter: \"\",\n onBeforePaste: function(e, t) {\n return (e = e.toLowerCase()).replace(\"mailto:\", \"\");\n },\n definitions: {\n \"*\": {\n validator: \"[0-9\\uff11-\\uff19A-Za-z\\u0410-\\u044f\\u0401\\u0451\\xc0-\\xff\\xb5!#$%&'*+/=?^_`{|}~-]\"\n },\n \"-\": {\n validator: \"[0-9A-Za-z-]\"\n }\n },\n onUnMask: function(e, t, i) {\n return e;\n },\n inputmode: \"email\"\n },\n mac: {\n mask: \"##:##:##:##:##:##\"\n },\n vin: {\n mask: \"V{13}9{4}\",\n definitions: {\n V: {\n validator: \"[A-HJ-NPR-Za-hj-npr-z\\\\d]\",\n casing: \"upper\"\n }\n },\n clearIncomplete: !0,\n autoUnmask: !0\n },\n ssn: {\n mask: \"999-99-9999\",\n postValidation: function(e, t, i, n, a, s, l) {\n var c = o.getMaskTemplate.call(this, !0, r.getLastValidPosition.call(this), !0, !0);\n return /^(?!219-09-9999|078-05-1120)(?!666|000|9.{2}).{3}-(?!00).{2}-(?!0{4}).{4}$/.test(c.join(\"\"));\n }\n }\n });\n },\n 207: function(e, t, i) {\n var n = s(i(2394)), a = s(i(7184)), r = i(8711), o = i(2839);\n function s(e) {\n return e && e.__esModule ? e : {\n default: e\n };\n }\n var l = n.default.dependencyLib;\n function c(e, t) {\n for (var i = \"\", a = 0; a < e.length; a++) n.default.prototype.definitions[e.charAt(a)] || t.definitions[e.charAt(a)] || t.optionalmarker[0] === e.charAt(a) || t.optionalmarker[1] === e.charAt(a) || t.quantifiermarker[0] === e.charAt(a) || t.quantifiermarker[1] === e.charAt(a) || t.groupmarker[0] === e.charAt(a) || t.groupmarker[1] === e.charAt(a) || t.alternatormarker === e.charAt(a) ? i += \"\\\\\" + e.charAt(a) : i += e.charAt(a);\n return i;\n }\n function u(e, t, i, n) {\n if (e.length > 0 && t > 0 && (!i.digitsOptional || n)) {\n var a = e.indexOf(i.radixPoint), r = !1;\n i.negationSymbol.back === e[e.length - 1] && (r = !0, e.length--), -1 === a && (e.push(i.radixPoint), \n a = e.length - 1);\n for (var o = 1; o <= t; o++) isFinite(e[a + o]) || (e[a + o] = \"0\");\n }\n return r && e.push(i.negationSymbol.back), e;\n }\n function f(e, t) {\n var i = 0;\n for (var n in \"+\" === e && (i = r.seekNext.call(this, t.validPositions.length - 1)), \n t.tests) if ((n = parseInt(n)) >= i) for (var a = 0, o = t.tests[n].length; a < o; a++) if ((void 0 === t.validPositions[n] || \"-\" === e) && t.tests[n][a].match.def === e) return n + (void 0 !== t.validPositions[n] && \"-\" !== e ? 1 : 0);\n return i;\n }\n function d(e, t) {\n for (var i = -1, n = 0, a = t.validPositions.length; n < a; n++) {\n var r = t.validPositions[n];\n if (r && r.match.def === e) {\n i = n;\n break;\n }\n }\n return i;\n }\n function p(e, t, i, n, a) {\n var r = t.buffer ? t.buffer.indexOf(a.radixPoint) : -1, o = (-1 !== r || n && a.jitMasking) && new RegExp(a.definitions[9].validator).test(e);\n return a._radixDance && -1 !== r && o && null == t.validPositions[r] ? {\n insert: {\n pos: r === i ? r + 1 : r,\n c: a.radixPoint\n },\n pos: i\n } : o;\n }\n n.default.extendAliases({\n numeric: {\n mask: function(e) {\n e.repeat = 0, e.groupSeparator === e.radixPoint && e.digits && \"0\" !== e.digits && (\".\" === e.radixPoint ? e.groupSeparator = \",\" : \",\" === e.radixPoint ? e.groupSeparator = \".\" : e.groupSeparator = \"\"), \n \" \" === e.groupSeparator && (e.skipOptionalPartCharacter = void 0), e.placeholder.length > 1 && (e.placeholder = e.placeholder.charAt(0)), \n \"radixFocus\" === e.positionCaretOnClick && \"\" === e.placeholder && (e.positionCaretOnClick = \"lvp\");\n var t = \"0\", i = e.radixPoint;\n !0 === e.numericInput && void 0 === e.__financeInput ? (t = \"1\", e.positionCaretOnClick = \"radixFocus\" === e.positionCaretOnClick ? \"lvp\" : e.positionCaretOnClick, \n e.digitsOptional = !1, isNaN(e.digits) && (e.digits = 2), e._radixDance = !1, i = \",\" === e.radixPoint ? \"?\" : \"!\", \n \"\" !== e.radixPoint && void 0 === e.definitions[i] && (e.definitions[i] = {}, e.definitions[i].validator = \"[\" + e.radixPoint + \"]\", \n e.definitions[i].placeholder = e.radixPoint, e.definitions[i].static = !0, e.definitions[i].generated = !0)) : (e.__financeInput = !1, \n e.numericInput = !0);\n var n, r = \"[+]\";\n if (r += c(e.prefix, e), \"\" !== e.groupSeparator ? (void 0 === e.definitions[e.groupSeparator] && (e.definitions[e.groupSeparator] = {}, \n e.definitions[e.groupSeparator].validator = \"[\" + e.groupSeparator + \"]\", e.definitions[e.groupSeparator].placeholder = e.groupSeparator, \n e.definitions[e.groupSeparator].static = !0, e.definitions[e.groupSeparator].generated = !0), \n r += e._mask(e)) : r += \"9{+}\", void 0 !== e.digits && 0 !== e.digits) {\n var o = e.digits.toString().split(\",\");\n isFinite(o[0]) && o[1] && isFinite(o[1]) ? r += i + t + \"{\" + e.digits + \"}\" : (isNaN(e.digits) || parseInt(e.digits) > 0) && (e.digitsOptional || e.jitMasking ? (n = r + i + t + \"{0,\" + e.digits + \"}\", \n e.keepStatic = !0) : r += i + t + \"{\" + e.digits + \"}\");\n } else e.inputmode = \"numeric\";\n return r += c(e.suffix, e), r += \"[-]\", n && (r = [ n + c(e.suffix, e) + \"[-]\", r ]), \n e.greedy = !1, function(e) {\n void 0 === e.parseMinMaxOptions && (null !== e.min && (e.min = e.min.toString().replace(new RegExp((0, \n a.default)(e.groupSeparator), \"g\"), \"\"), \",\" === e.radixPoint && (e.min = e.min.replace(e.radixPoint, \".\")), \n e.min = isFinite(e.min) ? parseFloat(e.min) : NaN, isNaN(e.min) && (e.min = Number.MIN_VALUE)), \n null !== e.max && (e.max = e.max.toString().replace(new RegExp((0, a.default)(e.groupSeparator), \"g\"), \"\"), \n \",\" === e.radixPoint && (e.max = e.max.replace(e.radixPoint, \".\")), e.max = isFinite(e.max) ? parseFloat(e.max) : NaN, \n isNaN(e.max) && (e.max = Number.MAX_VALUE)), e.parseMinMaxOptions = \"done\");\n }(e), \"\" !== e.radixPoint && e.substituteRadixPoint && (e.substitutes[\".\" == e.radixPoint ? \",\" : \".\"] = e.radixPoint), \n r;\n },\n _mask: function(e) {\n return \"(\" + e.groupSeparator + \"999){+|1}\";\n },\n digits: \"*\",\n digitsOptional: !0,\n enforceDigitsOnBlur: !1,\n radixPoint: \".\",\n positionCaretOnClick: \"radixFocus\",\n _radixDance: !0,\n groupSeparator: \"\",\n allowMinus: !0,\n negationSymbol: {\n front: \"-\",\n back: \"\"\n },\n prefix: \"\",\n suffix: \"\",\n min: null,\n max: null,\n SetMaxOnOverflow: !1,\n step: 1,\n inputType: \"text\",\n unmaskAsNumber: !1,\n roundingFN: Math.round,\n inputmode: \"decimal\",\n shortcuts: {\n k: \"1000\",\n m: \"1000000\"\n },\n placeholder: \"0\",\n greedy: !1,\n rightAlign: !0,\n insertMode: !0,\n autoUnmask: !1,\n skipOptionalPartCharacter: \"\",\n usePrototypeDefinitions: !1,\n stripLeadingZeroes: !0,\n substituteRadixPoint: !0,\n definitions: {\n 0: {\n validator: p\n },\n 1: {\n validator: p,\n definitionSymbol: \"9\"\n },\n 9: {\n validator: \"[0-9\\uff10-\\uff19\\u0660-\\u0669\\u06f0-\\u06f9]\",\n definitionSymbol: \"*\"\n },\n \"+\": {\n validator: function(e, t, i, n, a) {\n return a.allowMinus && (\"-\" === e || e === a.negationSymbol.front);\n }\n },\n \"-\": {\n validator: function(e, t, i, n, a) {\n return a.allowMinus && e === a.negationSymbol.back;\n }\n }\n },\n preValidation: function(e, t, i, n, a, r, o, s) {\n if (!1 !== a.__financeInput && i === a.radixPoint) return !1;\n var l = e.indexOf(a.radixPoint), c = t;\n if (t = function(e, t, i, n, a) {\n return a._radixDance && a.numericInput && t !== a.negationSymbol.back && e <= i && (i > 0 || t == a.radixPoint) && (void 0 === n.validPositions[e - 1] || n.validPositions[e - 1].input !== a.negationSymbol.back) && (e -= 1), \n e;\n }(t, i, l, r, a), \"-\" === i || i === a.negationSymbol.front) {\n if (!0 !== a.allowMinus) return !1;\n var u = !1, p = d(\"+\", r), h = d(\"-\", r);\n return -1 !== p && (u = [ p, h ]), !1 !== u ? {\n remove: u,\n caret: c - a.negationSymbol.back.length\n } : {\n insert: [ {\n pos: f.call(this, \"+\", r),\n c: a.negationSymbol.front,\n fromIsValid: !0\n }, {\n pos: f.call(this, \"-\", r),\n c: a.negationSymbol.back,\n fromIsValid: void 0\n } ],\n caret: c + a.negationSymbol.back.length\n };\n }\n if (i === a.groupSeparator) return {\n caret: c\n };\n if (s) return !0;\n if (-1 !== l && !0 === a._radixDance && !1 === n && i === a.radixPoint && void 0 !== a.digits && (isNaN(a.digits) || parseInt(a.digits) > 0) && l !== t) return {\n caret: a._radixDance && t === l - 1 ? l + 1 : l\n };\n if (!1 === a.__financeInput) if (n) {\n if (a.digitsOptional) return {\n rewritePosition: o.end\n };\n if (!a.digitsOptional) {\n if (o.begin > l && o.end <= l) return i === a.radixPoint ? {\n insert: {\n pos: l + 1,\n c: \"0\",\n fromIsValid: !0\n },\n rewritePosition: l\n } : {\n rewritePosition: l + 1\n };\n if (o.begin < l) return {\n rewritePosition: o.begin - 1\n };\n }\n } else if (!a.showMaskOnHover && !a.showMaskOnFocus && !a.digitsOptional && a.digits > 0 && \"\" === this.__valueGet.call(this.el)) return {\n rewritePosition: l\n };\n return {\n rewritePosition: t\n };\n },\n postValidation: function(e, t, i, n, a, r, o) {\n if (!1 === n) return n;\n if (o) return !0;\n if (null !== a.min || null !== a.max) {\n var s = a.onUnMask(e.slice().reverse().join(\"\"), void 0, l.extend({}, a, {\n unmaskAsNumber: !0\n }));\n if (null !== a.min && s < a.min && (s.toString().length > a.min.toString().length || s < 0)) return !1;\n if (null !== a.max && s > a.max) return !!a.SetMaxOnOverflow && {\n refreshFromBuffer: !0,\n buffer: u(a.max.toString().replace(\".\", a.radixPoint).split(\"\"), a.digits, a).reverse()\n };\n }\n return n;\n },\n onUnMask: function(e, t, i) {\n if (\"\" === t && !0 === i.nullable) return t;\n var n = e.replace(i.prefix, \"\");\n return n = (n = n.replace(i.suffix, \"\")).replace(new RegExp((0, a.default)(i.groupSeparator), \"g\"), \"\"), \n \"\" !== i.placeholder.charAt(0) && (n = n.replace(new RegExp(i.placeholder.charAt(0), \"g\"), \"0\")), \n i.unmaskAsNumber ? (\"\" !== i.radixPoint && -1 !== n.indexOf(i.radixPoint) && (n = n.replace(a.default.call(this, i.radixPoint), \".\")), \n n = (n = n.replace(new RegExp(\"^\" + (0, a.default)(i.negationSymbol.front)), \"-\")).replace(new RegExp((0, \n a.default)(i.negationSymbol.back) + \"$\"), \"\"), Number(n)) : n;\n },\n isComplete: function(e, t) {\n var i = (t.numericInput ? e.slice().reverse() : e).join(\"\");\n return i = (i = (i = (i = (i = i.replace(new RegExp(\"^\" + (0, a.default)(t.negationSymbol.front)), \"-\")).replace(new RegExp((0, \n a.default)(t.negationSymbol.back) + \"$\"), \"\")).replace(t.prefix, \"\")).replace(t.suffix, \"\")).replace(new RegExp((0, \n a.default)(t.groupSeparator) + \"([0-9]{3})\", \"g\"), \"$1\"), \",\" === t.radixPoint && (i = i.replace((0, \n a.default)(t.radixPoint), \".\")), isFinite(i);\n },\n onBeforeMask: function(e, t) {\n var i = t.radixPoint || \",\";\n isFinite(t.digits) && (t.digits = parseInt(t.digits)), \"number\" != typeof e && \"number\" !== t.inputType || \"\" === i || (e = e.toString().replace(\".\", i));\n var n = \"-\" === e.charAt(0) || e.charAt(0) === t.negationSymbol.front, r = e.split(i), o = r[0].replace(/[^\\-0-9]/g, \"\"), s = r.length > 1 ? r[1].replace(/[^0-9]/g, \"\") : \"\", l = r.length > 1;\n e = o + (\"\" !== s ? i + s : s);\n var c = 0;\n if (\"\" !== i && (c = t.digitsOptional ? t.digits < s.length ? t.digits : s.length : t.digits, \n \"\" !== s || !t.digitsOptional)) {\n var f = Math.pow(10, c || 1);\n e = e.replace((0, a.default)(i), \".\"), isNaN(parseFloat(e)) || (e = (t.roundingFN(parseFloat(e) * f) / f).toFixed(c)), \n e = e.toString().replace(\".\", i);\n }\n if (0 === t.digits && -1 !== e.indexOf(i) && (e = e.substring(0, e.indexOf(i))), \n null !== t.min || null !== t.max) {\n var d = e.toString().replace(i, \".\");\n null !== t.min && d < t.min ? e = t.min.toString().replace(\".\", i) : null !== t.max && d > t.max && (e = t.max.toString().replace(\".\", i));\n }\n return n && \"-\" !== e.charAt(0) && (e = \"-\" + e), u(e.toString().split(\"\"), c, t, l).join(\"\");\n },\n onBeforeWrite: function(e, t, i, n) {\n function r(e, t) {\n if (!1 !== n.__financeInput || t) {\n var i = e.indexOf(n.radixPoint);\n -1 !== i && e.splice(i, 1);\n }\n if (\"\" !== n.groupSeparator) for (;-1 !== (i = e.indexOf(n.groupSeparator)); ) e.splice(i, 1);\n return e;\n }\n var o, s;\n if (n.stripLeadingZeroes && (s = function(e, t) {\n var i = new RegExp(\"(^\" + (\"\" !== t.negationSymbol.front ? (0, a.default)(t.negationSymbol.front) + \"?\" : \"\") + (0, \n a.default)(t.prefix) + \")(.*)(\" + (0, a.default)(t.suffix) + (\"\" != t.negationSymbol.back ? (0, \n a.default)(t.negationSymbol.back) + \"?\" : \"\") + \"$)\").exec(e.slice().reverse().join(\"\")), n = i ? i[2] : \"\", r = !1;\n return n && (n = n.split(t.radixPoint.charAt(0))[0], r = new RegExp(\"^[0\" + t.groupSeparator + \"]*\").exec(n)), \n !(!r || !(r[0].length > 1 || r[0].length > 0 && r[0].length < n.length)) && r;\n }(t, n))) for (var c = t.join(\"\").lastIndexOf(s[0].split(\"\").reverse().join(\"\")) - (s[0] == s.input ? 0 : 1), f = s[0] == s.input ? 1 : 0, d = s[0].length - f; d > 0; d--) delete this.maskset.validPositions[c + d], \n delete t[c + d];\n if (e) switch (e.type) {\n case \"blur\":\n case \"checkval\":\n if (null !== n.min) {\n var p = n.onUnMask(t.slice().reverse().join(\"\"), void 0, l.extend({}, n, {\n unmaskAsNumber: !0\n }));\n if (null !== n.min && p < n.min) return {\n refreshFromBuffer: !0,\n buffer: u(n.min.toString().replace(\".\", n.radixPoint).split(\"\"), n.digits, n).reverse()\n };\n }\n if (t[t.length - 1] === n.negationSymbol.front) {\n var h = new RegExp(\"(^\" + (\"\" != n.negationSymbol.front ? (0, a.default)(n.negationSymbol.front) + \"?\" : \"\") + (0, \n a.default)(n.prefix) + \")(.*)(\" + (0, a.default)(n.suffix) + (\"\" != n.negationSymbol.back ? (0, \n a.default)(n.negationSymbol.back) + \"?\" : \"\") + \"$)\").exec(r(t.slice(), !0).reverse().join(\"\"));\n 0 == (h ? h[2] : \"\") && (o = {\n refreshFromBuffer: !0,\n buffer: [ 0 ]\n });\n } else if (\"\" !== n.radixPoint) {\n t.indexOf(n.radixPoint) === n.suffix.length && (o && o.buffer ? o.buffer.splice(0, 1 + n.suffix.length) : (t.splice(0, 1 + n.suffix.length), \n o = {\n refreshFromBuffer: !0,\n buffer: r(t)\n }));\n }\n if (n.enforceDigitsOnBlur) {\n var v = (o = o || {}) && o.buffer || t.slice().reverse();\n o.refreshFromBuffer = !0, o.buffer = u(v, n.digits, n, !0).reverse();\n }\n }\n return o;\n },\n onKeyDown: function(e, t, i, n) {\n var a, r = l(this);\n if (3 != e.location) {\n var s, c = e.key;\n if ((s = n.shortcuts && n.shortcuts[c]) && s.length > 1) return this.inputmask.__valueSet.call(this, parseFloat(this.inputmask.unmaskedvalue()) * parseInt(s)), \n r.trigger(\"setvalue\"), !1;\n }\n if (e.ctrlKey) switch (e.key) {\n case o.keys.ArrowUp:\n return this.inputmask.__valueSet.call(this, parseFloat(this.inputmask.unmaskedvalue()) + parseInt(n.step)), \n r.trigger(\"setvalue\"), !1;\n\n case o.keys.ArrowDown:\n return this.inputmask.__valueSet.call(this, parseFloat(this.inputmask.unmaskedvalue()) - parseInt(n.step)), \n r.trigger(\"setvalue\"), !1;\n }\n if (!e.shiftKey && (e.key === o.keys.Delete || e.key === o.keys.Backspace || e.key === o.keys.BACKSPACE_SAFARI) && i.begin !== t.length) {\n if (t[e.key === o.keys.Delete ? i.begin - 1 : i.end] === n.negationSymbol.front) return a = t.slice().reverse(), \n \"\" !== n.negationSymbol.front && a.shift(), \"\" !== n.negationSymbol.back && a.pop(), \n r.trigger(\"setvalue\", [ a.join(\"\"), i.begin ]), !1;\n if (!0 === n._radixDance) {\n var f = t.indexOf(n.radixPoint);\n if (n.digitsOptional) {\n if (0 === f) return (a = t.slice().reverse()).pop(), r.trigger(\"setvalue\", [ a.join(\"\"), i.begin >= a.length ? a.length : i.begin ]), \n !1;\n } else if (-1 !== f && (i.begin < f || i.end < f || e.key === o.keys.Delete && (i.begin === f || i.begin - 1 === f))) {\n var d = void 0;\n return i.begin === i.end && (e.key === o.keys.Backspace || e.key === o.keys.BACKSPACE_SAFARI ? i.begin++ : e.key === o.keys.Delete && i.begin - 1 === f && (d = l.extend({}, i), \n i.begin--, i.end--)), (a = t.slice().reverse()).splice(a.length - i.begin, i.begin - i.end + 1), \n a = u(a, n.digits, n).join(\"\"), d && (i = d), r.trigger(\"setvalue\", [ a, i.begin >= a.length ? f + 1 : i.begin ]), \n !1;\n }\n }\n }\n }\n },\n currency: {\n prefix: \"\",\n groupSeparator: \",\",\n alias: \"numeric\",\n digits: 2,\n digitsOptional: !1\n },\n decimal: {\n alias: \"numeric\"\n },\n integer: {\n alias: \"numeric\",\n inputmode: \"numeric\",\n digits: 0\n },\n percentage: {\n alias: \"numeric\",\n min: 0,\n max: 100,\n suffix: \" %\",\n digits: 0,\n allowMinus: !1\n },\n indianns: {\n alias: \"numeric\",\n _mask: function(e) {\n return \"(\" + e.groupSeparator + \"99){*|1}(\" + e.groupSeparator + \"999){1|1}\";\n },\n groupSeparator: \",\",\n radixPoint: \".\",\n placeholder: \"0\",\n digits: 2,\n digitsOptional: !1\n }\n });\n },\n 9380: function(e, t, i) {\n var n;\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.default = void 0;\n var a = ((n = i(8741)) && n.__esModule ? n : {\n default: n\n }).default ? window : {};\n t.default = a;\n },\n 7760: function(e, t, i) {\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.HandleNativePlaceholder = function(e, t) {\n var i = e ? e.inputmask : this;\n if (s.ie) {\n if (e.inputmask._valueGet() !== t && (e.placeholder !== t || \"\" === e.placeholder)) {\n var n = r.getBuffer.call(i).slice(), a = e.inputmask._valueGet();\n if (a !== t) {\n var o = r.getLastValidPosition.call(i);\n -1 === o && a === r.getBufferTemplate.call(i).join(\"\") ? n = [] : -1 !== o && u.call(i, n), \n d(e, n);\n }\n }\n } else e.placeholder !== t && (e.placeholder = t, \"\" === e.placeholder && e.removeAttribute(\"placeholder\"));\n }, t.applyInputValue = c, t.checkVal = f, t.clearOptionalTail = u, t.unmaskedvalue = function(e) {\n var t = e ? e.inputmask : this, i = t.opts, n = t.maskset;\n if (e) {\n if (void 0 === e.inputmask) return e.value;\n e.inputmask && e.inputmask.refreshValue && c(e, e.inputmask._valueGet(!0));\n }\n for (var a = [], o = n.validPositions, s = 0, l = o.length; s < l; s++) o[s] && o[s].match && (1 != o[s].match.static || Array.isArray(n.metadata) && !0 !== o[s].generatedInput) && a.push(o[s].input);\n var u = 0 === a.length ? \"\" : (t.isRTL ? a.reverse() : a).join(\"\");\n if (\"function\" == typeof i.onUnMask) {\n var f = (t.isRTL ? r.getBuffer.call(t).slice().reverse() : r.getBuffer.call(t)).join(\"\");\n u = i.onUnMask.call(t, f, u, i);\n }\n return u;\n }, t.writeBuffer = d;\n var n = i(2839), a = i(4713), r = i(8711), o = i(7215), s = i(9845), l = i(6030);\n function c(e, t) {\n var i = e ? e.inputmask : this, n = i.opts;\n e.inputmask.refreshValue = !1, \"function\" == typeof n.onBeforeMask && (t = n.onBeforeMask.call(i, t, n) || t), \n f(e, !0, !1, t = (t || \"\").toString().split(\"\")), i.undoValue = i._valueGet(!0), \n (n.clearMaskOnLostFocus || n.clearIncomplete) && e.inputmask._valueGet() === r.getBufferTemplate.call(i).join(\"\") && -1 === r.getLastValidPosition.call(i) && e.inputmask._valueSet(\"\");\n }\n function u(e) {\n e.length = 0;\n for (var t, i = a.getMaskTemplate.call(this, !0, 0, !0, void 0, !0); void 0 !== (t = i.shift()); ) e.push(t);\n return e;\n }\n function f(e, t, i, n, s) {\n var c = e ? e.inputmask : this, u = c.maskset, f = c.opts, p = c.dependencyLib, h = n.slice(), v = \"\", m = -1, g = void 0, y = f.skipOptionalPartCharacter;\n f.skipOptionalPartCharacter = \"\", r.resetMaskSet.call(c), u.tests = {}, m = f.radixPoint ? r.determineNewCaretPosition.call(c, {\n begin: 0,\n end: 0\n }, !1, !1 === f.__financeInput ? \"radixFocus\" : void 0).begin : 0, u.p = m, c.caretPos = {\n begin: m\n };\n var k = [], b = c.caretPos;\n if (h.forEach((function(e, t) {\n if (void 0 !== e) {\n var n = new p.Event(\"_checkval\");\n n.key = e, v += e;\n var o = r.getLastValidPosition.call(c, void 0, !0);\n !function(e, t) {\n for (var i = a.getMaskTemplate.call(c, !0, 0).slice(e, r.seekNext.call(c, e, !1, !1)).join(\"\").replace(/'/g, \"\"), n = i.indexOf(t); n > 0 && \" \" === i[n - 1]; ) n--;\n var o = 0 === n && !r.isMask.call(c, e) && (a.getTest.call(c, e).match.nativeDef === t.charAt(0) || !0 === a.getTest.call(c, e).match.static && a.getTest.call(c, e).match.nativeDef === \"'\" + t.charAt(0) || \" \" === a.getTest.call(c, e).match.nativeDef && (a.getTest.call(c, e + 1).match.nativeDef === t.charAt(0) || !0 === a.getTest.call(c, e + 1).match.static && a.getTest.call(c, e + 1).match.nativeDef === \"'\" + t.charAt(0)));\n if (!o && n > 0 && !r.isMask.call(c, e, !1, !0)) {\n var s = r.seekNext.call(c, e);\n c.caretPos.begin < s && (c.caretPos = {\n begin: s\n });\n }\n return o;\n }(m, v) ? (g = l.EventHandlers.keypressEvent.call(c, n, !0, !1, i, c.caretPos.begin)) && (m = c.caretPos.begin + 1, \n v = \"\") : g = l.EventHandlers.keypressEvent.call(c, n, !0, !1, i, o + 1), g ? (void 0 !== g.pos && u.validPositions[g.pos] && !0 === u.validPositions[g.pos].match.static && void 0 === u.validPositions[g.pos].alternation && (k.push(g.pos), \n c.isRTL || (g.forwardPosition = g.pos + 1)), d.call(c, void 0, r.getBuffer.call(c), g.forwardPosition, n, !1), \n c.caretPos = {\n begin: g.forwardPosition,\n end: g.forwardPosition\n }, b = c.caretPos) : void 0 === u.validPositions[t] && h[t] === a.getPlaceholder.call(c, t) && r.isMask.call(c, t, !0) ? c.caretPos.begin++ : c.caretPos = b;\n }\n })), k.length > 0) {\n var x, P, w = r.seekNext.call(c, -1, void 0, !1);\n if (!o.isComplete.call(c, r.getBuffer.call(c)) && k.length <= w || o.isComplete.call(c, r.getBuffer.call(c)) && k.length > 0 && k.length !== w && 0 === k[0]) for (var S = w; void 0 !== (x = k.shift()); ) {\n var M = new p.Event(\"_checkval\");\n if ((P = u.validPositions[x]).generatedInput = !0, M.key = P.input, (g = l.EventHandlers.keypressEvent.call(c, M, !0, !1, i, S)) && void 0 !== g.pos && g.pos !== x && u.validPositions[g.pos] && !0 === u.validPositions[g.pos].match.static) k.push(g.pos); else if (!g) break;\n S++;\n }\n }\n t && d.call(c, e, r.getBuffer.call(c), g ? g.forwardPosition : c.caretPos.begin, s || new p.Event(\"checkval\"), s && (\"input\" === s.type && c.undoValue !== r.getBuffer.call(c).join(\"\") || \"paste\" === s.type)), \n f.skipOptionalPartCharacter = y;\n }\n function d(e, t, i, a, s) {\n var l = e ? e.inputmask : this, c = l.opts, u = l.dependencyLib;\n if (a && \"function\" == typeof c.onBeforeWrite) {\n var f = c.onBeforeWrite.call(l, a, t, i, c);\n if (f) {\n if (f.refreshFromBuffer) {\n var d = f.refreshFromBuffer;\n o.refreshFromBuffer.call(l, !0 === d ? d : d.start, d.end, f.buffer || t), t = r.getBuffer.call(l, !0);\n }\n void 0 !== i && (i = void 0 !== f.caret ? f.caret : i);\n }\n }\n if (void 0 !== e && (e.inputmask._valueSet(t.join(\"\")), void 0 === i || void 0 !== a && \"blur\" === a.type || r.caret.call(l, e, i, void 0, void 0, void 0 !== a && \"keydown\" === a.type && (a.key === n.keys.Delete || a.key === n.keys.Backspace)), \n !0 === s)) {\n var p = u(e), h = e.inputmask._valueGet();\n e.inputmask.skipInputEvent = !0, p.trigger(\"input\"), setTimeout((function() {\n h === r.getBufferTemplate.call(l).join(\"\") ? p.trigger(\"cleared\") : !0 === o.isComplete.call(l, t) && p.trigger(\"complete\");\n }), 0);\n }\n }\n },\n 2394: function(e, t, i) {\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.default = void 0;\n var n = i(157), a = m(i(4963)), r = m(i(9380)), o = i(2391), s = i(4713), l = i(8711), c = i(7215), u = i(7760), f = i(9716), d = m(i(7392)), p = m(i(3976)), h = m(i(8741));\n function v(e) {\n return v = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function(e) {\n return typeof e;\n } : function(e) {\n return e && \"function\" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? \"symbol\" : typeof e;\n }, v(e);\n }\n function m(e) {\n return e && e.__esModule ? e : {\n default: e\n };\n }\n var g = r.default.document, y = \"_inputmask_opts\";\n function k(e, t, i) {\n if (h.default) {\n if (!(this instanceof k)) return new k(e, t, i);\n this.dependencyLib = a.default, this.el = void 0, this.events = {}, this.maskset = void 0, \n !0 !== i && (\"[object Object]\" === Object.prototype.toString.call(e) ? t = e : (t = t || {}, \n e && (t.alias = e)), this.opts = a.default.extend(!0, {}, this.defaults, t), this.noMasksCache = t && void 0 !== t.definitions, \n this.userOptions = t || {}, b(this.opts.alias, t, this.opts)), this.refreshValue = !1, \n this.undoValue = void 0, this.$el = void 0, this.skipInputEvent = !1, this.validationEvent = !1, \n this.ignorable = !1, this.maxLength, this.mouseEnter = !1, this.clicked = 0, this.originalPlaceholder = void 0, \n this.isComposing = !1, this.hasAlternator = !1;\n }\n }\n function b(e, t, i) {\n var n = k.prototype.aliases[e];\n return n ? (n.alias && b(n.alias, void 0, i), a.default.extend(!0, i, n), a.default.extend(!0, i, t), \n !0) : (null === i.mask && (i.mask = e), !1);\n }\n k.prototype = {\n dataAttribute: \"data-inputmask\",\n defaults: p.default,\n definitions: d.default,\n aliases: {},\n masksCache: {},\n get isRTL() {\n return this.opts.isRTL || this.opts.numericInput;\n },\n mask: function(e) {\n var t = this;\n return \"string\" == typeof e && (e = g.getElementById(e) || g.querySelectorAll(e)), \n (e = e.nodeName ? [ e ] : Array.isArray(e) ? e : [].slice.call(e)).forEach((function(e, i) {\n var s = a.default.extend(!0, {}, t.opts);\n if (function(e, t, i, n) {\n function o(t, a) {\n var o = \"\" === n ? t : n + \"-\" + t;\n null !== (a = void 0 !== a ? a : e.getAttribute(o)) && (\"string\" == typeof a && (0 === t.indexOf(\"on\") ? a = r.default[a] : \"false\" === a ? a = !1 : \"true\" === a && (a = !0)), \n i[t] = a);\n }\n if (!0 === t.importDataAttributes) {\n var s, l, c, u, f = e.getAttribute(n);\n if (f && \"\" !== f && (f = f.replace(/'/g, '\"'), l = JSON.parse(\"{\" + f + \"}\")), \n l) for (u in c = void 0, l) if (\"alias\" === u.toLowerCase()) {\n c = l[u];\n break;\n }\n for (s in o(\"alias\", c), i.alias && b(i.alias, i, t), t) {\n if (l) for (u in c = void 0, l) if (u.toLowerCase() === s.toLowerCase()) {\n c = l[u];\n break;\n }\n o(s, c);\n }\n }\n a.default.extend(!0, t, i), (\"rtl\" === e.dir || t.rightAlign) && (e.style.textAlign = \"right\");\n (\"rtl\" === e.dir || t.numericInput) && (e.dir = \"ltr\", e.removeAttribute(\"dir\"), \n t.isRTL = !0);\n return Object.keys(i).length;\n }(e, s, a.default.extend(!0, {}, t.userOptions), t.dataAttribute)) {\n var l = (0, o.generateMaskSet)(s, t.noMasksCache);\n void 0 !== l && (void 0 !== e.inputmask && (e.inputmask.opts.autoUnmask = !0, e.inputmask.remove()), \n e.inputmask = new k(void 0, void 0, !0), e.inputmask.opts = s, e.inputmask.noMasksCache = t.noMasksCache, \n e.inputmask.userOptions = a.default.extend(!0, {}, t.userOptions), e.inputmask.el = e, \n e.inputmask.$el = (0, a.default)(e), e.inputmask.maskset = l, a.default.data(e, y, t.userOptions), \n n.mask.call(e.inputmask));\n }\n })), e && e[0] && e[0].inputmask || this;\n },\n option: function(e, t) {\n return \"string\" == typeof e ? this.opts[e] : \"object\" === v(e) ? (a.default.extend(this.userOptions, e), \n this.el && !0 !== t && this.mask(this.el), this) : void 0;\n },\n unmaskedvalue: function(e) {\n if (this.maskset = this.maskset || (0, o.generateMaskSet)(this.opts, this.noMasksCache), \n void 0 === this.el || void 0 !== e) {\n var t = (\"function\" == typeof this.opts.onBeforeMask && this.opts.onBeforeMask.call(this, e, this.opts) || e).split(\"\");\n u.checkVal.call(this, void 0, !1, !1, t), \"function\" == typeof this.opts.onBeforeWrite && this.opts.onBeforeWrite.call(this, void 0, l.getBuffer.call(this), 0, this.opts);\n }\n return u.unmaskedvalue.call(this, this.el);\n },\n remove: function() {\n if (this.el) {\n a.default.data(this.el, y, null);\n var e = this.opts.autoUnmask ? (0, u.unmaskedvalue)(this.el) : this._valueGet(this.opts.autoUnmask);\n e !== l.getBufferTemplate.call(this).join(\"\") ? this._valueSet(e, this.opts.autoUnmask) : this._valueSet(\"\"), \n f.EventRuler.off(this.el), Object.getOwnPropertyDescriptor && Object.getPrototypeOf ? Object.getOwnPropertyDescriptor(Object.getPrototypeOf(this.el), \"value\") && this.__valueGet && Object.defineProperty(this.el, \"value\", {\n get: this.__valueGet,\n set: this.__valueSet,\n configurable: !0\n }) : g.__lookupGetter__ && this.el.__lookupGetter__(\"value\") && this.__valueGet && (this.el.__defineGetter__(\"value\", this.__valueGet), \n this.el.__defineSetter__(\"value\", this.__valueSet)), this.el.inputmask = void 0;\n }\n return this.el;\n },\n getemptymask: function() {\n return this.maskset = this.maskset || (0, o.generateMaskSet)(this.opts, this.noMasksCache), \n (this.isRTL ? l.getBufferTemplate.call(this).reverse() : l.getBufferTemplate.call(this)).join(\"\");\n },\n hasMaskedValue: function() {\n return !this.opts.autoUnmask;\n },\n isComplete: function() {\n return this.maskset = this.maskset || (0, o.generateMaskSet)(this.opts, this.noMasksCache), \n c.isComplete.call(this, l.getBuffer.call(this));\n },\n getmetadata: function() {\n if (this.maskset = this.maskset || (0, o.generateMaskSet)(this.opts, this.noMasksCache), \n Array.isArray(this.maskset.metadata)) {\n var e = s.getMaskTemplate.call(this, !0, 0, !1).join(\"\");\n return this.maskset.metadata.forEach((function(t) {\n return t.mask !== e || (e = t, !1);\n })), e;\n }\n return this.maskset.metadata;\n },\n isValid: function(e) {\n if (this.maskset = this.maskset || (0, o.generateMaskSet)(this.opts, this.noMasksCache), \n e) {\n var t = (\"function\" == typeof this.opts.onBeforeMask && this.opts.onBeforeMask.call(this, e, this.opts) || e).split(\"\");\n u.checkVal.call(this, void 0, !0, !1, t);\n } else e = this.isRTL ? l.getBuffer.call(this).slice().reverse().join(\"\") : l.getBuffer.call(this).join(\"\");\n for (var i = l.getBuffer.call(this), n = l.determineLastRequiredPosition.call(this), a = i.length - 1; a > n && !l.isMask.call(this, a); a--) ;\n return i.splice(n, a + 1 - n), c.isComplete.call(this, i) && e === (this.isRTL ? l.getBuffer.call(this).slice().reverse().join(\"\") : l.getBuffer.call(this).join(\"\"));\n },\n format: function(e, t) {\n this.maskset = this.maskset || (0, o.generateMaskSet)(this.opts, this.noMasksCache);\n var i = (\"function\" == typeof this.opts.onBeforeMask && this.opts.onBeforeMask.call(this, e, this.opts) || e).split(\"\");\n u.checkVal.call(this, void 0, !0, !1, i);\n var n = this.isRTL ? l.getBuffer.call(this).slice().reverse().join(\"\") : l.getBuffer.call(this).join(\"\");\n return t ? {\n value: n,\n metadata: this.getmetadata()\n } : n;\n },\n setValue: function(e) {\n this.el && (0, a.default)(this.el).trigger(\"setvalue\", [ e ]);\n },\n analyseMask: o.analyseMask\n }, k.extendDefaults = function(e) {\n a.default.extend(!0, k.prototype.defaults, e);\n }, k.extendDefinitions = function(e) {\n a.default.extend(!0, k.prototype.definitions, e);\n }, k.extendAliases = function(e) {\n a.default.extend(!0, k.prototype.aliases, e);\n }, k.format = function(e, t, i) {\n return k(t).format(e, i);\n }, k.unmask = function(e, t) {\n return k(t).unmaskedvalue(e);\n }, k.isValid = function(e, t) {\n return k(t).isValid(e);\n }, k.remove = function(e) {\n \"string\" == typeof e && (e = g.getElementById(e) || g.querySelectorAll(e)), (e = e.nodeName ? [ e ] : e).forEach((function(e) {\n e.inputmask && e.inputmask.remove();\n }));\n }, k.setValue = function(e, t) {\n \"string\" == typeof e && (e = g.getElementById(e) || g.querySelectorAll(e)), (e = e.nodeName ? [ e ] : e).forEach((function(e) {\n e.inputmask ? e.inputmask.setValue(t) : (0, a.default)(e).trigger(\"setvalue\", [ t ]);\n }));\n }, k.dependencyLib = a.default, r.default.Inputmask = k;\n var x = k;\n t.default = x;\n },\n 5296: function(e, t, i) {\n function n(e) {\n return n = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function(e) {\n return typeof e;\n } : function(e) {\n return e && \"function\" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? \"symbol\" : typeof e;\n }, n(e);\n }\n var a = h(i(9380)), r = h(i(2394)), o = h(i(8741));\n function s(e, t) {\n for (var i = 0; i < t.length; i++) {\n var a = t[i];\n a.enumerable = a.enumerable || !1, a.configurable = !0, \"value\" in a && (a.writable = !0), \n Object.defineProperty(e, (r = a.key, o = void 0, o = function(e, t) {\n if (\"object\" !== n(e) || null === e) return e;\n var i = e[Symbol.toPrimitive];\n if (void 0 !== i) {\n var a = i.call(e, t || \"default\");\n if (\"object\" !== n(a)) return a;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === t ? String : Number)(e);\n }(r, \"string\"), \"symbol\" === n(o) ? o : String(o)), a);\n }\n var r, o;\n }\n function l(e) {\n var t = f();\n return function() {\n var i, a = p(e);\n if (t) {\n var r = p(this).constructor;\n i = Reflect.construct(a, arguments, r);\n } else i = a.apply(this, arguments);\n return function(e, t) {\n if (t && (\"object\" === n(t) || \"function\" == typeof t)) return t;\n if (void 0 !== t) throw new TypeError(\"Derived constructors may only return object or undefined\");\n return function(e) {\n if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n return e;\n }(e);\n }(this, i);\n };\n }\n function c(e) {\n var t = \"function\" == typeof Map ? new Map : void 0;\n return c = function(e) {\n if (null === e || (i = e, -1 === Function.toString.call(i).indexOf(\"[native code]\"))) return e;\n var i;\n if (\"function\" != typeof e) throw new TypeError(\"Super expression must either be null or a function\");\n if (void 0 !== t) {\n if (t.has(e)) return t.get(e);\n t.set(e, n);\n }\n function n() {\n return u(e, arguments, p(this).constructor);\n }\n return n.prototype = Object.create(e.prototype, {\n constructor: {\n value: n,\n enumerable: !1,\n writable: !0,\n configurable: !0\n }\n }), d(n, e);\n }, c(e);\n }\n function u(e, t, i) {\n return u = f() ? Reflect.construct.bind() : function(e, t, i) {\n var n = [ null ];\n n.push.apply(n, t);\n var a = new (Function.bind.apply(e, n));\n return i && d(a, i.prototype), a;\n }, u.apply(null, arguments);\n }\n function f() {\n if (\"undefined\" == typeof Reflect || !Reflect.construct) return !1;\n if (Reflect.construct.sham) return !1;\n if (\"function\" == typeof Proxy) return !0;\n try {\n return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {}))), \n !0;\n } catch (e) {\n return !1;\n }\n }\n function d(e, t) {\n return d = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(e, t) {\n return e.__proto__ = t, e;\n }, d(e, t);\n }\n function p(e) {\n return p = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {\n return e.__proto__ || Object.getPrototypeOf(e);\n }, p(e);\n }\n function h(e) {\n return e && e.__esModule ? e : {\n default: e\n };\n }\n var v = a.default.document;\n if (o.default && v && v.head && v.head.attachShadow && a.default.customElements && void 0 === a.default.customElements.get(\"input-mask\")) {\n var m = function(e) {\n !function(e, t) {\n if (\"function\" != typeof t && null !== t) throw new TypeError(\"Super expression must either be null or a function\");\n e.prototype = Object.create(t && t.prototype, {\n constructor: {\n value: e,\n writable: !0,\n configurable: !0\n }\n }), Object.defineProperty(e, \"prototype\", {\n writable: !1\n }), t && d(e, t);\n }(o, e);\n var t, i, n, a = l(o);\n function o() {\n var e;\n !function(e, t) {\n if (!(e instanceof t)) throw new TypeError(\"Cannot call a class as a function\");\n }(this, o);\n var t = (e = a.call(this)).getAttributeNames(), i = e.attachShadow({\n mode: \"closed\"\n }), n = v.createElement(\"input\");\n for (var s in n.type = \"text\", i.appendChild(n), t) Object.prototype.hasOwnProperty.call(t, s) && n.setAttribute(t[s], e.getAttribute(t[s]));\n var l = new r.default;\n return l.dataAttribute = \"\", l.mask(n), n.inputmask.shadowRoot = i, e;\n }\n return t = o, i && s(t.prototype, i), n && s(t, n), Object.defineProperty(t, \"prototype\", {\n writable: !1\n }), t;\n }(c(HTMLElement));\n a.default.customElements.define(\"input-mask\", m);\n }\n },\n 2839: function(e, t) {\n function i(e, t) {\n return function(e) {\n if (Array.isArray(e)) return e;\n }(e) || function(e, t) {\n var i = null == e ? null : \"undefined\" != typeof Symbol && e[Symbol.iterator] || e[\"@@iterator\"];\n if (null != i) {\n var n, a, r, o, s = [], l = !0, c = !1;\n try {\n if (r = (i = i.call(e)).next, 0 === t) {\n if (Object(i) !== i) return;\n l = !1;\n } else for (;!(l = (n = r.call(i)).done) && (s.push(n.value), s.length !== t); l = !0) ;\n } catch (e) {\n c = !0, a = e;\n } finally {\n try {\n if (!l && null != i.return && (o = i.return(), Object(o) !== o)) return;\n } finally {\n if (c) throw a;\n }\n }\n return s;\n }\n }(e, t) || function(e, t) {\n if (!e) return;\n if (\"string\" == typeof e) return n(e, t);\n var i = Object.prototype.toString.call(e).slice(8, -1);\n \"Object\" === i && e.constructor && (i = e.constructor.name);\n if (\"Map\" === i || \"Set\" === i) return Array.from(e);\n if (\"Arguments\" === i || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)) return n(e, t);\n }(e, t) || function() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n }();\n }\n function n(e, t) {\n (null == t || t > e.length) && (t = e.length);\n for (var i = 0, n = new Array(t); i < t; i++) n[i] = e[i];\n return n;\n }\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.keys = t.keyCode = void 0, t.toKey = function(e, t) {\n return r[e] || (t ? String.fromCharCode(e) : String.fromCharCode(e).toLowerCase());\n }, t.toKeyCode = function(e) {\n return a[e];\n };\n var a = {\n AltGraph: 18,\n ArrowDown: 40,\n ArrowLeft: 37,\n ArrowRight: 39,\n ArrowUp: 38,\n Backspace: 8,\n BACKSPACE_SAFARI: 127,\n CapsLock: 20,\n Delete: 46,\n End: 35,\n Enter: 13,\n Escape: 27,\n Home: 36,\n Insert: 45,\n PageDown: 34,\n PageUp: 33,\n Space: 32,\n Tab: 9,\n c: 67,\n x: 88,\n z: 90,\n Shift: 16,\n Control: 17,\n Alt: 18,\n Pause: 19,\n Meta_LEFT: 91,\n Meta_RIGHT: 92,\n ContextMenu: 93,\n Process: 229,\n Unidentified: 229,\n F1: 112,\n F2: 113,\n F3: 114,\n F4: 115,\n F5: 116,\n F6: 117,\n F7: 118,\n F8: 119,\n F9: 120,\n F10: 121,\n F11: 122,\n F12: 123\n };\n t.keyCode = a;\n var r = Object.entries(a).reduce((function(e, t) {\n var n = i(t, 2), a = n[0], r = n[1];\n return e[r] = void 0 === e[r] ? a : e[r], e;\n }), {}), o = Object.entries(a).reduce((function(e, t) {\n var n = i(t, 2), a = n[0];\n n[1];\n return e[a] = \"Space\" === a ? \" \" : a, e;\n }), {});\n t.keys = o;\n },\n 2391: function(e, t, i) {\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.analyseMask = function(e, t, i) {\n var n, o, s, l, c, u, f = /(?:[?*+]|\\{[0-9+*]+(?:,[0-9+*]*)?(?:\\|[0-9+*]*)?\\})|[^.?*+^${[]()|\\\\]+|./g, d = /\\[\\^?]?(?:[^\\\\\\]]+|\\\\[\\S\\s]?)*]?|\\\\(?:0(?:[0-3][0-7]{0,2}|[4-7][0-7]?)?|[1-9][0-9]*|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|c[A-Za-z]|[\\S\\s]?)|\\((?:\\?[:=!]?)?|(?:[?*+]|\\{[0-9]+(?:,[0-9]*)?\\})\\??|[^.?*+^${[()|\\\\]+|./g, p = !1, h = new a.default, v = [], m = [], g = !1;\n function y(e, n, a) {\n a = void 0 !== a ? a : e.matches.length;\n var o = e.matches[a - 1];\n if (t) {\n if (0 === n.indexOf(\"[\") || p && /\\\\d|\\\\s|\\\\w|\\\\p/i.test(n) || \".\" === n) {\n var s = i.casing ? \"i\" : \"\";\n /^\\\\p\\{.*}$/i.test(n) && (s += \"u\"), e.matches.splice(a++, 0, {\n fn: new RegExp(n, s),\n static: !1,\n optionality: !1,\n newBlockMarker: void 0 === o ? \"master\" : o.def !== n,\n casing: null,\n def: n,\n placeholder: void 0,\n nativeDef: n\n });\n } else p && (n = n[n.length - 1]), n.split(\"\").forEach((function(t, n) {\n o = e.matches[a - 1], e.matches.splice(a++, 0, {\n fn: /[a-z]/i.test(i.staticDefinitionSymbol || t) ? new RegExp(\"[\" + (i.staticDefinitionSymbol || t) + \"]\", i.casing ? \"i\" : \"\") : null,\n static: !0,\n optionality: !1,\n newBlockMarker: void 0 === o ? \"master\" : o.def !== t && !0 !== o.static,\n casing: null,\n def: i.staticDefinitionSymbol || t,\n placeholder: void 0 !== i.staticDefinitionSymbol ? t : void 0,\n nativeDef: (p ? \"'\" : \"\") + t\n });\n }));\n p = !1;\n } else {\n var l = i.definitions && i.definitions[n] || i.usePrototypeDefinitions && r.default.prototype.definitions[n];\n l && !p ? e.matches.splice(a++, 0, {\n fn: l.validator ? \"string\" == typeof l.validator ? new RegExp(l.validator, i.casing ? \"i\" : \"\") : new function() {\n this.test = l.validator;\n } : new RegExp(\".\"),\n static: l.static || !1,\n optionality: l.optional || !1,\n defOptionality: l.optional || !1,\n newBlockMarker: void 0 === o || l.optional ? \"master\" : o.def !== (l.definitionSymbol || n),\n casing: l.casing,\n def: l.definitionSymbol || n,\n placeholder: l.placeholder,\n nativeDef: n,\n generated: l.generated\n }) : (e.matches.splice(a++, 0, {\n fn: /[a-z]/i.test(i.staticDefinitionSymbol || n) ? new RegExp(\"[\" + (i.staticDefinitionSymbol || n) + \"]\", i.casing ? \"i\" : \"\") : null,\n static: !0,\n optionality: !1,\n newBlockMarker: void 0 === o ? \"master\" : o.def !== n && !0 !== o.static,\n casing: null,\n def: i.staticDefinitionSymbol || n,\n placeholder: void 0 !== i.staticDefinitionSymbol ? n : void 0,\n nativeDef: (p ? \"'\" : \"\") + n\n }), p = !1);\n }\n }\n function k() {\n if (v.length > 0) {\n if (y(l = v[v.length - 1], o), l.isAlternator) {\n c = v.pop();\n for (var e = 0; e < c.matches.length; e++) c.matches[e].isGroup && (c.matches[e].isGroup = !1);\n v.length > 0 ? (l = v[v.length - 1]).matches.push(c) : h.matches.push(c);\n }\n } else y(h, o);\n }\n function b(e) {\n var t = new a.default(!0);\n return t.openGroup = !1, t.matches = e, t;\n }\n function x() {\n if ((s = v.pop()).openGroup = !1, void 0 !== s) if (v.length > 0) {\n if ((l = v[v.length - 1]).matches.push(s), l.isAlternator) {\n for (var e = (c = v.pop()).matches[0].matches ? c.matches[0].matches.length : 1, t = 0; t < c.matches.length; t++) c.matches[t].isGroup = !1, \n c.matches[t].alternatorGroup = !1, null === i.keepStatic && e < (c.matches[t].matches ? c.matches[t].matches.length : 1) && (i.keepStatic = !0), \n e = c.matches[t].matches ? c.matches[t].matches.length : 1;\n v.length > 0 ? (l = v[v.length - 1]).matches.push(c) : h.matches.push(c);\n }\n } else h.matches.push(s); else k();\n }\n function P(e) {\n var t = e.pop();\n return t.isQuantifier && (t = b([ e.pop(), t ])), t;\n }\n t && (i.optionalmarker[0] = void 0, i.optionalmarker[1] = void 0);\n for (;n = t ? d.exec(e) : f.exec(e); ) {\n if (o = n[0], t) {\n switch (o.charAt(0)) {\n case \"?\":\n o = \"{0,1}\";\n break;\n\n case \"+\":\n case \"*\":\n o = \"{\" + o + \"}\";\n break;\n\n case \"|\":\n if (0 === v.length) {\n var w = b(h.matches);\n w.openGroup = !0, v.push(w), h.matches = [], g = !0;\n }\n }\n switch (o) {\n case \"\\\\d\":\n o = \"[0-9]\";\n break;\n\n case \"\\\\p\":\n o += d.exec(e)[0], o += d.exec(e)[0];\n }\n }\n if (p) k(); else switch (o.charAt(0)) {\n case \"$\":\n case \"^\":\n t || k();\n break;\n\n case i.escapeChar:\n p = !0, t && k();\n break;\n\n case i.optionalmarker[1]:\n case i.groupmarker[1]:\n x();\n break;\n\n case i.optionalmarker[0]:\n v.push(new a.default(!1, !0));\n break;\n\n case i.groupmarker[0]:\n v.push(new a.default(!0));\n break;\n\n case i.quantifiermarker[0]:\n var S = new a.default(!1, !1, !0), M = (o = o.replace(/[{}?]/g, \"\")).split(\"|\"), _ = M[0].split(\",\"), O = isNaN(_[0]) ? _[0] : parseInt(_[0]), E = 1 === _.length ? O : isNaN(_[1]) ? _[1] : parseInt(_[1]), T = isNaN(M[1]) ? M[1] : parseInt(M[1]);\n \"*\" !== O && \"+\" !== O || (O = \"*\" === E ? 0 : 1), S.quantifier = {\n min: O,\n max: E,\n jit: T\n };\n var j = v.length > 0 ? v[v.length - 1].matches : h.matches;\n (n = j.pop()).isGroup || (n = b([ n ])), j.push(n), j.push(S);\n break;\n\n case i.alternatormarker:\n if (v.length > 0) {\n var A = (l = v[v.length - 1]).matches[l.matches.length - 1];\n u = l.openGroup && (void 0 === A.matches || !1 === A.isGroup && !1 === A.isAlternator) ? v.pop() : P(l.matches);\n } else u = P(h.matches);\n if (u.isAlternator) v.push(u); else if (u.alternatorGroup ? (c = v.pop(), u.alternatorGroup = !1) : c = new a.default(!1, !1, !1, !0), \n c.matches.push(u), v.push(c), u.openGroup) {\n u.openGroup = !1;\n var D = new a.default(!0);\n D.alternatorGroup = !0, v.push(D);\n }\n break;\n\n default:\n k();\n }\n }\n g && x();\n for (;v.length > 0; ) s = v.pop(), h.matches.push(s);\n h.matches.length > 0 && (!function e(n) {\n n && n.matches && n.matches.forEach((function(a, r) {\n var o = n.matches[r + 1];\n (void 0 === o || void 0 === o.matches || !1 === o.isQuantifier) && a && a.isGroup && (a.isGroup = !1, \n t || (y(a, i.groupmarker[0], 0), !0 !== a.openGroup && y(a, i.groupmarker[1]))), \n e(a);\n }));\n }(h), m.push(h));\n (i.numericInput || i.isRTL) && function e(t) {\n for (var n in t.matches = t.matches.reverse(), t.matches) if (Object.prototype.hasOwnProperty.call(t.matches, n)) {\n var a = parseInt(n);\n if (t.matches[n].isQuantifier && t.matches[a + 1] && t.matches[a + 1].isGroup) {\n var r = t.matches[n];\n t.matches.splice(n, 1), t.matches.splice(a + 1, 0, r);\n }\n void 0 !== t.matches[n].matches ? t.matches[n] = e(t.matches[n]) : t.matches[n] = ((o = t.matches[n]) === i.optionalmarker[0] ? o = i.optionalmarker[1] : o === i.optionalmarker[1] ? o = i.optionalmarker[0] : o === i.groupmarker[0] ? o = i.groupmarker[1] : o === i.groupmarker[1] && (o = i.groupmarker[0]), \n o);\n }\n var o;\n return t;\n }(m[0]);\n return m;\n }, t.generateMaskSet = function(e, t) {\n var i;\n function a(e, t) {\n var i = t.repeat, n = t.groupmarker, a = t.quantifiermarker, r = t.keepStatic;\n if (i > 0 || \"*\" === i || \"+\" === i) {\n var l = \"*\" === i ? 0 : \"+\" === i ? 1 : i;\n e = n[0] + e + n[1] + a[0] + l + \",\" + i + a[1];\n }\n if (!0 === r) {\n var c = e.match(new RegExp(\"(.)\\\\[([^\\\\]]*)\\\\]\", \"g\"));\n c && c.forEach((function(t, i) {\n var n = function(e, t) {\n return function(e) {\n if (Array.isArray(e)) return e;\n }(e) || function(e, t) {\n var i = null == e ? null : \"undefined\" != typeof Symbol && e[Symbol.iterator] || e[\"@@iterator\"];\n if (null != i) {\n var n, a, r, o, s = [], l = !0, c = !1;\n try {\n if (r = (i = i.call(e)).next, 0 === t) {\n if (Object(i) !== i) return;\n l = !1;\n } else for (;!(l = (n = r.call(i)).done) && (s.push(n.value), s.length !== t); l = !0) ;\n } catch (e) {\n c = !0, a = e;\n } finally {\n try {\n if (!l && null != i.return && (o = i.return(), Object(o) !== o)) return;\n } finally {\n if (c) throw a;\n }\n }\n return s;\n }\n }(e, t) || function(e, t) {\n if (!e) return;\n if (\"string\" == typeof e) return s(e, t);\n var i = Object.prototype.toString.call(e).slice(8, -1);\n \"Object\" === i && e.constructor && (i = e.constructor.name);\n if (\"Map\" === i || \"Set\" === i) return Array.from(e);\n if (\"Arguments\" === i || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)) return s(e, t);\n }(e, t) || function() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n }();\n }(t.split(\"[\"), 2), a = n[0], r = n[1];\n r = r.replace(\"]\", \"\"), e = e.replace(new RegExp(\"\".concat((0, o.default)(a), \"\\\\[\").concat((0, \n o.default)(r), \"\\\\]\")), a.charAt(0) === r.charAt(0) ? \"(\".concat(a, \"|\").concat(a).concat(r, \")\") : \"\".concat(a, \"[\").concat(r, \"]\"));\n }));\n }\n return e;\n }\n function l(e, i, o) {\n var s, l, c = !1;\n return null !== e && \"\" !== e || ((c = null !== o.regex) ? e = (e = o.regex).replace(/^(\\^)(.*)(\\$)$/, \"$2\") : (c = !0, \n e = \".*\")), 1 === e.length && !1 === o.greedy && 0 !== o.repeat && (o.placeholder = \"\"), \n e = a(e, o), l = c ? \"regex_\" + o.regex : o.numericInput ? e.split(\"\").reverse().join(\"\") : e, \n null !== o.keepStatic && (l = \"ks_\" + o.keepStatic + l), void 0 === r.default.prototype.masksCache[l] || !0 === t ? (s = {\n mask: e,\n maskToken: r.default.prototype.analyseMask(e, c, o),\n validPositions: [],\n _buffer: void 0,\n buffer: void 0,\n tests: {},\n excludes: {},\n metadata: i,\n maskLength: void 0,\n jitOffset: {}\n }, !0 !== t && (r.default.prototype.masksCache[l] = s, s = n.default.extend(!0, {}, r.default.prototype.masksCache[l]))) : s = n.default.extend(!0, {}, r.default.prototype.masksCache[l]), \n s;\n }\n \"function\" == typeof e.mask && (e.mask = e.mask(e));\n if (Array.isArray(e.mask)) {\n if (e.mask.length > 1) {\n null === e.keepStatic && (e.keepStatic = !0);\n var c = e.groupmarker[0];\n return (e.isRTL ? e.mask.reverse() : e.mask).forEach((function(t) {\n c.length > 1 && (c += e.alternatormarker), void 0 !== t.mask && \"function\" != typeof t.mask ? c += t.mask : c += t;\n })), l(c += e.groupmarker[1], e.mask, e);\n }\n e.mask = e.mask.pop();\n }\n i = e.mask && void 0 !== e.mask.mask && \"function\" != typeof e.mask.mask ? l(e.mask.mask, e.mask, e) : l(e.mask, e.mask, e);\n null === e.keepStatic && (e.keepStatic = !1);\n return i;\n };\n var n = l(i(4963)), a = l(i(9695)), r = l(i(2394)), o = l(i(7184));\n function s(e, t) {\n (null == t || t > e.length) && (t = e.length);\n for (var i = 0, n = new Array(t); i < t; i++) n[i] = e[i];\n return n;\n }\n function l(e) {\n return e && e.__esModule ? e : {\n default: e\n };\n }\n },\n 157: function(e, t, i) {\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.mask = function() {\n var e = this, t = this.opts, i = this.el, u = this.dependencyLib;\n o.EventRuler.off(i);\n var f = function(t, i) {\n \"textarea\" !== t.tagName.toLowerCase() && i.ignorables.push(n.keys.Enter);\n var s = t.getAttribute(\"type\"), l = \"input\" === t.tagName.toLowerCase() && i.supportsInputType.includes(s) || t.isContentEditable || \"textarea\" === t.tagName.toLowerCase();\n if (!l) if (\"input\" === t.tagName.toLowerCase()) {\n var c = document.createElement(\"input\");\n c.setAttribute(\"type\", s), l = \"text\" === c.type, c = null;\n } else l = \"partial\";\n return !1 !== l ? function(t) {\n var n, s;\n function l() {\n return this.inputmask ? this.inputmask.opts.autoUnmask ? this.inputmask.unmaskedvalue() : -1 !== a.getLastValidPosition.call(e) || !0 !== i.nullable ? (this.inputmask.shadowRoot || this.ownerDocument).activeElement === this && i.clearMaskOnLostFocus ? (e.isRTL ? r.clearOptionalTail.call(e, a.getBuffer.call(e).slice()).reverse() : r.clearOptionalTail.call(e, a.getBuffer.call(e).slice())).join(\"\") : n.call(this) : \"\" : n.call(this);\n }\n function c(e) {\n s.call(this, e), this.inputmask && (0, r.applyInputValue)(this, e);\n }\n if (!t.inputmask.__valueGet) {\n if (!0 !== i.noValuePatching) {\n if (Object.getOwnPropertyDescriptor) {\n var f = Object.getPrototypeOf ? Object.getOwnPropertyDescriptor(Object.getPrototypeOf(t), \"value\") : void 0;\n f && f.get && f.set ? (n = f.get, s = f.set, Object.defineProperty(t, \"value\", {\n get: l,\n set: c,\n configurable: !0\n })) : \"input\" !== t.tagName.toLowerCase() && (n = function() {\n return this.textContent;\n }, s = function(e) {\n this.textContent = e;\n }, Object.defineProperty(t, \"value\", {\n get: l,\n set: c,\n configurable: !0\n }));\n } else document.__lookupGetter__ && t.__lookupGetter__(\"value\") && (n = t.__lookupGetter__(\"value\"), \n s = t.__lookupSetter__(\"value\"), t.__defineGetter__(\"value\", l), t.__defineSetter__(\"value\", c));\n t.inputmask.__valueGet = n, t.inputmask.__valueSet = s;\n }\n t.inputmask._valueGet = function(t) {\n return e.isRTL && !0 !== t ? n.call(this.el).split(\"\").reverse().join(\"\") : n.call(this.el);\n }, t.inputmask._valueSet = function(t, i) {\n s.call(this.el, null == t ? \"\" : !0 !== i && e.isRTL ? t.split(\"\").reverse().join(\"\") : t);\n }, void 0 === n && (n = function() {\n return this.value;\n }, s = function(e) {\n this.value = e;\n }, function(t) {\n if (u.valHooks && (void 0 === u.valHooks[t] || !0 !== u.valHooks[t].inputmaskpatch)) {\n var n = u.valHooks[t] && u.valHooks[t].get ? u.valHooks[t].get : function(e) {\n return e.value;\n }, o = u.valHooks[t] && u.valHooks[t].set ? u.valHooks[t].set : function(e, t) {\n return e.value = t, e;\n };\n u.valHooks[t] = {\n get: function(t) {\n if (t.inputmask) {\n if (t.inputmask.opts.autoUnmask) return t.inputmask.unmaskedvalue();\n var r = n(t);\n return -1 !== a.getLastValidPosition.call(e, void 0, void 0, t.inputmask.maskset.validPositions) || !0 !== i.nullable ? r : \"\";\n }\n return n(t);\n },\n set: function(e, t) {\n var i = o(e, t);\n return e.inputmask && (0, r.applyInputValue)(e, t), i;\n },\n inputmaskpatch: !0\n };\n }\n }(t.type), function(e) {\n o.EventRuler.on(e, \"mouseenter\", (function() {\n var e = this, t = e.inputmask._valueGet(!0);\n t != (e.inputmask.isRTL ? a.getBuffer.call(e.inputmask).slice().reverse() : a.getBuffer.call(e.inputmask)).join(\"\") && (0, \n r.applyInputValue)(e, t);\n }));\n }(t));\n }\n }(t) : t.inputmask = void 0, l;\n }(i, t);\n if (!1 !== f) {\n e.originalPlaceholder = i.placeholder, e.maxLength = void 0 !== i ? i.maxLength : void 0, \n -1 === e.maxLength && (e.maxLength = void 0), \"inputMode\" in i && null === i.getAttribute(\"inputmode\") && (i.inputMode = t.inputmode, \n i.setAttribute(\"inputmode\", t.inputmode)), !0 === f && (t.showMaskOnFocus = t.showMaskOnFocus && -1 === [ \"cc-number\", \"cc-exp\" ].indexOf(i.autocomplete), \n s.iphone && (t.insertModeVisual = !1, i.setAttribute(\"autocorrect\", \"off\")), o.EventRuler.on(i, \"submit\", c.EventHandlers.submitEvent), \n o.EventRuler.on(i, \"reset\", c.EventHandlers.resetEvent), o.EventRuler.on(i, \"blur\", c.EventHandlers.blurEvent), \n o.EventRuler.on(i, \"focus\", c.EventHandlers.focusEvent), o.EventRuler.on(i, \"invalid\", c.EventHandlers.invalidEvent), \n o.EventRuler.on(i, \"click\", c.EventHandlers.clickEvent), o.EventRuler.on(i, \"mouseleave\", c.EventHandlers.mouseleaveEvent), \n o.EventRuler.on(i, \"mouseenter\", c.EventHandlers.mouseenterEvent), o.EventRuler.on(i, \"paste\", c.EventHandlers.pasteEvent), \n o.EventRuler.on(i, \"cut\", c.EventHandlers.cutEvent), o.EventRuler.on(i, \"complete\", t.oncomplete), \n o.EventRuler.on(i, \"incomplete\", t.onincomplete), o.EventRuler.on(i, \"cleared\", t.oncleared), \n !0 !== t.inputEventOnly && o.EventRuler.on(i, \"keydown\", c.EventHandlers.keyEvent), \n (s.mobile || t.inputEventOnly) && i.removeAttribute(\"maxLength\"), o.EventRuler.on(i, \"input\", c.EventHandlers.inputFallBackEvent)), \n o.EventRuler.on(i, \"setvalue\", c.EventHandlers.setValueEvent), a.getBufferTemplate.call(e).join(\"\"), \n e.undoValue = e._valueGet(!0);\n var d = (i.inputmask.shadowRoot || i.ownerDocument).activeElement;\n if (\"\" !== i.inputmask._valueGet(!0) || !1 === t.clearMaskOnLostFocus || d === i) {\n (0, r.applyInputValue)(i, i.inputmask._valueGet(!0), t);\n var p = a.getBuffer.call(e).slice();\n !1 === l.isComplete.call(e, p) && t.clearIncomplete && a.resetMaskSet.call(e), t.clearMaskOnLostFocus && d !== i && (-1 === a.getLastValidPosition.call(e) ? p = [] : r.clearOptionalTail.call(e, p)), \n (!1 === t.clearMaskOnLostFocus || t.showMaskOnFocus && d === i || \"\" !== i.inputmask._valueGet(!0)) && (0, \n r.writeBuffer)(i, p), d === i && a.caret.call(e, i, a.seekNext.call(e, a.getLastValidPosition.call(e)));\n }\n }\n };\n var n = i(2839), a = i(8711), r = i(7760), o = i(9716), s = i(9845), l = i(7215), c = i(6030);\n },\n 9695: function(e, t) {\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.default = function(e, t, i, n) {\n this.matches = [], this.openGroup = e || !1, this.alternatorGroup = !1, this.isGroup = e || !1, \n this.isOptional = t || !1, this.isQuantifier = i || !1, this.isAlternator = n || !1, \n this.quantifier = {\n min: 1,\n max: 1\n };\n };\n },\n 3194: function() {\n Array.prototype.includes || Object.defineProperty(Array.prototype, \"includes\", {\n value: function(e, t) {\n if (null == this) throw new TypeError('\"this\" is null or not defined');\n var i = Object(this), n = i.length >>> 0;\n if (0 === n) return !1;\n for (var a = 0 | t, r = Math.max(a >= 0 ? a : n - Math.abs(a), 0); r < n; ) {\n if (i[r] === e) return !0;\n r++;\n }\n return !1;\n }\n });\n },\n 9302: function() {\n var e = Function.bind.call(Function.call, Array.prototype.reduce), t = Function.bind.call(Function.call, Object.prototype.propertyIsEnumerable), i = Function.bind.call(Function.call, Array.prototype.concat), n = Object.keys;\n Object.entries || (Object.entries = function(a) {\n return e(n(a), (function(e, n) {\n return i(e, \"string\" == typeof n && t(a, n) ? [ [ n, a[n] ] ] : []);\n }), []);\n });\n },\n 7149: function() {\n function e(t) {\n return e = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function(e) {\n return typeof e;\n } : function(e) {\n return e && \"function\" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? \"symbol\" : typeof e;\n }, e(t);\n }\n \"function\" != typeof Object.getPrototypeOf && (Object.getPrototypeOf = \"object\" === e(\"test\".__proto__) ? function(e) {\n return e.__proto__;\n } : function(e) {\n return e.constructor.prototype;\n });\n },\n 4013: function() {\n String.prototype.includes || (String.prototype.includes = function(e, t) {\n return \"number\" != typeof t && (t = 0), !(t + e.length > this.length) && -1 !== this.indexOf(e, t);\n });\n },\n 8711: function(e, t, i) {\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.caret = function(e, t, i, n, a) {\n var r, o = this, s = this.opts;\n if (void 0 === t) return \"selectionStart\" in e && \"selectionEnd\" in e ? (t = e.selectionStart, \n i = e.selectionEnd) : window.getSelection ? (r = window.getSelection().getRangeAt(0)).commonAncestorContainer.parentNode !== e && r.commonAncestorContainer !== e || (t = r.startOffset, \n i = r.endOffset) : document.selection && document.selection.createRange && (i = (t = 0 - (r = document.selection.createRange()).duplicate().moveStart(\"character\", -e.inputmask._valueGet().length)) + r.text.length), \n {\n begin: n ? t : c.call(o, t),\n end: n ? i : c.call(o, i)\n };\n if (Array.isArray(t) && (i = o.isRTL ? t[0] : t[1], t = o.isRTL ? t[1] : t[0]), \n void 0 !== t.begin && (i = o.isRTL ? t.begin : t.end, t = o.isRTL ? t.end : t.begin), \n \"number\" == typeof t) {\n t = n ? t : c.call(o, t), i = \"number\" == typeof (i = n ? i : c.call(o, i)) ? i : t;\n var l = parseInt(((e.ownerDocument.defaultView || window).getComputedStyle ? (e.ownerDocument.defaultView || window).getComputedStyle(e, null) : e.currentStyle).fontSize) * i;\n if (e.scrollLeft = l > e.scrollWidth ? l : 0, e.inputmask.caretPos = {\n begin: t,\n end: i\n }, s.insertModeVisual && !1 === s.insertMode && t === i && (a || i++), e === (e.inputmask.shadowRoot || e.ownerDocument).activeElement) if (\"setSelectionRange\" in e) e.setSelectionRange(t, i); else if (window.getSelection) {\n if (r = document.createRange(), void 0 === e.firstChild || null === e.firstChild) {\n var u = document.createTextNode(\"\");\n e.appendChild(u);\n }\n r.setStart(e.firstChild, t < e.inputmask._valueGet().length ? t : e.inputmask._valueGet().length), \n r.setEnd(e.firstChild, i < e.inputmask._valueGet().length ? i : e.inputmask._valueGet().length), \n r.collapse(!0);\n var f = window.getSelection();\n f.removeAllRanges(), f.addRange(r);\n } else e.createTextRange && ((r = e.createTextRange()).collapse(!0), r.moveEnd(\"character\", i), \n r.moveStart(\"character\", t), r.select());\n }\n }, t.determineLastRequiredPosition = function(e) {\n var t, i, r = this, s = r.maskset, l = r.dependencyLib, c = n.getMaskTemplate.call(r, !0, o.call(r), !0, !0), u = c.length, f = o.call(r), d = {}, p = s.validPositions[f], h = void 0 !== p ? p.locator.slice() : void 0;\n for (t = f + 1; t < c.length; t++) h = (i = n.getTestTemplate.call(r, t, h, t - 1)).locator.slice(), \n d[t] = l.extend(!0, {}, i);\n var v = p && void 0 !== p.alternation ? p.locator[p.alternation] : void 0;\n for (t = u - 1; t > f && (((i = d[t]).match.optionality || i.match.optionalQuantifier && i.match.newBlockMarker || v && (v !== d[t].locator[p.alternation] && 1 != i.match.static || !0 === i.match.static && i.locator[p.alternation] && a.checkAlternationMatch.call(r, i.locator[p.alternation].toString().split(\",\"), v.toString().split(\",\")) && \"\" !== n.getTests.call(r, t)[0].def)) && c[t] === n.getPlaceholder.call(r, t, i.match)); t--) u--;\n return e ? {\n l: u,\n def: d[u] ? d[u].match : void 0\n } : u;\n }, t.determineNewCaretPosition = function(e, t, i) {\n var a = this, c = a.maskset, u = a.opts;\n t && (a.isRTL ? e.end = e.begin : e.begin = e.end);\n if (e.begin === e.end) {\n switch (i = i || u.positionCaretOnClick) {\n case \"none\":\n break;\n\n case \"select\":\n e = {\n begin: 0,\n end: r.call(a).length\n };\n break;\n\n case \"ignore\":\n e.end = e.begin = l.call(a, o.call(a));\n break;\n\n case \"radixFocus\":\n if (a.clicked > 1 && 0 == c.validPositions.length) break;\n if (function(e) {\n if (\"\" !== u.radixPoint && 0 !== u.digits) {\n var t = c.validPositions;\n if (void 0 === t[e] || t[e].input === n.getPlaceholder.call(a, e)) {\n if (e < l.call(a, -1)) return !0;\n var i = r.call(a).indexOf(u.radixPoint);\n if (-1 !== i) {\n for (var o = 0, s = t.length; o < s; o++) if (t[o] && i < o && t[o].input !== n.getPlaceholder.call(a, o)) return !1;\n return !0;\n }\n }\n }\n return !1;\n }(e.begin)) {\n var f = r.call(a).join(\"\").indexOf(u.radixPoint);\n e.end = e.begin = u.numericInput ? l.call(a, f) : f;\n break;\n }\n\n default:\n var d = e.begin, p = o.call(a, d, !0), h = l.call(a, -1 !== p || s.call(a, 0) ? p : -1);\n if (d <= h) e.end = e.begin = s.call(a, d, !1, !0) ? d : l.call(a, d); else {\n var v = c.validPositions[p], m = n.getTestTemplate.call(a, h, v ? v.match.locator : void 0, v), g = n.getPlaceholder.call(a, h, m.match);\n if (\"\" !== g && r.call(a)[h] !== g && !0 !== m.match.optionalQuantifier && !0 !== m.match.newBlockMarker || !s.call(a, h, u.keepStatic, !0) && m.match.def === g) {\n var y = l.call(a, h);\n (d >= y || d === h) && (h = y);\n }\n e.end = e.begin = h;\n }\n }\n return e;\n }\n }, t.getBuffer = r, t.getBufferTemplate = function() {\n var e = this.maskset;\n void 0 === e._buffer && (e._buffer = n.getMaskTemplate.call(this, !1, 1), void 0 === e.buffer && (e.buffer = e._buffer.slice()));\n return e._buffer;\n }, t.getLastValidPosition = o, t.isMask = s, t.resetMaskSet = function(e) {\n var t = this.maskset;\n t.buffer = void 0, !0 !== e && (t.validPositions = [], t.p = 0);\n }, t.seekNext = l, t.seekPrevious = function(e, t) {\n var i = this, a = e - 1;\n if (e <= 0) return 0;\n for (;a > 0 && (!0 === t && (!0 !== n.getTest.call(i, a).match.newBlockMarker || !s.call(i, a, void 0, !0)) || !0 !== t && !s.call(i, a, void 0, !0)); ) a--;\n return a;\n }, t.translatePosition = c;\n var n = i(4713), a = i(7215);\n function r(e) {\n var t = this, i = t.maskset;\n return void 0 !== i.buffer && !0 !== e || (i.buffer = n.getMaskTemplate.call(t, !0, o.call(t), !0), \n void 0 === i._buffer && (i._buffer = i.buffer.slice())), i.buffer;\n }\n function o(e, t, i) {\n var n = this.maskset, a = -1, r = -1, o = i || n.validPositions;\n void 0 === e && (e = -1);\n for (var s = 0, l = o.length; s < l; s++) o[s] && (t || !0 !== o[s].generatedInput) && (s <= e && (a = s), \n s >= e && (r = s));\n return -1 === a || a == e ? r : -1 == r || e - a < r - e ? a : r;\n }\n function s(e, t, i) {\n var a = this, r = this.maskset, o = n.getTestTemplate.call(a, e).match;\n if (\"\" === o.def && (o = n.getTest.call(a, e).match), !0 !== o.static) return o.fn;\n if (!0 === i && void 0 !== r.validPositions[e] && !0 !== r.validPositions[e].generatedInput) return !0;\n if (!0 !== t && e > -1) {\n if (i) {\n var s = n.getTests.call(a, e);\n return s.length > 1 + (\"\" === s[s.length - 1].match.def ? 1 : 0);\n }\n var l = n.determineTestTemplate.call(a, e, n.getTests.call(a, e)), c = n.getPlaceholder.call(a, e, l.match);\n return l.match.def !== c;\n }\n return !1;\n }\n function l(e, t, i) {\n var a = this;\n void 0 === i && (i = !0);\n for (var r = e + 1; \"\" !== n.getTest.call(a, r).match.def && (!0 === t && (!0 !== n.getTest.call(a, r).match.newBlockMarker || !s.call(a, r, void 0, !0)) || !0 !== t && !s.call(a, r, void 0, i)); ) r++;\n return r;\n }\n function c(e) {\n var t = this.opts, i = this.el;\n return !this.isRTL || \"number\" != typeof e || t.greedy && \"\" === t.placeholder || !i || (e = this._valueGet().length - e) < 0 && (e = 0), \n e;\n }\n },\n 4713: function(e, t, i) {\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.determineTestTemplate = c, t.getDecisionTaker = o, t.getMaskTemplate = function(e, t, i, n, a) {\n var r = this, o = this.opts, u = this.maskset, f = o.greedy;\n a && o.greedy && (o.greedy = !1, r.maskset.tests = {});\n t = t || 0;\n var p, h, v, m, g = [], y = 0;\n do {\n if (!0 === e && u.validPositions[y]) h = (v = a && u.validPositions[y].match.optionality && void 0 === u.validPositions[y + 1] && (!0 === u.validPositions[y].generatedInput || u.validPositions[y].input == o.skipOptionalPartCharacter && y > 0) ? c.call(r, y, d.call(r, y, p, y - 1)) : u.validPositions[y]).match, \n p = v.locator.slice(), g.push(!0 === i ? v.input : !1 === i ? h.nativeDef : s.call(r, y, h)); else {\n h = (v = l.call(r, y, p, y - 1)).match, p = v.locator.slice();\n var k = !0 !== n && (!1 !== o.jitMasking ? o.jitMasking : h.jit);\n (m = (m && h.static && h.def !== o.groupSeparator && null === h.fn || u.validPositions[y - 1] && h.static && h.def !== o.groupSeparator && null === h.fn) && u.tests[y]) || !1 === k || void 0 === k || \"number\" == typeof k && isFinite(k) && k > y ? g.push(!1 === i ? h.nativeDef : s.call(r, g.length, h)) : m = !1;\n }\n y++;\n } while (!0 !== h.static || \"\" !== h.def || t > y);\n \"\" === g[g.length - 1] && g.pop();\n !1 === i && void 0 !== u.maskLength || (u.maskLength = y - 1);\n return o.greedy = f, g;\n }, t.getPlaceholder = s, t.getTest = u, t.getTestTemplate = l, t.getTests = d, t.isSubsetOf = f;\n var n, a = (n = i(2394)) && n.__esModule ? n : {\n default: n\n };\n function r(e, t) {\n var i = (null != e.alternation ? e.mloc[o(e)] : e.locator).join(\"\");\n if (\"\" !== i) for (;i.length < t; ) i += \"0\";\n return i;\n }\n function o(e) {\n var t = e.locator[e.alternation];\n return \"string\" == typeof t && t.length > 0 && (t = t.split(\",\")[0]), void 0 !== t ? t.toString() : \"\";\n }\n function s(e, t, i) {\n var n = this.opts, a = this.maskset;\n if (void 0 !== (t = t || u.call(this, e).match).placeholder || !0 === i) return \"function\" == typeof t.placeholder ? t.placeholder(n) : t.placeholder;\n if (!0 === t.static) {\n if (e > -1 && void 0 === a.validPositions[e]) {\n var r, o = d.call(this, e), s = [];\n if (o.length > 1 + (\"\" === o[o.length - 1].match.def ? 1 : 0)) for (var l = 0; l < o.length; l++) if (\"\" !== o[l].match.def && !0 !== o[l].match.optionality && !0 !== o[l].match.optionalQuantifier && (!0 === o[l].match.static || void 0 === r || !1 !== o[l].match.fn.test(r.match.def, a, e, !0, n)) && (s.push(o[l]), \n !0 === o[l].match.static && (r = o[l]), s.length > 1 && /[0-9a-bA-Z]/.test(s[0].match.def))) return n.placeholder.charAt(e % n.placeholder.length);\n }\n return t.def;\n }\n return n.placeholder.charAt(e % n.placeholder.length);\n }\n function l(e, t, i) {\n return this.maskset.validPositions[e] || c.call(this, e, d.call(this, e, t ? t.slice() : t, i));\n }\n function c(e, t) {\n var i = this.opts, n = 0, a = function(e, t) {\n var i = 0, n = !1;\n t.forEach((function(e) {\n e.match.optionality && (0 !== i && i !== e.match.optionality && (n = !0), (0 === i || i > e.match.optionality) && (i = e.match.optionality));\n })), i && (0 == e || 1 == t.length ? i = 0 : n || (i = 0));\n return i;\n }(e, t);\n e = e > 0 ? e - 1 : 0;\n var o, s, l, c = r(u.call(this, e));\n i.greedy && t.length > 1 && \"\" === t[t.length - 1].match.def && (n = 1);\n for (var f = 0; f < t.length - n; f++) {\n var d = t[f];\n o = r(d, c.length);\n var p = Math.abs(o - c);\n (void 0 === s || \"\" !== o && p < s || l && !i.greedy && l.match.optionality && l.match.optionality - a > 0 && \"master\" === l.match.newBlockMarker && (!d.match.optionality || d.match.optionality - a < 1 || !d.match.newBlockMarker) || l && !i.greedy && l.match.optionalQuantifier && !d.match.optionalQuantifier) && (s = p, \n l = d);\n }\n return l;\n }\n function u(e, t) {\n var i = this.maskset;\n return i.validPositions[e] ? i.validPositions[e] : (t || d.call(this, e))[0];\n }\n function f(e, t, i) {\n function n(e) {\n for (var t, i = [], n = -1, a = 0, r = e.length; a < r; a++) if (\"-\" === e.charAt(a)) for (t = e.charCodeAt(a + 1); ++n < t; ) i.push(String.fromCharCode(n)); else n = e.charCodeAt(a), \n i.push(e.charAt(a));\n return i.join(\"\");\n }\n return e.match.def === t.match.nativeDef || !(!(i.regex || e.match.fn instanceof RegExp && t.match.fn instanceof RegExp) || !0 === e.match.static || !0 === t.match.static) && -1 !== n(t.match.fn.toString().replace(/[[\\]/]/g, \"\")).indexOf(n(e.match.fn.toString().replace(/[[\\]/]/g, \"\")));\n }\n function d(e, t, i) {\n var n, r, o = this, s = this.dependencyLib, l = this.maskset, u = this.opts, d = this.el, p = l.maskToken, h = t ? i : 0, v = t ? t.slice() : [ 0 ], m = [], g = !1, y = t ? t.join(\"\") : \"\";\n function k(t, i, r, s) {\n function c(r, s, p) {\n function v(e, t) {\n var i = 0 === t.matches.indexOf(e);\n return i || t.matches.every((function(n, a) {\n return !0 === n.isQuantifier ? i = v(e, t.matches[a - 1]) : Object.prototype.hasOwnProperty.call(n, \"matches\") && (i = v(e, n)), \n !i;\n })), i;\n }\n function x(e, t, i) {\n var n, a;\n if ((l.tests[e] || l.validPositions[e]) && (l.tests[e] || [ l.validPositions[e] ]).every((function(e, r) {\n if (e.mloc[t]) return n = e, !1;\n var o = void 0 !== i ? i : e.alternation, s = void 0 !== e.locator[o] ? e.locator[o].toString().indexOf(t) : -1;\n return (void 0 === a || s < a) && -1 !== s && (n = e, a = s), !0;\n })), n) {\n var r = n.locator[n.alternation];\n return (n.mloc[t] || n.mloc[r] || n.locator).slice((void 0 !== i ? i : n.alternation) + 1);\n }\n return void 0 !== i ? x(e, t) : void 0;\n }\n function P(e, t) {\n var i = e.alternation, n = void 0 === t || i === t.alternation && -1 === e.locator[i].toString().indexOf(t.locator[i]);\n if (!n && i > t.alternation) for (var a = t.alternation; a < i; a++) if (e.locator[a] !== t.locator[a]) {\n i = a, n = !0;\n break;\n }\n if (n) {\n e.mloc = e.mloc || {};\n var r = e.locator[i];\n if (void 0 !== r) {\n if (\"string\" == typeof r && (r = r.split(\",\")[0]), void 0 === e.mloc[r] && (e.mloc[r] = e.locator.slice()), \n void 0 !== t) {\n for (var o in t.mloc) \"string\" == typeof o && (o = o.split(\",\")[0]), void 0 === e.mloc[o] && (e.mloc[o] = t.mloc[o]);\n e.locator[i] = Object.keys(e.mloc).join(\",\");\n }\n return !0;\n }\n e.alternation = void 0;\n }\n return !1;\n }\n function w(e, t) {\n if (e.locator.length !== t.locator.length) return !1;\n for (var i = e.alternation + 1; i < e.locator.length; i++) if (e.locator[i] !== t.locator[i]) return !1;\n return !0;\n }\n if (h > e + u._maxTestPos) throw \"Inputmask: There is probably an error in your mask definition or in the code. Create an issue on github with an example of the mask you are using. \" + l.mask;\n if (h === e && void 0 === r.matches) {\n if (m.push({\n match: r,\n locator: s.reverse(),\n cd: y,\n mloc: {}\n }), !r.optionality || void 0 !== p || !(u.definitions && u.definitions[r.nativeDef] && u.definitions[r.nativeDef].optional || a.default.prototype.definitions[r.nativeDef] && a.default.prototype.definitions[r.nativeDef].optional)) return !0;\n g = !0, h = e;\n } else if (void 0 !== r.matches) {\n if (r.isGroup && p !== r) return function() {\n if (r = c(t.matches[t.matches.indexOf(r) + 1], s, p)) return !0;\n }();\n if (r.isOptional) return function() {\n var t = r, a = m.length;\n if (r = k(r, i, s, p), m.length > 0) {\n if (m.forEach((function(e, t) {\n t >= a && (e.match.optionality = e.match.optionality ? e.match.optionality + 1 : 1);\n })), n = m[m.length - 1].match, void 0 !== p || !v(n, t)) return r;\n g = !0, h = e;\n }\n }();\n if (r.isAlternator) return function() {\n o.hasAlternator = !0;\n var n, a, v, y = r, k = [], b = m.slice(), S = s.length, M = !1, _ = i.length > 0 ? i.shift() : -1;\n if (-1 === _ || \"string\" == typeof _) {\n var O, E = h, T = i.slice(), j = [];\n if (\"string\" == typeof _) j = _.split(\",\"); else for (O = 0; O < y.matches.length; O++) j.push(O.toString());\n if (void 0 !== l.excludes[e]) {\n for (var A = j.slice(), D = 0, B = l.excludes[e].length; D < B; D++) {\n var C = l.excludes[e][D].toString().split(\":\");\n s.length == C[1] && j.splice(j.indexOf(C[0]), 1);\n }\n 0 === j.length && (delete l.excludes[e], j = A);\n }\n (!0 === u.keepStatic || isFinite(parseInt(u.keepStatic)) && E >= u.keepStatic) && (j = j.slice(0, 1));\n for (var R = 0; R < j.length; R++) {\n O = parseInt(j[R]), m = [], i = \"string\" == typeof _ && x(h, O, S) || T.slice();\n var L = y.matches[O];\n if (L && c(L, [ O ].concat(s), p)) r = !0; else if (0 === R && (M = !0), L && L.matches && L.matches.length > y.matches[0].matches.length) break;\n n = m.slice(), h = E, m = [];\n for (var F = 0; F < n.length; F++) {\n var I = n[F], N = !1;\n I.match.jit = I.match.jit || M, I.alternation = I.alternation || S, P(I);\n for (var V = 0; V < k.length; V++) {\n var G = k[V];\n if (\"string\" != typeof _ || void 0 !== I.alternation && j.includes(I.locator[I.alternation].toString())) {\n if (I.match.nativeDef === G.match.nativeDef) {\n N = !0, P(G, I);\n break;\n }\n if (f(I, G, u)) {\n P(I, G) && (N = !0, k.splice(k.indexOf(G), 0, I));\n break;\n }\n if (f(G, I, u)) {\n P(G, I);\n break;\n }\n if (v = G, !0 === (a = I).match.static && !0 !== v.match.static && v.match.fn.test(a.match.def, l, e, !1, u, !1)) {\n w(I, G) || void 0 !== d.inputmask.userOptions.keepStatic ? P(I, G) && (N = !0, k.splice(k.indexOf(G), 0, I)) : u.keepStatic = !0;\n break;\n }\n }\n }\n N || k.push(I);\n }\n }\n m = b.concat(k), h = e, g = m.length > 0, r = k.length > 0, i = T.slice();\n } else r = c(y.matches[_] || t.matches[_], [ _ ].concat(s), p);\n if (r) return !0;\n }();\n if (r.isQuantifier && p !== t.matches[t.matches.indexOf(r) - 1]) return function() {\n for (var a = r, o = !1, f = i.length > 0 ? i.shift() : 0; f < (isNaN(a.quantifier.max) ? f + 1 : a.quantifier.max) && h <= e; f++) {\n var d = t.matches[t.matches.indexOf(a) - 1];\n if (r = c(d, [ f ].concat(s), d)) {\n if (m.forEach((function(t, i) {\n (n = b(d, t.match) ? t.match : m[m.length - 1].match).optionalQuantifier = f >= a.quantifier.min, \n n.jit = (f + 1) * (d.matches.indexOf(n) + 1) > a.quantifier.jit, n.optionalQuantifier && v(n, d) && (g = !0, \n h = e, u.greedy && null == l.validPositions[e - 1] && f > a.quantifier.min && -1 != [ \"*\", \"+\" ].indexOf(a.quantifier.max) && (m.pop(), \n y = void 0), o = !0, r = !1), !o && n.jit && (l.jitOffset[e] = d.matches.length - d.matches.indexOf(n));\n })), o) break;\n return !0;\n }\n }\n }();\n if (r = k(r, i, s, p)) return !0;\n } else h++;\n }\n for (var p = i.length > 0 ? i.shift() : 0; p < t.matches.length; p++) if (!0 !== t.matches[p].isQuantifier) {\n var v = c(t.matches[p], [ p ].concat(r), s);\n if (v && h === e) return v;\n if (h > e) break;\n }\n }\n function b(e, t) {\n var i = -1 != e.matches.indexOf(t);\n return i || e.matches.forEach((function(e, n) {\n void 0 === e.matches || i || (i = b(e, t));\n })), i;\n }\n if (e > -1) {\n if (void 0 === t) {\n for (var x, P = e - 1; void 0 === (x = l.validPositions[P] || l.tests[P]) && P > -1; ) P--;\n void 0 !== x && P > -1 && (v = function(e, t) {\n var i, n = [];\n return Array.isArray(t) || (t = [ t ]), t.length > 0 && (void 0 === t[0].alternation || !0 === u.keepStatic ? 0 === (n = c.call(o, e, t.slice()).locator.slice()).length && (n = t[0].locator.slice()) : t.forEach((function(e) {\n \"\" !== e.def && (0 === n.length ? (i = e.alternation, n = e.locator.slice()) : e.locator[i] && -1 === n[i].toString().indexOf(e.locator[i]) && (n[i] += \",\" + e.locator[i]));\n }))), n;\n }(P, x), y = v.join(\"\"), h = P);\n }\n if (l.tests[e] && l.tests[e][0].cd === y) return l.tests[e];\n for (var w = v.shift(); w < p.length; w++) {\n if (k(p[w], v, [ w ]) && h === e || h > e) break;\n }\n }\n return (0 === m.length || g) && m.push({\n match: {\n fn: null,\n static: !0,\n optionality: !1,\n casing: null,\n def: \"\",\n placeholder: \"\"\n },\n locator: [],\n mloc: {},\n cd: y\n }), void 0 !== t && l.tests[e] ? r = s.extend(!0, [], m) : (l.tests[e] = s.extend(!0, [], m), \n r = l.tests[e]), m.forEach((function(e) {\n e.match.optionality = e.match.defOptionality || !1;\n })), r;\n }\n },\n 7215: function(e, t, i) {\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.alternate = s, t.checkAlternationMatch = function(e, t, i) {\n for (var n, a = this.opts.greedy ? t : t.slice(0, 1), r = !1, o = void 0 !== i ? i.split(\",\") : [], s = 0; s < o.length; s++) -1 !== (n = e.indexOf(o[s])) && e.splice(n, 1);\n for (var l = 0; l < e.length; l++) if (a.includes(e[l])) {\n r = !0;\n break;\n }\n return r;\n }, t.handleRemove = function(e, t, i, o, l) {\n var c = this, u = this.maskset, f = this.opts;\n if ((f.numericInput || c.isRTL) && (t === a.keys.Backspace ? t = a.keys.Delete : t === a.keys.Delete && (t = a.keys.Backspace), \n c.isRTL)) {\n var d = i.end;\n i.end = i.begin, i.begin = d;\n }\n var p, h = r.getLastValidPosition.call(c, void 0, !0);\n i.end >= r.getBuffer.call(c).length && h >= i.end && (i.end = h + 1);\n t === a.keys.Backspace ? i.end - i.begin < 1 && (i.begin = r.seekPrevious.call(c, i.begin)) : t === a.keys.Delete && i.begin === i.end && (i.end = r.isMask.call(c, i.end, !0, !0) ? i.end + 1 : r.seekNext.call(c, i.end) + 1);\n if (!1 !== (p = v.call(c, i))) {\n if (!0 !== o && !1 !== f.keepStatic || null !== f.regex && -1 !== n.getTest.call(c, i.begin).match.def.indexOf(\"|\")) {\n var m = s.call(c, !0);\n if (m) {\n var g = void 0 !== m.caret ? m.caret : m.pos ? r.seekNext.call(c, m.pos.begin ? m.pos.begin : m.pos) : r.getLastValidPosition.call(c, -1, !0);\n (t !== a.keys.Delete || i.begin > g) && i.begin;\n }\n }\n !0 !== o && (u.p = t === a.keys.Delete ? i.begin + p : i.begin, u.p = r.determineNewCaretPosition.call(c, {\n begin: u.p,\n end: u.p\n }, !1, !1 === f.insertMode && t === a.keys.Backspace ? \"none\" : void 0).begin);\n }\n }, t.isComplete = c, t.isSelection = u, t.isValid = f, t.refreshFromBuffer = p, \n t.revalidateMask = v;\n var n = i(4713), a = i(2839), r = i(8711), o = i(6030);\n function s(e, t, i, a, o, l) {\n var c, u, d, p, h, v, m, g, y, k, b, x = this, P = this.dependencyLib, w = this.opts, S = x.maskset, M = P.extend(!0, [], S.validPositions), _ = P.extend(!0, {}, S.tests), O = !1, E = !1, T = void 0 !== o ? o : r.getLastValidPosition.call(x);\n if (l && (k = l.begin, b = l.end, l.begin > l.end && (k = l.end, b = l.begin)), \n -1 === T && void 0 === o) c = 0, u = (p = n.getTest.call(x, c)).alternation; else for (;T >= 0; T--) if ((d = S.validPositions[T]) && void 0 !== d.alternation) {\n if (T <= (e || 0) && p && p.locator[d.alternation] !== d.locator[d.alternation]) break;\n c = T, u = S.validPositions[c].alternation, p = d;\n }\n if (void 0 !== u) {\n m = parseInt(c), S.excludes[m] = S.excludes[m] || [], !0 !== e && S.excludes[m].push((0, \n n.getDecisionTaker)(p) + \":\" + p.alternation);\n var j = [], A = -1;\n for (h = m; h < r.getLastValidPosition.call(x, void 0, !0) + 1; h++) -1 === A && e <= h && void 0 !== t && (j.push(t), \n A = j.length - 1), (v = S.validPositions[h]) && !0 !== v.generatedInput && (void 0 === l || h < k || h >= b) && j.push(v.input), \n delete S.validPositions[h];\n for (-1 === A && void 0 !== t && (j.push(t), A = j.length - 1); void 0 !== S.excludes[m] && S.excludes[m].length < 10; ) {\n for (S.tests = {}, r.resetMaskSet.call(x, !0), O = !0, h = 0; h < j.length && (g = O.caret || r.getLastValidPosition.call(x, void 0, !0) + 1, \n y = j[h], O = f.call(x, g, y, !1, a, !0)); h++) h === A && (E = O), 1 == e && O && (E = {\n caretPos: h\n });\n if (O) break;\n if (r.resetMaskSet.call(x), p = n.getTest.call(x, m), S.validPositions = P.extend(!0, [], M), \n S.tests = P.extend(!0, {}, _), !S.excludes[m]) {\n E = s.call(x, e, t, i, a, m - 1, l);\n break;\n }\n var D = (0, n.getDecisionTaker)(p);\n if (-1 !== S.excludes[m].indexOf(D + \":\" + p.alternation)) {\n E = s.call(x, e, t, i, a, m - 1, l);\n break;\n }\n for (S.excludes[m].push(D + \":\" + p.alternation), h = m; h < r.getLastValidPosition.call(x, void 0, !0) + 1; h++) delete S.validPositions[h];\n }\n }\n return E && !1 === w.keepStatic || delete S.excludes[m], E;\n }\n function l(e, t, i) {\n var n = this.opts, r = this.maskset;\n switch (n.casing || t.casing) {\n case \"upper\":\n e = e.toUpperCase();\n break;\n\n case \"lower\":\n e = e.toLowerCase();\n break;\n\n case \"title\":\n var o = r.validPositions[i - 1];\n e = 0 === i || o && o.input === String.fromCharCode(a.keyCode.Space) ? e.toUpperCase() : e.toLowerCase();\n break;\n\n default:\n if (\"function\" == typeof n.casing) {\n var s = Array.prototype.slice.call(arguments);\n s.push(r.validPositions), e = n.casing.apply(this, s);\n }\n }\n return e;\n }\n function c(e) {\n var t = this, i = this.opts, a = this.maskset;\n if (\"function\" == typeof i.isComplete) return i.isComplete(e, i);\n if (\"*\" !== i.repeat) {\n var o = !1, s = r.determineLastRequiredPosition.call(t, !0), l = r.seekPrevious.call(t, s.l);\n if (void 0 === s.def || s.def.newBlockMarker || s.def.optionality || s.def.optionalQuantifier) {\n o = !0;\n for (var c = 0; c <= l; c++) {\n var u = n.getTestTemplate.call(t, c).match;\n if (!0 !== u.static && void 0 === a.validPositions[c] && !0 !== u.optionality && !0 !== u.optionalQuantifier || !0 === u.static && e[c] !== n.getPlaceholder.call(t, c, u)) {\n o = !1;\n break;\n }\n }\n }\n return o;\n }\n }\n function u(e) {\n var t = this.opts.insertMode ? 0 : 1;\n return this.isRTL ? e.begin - e.end > t : e.end - e.begin > t;\n }\n function f(e, t, i, a, o, d, m) {\n var g = this, y = this.dependencyLib, k = this.opts, b = g.maskset;\n i = !0 === i;\n var x = e;\n function P(e) {\n if (void 0 !== e) {\n if (void 0 !== e.remove && (Array.isArray(e.remove) || (e.remove = [ e.remove ]), \n e.remove.sort((function(e, t) {\n return g.isRTL ? e.pos - t.pos : t.pos - e.pos;\n })).forEach((function(e) {\n v.call(g, {\n begin: e,\n end: e + 1\n });\n })), e.remove = void 0), void 0 !== e.insert && (Array.isArray(e.insert) || (e.insert = [ e.insert ]), \n e.insert.sort((function(e, t) {\n return g.isRTL ? t.pos - e.pos : e.pos - t.pos;\n })).forEach((function(e) {\n \"\" !== e.c && f.call(g, e.pos, e.c, void 0 === e.strict || e.strict, void 0 !== e.fromIsValid ? e.fromIsValid : a);\n })), e.insert = void 0), e.refreshFromBuffer && e.buffer) {\n var t = e.refreshFromBuffer;\n p.call(g, !0 === t ? t : t.start, t.end, e.buffer), e.refreshFromBuffer = void 0;\n }\n void 0 !== e.rewritePosition && (x = e.rewritePosition, e = !0);\n }\n return e;\n }\n function w(t, i, o) {\n var s = !1;\n return n.getTests.call(g, t).every((function(c, f) {\n var d = c.match;\n if (r.getBuffer.call(g, !0), !1 !== (s = (!d.jit || void 0 !== b.validPositions[r.seekPrevious.call(g, t)]) && (null != d.fn ? d.fn.test(i, b, t, o, k, u.call(g, e)) : (i === d.def || i === k.skipOptionalPartCharacter) && \"\" !== d.def && {\n c: n.getPlaceholder.call(g, t, d, !0) || d.def,\n pos: t\n }))) {\n var p = void 0 !== s.c ? s.c : i, h = t;\n return p = p === k.skipOptionalPartCharacter && !0 === d.static ? n.getPlaceholder.call(g, t, d, !0) || d.def : p, \n !0 !== (s = P(s)) && void 0 !== s.pos && s.pos !== t && (h = s.pos), !0 !== s && void 0 === s.pos && void 0 === s.c ? !1 : (!1 === v.call(g, e, y.extend({}, c, {\n input: l.call(g, p, d, h)\n }), a, h) && (s = !1), !1);\n }\n return !0;\n })), s;\n }\n void 0 !== e.begin && (x = g.isRTL ? e.end : e.begin);\n var S = !0, M = y.extend(!0, {}, b.validPositions);\n if (!1 === k.keepStatic && void 0 !== b.excludes[x] && !0 !== o && !0 !== a) for (var _ = x; _ < (g.isRTL ? e.begin : e.end); _++) void 0 !== b.excludes[_] && (b.excludes[_] = void 0, \n delete b.tests[_]);\n if (\"function\" == typeof k.preValidation && !0 !== a && !0 !== d && (S = P(S = k.preValidation.call(g, r.getBuffer.call(g), x, t, u.call(g, e), k, b, e, i || o))), \n !0 === S) {\n if (S = w(x, t, i), (!i || !0 === a) && !1 === S && !0 !== d) {\n var O = b.validPositions[x];\n if (!O || !0 !== O.match.static || O.match.def !== t && t !== k.skipOptionalPartCharacter) {\n if (k.insertMode || void 0 === b.validPositions[r.seekNext.call(g, x)] || e.end > x) {\n var E = !1;\n if (b.jitOffset[x] && void 0 === b.validPositions[r.seekNext.call(g, x)] && !1 !== (S = f.call(g, x + b.jitOffset[x], t, !0, !0)) && (!0 !== o && (S.caret = x), \n E = !0), e.end > x && (b.validPositions[x] = void 0), !E && !r.isMask.call(g, x, k.keepStatic && 0 === x)) for (var T = x + 1, j = r.seekNext.call(g, x, !1, 0 !== x); T <= j; T++) if (!1 !== (S = w(T, t, i))) {\n S = h.call(g, x, void 0 !== S.pos ? S.pos : T) || S, x = T;\n break;\n }\n }\n } else S = {\n caret: r.seekNext.call(g, x)\n };\n }\n g.hasAlternator && !0 !== o && !i && (!1 === S && k.keepStatic && (c.call(g, r.getBuffer.call(g)) || 0 === x) ? S = s.call(g, x, t, i, a, void 0, e) : (u.call(g, e) && b.tests[x] && b.tests[x].length > 1 && k.keepStatic || 1 == S && !0 !== k.numericInput && b.tests[x] && b.tests[x].length > 1 && r.getLastValidPosition.call(g, void 0, !0) > x) && (S = s.call(g, !0))), \n !0 === S && (S = {\n pos: x\n });\n }\n if (\"function\" == typeof k.postValidation && !0 !== a && !0 !== d) {\n var A = k.postValidation.call(g, r.getBuffer.call(g, !0), void 0 !== e.begin ? g.isRTL ? e.end : e.begin : e, t, S, k, b, i, m);\n void 0 !== A && (S = !0 === A ? S : A);\n }\n S && void 0 === S.pos && (S.pos = x), !1 === S || !0 === d ? (r.resetMaskSet.call(g, !0), \n b.validPositions = y.extend(!0, [], M)) : h.call(g, void 0, x, !0);\n var D = P(S);\n void 0 !== g.maxLength && (r.getBuffer.call(g).length > g.maxLength && !a && (r.resetMaskSet.call(g, !0), \n b.validPositions = y.extend(!0, [], M), D = !1));\n return D;\n }\n function d(e, t, i) {\n for (var a = this.maskset, r = !1, o = n.getTests.call(this, e), s = 0; s < o.length; s++) {\n if (o[s].match && (o[s].match.nativeDef === t.match[i.shiftPositions ? \"def\" : \"nativeDef\"] && (!i.shiftPositions || !t.match.static) || o[s].match.nativeDef === t.match.nativeDef || i.regex && !o[s].match.static && o[s].match.fn.test(t.input, a, e, !1, i))) {\n r = !0;\n break;\n }\n if (o[s].match && o[s].match.def === t.match.nativeDef) {\n r = void 0;\n break;\n }\n }\n return !1 === r && void 0 !== a.jitOffset[e] && (r = d.call(this, e + a.jitOffset[e], t, i)), \n r;\n }\n function p(e, t, i) {\n var n, a, s = this, l = this.maskset, c = this.opts, u = this.dependencyLib, f = c.skipOptionalPartCharacter, d = s.isRTL ? i.slice().reverse() : i;\n if (c.skipOptionalPartCharacter = \"\", !0 === e) r.resetMaskSet.call(s), l.tests = {}, \n e = 0, t = i.length, a = r.determineNewCaretPosition.call(s, {\n begin: 0,\n end: 0\n }, !1).begin; else {\n for (n = e; n < t; n++) delete l.validPositions[n];\n a = e;\n }\n var p = new u.Event(\"keypress\");\n for (n = e; n < t; n++) {\n p.key = d[n].toString(), s.ignorable = !1;\n var h = o.EventHandlers.keypressEvent.call(s, p, !0, !1, !1, a);\n !1 !== h && void 0 !== h && (a = h.forwardPosition);\n }\n c.skipOptionalPartCharacter = f;\n }\n function h(e, t, i) {\n var a = this, o = this.maskset, s = this.dependencyLib;\n if (void 0 === e) for (e = t - 1; e > 0 && !o.validPositions[e]; e--) ;\n for (var l = e; l < t; l++) {\n if (void 0 === o.validPositions[l] && !r.isMask.call(a, l, !1)) if (0 == l ? n.getTest.call(a, l) : o.validPositions[l - 1]) {\n var c = n.getTests.call(a, l).slice();\n \"\" === c[c.length - 1].match.def && c.pop();\n var u, d = n.determineTestTemplate.call(a, l, c);\n if (d && (!0 !== d.match.jit || \"master\" === d.match.newBlockMarker && (u = o.validPositions[l + 1]) && !0 === u.match.optionalQuantifier) && ((d = s.extend({}, d, {\n input: n.getPlaceholder.call(a, l, d.match, !0) || d.match.def\n })).generatedInput = !0, v.call(a, l, d, !0), !0 !== i)) {\n var p = o.validPositions[t].input;\n return o.validPositions[t] = void 0, f.call(a, t, p, !0, !0);\n }\n }\n }\n }\n function v(e, t, i, a) {\n var o = this, s = this.maskset, l = this.opts, c = this.dependencyLib;\n function u(e, t, i) {\n var n = t[e];\n if (void 0 !== n && !0 === n.match.static && !0 !== n.match.optionality && (void 0 === t[0] || void 0 === t[0].alternation)) {\n var a = i.begin <= e - 1 ? t[e - 1] && !0 === t[e - 1].match.static && t[e - 1] : t[e - 1], r = i.end > e + 1 ? t[e + 1] && !0 === t[e + 1].match.static && t[e + 1] : t[e + 1];\n return a && r;\n }\n return !1;\n }\n var p = 0, h = void 0 !== e.begin ? e.begin : e, v = void 0 !== e.end ? e.end : e, m = !0;\n if (e.begin > e.end && (h = e.end, v = e.begin), a = void 0 !== a ? a : h, void 0 === i && (h !== v || l.insertMode && void 0 !== s.validPositions[a] || void 0 === t || t.match.optionalQuantifier || t.match.optionality)) {\n var g, y = c.extend(!0, {}, s.validPositions), k = r.getLastValidPosition.call(o, void 0, !0);\n for (s.p = h, g = k; g >= h; g--) delete s.validPositions[g], void 0 === t && delete s.tests[g + 1];\n var b, x, P = a, w = P;\n for (t && (s.validPositions[a] = c.extend(!0, {}, t), w++, P++), g = t ? v : v - 1; g <= k; g++) {\n if (void 0 !== (b = y[g]) && !0 !== b.generatedInput && (g >= v || g >= h && u(g, y, {\n begin: h,\n end: v\n }))) {\n for (;\"\" !== n.getTest.call(o, w).match.def; ) {\n if (!1 !== (x = d.call(o, w, b, l)) || \"+\" === b.match.def) {\n \"+\" === b.match.def && r.getBuffer.call(o, !0);\n var S = f.call(o, w, b.input, \"+\" !== b.match.def, !0);\n if (m = !1 !== S, P = (S.pos || w) + 1, !m && x) break;\n } else m = !1;\n if (m) {\n void 0 === t && b.match.static && g === e.begin && p++;\n break;\n }\n if (!m && r.getBuffer.call(o), w > s.maskLength) break;\n w++;\n }\n \"\" == n.getTest.call(o, w).match.def && (m = !1), w = P;\n }\n if (!m) break;\n }\n if (!m) return s.validPositions = c.extend(!0, [], y), r.resetMaskSet.call(o, !0), \n !1;\n } else t && n.getTest.call(o, a).match.cd === t.match.cd && (s.validPositions[a] = c.extend(!0, {}, t));\n return r.resetMaskSet.call(o, !0), p;\n }\n }\n }, t = {};\n function i(n) {\n var a = t[n];\n if (void 0 !== a) return a.exports;\n var r = t[n] = {\n exports: {}\n };\n return e[n](r, r.exports, i), r.exports;\n }\n var n = {};\n return function() {\n var e, t = n;\n Object.defineProperty(t, \"__esModule\", {\n value: !0\n }), t.default = void 0, i(7149), i(3194), i(9302), i(4013), i(3851), i(219), i(207), \n i(5296);\n var a = ((e = i(2394)) && e.__esModule ? e : {\n default: e\n }).default;\n t.default = a;\n }(), n;\n }();\n}));\n\n//# sourceURL=webpack://Formio/./node_modules/inputmask/dist/inputmask.js?");
|
1748
|
+
|
1749
|
+
/***/ }),
|
1750
|
+
|
1801
1751
|
/***/ "./node_modules/json-logic-js/logic.js":
|
1802
1752
|
/*!*********************************************!*\
|
1803
1753
|
!*** ./node_modules/json-logic-js/logic.js ***!
|
@@ -2078,16 +2028,6 @@ eval("var Symbol = __webpack_require__(/*! ./_Symbol */ \"./node_modules/lodash/
|
|
2078
2028
|
|
2079
2029
|
/***/ }),
|
2080
2030
|
|
2081
|
-
/***/ "./node_modules/lodash/_baseHas.js":
|
2082
|
-
/*!*****************************************!*\
|
2083
|
-
!*** ./node_modules/lodash/_baseHas.js ***!
|
2084
|
-
\*****************************************/
|
2085
|
-
/***/ (function(module) {
|
2086
|
-
|
2087
|
-
eval("/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.has` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\nfunction baseHas(object, key) {\n return object != null && hasOwnProperty.call(object, key);\n}\n\nmodule.exports = baseHas;\n\n\n//# sourceURL=webpack://Formio/./node_modules/lodash/_baseHas.js?");
|
2088
|
-
|
2089
|
-
/***/ }),
|
2090
|
-
|
2091
2031
|
/***/ "./node_modules/lodash/_baseHasIn.js":
|
2092
2032
|
/*!*******************************************!*\
|
2093
2033
|
!*** ./node_modules/lodash/_baseHasIn.js ***!
|
@@ -2258,16 +2198,6 @@ eval("var constant = __webpack_require__(/*! ./constant */ \"./node_modules/loda
|
|
2258
2198
|
|
2259
2199
|
/***/ }),
|
2260
2200
|
|
2261
|
-
/***/ "./node_modules/lodash/_baseSlice.js":
|
2262
|
-
/*!*******************************************!*\
|
2263
|
-
!*** ./node_modules/lodash/_baseSlice.js ***!
|
2264
|
-
\*******************************************/
|
2265
|
-
/***/ (function(module) {
|
2266
|
-
|
2267
|
-
eval("/**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\nfunction baseSlice(array, start, end) {\n var index = -1,\n length = array.length;\n\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = end > length ? length : end;\n if (end < 0) {\n end += length;\n }\n length = start > end ? 0 : ((end - start) >>> 0);\n start >>>= 0;\n\n var result = Array(length);\n while (++index < length) {\n result[index] = array[index + start];\n }\n return result;\n}\n\nmodule.exports = baseSlice;\n\n\n//# sourceURL=webpack://Formio/./node_modules/lodash/_baseSlice.js?");
|
2268
|
-
|
2269
|
-
/***/ }),
|
2270
|
-
|
2271
2201
|
/***/ "./node_modules/lodash/_baseTimes.js":
|
2272
2202
|
/*!*******************************************!*\
|
2273
2203
|
!*** ./node_modules/lodash/_baseTimes.js ***!
|
@@ -2308,16 +2238,6 @@ eval("/**\n * The base implementation of `_.unary` without support for storing m
|
|
2308
2238
|
|
2309
2239
|
/***/ }),
|
2310
2240
|
|
2311
|
-
/***/ "./node_modules/lodash/_baseUnset.js":
|
2312
|
-
/*!*******************************************!*\
|
2313
|
-
!*** ./node_modules/lodash/_baseUnset.js ***!
|
2314
|
-
\*******************************************/
|
2315
|
-
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
2316
|
-
|
2317
|
-
eval("var castPath = __webpack_require__(/*! ./_castPath */ \"./node_modules/lodash/_castPath.js\"),\n last = __webpack_require__(/*! ./last */ \"./node_modules/lodash/last.js\"),\n parent = __webpack_require__(/*! ./_parent */ \"./node_modules/lodash/_parent.js\"),\n toKey = __webpack_require__(/*! ./_toKey */ \"./node_modules/lodash/_toKey.js\");\n\n/**\n * The base implementation of `_.unset`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The property path to unset.\n * @returns {boolean} Returns `true` if the property is deleted, else `false`.\n */\nfunction baseUnset(object, path) {\n path = castPath(path, object);\n object = parent(object, path);\n return object == null || delete object[toKey(last(path))];\n}\n\nmodule.exports = baseUnset;\n\n\n//# sourceURL=webpack://Formio/./node_modules/lodash/_baseUnset.js?");
|
2318
|
-
|
2319
|
-
/***/ }),
|
2320
|
-
|
2321
2241
|
/***/ "./node_modules/lodash/_cacheHas.js":
|
2322
2242
|
/*!******************************************!*\
|
2323
2243
|
!*** ./node_modules/lodash/_cacheHas.js ***!
|
@@ -2818,16 +2738,6 @@ eval("var apply = __webpack_require__(/*! ./_apply */ \"./node_modules/lodash/_a
|
|
2818
2738
|
|
2819
2739
|
/***/ }),
|
2820
2740
|
|
2821
|
-
/***/ "./node_modules/lodash/_parent.js":
|
2822
|
-
/*!****************************************!*\
|
2823
|
-
!*** ./node_modules/lodash/_parent.js ***!
|
2824
|
-
\****************************************/
|
2825
|
-
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
2826
|
-
|
2827
|
-
eval("var baseGet = __webpack_require__(/*! ./_baseGet */ \"./node_modules/lodash/_baseGet.js\"),\n baseSlice = __webpack_require__(/*! ./_baseSlice */ \"./node_modules/lodash/_baseSlice.js\");\n\n/**\n * Gets the parent value at `path` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} path The path to get the parent value of.\n * @returns {*} Returns the parent value.\n */\nfunction parent(object, path) {\n return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));\n}\n\nmodule.exports = parent;\n\n\n//# sourceURL=webpack://Formio/./node_modules/lodash/_parent.js?");
|
2828
|
-
|
2829
|
-
/***/ }),
|
2830
|
-
|
2831
2741
|
/***/ "./node_modules/lodash/_root.js":
|
2832
2742
|
/*!**************************************!*\
|
2833
2743
|
!*** ./node_modules/lodash/_root.js ***!
|
@@ -3038,16 +2948,6 @@ eval("var baseGet = __webpack_require__(/*! ./_baseGet */ \"./node_modules/lodas
|
|
3038
2948
|
|
3039
2949
|
/***/ }),
|
3040
2950
|
|
3041
|
-
/***/ "./node_modules/lodash/has.js":
|
3042
|
-
/*!************************************!*\
|
3043
|
-
!*** ./node_modules/lodash/has.js ***!
|
3044
|
-
\************************************/
|
3045
|
-
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
3046
|
-
|
3047
|
-
eval("var baseHas = __webpack_require__(/*! ./_baseHas */ \"./node_modules/lodash/_baseHas.js\"),\n hasPath = __webpack_require__(/*! ./_hasPath */ \"./node_modules/lodash/_hasPath.js\");\n\n/**\n * Checks if `path` is a direct property of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = { 'a': { 'b': 2 } };\n * var other = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.has(object, 'a');\n * // => true\n *\n * _.has(object, 'a.b');\n * // => true\n *\n * _.has(object, ['a', 'b']);\n * // => true\n *\n * _.has(other, 'a');\n * // => false\n */\nfunction has(object, path) {\n return object != null && hasPath(object, path, baseHas);\n}\n\nmodule.exports = has;\n\n\n//# sourceURL=webpack://Formio/./node_modules/lodash/has.js?");
|
3048
|
-
|
3049
|
-
/***/ }),
|
3050
|
-
|
3051
2951
|
/***/ "./node_modules/lodash/hasIn.js":
|
3052
2952
|
/*!**************************************!*\
|
3053
2953
|
!*** ./node_modules/lodash/hasIn.js ***!
|
@@ -3108,16 +3008,6 @@ eval("/* module decorator */ module = __webpack_require__.nmd(module);\nvar root
|
|
3108
3008
|
|
3109
3009
|
/***/ }),
|
3110
3010
|
|
3111
|
-
/***/ "./node_modules/lodash/isEmpty.js":
|
3112
|
-
/*!****************************************!*\
|
3113
|
-
!*** ./node_modules/lodash/isEmpty.js ***!
|
3114
|
-
\****************************************/
|
3115
|
-
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
3116
|
-
|
3117
|
-
eval("var baseKeys = __webpack_require__(/*! ./_baseKeys */ \"./node_modules/lodash/_baseKeys.js\"),\n getTag = __webpack_require__(/*! ./_getTag */ \"./node_modules/lodash/_getTag.js\"),\n isArguments = __webpack_require__(/*! ./isArguments */ \"./node_modules/lodash/isArguments.js\"),\n isArray = __webpack_require__(/*! ./isArray */ \"./node_modules/lodash/isArray.js\"),\n isArrayLike = __webpack_require__(/*! ./isArrayLike */ \"./node_modules/lodash/isArrayLike.js\"),\n isBuffer = __webpack_require__(/*! ./isBuffer */ \"./node_modules/lodash/isBuffer.js\"),\n isPrototype = __webpack_require__(/*! ./_isPrototype */ \"./node_modules/lodash/_isPrototype.js\"),\n isTypedArray = __webpack_require__(/*! ./isTypedArray */ \"./node_modules/lodash/isTypedArray.js\");\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n setTag = '[object Set]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if `value` is an empty object, collection, map, or set.\n *\n * Objects are considered empty if they have no own enumerable string keyed\n * properties.\n *\n * Array-like values such as `arguments` objects, arrays, buffers, strings, or\n * jQuery-like collections are considered empty if they have a `length` of `0`.\n * Similarly, maps and sets are considered empty if they have a `size` of `0`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is empty, else `false`.\n * @example\n *\n * _.isEmpty(null);\n * // => true\n *\n * _.isEmpty(true);\n * // => true\n *\n * _.isEmpty(1);\n * // => true\n *\n * _.isEmpty([1, 2, 3]);\n * // => false\n *\n * _.isEmpty({ 'a': 1 });\n * // => false\n */\nfunction isEmpty(value) {\n if (value == null) {\n return true;\n }\n if (isArrayLike(value) &&\n (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||\n isBuffer(value) || isTypedArray(value) || isArguments(value))) {\n return !value.length;\n }\n var tag = getTag(value);\n if (tag == mapTag || tag == setTag) {\n return !value.size;\n }\n if (isPrototype(value)) {\n return !baseKeys(value).length;\n }\n for (var key in value) {\n if (hasOwnProperty.call(value, key)) {\n return false;\n }\n }\n return true;\n}\n\nmodule.exports = isEmpty;\n\n\n//# sourceURL=webpack://Formio/./node_modules/lodash/isEmpty.js?");
|
3118
|
-
|
3119
|
-
/***/ }),
|
3120
|
-
|
3121
3011
|
/***/ "./node_modules/lodash/isFunction.js":
|
3122
3012
|
/*!*******************************************!*\
|
3123
3013
|
!*** ./node_modules/lodash/isFunction.js ***!
|
@@ -3138,16 +3028,6 @@ eval("/** Used as references for various `Number` constants. */\nvar MAX_SAFE_IN
|
|
3138
3028
|
|
3139
3029
|
/***/ }),
|
3140
3030
|
|
3141
|
-
/***/ "./node_modules/lodash/isNil.js":
|
3142
|
-
/*!**************************************!*\
|
3143
|
-
!*** ./node_modules/lodash/isNil.js ***!
|
3144
|
-
\**************************************/
|
3145
|
-
/***/ (function(module) {
|
3146
|
-
|
3147
|
-
eval("/**\n * Checks if `value` is `null` or `undefined`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is nullish, else `false`.\n * @example\n *\n * _.isNil(null);\n * // => true\n *\n * _.isNil(void 0);\n * // => true\n *\n * _.isNil(NaN);\n * // => false\n */\nfunction isNil(value) {\n return value == null;\n}\n\nmodule.exports = isNil;\n\n\n//# sourceURL=webpack://Formio/./node_modules/lodash/isNil.js?");
|
3148
|
-
|
3149
|
-
/***/ }),
|
3150
|
-
|
3151
3031
|
/***/ "./node_modules/lodash/isObject.js":
|
3152
3032
|
/*!*****************************************!*\
|
3153
3033
|
!*** ./node_modules/lodash/isObject.js ***!
|
@@ -3168,16 +3048,6 @@ eval("/**\n * Checks if `value` is object-like. A value is object-like if it's n
|
|
3168
3048
|
|
3169
3049
|
/***/ }),
|
3170
3050
|
|
3171
|
-
/***/ "./node_modules/lodash/isString.js":
|
3172
|
-
/*!*****************************************!*\
|
3173
|
-
!*** ./node_modules/lodash/isString.js ***!
|
3174
|
-
\*****************************************/
|
3175
|
-
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
3176
|
-
|
3177
|
-
eval("var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ \"./node_modules/lodash/_baseGetTag.js\"),\n isArray = __webpack_require__(/*! ./isArray */ \"./node_modules/lodash/isArray.js\"),\n isObjectLike = __webpack_require__(/*! ./isObjectLike */ \"./node_modules/lodash/isObjectLike.js\");\n\n/** `Object#toString` result references. */\nvar stringTag = '[object String]';\n\n/**\n * Checks if `value` is classified as a `String` primitive or object.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a string, else `false`.\n * @example\n *\n * _.isString('abc');\n * // => true\n *\n * _.isString(1);\n * // => false\n */\nfunction isString(value) {\n return typeof value == 'string' ||\n (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);\n}\n\nmodule.exports = isString;\n\n\n//# sourceURL=webpack://Formio/./node_modules/lodash/isString.js?");
|
3178
|
-
|
3179
|
-
/***/ }),
|
3180
|
-
|
3181
3051
|
/***/ "./node_modules/lodash/isSymbol.js":
|
3182
3052
|
/*!*****************************************!*\
|
3183
3053
|
!*** ./node_modules/lodash/isSymbol.js ***!
|
@@ -3208,16 +3078,6 @@ eval("var arrayLikeKeys = __webpack_require__(/*! ./_arrayLikeKeys */ \"./node_m
|
|
3208
3078
|
|
3209
3079
|
/***/ }),
|
3210
3080
|
|
3211
|
-
/***/ "./node_modules/lodash/last.js":
|
3212
|
-
/*!*************************************!*\
|
3213
|
-
!*** ./node_modules/lodash/last.js ***!
|
3214
|
-
\*************************************/
|
3215
|
-
/***/ (function(module) {
|
3216
|
-
|
3217
|
-
eval("/**\n * Gets the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the last element of `array`.\n * @example\n *\n * _.last([1, 2, 3]);\n * // => 3\n */\nfunction last(array) {\n var length = array == null ? 0 : array.length;\n return length ? array[length - 1] : undefined;\n}\n\nmodule.exports = last;\n\n\n//# sourceURL=webpack://Formio/./node_modules/lodash/last.js?");
|
3218
|
-
|
3219
|
-
/***/ }),
|
3220
|
-
|
3221
3081
|
/***/ "./node_modules/lodash/lodash.js":
|
3222
3082
|
/*!***************************************!*\
|
3223
3083
|
!*** ./node_modules/lodash/lodash.js ***!
|
@@ -3258,16 +3118,6 @@ eval("var baseProperty = __webpack_require__(/*! ./_baseProperty */ \"./node_mod
|
|
3258
3118
|
|
3259
3119
|
/***/ }),
|
3260
3120
|
|
3261
|
-
/***/ "./node_modules/lodash/set.js":
|
3262
|
-
/*!************************************!*\
|
3263
|
-
!*** ./node_modules/lodash/set.js ***!
|
3264
|
-
\************************************/
|
3265
|
-
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
3266
|
-
|
3267
|
-
eval("var baseSet = __webpack_require__(/*! ./_baseSet */ \"./node_modules/lodash/_baseSet.js\");\n\n/**\n * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,\n * it's created. Arrays are created for missing index properties while objects\n * are created for all other missing properties. Use `_.setWith` to customize\n * `path` creation.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.set(object, 'a[0].b.c', 4);\n * console.log(object.a[0].b.c);\n * // => 4\n *\n * _.set(object, ['x', '0', 'y', 'z'], 5);\n * console.log(object.x[0].y.z);\n * // => 5\n */\nfunction set(object, path, value) {\n return object == null ? object : baseSet(object, path, value);\n}\n\nmodule.exports = set;\n\n\n//# sourceURL=webpack://Formio/./node_modules/lodash/set.js?");
|
3268
|
-
|
3269
|
-
/***/ }),
|
3270
|
-
|
3271
3121
|
/***/ "./node_modules/lodash/stubArray.js":
|
3272
3122
|
/*!******************************************!*\
|
3273
3123
|
!*** ./node_modules/lodash/stubArray.js ***!
|
@@ -3328,16 +3178,6 @@ eval("var baseToString = __webpack_require__(/*! ./_baseToString */ \"./node_mod
|
|
3328
3178
|
|
3329
3179
|
/***/ }),
|
3330
3180
|
|
3331
|
-
/***/ "./node_modules/lodash/unset.js":
|
3332
|
-
/*!**************************************!*\
|
3333
|
-
!*** ./node_modules/lodash/unset.js ***!
|
3334
|
-
\**************************************/
|
3335
|
-
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
3336
|
-
|
3337
|
-
eval("var baseUnset = __webpack_require__(/*! ./_baseUnset */ \"./node_modules/lodash/_baseUnset.js\");\n\n/**\n * Removes the property at `path` of `object`.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to unset.\n * @returns {boolean} Returns `true` if the property is deleted, else `false`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 7 } }] };\n * _.unset(object, 'a[0].b.c');\n * // => true\n *\n * console.log(object);\n * // => { 'a': [{ 'b': {} }] };\n *\n * _.unset(object, ['a', '0', 'b', 'c']);\n * // => true\n *\n * console.log(object);\n * // => { 'a': [{ 'b': {} }] };\n */\nfunction unset(object, path) {\n return object == null ? true : baseUnset(object, path);\n}\n\nmodule.exports = unset;\n\n\n//# sourceURL=webpack://Formio/./node_modules/lodash/unset.js?");
|
3338
|
-
|
3339
|
-
/***/ }),
|
3340
|
-
|
3341
3181
|
/***/ "./node_modules/moment-timezone/moment-timezone.js":
|
3342
3182
|
/*!*********************************************************!*\
|
3343
3183
|
!*** ./node_modules/moment-timezone/moment-timezone.js ***!
|
@@ -3618,7 +3458,7 @@ eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3618
3458
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
3619
3459
|
|
3620
3460
|
"use strict";
|
3621
|
-
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.isComponentDataEmpty = exports.getEmptyValue = exports.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 = exports.findComponents = void 0;\nconst core_1 = __webpack_require__(/*! @formio/core */ \"./node_modules/@formio/core/lib/index.js\");\nconst { flattenComponents, guid, uniqueName, MODEL_TYPES, getModelType, getComponentAbsolutePath, getComponentPath, isComponentModelType, isComponentNestedDataType, componentPath, componentChildPath, eachComponentDataAsync, eachComponentData, getComponentKey, getContextualRowPath, getContextualRowData, componentInfo, eachComponent, eachComponentAsync, getComponentData, getComponentActualValue, isLayoutComponent, matchComponent, getComponent, searchComponents, removeComponent, hasCondition, parseFloatExt, formatAsCurrency, escapeRegExCharacters, getValue, getStrings, generateFormChange, applyFormChanges, findComponent, getEmptyValue, isComponentDataEmpty } = core_1.Utils;\nexports.flattenComponents = flattenComponents;\nexports.guid = guid;\nexports.uniqueName = uniqueName;\nexports.MODEL_TYPES = MODEL_TYPES;\nexports.getModelType = getModelType;\nexports.getComponentAbsolutePath = getComponentAbsolutePath;\nexports.getComponentPath = getComponentPath;\nexports.isComponentModelType = isComponentModelType;\nexports.isComponentNestedDataType = isComponentNestedDataType;\nexports.componentPath = componentPath;\nexports.componentChildPath = componentChildPath;\nexports.eachComponentDataAsync = eachComponentDataAsync;\nexports.eachComponentData = eachComponentData;\nexports.getComponentKey = getComponentKey;\nexports.getContextualRowPath = getContextualRowPath;\nexports.getContextualRowData = getContextualRowData;\nexports.componentInfo = componentInfo;\nexports.eachComponent = eachComponent;\nexports.eachComponentAsync = eachComponentAsync;\nexports.getComponentData = getComponentData;\nexports.getComponentActualValue = getComponentActualValue;\nexports.isLayoutComponent = isLayoutComponent;\nexports.matchComponent = matchComponent;\nexports.getComponent = getComponent;\nexports.searchComponents = searchComponents;\nexports.removeComponent = removeComponent;\nexports.hasCondition = hasCondition;\nexports.parseFloatExt = parseFloatExt;\nexports.formatAsCurrency = formatAsCurrency;\nexports.escapeRegExCharacters = escapeRegExCharacters;\nexports.getValue = getValue;\nexports.getStrings = getStrings;\nexports.generateFormChange = generateFormChange;\nexports.applyFormChanges = applyFormChanges;\nexports.findComponent = findComponent;\nexports.getEmptyValue = getEmptyValue;\nexports.isComponentDataEmpty = isComponentDataEmpty;\n/**\n * Deprecated version of findComponents. Renamed to searchComponents.\n * @param components
|
3461
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.isComponentDataEmpty = exports.getEmptyValue = exports.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 = exports.findComponents = void 0;\nconst core_1 = __webpack_require__(/*! @formio/core */ \"./node_modules/@formio/core/lib/index.js\");\nconst { flattenComponents, guid, uniqueName, MODEL_TYPES, getModelType, getComponentAbsolutePath, getComponentPath, isComponentModelType, isComponentNestedDataType, componentPath, componentChildPath, eachComponentDataAsync, eachComponentData, getComponentKey, getContextualRowPath, getContextualRowData, componentInfo, eachComponent, eachComponentAsync, getComponentData, getComponentActualValue, isLayoutComponent, matchComponent, getComponent, searchComponents, removeComponent, hasCondition, parseFloatExt, formatAsCurrency, escapeRegExCharacters, getValue, getStrings, generateFormChange, applyFormChanges, findComponent, getEmptyValue, isComponentDataEmpty } = core_1.Utils;\nexports.flattenComponents = flattenComponents;\nexports.guid = guid;\nexports.uniqueName = uniqueName;\nexports.MODEL_TYPES = MODEL_TYPES;\nexports.getModelType = getModelType;\nexports.getComponentAbsolutePath = getComponentAbsolutePath;\nexports.getComponentPath = getComponentPath;\nexports.isComponentModelType = isComponentModelType;\nexports.isComponentNestedDataType = isComponentNestedDataType;\nexports.componentPath = componentPath;\nexports.componentChildPath = componentChildPath;\nexports.eachComponentDataAsync = eachComponentDataAsync;\nexports.eachComponentData = eachComponentData;\nexports.getComponentKey = getComponentKey;\nexports.getContextualRowPath = getContextualRowPath;\nexports.getContextualRowData = getContextualRowData;\nexports.componentInfo = componentInfo;\nexports.eachComponent = eachComponent;\nexports.eachComponentAsync = eachComponentAsync;\nexports.getComponentData = getComponentData;\nexports.getComponentActualValue = getComponentActualValue;\nexports.isLayoutComponent = isLayoutComponent;\nexports.matchComponent = matchComponent;\nexports.getComponent = getComponent;\nexports.searchComponents = searchComponents;\nexports.removeComponent = removeComponent;\nexports.hasCondition = hasCondition;\nexports.parseFloatExt = parseFloatExt;\nexports.formatAsCurrency = formatAsCurrency;\nexports.escapeRegExCharacters = escapeRegExCharacters;\nexports.getValue = getValue;\nexports.getStrings = getStrings;\nexports.generateFormChange = generateFormChange;\nexports.applyFormChanges = applyFormChanges;\nexports.findComponent = findComponent;\nexports.getEmptyValue = getEmptyValue;\nexports.isComponentDataEmpty = isComponentDataEmpty;\n/**\n * Deprecated version of findComponents. Renamed to searchComponents.\n * @param {import('@formio/core').Component[]} components - The components to find components within.\n * @param {object} query - The query to use when searching for the components.\n * @returns {import('@formio/core').Component[]} - The result of the component that is found.\n */\nfunction findComponents(components, query) {\n console.warn('formio.js/utils findComponents is deprecated. Use searchComponents instead.');\n return searchComponents(components, query);\n}\nexports.findComponents = findComponents;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/utils/formUtils.js?");
|
3622
3462
|
|
3623
3463
|
/***/ }),
|
3624
3464
|
|
@@ -3640,7 +3480,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexpo
|
|
3640
3480
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
3641
3481
|
|
3642
3482
|
"use strict";
|
3643
|
-
eval("\n/* global jQuery */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.observeOverload = exports.withSwitch = exports.firstNonNil = exports.unfold = exports.bootstrapVersion = exports.uniqueKey = exports.iterateKey = exports.delay = exports.fieldData = exports.getCurrencyAffixes = exports.getNumberDecimalLimit = exports.getNumberSeparators = exports.matchInputMask = exports.unmaskValue = exports.getInputMask = exports.convertFormatToMask = exports.convertFormatToMoment = exports.convertFormatToFlatpickr = exports.getLocaleDateFormatInfo = exports.formatOffset = exports.formatDate = exports.momentDate = exports.loadZones = exports.shouldLoadZones = exports.zonesLoaded = exports.offsetDate = exports.currentTimezone = exports.isValidDate = exports.getDateSetting = exports.guid = exports.uniqueName = exports.convertStringToHTMLElement = exports.unescapeHTML = exports.setActionProperty = exports.checkTrigger = exports.checkCondition = exports.checkJsonConditional = exports.checkCustomConditional = exports.getComponentActualValue = exports.checkSimpleConditional = exports.checkCalculated = exports.isMongoId = exports.boolValue = exports.getElementRect = exports.getPropertyValue = exports.getRandomComponentId = exports.evaluate = exports.moment = exports.ConditionOperators = exports.jsonLogic = void 0;\nexports.isSelectResourceWithObjectValue = exports.getItemTemplateKeys = exports.interpolateErrors = exports.getComponentSavedTypes = exports.componentValueTypes = exports._ = exports.getFocusableElements = exports.isInsideScopingComponent = exports.isPromise = exports.getDataParentComponent = exports.getComponentPath = exports.getComponentPathWithoutIndicies = exports.getBrowserInfo = exports.getIEBrowserVersion = exports.round = exports.getStringFromComponentPath = exports.isChildOf = exports.getArrayFromComponentPath = exports.isInputComponent = exports.interpolate = exports.Evaluator = exports.fastCloneDeep = exports.sanitize = exports.translateHTMLTemplate = exports.getContextButtons = exports.getContextComponents = void 0;\nconst lodash_1 = __importDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nexports._ = lodash_1.default;\nconst fetch_ponyfill_1 = __importDefault(__webpack_require__(/*! fetch-ponyfill */ \"./node_modules/fetch-ponyfill/build/fetch-browser.js\"));\nconst json_logic_js_1 = __importDefault(__webpack_require__(/*! json-logic-js */ \"./node_modules/json-logic-js/logic.js\"));\nexports.jsonLogic = json_logic_js_1.default;\nconst moment_timezone_1 = __importDefault(__webpack_require__(/*! moment-timezone/moment-timezone */ \"./node_modules/moment-timezone/moment-timezone.js\"));\nconst jstimezonedetect_1 = __importDefault(__webpack_require__(/*! jstimezonedetect */ \"./node_modules/jstimezonedetect/dist/jstz.min.js\"));\nconst operators_1 = __webpack_require__(/*! ./jsonlogic/operators */ \"./lib/cjs/utils/jsonlogic/operators.js\");\nconst dompurify_1 = __importDefault(__webpack_require__(/*! dompurify */ \"./node_modules/dompurify/dist/purify.js\"));\nconst formUtils_1 = __webpack_require__(/*! ./formUtils */ \"./lib/cjs/utils/formUtils.js\");\nconst Evaluator_1 = __webpack_require__(/*! ./Evaluator */ \"./lib/cjs/utils/Evaluator.js\");\nObject.defineProperty(exports, \"Evaluator\", ({ enumerable: true, get: function () { return Evaluator_1.Evaluator; } }));\nconst conditionOperators_1 = __importDefault(__webpack_require__(/*! ./conditionOperators */ \"./lib/cjs/utils/conditionOperators/index.js\"));\nexports.ConditionOperators = conditionOperators_1.default;\nconst interpolate = Evaluator_1.Evaluator.interpolate;\nexports.interpolate = interpolate;\nconst { fetch } = (0, fetch_ponyfill_1.default)({\n Promise: Promise\n});\n__exportStar(__webpack_require__(/*! ./formUtils */ \"./lib/cjs/utils/formUtils.js\"), exports);\n// Configure JsonLogic\noperators_1.lodashOperators.forEach((name) => json_logic_js_1.default.add_operation(`_${name}`, lodash_1.default[name]));\n// Retrieve Any Date\njson_logic_js_1.default.add_operation('getDate', (date) => {\n return (0, moment_timezone_1.default)(date).toISOString();\n});\n// Set Relative Minimum Date\njson_logic_js_1.default.add_operation('relativeMinDate', (relativeMinDate) => {\n return (0, moment_timezone_1.default)().subtract(relativeMinDate, 'days').toISOString();\n});\n// Set Relative Maximum Date\njson_logic_js_1.default.add_operation('relativeMaxDate', (relativeMaxDate) => {\n return (0, moment_timezone_1.default)().add(relativeMaxDate, 'days').toISOString();\n});\nexports.moment = __importStar(__webpack_require__(/*! moment-timezone/moment-timezone */ \"./node_modules/moment-timezone/moment-timezone.js\"));\n/**\n * Sets the path to the component and parent schema.\n * @param {import('@formio/core').Component} component - The component to set the path for.\n */\nfunction setPathToComponentAndPerentSchema(component) {\n component.path = getComponentPath(component);\n const dataParent = getDataParentComponent(component);\n if (dataParent && typeof dataParent === 'object') {\n dataParent.path = getComponentPath(dataParent);\n }\n}\n/**\n * Evaluate a method.\n * @param {Function|string|object} func - The function to evaluate.\n * @param {*} args - A map of arguments to pass to the function.\n * @param {string} ret - The name of the \"return\" variable in the script.\n * @param {boolean} tokenize - True if the script should be interpolated before being executed.\n * @returns {*} - The result of the evaluation.\n */\nfunction evaluate(func, args, ret, tokenize) {\n let returnVal = null;\n const component = args.component ? args.component : { key: 'unknown' };\n if (!args.form && args.instance) {\n args.form = lodash_1.default.get(args.instance, 'root._form', {});\n }\n const componentKey = component.key;\n if (typeof func === 'string') {\n if (ret) {\n func += `;return ${ret}`;\n }\n if (tokenize) {\n // Replace all {{ }} references with actual data.\n func = func.replace(/({{\\s+(.*)\\s+}})/, (match, $1, $2) => {\n if ($2.indexOf('data.') === 0) {\n return lodash_1.default.get(args.data, $2.replace('data.', ''));\n }\n else if ($2.indexOf('row.') === 0) {\n return lodash_1.default.get(args.row, $2.replace('row.', ''));\n }\n // Support legacy...\n return lodash_1.default.get(args.data, $2);\n });\n }\n try {\n func = Evaluator_1.Evaluator.evaluator(func, args);\n args = lodash_1.default.values(args);\n }\n catch (err) {\n console.warn(`An error occured within the custom function for ${componentKey}`, err);\n returnVal = null;\n func = false;\n }\n }\n if (typeof func === 'function') {\n try {\n returnVal = Evaluator_1.Evaluator.evaluate(func, args);\n }\n catch (err) {\n returnVal = null;\n console.warn(`An error occured within custom function for ${componentKey}`, err);\n }\n }\n else if (typeof func === 'object') {\n try {\n returnVal = json_logic_js_1.default.apply(func, args);\n }\n catch (err) {\n returnVal = null;\n console.warn(`An error occured within custom function for ${componentKey}`, err);\n }\n }\n else if (func) {\n console.warn(`Unknown function type for ${componentKey}`);\n }\n return returnVal;\n}\nexports.evaluate = evaluate;\n/**\n * Returns a random compoennt ID.\n * @returns {string} - A random component ID.\n */\nfunction getRandomComponentId() {\n return `e${Math.random().toString(36).substring(7)}`;\n}\nexports.getRandomComponentId = getRandomComponentId;\n/**\n * Get a property value of an element.\n * @param {CSSStyleDeclaration} style - The style element to get the property value from.\n * @param {string} prop - The property to get the value for.\n * @returns {number} - The value of the property.\n */\nfunction getPropertyValue(style, prop) {\n let value = style.getPropertyValue(prop);\n value = value ? value.replace(/[^0-9.]/g, '') : '0';\n return parseFloat(value);\n}\nexports.getPropertyValue = getPropertyValue;\n/**\n * Get an elements bounding rectagle.\n * @param {HTMLElement} element - A DOM element to get the bounding rectangle for.\n * @returns {{x: number, y: number, width: number, height: number}} - The bounding rectangle.\n */\nfunction getElementRect(element) {\n const style = window.getComputedStyle(element, null);\n return {\n x: getPropertyValue(style, 'left'),\n y: getPropertyValue(style, 'top'),\n width: getPropertyValue(style, 'width'),\n height: getPropertyValue(style, 'height')\n };\n}\nexports.getElementRect = getElementRect;\n/**\n * Determines the boolean value of a setting.\n * @param {string|boolean} value - A string or boolean value to convert to boolean.\n * @returns {boolean} - The boolean value of the setting.\n */\nfunction boolValue(value) {\n if (lodash_1.default.isBoolean(value)) {\n return value;\n }\n else if (lodash_1.default.isString(value)) {\n return (value.toLowerCase() === 'true');\n }\n else {\n return !!value;\n }\n}\nexports.boolValue = boolValue;\n/**\n * Check to see if an ID is a mongoID.\n * @param {string} text - The text to check if it is a mongoID.\n * @returns {boolean} - TRUE if the text is a mongoID; FALSE otherwise.\n */\nfunction isMongoId(text) {\n return !!text.toString().match(/^[0-9a-fA-F]{24}$/);\n}\nexports.isMongoId = isMongoId;\n/**\n * Checks the calculated value for a provided component and data.\n * @param {import('@formio/core').Component} component - The component to check for the calculated value.\n * @param {import('@formio/core').Submission} submission - A submission object.\n * @param {*} rowData - The contextual row data for the component.\n */\nfunction checkCalculated(component, submission, rowData) {\n // Process calculated value stuff if present.\n if (component.calculateValue) {\n lodash_1.default.set(rowData, component.key, evaluate(component.calculateValue, {\n value: undefined,\n data: submission ? submission.data : rowData,\n row: rowData,\n util: this,\n component\n }, 'value'));\n }\n}\nexports.checkCalculated = checkCalculated;\n/**\n * Check if a simple conditional evaluates to true.\n * @param {import('@formio/core').Component} component - The component to check for the conditional.\n * @param {import('@formio/core').SimpleConditional} condition - The condition to check.\n * @param {*} row - The row data for the component.\n * @param {*} data - The full submission data.\n * @param {import('../../src/components/_classes/component/Component').Component} instance - The instance of the component.\n * @returns {boolean} - TRUE if the condition is true; FALSE otherwise.\n */\nfunction checkSimpleConditional(component, condition, row, data, instance) {\n if (condition.when) {\n const value = getComponentActualValue(condition.when, data, row);\n const eq = String(condition.eq);\n const show = String(condition.show);\n // Special check for selectboxes component.\n if (lodash_1.default.isObject(value) && lodash_1.default.has(value, condition.eq)) {\n return String(value[condition.eq]) === show;\n }\n // FOR-179 - Check for multiple values.\n if (Array.isArray(value) && value.map(String).includes(eq)) {\n return show === 'true';\n }\n return (String(value) === eq) === (show === 'true');\n }\n else {\n const { conditions = [], conjunction = 'all', show = true } = condition;\n if (!conditions.length) {\n return true;\n }\n const conditionsResult = lodash_1.default.map(conditions, (cond) => {\n const { value: comparedValue, operator, component: conditionComponentPath } = cond;\n if (!conditionComponentPath) {\n return true;\n }\n const value = getComponentActualValue(conditionComponentPath, data, row);\n const ConditionOperator = conditionOperators_1.default[operator];\n return ConditionOperator\n ? new ConditionOperator().getResult({ value, comparedValue, instance, component, conditionComponentPath })\n : true;\n });\n let result = false;\n switch (conjunction) {\n case 'any':\n result = lodash_1.default.some(conditionsResult, res => !!res);\n break;\n default:\n result = lodash_1.default.every(conditionsResult, res => !!res);\n }\n return show ? result : !result;\n }\n}\nexports.checkSimpleConditional = checkSimpleConditional;\n/**\n * Returns a components normalized value.\n * @param {string} compPath - The full path to the component.\n * @param {*} data - The data object to get the value from.\n * @param {*} row - The contextual row data for the component.\n * @returns {*} - The normalized value of the component.\n */\nfunction getComponentActualValue(compPath, data, row) {\n let value = null;\n if (row) {\n value = (0, formUtils_1.getValue)({ data: row }, compPath);\n }\n if (data && lodash_1.default.isNil(value)) {\n value = (0, formUtils_1.getValue)({ data }, compPath);\n }\n // FOR-400 - Fix issue where falsey values were being evaluated as show=true\n if (lodash_1.default.isNil(value) || (lodash_1.default.isObject(value) && lodash_1.default.isEmpty(value))) {\n value = '';\n }\n return value;\n}\nexports.getComponentActualValue = getComponentActualValue;\n/**\n * Check custom javascript conditional.\n * @param {import('@formio/core').Component} component - The component to check for the conditional.\n * @param {string} custom - The custom conditional string to evaluate.\n * @param {*} row - The row data for the component.\n * @param {*} data - The full submission data.\n * @param {import('@formio/core').Form} form - The form object.\n * @param {string} variable - The variable name for the result of the custom conditional.\n * @param {*} onError - A custom return if there is an error or the value is null from the evaluation.\n * @param {import('../../src/components/_classes/component/Component').Component} instance - The component instance.\n * @returns {*} - The result of the evaulation.\n */\nfunction checkCustomConditional(component, custom, row, data, form, variable, onError, instance) {\n if (typeof custom === 'string') {\n custom = `var ${variable} = true; ${custom}; return ${variable};`;\n }\n const value = (instance && instance.evaluate) ?\n instance.evaluate(custom, { row, data, form }) :\n evaluate(custom, { row, data, form });\n if (value === null) {\n return onError;\n }\n return value;\n}\nexports.checkCustomConditional = checkCustomConditional;\n/**\n * Check a component for JSON conditionals.\n * @param {import('@formio/core').Component} component - The component\n * @param {import('@formio/core').JSONConditional} json - The json conditional to check.\n * @param {*} row - The contextual row data for the component.\n * @param {*} data - The full submission data.\n * @param {import('@formio/core').Form} form - The Form JSON of the form.\n * @param {*} onError - Custom return value if there is an error.\n * @returns {boolean} - TRUE if the condition is true; FALSE otherwise.\n */\nfunction checkJsonConditional(component, json, row, data, form, onError) {\n try {\n return json_logic_js_1.default.apply(json, {\n data,\n row,\n form,\n _: lodash_1.default,\n });\n }\n catch (err) {\n console.warn(`An error occurred in jsonLogic advanced condition for ${component.key}`, err);\n return onError;\n }\n}\nexports.checkJsonConditional = checkJsonConditional;\n/**\n * Returns the contextual row data for a component.\n * @param {import('@formio/core').Component} component - The component to get the row data for.\n * @param {*} row - The row data for the component.\n * @param {import('../../src/components/_classes/component/Component').Component} instance - The component instance.\n * @param {*} conditional - The component conditional.\n * @returns {*} - The contextual row data for the component.\n */\nfunction getRow(component, row, instance, conditional) {\n var _a;\n const condition = conditional || component.conditional;\n // If no component's instance passed (happens only in 6.x server), calculate its path based on the schema\n if (!instance) {\n instance = lodash_1.default.cloneDeep(component);\n setPathToComponentAndPerentSchema(instance);\n }\n const dataParent = getDataParentComponent(instance);\n const parentPath = dataParent ? getComponentPath(dataParent) : null;\n const isTriggerCondtionComponentPath = condition.when || !condition.conditions\n ? (_a = condition.when) === null || _a === void 0 ? void 0 : _a.startsWith(parentPath)\n : lodash_1.default.some(condition.conditions, cond => cond.component.startsWith(parentPath));\n if (dataParent && isTriggerCondtionComponentPath) {\n const newRow = {};\n lodash_1.default.set(newRow, parentPath, row);\n row = newRow;\n }\n return row;\n}\n/**\n * Checks the conditions for a provided component and data.\n * @param {import('@formio/core').Component} component - The component to check for the condition.\n * @param {*} row - The data within a row\n * @param {*} data - The full submission data.\n * @param {import('@formio/core').Form} form - The form object.\n * @param {import('../../src/components/_classes/component/Component').Component} instance - The component instance.\n * @returns {boolean} - TRUE if the condition is true; FALSE otherwise.\n */\nfunction checkCondition(component, row, data, form, instance) {\n const { customConditional, conditional } = component;\n if (customConditional) {\n return checkCustomConditional(component, customConditional, row, data, form, 'show', true, instance);\n }\n else if (conditional && (conditional.when || lodash_1.default.some(conditional.conditions || [], condition => condition.component && condition.operator))) {\n row = getRow(component, row, instance);\n return checkSimpleConditional(component, conditional, row, data, instance);\n }\n else if (conditional && conditional.json) {\n return checkJsonConditional(component, conditional.json, row, data, form, true);\n }\n // Default to show.\n return true;\n}\nexports.checkCondition = checkCondition;\n/**\n * Test a trigger on a component.\n * @param component\n * @param action\n * @param trigger\n * @param data\n * @param row\n * @param form\n * @param instance\n * @returns {mixed}\n */\nfunction checkTrigger(component, trigger, row, data, form, instance) {\n // If trigger is empty, don't fire it\n if (!trigger || !trigger[trigger.type]) {\n return false;\n }\n switch (trigger.type) {\n case 'simple':\n row = getRow(component, row, instance, trigger.simple);\n return checkSimpleConditional(component, trigger.simple, row, data, instance);\n case 'javascript':\n return checkCustomConditional(component, trigger.javascript, row, data, form, 'result', false, instance);\n case 'json':\n return checkJsonConditional(component, trigger.json, row, data, form, false);\n }\n // If none of the types matched, don't fire the trigger.\n return false;\n}\nexports.checkTrigger = checkTrigger;\n/**\n *\n * @param component\n * @param action\n * @param result\n * @param row\n * @param data\n * @param instance\n */\nfunction setActionProperty(component, action, result, row, data, instance) {\n const property = action.property.value;\n switch (action.property.type) {\n case 'boolean': {\n const currentValue = lodash_1.default.get(component, property, false).toString();\n const newValue = action.state.toString();\n if (currentValue !== newValue) {\n lodash_1.default.set(component, property, newValue === 'true');\n }\n break;\n }\n case 'string': {\n const evalData = {\n data,\n row,\n component,\n result,\n };\n const textValue = action.property.component ? action[action.property.component] : action.text;\n const currentValue = lodash_1.default.get(component, property, '');\n const newValue = (instance && instance.interpolate)\n ? instance.interpolate(textValue, evalData)\n : Evaluator_1.Evaluator.interpolate(textValue, evalData);\n if (newValue !== currentValue) {\n lodash_1.default.set(component, property, newValue);\n }\n break;\n }\n }\n return component;\n}\nexports.setActionProperty = setActionProperty;\n/**\n * Unescape HTML characters like <, >, & and etc.\n * @param str\n * @returns {string}\n */\nfunction unescapeHTML(str) {\n if (typeof window === 'undefined' || !('DOMParser' in window)) {\n return str;\n }\n const doc = new window.DOMParser().parseFromString(str, 'text/html');\n return doc.documentElement.textContent;\n}\nexports.unescapeHTML = unescapeHTML;\n/**\n * Make HTML element from string\n * @param str\n * @param selector\n * @returns {HTMLElement}\n */\n/**\n *\n * @param str\n * @param selector\n */\nfunction convertStringToHTMLElement(str, selector) {\n const doc = new window.DOMParser().parseFromString(str, 'text/html');\n return doc.body.querySelector(selector);\n}\nexports.convertStringToHTMLElement = convertStringToHTMLElement;\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\n ? `.${lodash_1.default.last(parts)}`\n : '';\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;\n/**\n *\n */\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'\n ? r\n : (r & 0x3 | 0x8);\n return v.toString(16);\n });\n}\nexports.guid = guid;\n/**\n * Return a translated date setting.\n * @param date\n * @returns {(null|Date)}\n */\nfunction getDateSetting(date) {\n if (lodash_1.default.isNil(date) || lodash_1.default.isNaN(date) || date === '') {\n return null;\n }\n if (date instanceof Date) {\n return date;\n }\n else if (typeof date.toDate === 'function') {\n return date.isValid() ? date.toDate() : null;\n }\n let dateSetting = ((typeof date !== 'string') || (date.indexOf('moment(') === -1)) ? (0, moment_timezone_1.default)(date) : null;\n if (dateSetting && dateSetting.isValid()) {\n return dateSetting.toDate();\n }\n dateSetting = null;\n try {\n const value = Evaluator_1.Evaluator.evaluator(`return ${date};`, 'moment')(moment_timezone_1.default);\n if (typeof value === 'string') {\n dateSetting = (0, moment_timezone_1.default)(value);\n }\n else if (typeof value.toDate === 'function') {\n dateSetting = (0, moment_timezone_1.default)(value.toDate().toUTCString());\n }\n else if (value instanceof Date) {\n dateSetting = (0, moment_timezone_1.default)(value);\n }\n }\n catch (e) {\n return null;\n }\n if (!dateSetting) {\n return null;\n }\n // Ensure this is a date.\n if (!dateSetting.isValid()) {\n return null;\n }\n return dateSetting.toDate();\n}\nexports.getDateSetting = getDateSetting;\n/**\n *\n * @param date\n */\nfunction isValidDate(date) {\n return lodash_1.default.isDate(date) && !lodash_1.default.isNaN(date.getDate());\n}\nexports.isValidDate = isValidDate;\n/**\n * Get the current timezone string.\n * @returns {string}\n */\nfunction currentTimezone() {\n if (moment_timezone_1.default.currentTimezone) {\n return moment_timezone_1.default.currentTimezone;\n }\n moment_timezone_1.default.currentTimezone = jstimezonedetect_1.default.determine().name();\n return moment_timezone_1.default.currentTimezone;\n}\nexports.currentTimezone = currentTimezone;\n/**\n * Get an offset date provided a date object and timezone object.\n * @param date\n * @param timezone\n * @returns {Date}\n */\nfunction offsetDate(date, timezone) {\n if (timezone === 'UTC') {\n return {\n date: new Date(date.getTime() + (date.getTimezoneOffset() * 60000)),\n abbr: 'UTC'\n };\n }\n const dateMoment = (0, moment_timezone_1.default)(date).tz(timezone);\n return {\n date: new Date(date.getTime() + ((dateMoment.utcOffset() + date.getTimezoneOffset()) * 60000)),\n abbr: dateMoment.format('z')\n };\n}\nexports.offsetDate = offsetDate;\n/**\n * Returns if the zones are loaded.\n * @returns {boolean}\n */\nfunction zonesLoaded() {\n return moment_timezone_1.default.zonesLoaded;\n}\nexports.zonesLoaded = zonesLoaded;\n/**\n * Returns if we should load the zones.\n * @param timezone\n * @returns {boolean}\n */\nfunction shouldLoadZones(timezone) {\n if (timezone === currentTimezone() || timezone === 'UTC') {\n return false;\n }\n return true;\n}\nexports.shouldLoadZones = shouldLoadZones;\n/**\n * Externally load the timezone data.\n * @param url\n * @param timezone\n * @returns {Promise<any> | *}\n */\nfunction loadZones(url, timezone) {\n if (timezone && !shouldLoadZones(timezone)) {\n // Return non-resolving promise.\n return new Promise(lodash_1.default.noop);\n }\n if (moment_timezone_1.default.zonesPromise) {\n return moment_timezone_1.default.zonesPromise;\n }\n return moment_timezone_1.default.zonesPromise = fetch(url)\n .then(resp => resp.json().then(zones => {\n moment_timezone_1.default.tz.load(zones);\n moment_timezone_1.default.zonesLoaded = true;\n // Trigger a global event that the timezones have finished loading.\n if (document && document.createEvent && document.body && document.body.dispatchEvent) {\n var event = document.createEvent('Event');\n event.initEvent('zonesLoaded', true, true);\n document.body.dispatchEvent(event);\n }\n }));\n}\nexports.loadZones = loadZones;\n/**\n * Get the moment date object for translating dates with timezones.\n * @param value\n * @param format\n * @param timezone\n * @returns {*}\n */\nfunction momentDate(value, format, timezone) {\n const momentDate = (0, moment_timezone_1.default)(value);\n if (!timezone) {\n return momentDate;\n }\n if (timezone === 'UTC') {\n timezone = 'Etc/UTC';\n }\n if ((timezone !== currentTimezone() || (format && format.match(/\\s(z$|z\\s)/))) && moment_timezone_1.default.zonesLoaded) {\n return momentDate.tz(timezone);\n }\n return momentDate;\n}\nexports.momentDate = momentDate;\n/**\n * Format a date provided a value, format, and timezone object.\n * @param timezonesUrl\n * @param value\n * @param format\n * @param timezone\n * @param flatPickrInputFormat\n * @returns {string}\n */\nfunction formatDate(timezonesUrl, value, format, timezone, flatPickrInputFormat) {\n const momentDate = (0, moment_timezone_1.default)(value, flatPickrInputFormat || undefined);\n if (timezone === currentTimezone()) {\n // See if our format contains a \"z\" timezone character.\n if (format.match(/\\s(z$|z\\s)/)) {\n loadZones(timezonesUrl);\n if (moment_timezone_1.default.zonesLoaded) {\n return momentDate.tz(timezone).format(convertFormatToMoment(format));\n }\n else {\n return momentDate.format(convertFormatToMoment(format.replace(/\\s(z$|z\\s)/, '')));\n }\n }\n // Return the standard format.\n return momentDate.format(convertFormatToMoment(format));\n }\n if (timezone === 'UTC') {\n const offset = offsetDate(momentDate.toDate(), 'UTC');\n return `${(0, moment_timezone_1.default)(offset.date).format(convertFormatToMoment(format))} UTC`;\n }\n // Load the zones since we need timezone information.\n loadZones(timezonesUrl);\n if (moment_timezone_1.default.zonesLoaded && timezone) {\n return momentDate.tz(timezone).format(`${convertFormatToMoment(format)} z`);\n }\n else {\n return momentDate.format(convertFormatToMoment(format));\n }\n}\nexports.formatDate = formatDate;\n/**\n * Pass a format function to format within a timezone.\n * @param timezonesUrl\n * @param formatFn\n * @param date\n * @param format\n * @param timezone\n * @returns {string}\n */\nfunction formatOffset(timezonesUrl, formatFn, date, format, timezone) {\n if (timezone === currentTimezone()) {\n return formatFn(date, format);\n }\n if (timezone === 'UTC') {\n return `${formatFn(offsetDate(date, 'UTC').date, format)} UTC`;\n }\n // Load the zones since we need timezone information.\n loadZones(timezonesUrl);\n if (moment_timezone_1.default.zonesLoaded) {\n const offset = offsetDate(date, timezone);\n return `${formatFn(offset.date, format)} ${offset.abbr}`;\n }\n else {\n return formatFn(date, format);\n }\n}\nexports.formatOffset = formatOffset;\n/**\n *\n * @param locale\n */\nfunction getLocaleDateFormatInfo(locale) {\n const formatInfo = {};\n const day = 21;\n const exampleDate = new Date(2017, 11, day);\n const localDateString = exampleDate.toLocaleDateString(locale);\n formatInfo.dayFirst = localDateString.slice(0, 2) === day.toString();\n return formatInfo;\n}\nexports.getLocaleDateFormatInfo = getLocaleDateFormatInfo;\n/**\n * Convert the format from the angular-datepicker module to flatpickr format.\n * @param format\n * @returns {string}\n */\nfunction convertFormatToFlatpickr(format) {\n return format\n // Remove the Z timezone offset, not supported by flatpickr.\n .replace(/Z/g, '')\n // Year conversion.\n .replace(/y/g, 'Y')\n .replace('YYYY', 'Y')\n .replace('YY', 'y')\n // Month conversion.\n .replace('MMMM', 'F')\n .replace(/M/g, 'n')\n .replace('nnn', 'M')\n .replace('nn', 'm')\n // Day in month.\n .replace(/d/g, 'j')\n .replace(/jj/g, 'd')\n // Day in week.\n .replace('EEEE', 'l')\n .replace('EEE', 'D')\n // Hours, minutes, seconds\n .replace('HH', 'H')\n .replace('hh', 'G')\n .replace('mm', 'i')\n .replace('ss', 'S')\n .replace(/a/g, 'K');\n}\nexports.convertFormatToFlatpickr = convertFormatToFlatpickr;\n/**\n * Convert the format from the angular-datepicker module to moment format.\n * @param format\n * @returns {string}\n */\nfunction convertFormatToMoment(format) {\n return format\n // Year conversion.\n .replace(/y/g, 'Y')\n // Day in month.\n .replace(/d/g, 'D')\n // Day in week.\n .replace(/E/g, 'd')\n // AM/PM marker\n .replace(/a/g, 'A')\n // Unix Timestamp\n .replace(/U/g, 'X');\n}\nexports.convertFormatToMoment = convertFormatToMoment;\n/**\n *\n * @param format\n */\nfunction convertFormatToMask(format) {\n return format\n // Long month replacement.\n .replace(/M{4}/g, 'MM')\n // Initial short month conversion.\n .replace(/M{3}/g, '***')\n // Short month conversion if input as text.\n .replace(/e/g, 'Q')\n // Month number conversion.\n .replace(/W/g, '99')\n // Year conversion.\n .replace(/[ydhmswHMG]/g, '9')\n // AM/PM conversion.\n .replace(/a/g, 'AA');\n}\nexports.convertFormatToMask = convertFormatToMask;\n/**\n * Returns an input mask that is compatible with the input mask library.\n * @param {string} mask - The Form.io input mask.\n * @param {string} placeholderChar - Char which is used as a placeholder.\n * @returns {Array} - The input mask for the mask library.\n */\nfunction getInputMask(mask, placeholderChar) {\n if (mask instanceof Array) {\n return mask;\n }\n const maskArray = [];\n maskArray.numeric = true;\n for (let i = 0; i < mask.length; i++) {\n switch (mask[i]) {\n case '9':\n maskArray.push(/\\d/);\n break;\n case 'A':\n maskArray.numeric = false;\n maskArray.push(/[a-zA-Z]/);\n break;\n case 'a':\n maskArray.numeric = false;\n maskArray.push(/[a-z]/);\n break;\n case '*':\n maskArray.numeric = false;\n maskArray.push(/[a-zA-Z0-9]/);\n break;\n // If char which is used inside mask placeholder was used in the mask, replace it with space to prevent errors\n case placeholderChar:\n maskArray.numeric = false;\n maskArray.push(' ');\n break;\n default:\n maskArray.numeric = false;\n maskArray.push(mask[i]);\n break;\n }\n }\n return maskArray;\n}\nexports.getInputMask = getInputMask;\n/**\n *\n * @param value\n * @param mask\n * @param placeholderChar\n */\nfunction unmaskValue(value, mask, placeholderChar) {\n if (!mask || !value || value.length > mask.length) {\n return value;\n }\n let unmaskedValue = value.split('');\n for (let i = 0; i < mask.length; i++) {\n const char = value[i] || '';\n const charPart = mask[i];\n if (!lodash_1.default.isRegExp(charPart) && char === charPart) {\n unmaskedValue[i] = '';\n }\n }\n unmaskedValue = unmaskedValue.join('').replace(placeholderChar, '');\n return unmaskedValue;\n}\nexports.unmaskValue = unmaskValue;\n/**\n *\n * @param value\n * @param inputMask\n */\nfunction matchInputMask(value, inputMask) {\n if (!inputMask) {\n return true;\n }\n // If value is longer than mask, it isn't valid.\n if (value.length > inputMask.length) {\n return false;\n }\n for (let i = 0; i < inputMask.length; i++) {\n const char = value[i] || '';\n const charPart = inputMask[i];\n if (!(lodash_1.default.isRegExp(charPart) && charPart.test(char) || charPart === char)) {\n return false;\n }\n }\n return true;\n}\nexports.matchInputMask = matchInputMask;\n/**\n *\n * @param lang\n */\nfunction getNumberSeparators(lang = 'en') {\n const formattedNumberString = (12345.6789).toLocaleString(lang);\n const delimeters = formattedNumberString.match(/..(.)...(.)../);\n if (!delimeters) {\n return {\n delimiter: ',',\n decimalSeparator: '.'\n };\n }\n return {\n delimiter: (delimeters.length > 1) ? delimeters[1] : ',',\n decimalSeparator: (delimeters.length > 2) ? delimeters[2] : '.',\n };\n}\nexports.getNumberSeparators = getNumberSeparators;\n/**\n *\n * @param component\n * @param defaultLimit\n */\nfunction getNumberDecimalLimit(component, defaultLimit) {\n if (lodash_1.default.has(component, 'decimalLimit')) {\n return lodash_1.default.get(component, 'decimalLimit');\n }\n // Determine the decimal limit. Defaults to 20 but can be overridden by validate.step or decimalLimit settings.\n let decimalLimit = defaultLimit || 20;\n const step = lodash_1.default.get(component, 'validate.step', 'any');\n if (step !== 'any') {\n const parts = step.toString().split('.');\n if (parts.length > 1) {\n decimalLimit = parts[1].length;\n }\n }\n return decimalLimit;\n}\nexports.getNumberDecimalLimit = getNumberDecimalLimit;\n/**\n *\n * @param root0\n * @param root0.currency\n * @param root0.decimalLimit\n * @param root0.decimalSeparator\n * @param root0.lang\n */\nfunction getCurrencyAffixes({ currency, decimalLimit, decimalSeparator, lang, }) {\n // Get the prefix and suffix from the localized string.\n let regex = `(.*)?${(100).toLocaleString(lang)}`;\n if (decimalLimit) {\n regex += `${decimalSeparator === '.' ? '\\\\.' : decimalSeparator}${(0).toLocaleString(lang)}{${decimalLimit}}`;\n }\n regex += '(.*)?';\n const parts = (100).toLocaleString(lang, {\n style: 'currency',\n currency: currency ? currency : 'USD',\n useGrouping: true,\n maximumFractionDigits: decimalLimit || 0,\n minimumFractionDigits: decimalLimit || 0\n }).replace('.', decimalSeparator).match(new RegExp(regex));\n return {\n prefix: (parts === null || parts === void 0 ? void 0 : parts[1]) || '',\n suffix: (parts === null || parts === void 0 ? void 0 : parts[2]) || ''\n };\n}\nexports.getCurrencyAffixes = getCurrencyAffixes;\n/**\n * Fetch the field data provided a component.\n * @param data\n * @param component\n * @returns {*}\n */\nfunction fieldData(data, component) {\n if (!data) {\n return '';\n }\n if (!component || !component.key) {\n return data;\n }\n if (component.key.includes('.')) {\n let value = data;\n const parts = component.key.split('.');\n let key = '';\n for (let i = 0; i < parts.length; i++) {\n key = parts[i];\n // Handle nested resources\n if (value.hasOwnProperty('_id')) {\n value = value.data;\n }\n // Return if the key is not found on the value.\n if (!value.hasOwnProperty(key)) {\n return;\n }\n // Convert old single field data in submissions to multiple\n if (key === parts[parts.length - 1] && component.multiple && !Array.isArray(value[key])) {\n value[key] = [value[key]];\n }\n // Set the value of this key.\n value = value[key];\n }\n return value;\n }\n else {\n // Convert old single field data in submissions to multiple\n if (component.multiple && !Array.isArray(data[component.key])) {\n data[component.key] = [data[component.key]];\n }\n // Fix for checkbox type radio submission values in tableView\n if (component.type === 'checkbox' && component.inputType === 'radio') {\n return data[component.name] === component.value;\n }\n return data[component.key];\n }\n}\nexports.fieldData = fieldData;\n/**\n * Delays function execution with possibility to execute function synchronously or cancel it.\n * @param fn Function to delay\n * @param delay Delay time\n * @param {...any} args\n * @returns {*}\n */\nfunction delay(fn, delay = 0, ...args) {\n const timer = setTimeout(fn, delay, ...args);\n /**\n *\n */\n function cancel() {\n clearTimeout(timer);\n }\n /**\n *\n */\n function earlyCall() {\n cancel();\n return fn(...args);\n }\n earlyCall.timer = timer;\n earlyCall.cancel = cancel;\n return earlyCall;\n}\nexports.delay = delay;\n/**\n * Iterate the given key to make it unique.\n * @param {string} key\n * Modify the component key to be unique.\n * @returns {string}\n * The new component key.\n */\nfunction iterateKey(key) {\n if (!key.match(/(\\d+)$/)) {\n return `${key}1`;\n }\n return key.replace(/(\\d+)$/, function (suffix) {\n return Number(suffix) + 1;\n });\n}\nexports.iterateKey = iterateKey;\n/**\n * Determines a unique key within a map provided the base key.\n * @param map\n * @param base\n * @returns {*}\n */\nfunction uniqueKey(map, base) {\n let newKey = base;\n while (map.hasOwnProperty(newKey)) {\n newKey = iterateKey(newKey);\n }\n return newKey;\n}\nexports.uniqueKey = uniqueKey;\n/**\n * Determines the major version number of bootstrap.\n * @param options\n * @returns {number}\n */\nfunction bootstrapVersion(options) {\n if (options.bootstrap) {\n return options.bootstrap;\n }\n if ((typeof jQuery === 'function') && (typeof jQuery().collapse === 'function')) {\n return parseInt(jQuery.fn.collapse.Constructor.VERSION.split('.')[0], 10);\n }\n if (window.bootstrap && window.bootstrap.Collapse) {\n return parseInt(window.bootstrap.Collapse.VERSION.split('.')[0], 10);\n }\n return 0;\n}\nexports.bootstrapVersion = bootstrapVersion;\n/**\n * Retrun provided argument.\n * If argument is a function, returns the result of a function call.\n * @param {*} e;\n * @param e\n * @returns {*}\n */\nfunction unfold(e) {\n if (typeof e === 'function') {\n return e();\n }\n return e;\n}\nexports.unfold = unfold;\n/**\n * Map values through unfold and return first non-nil value.\n * @param {Array<T>} collection;\n * @returns {T}\n */\nexports.firstNonNil = lodash_1.default.flow([\n lodash_1.default.partialRight(lodash_1.default.map, unfold),\n lodash_1.default.partialRight(lodash_1.default.find, v => !lodash_1.default.isUndefined(v))\n]);\n/*\n * Create enclosed state.\n * Returns functions to getting and cycling between states.\n * @param {*} a - initial state.\n * @param {*} b - next state.\n * @return {Functions[]} -- [get, toggle];\n */\n/**\n *\n * @param a\n * @param b\n */\nfunction withSwitch(a, b) {\n let state = a;\n let next = b;\n /**\n *\n */\n function get() {\n return state;\n }\n /**\n *\n */\n function toggle() {\n const prev = state;\n state = next;\n next = prev;\n }\n return [get, toggle];\n}\nexports.withSwitch = withSwitch;\n/**\n *\n * @param callback\n * @param options\n */\nfunction observeOverload(callback, options = {}) {\n const { limit = 50, delay = 500 } = options;\n let callCount = 0;\n let timeoutID = 0;\n const reset = () => callCount = 0;\n return () => {\n if (timeoutID !== 0) {\n clearTimeout(timeoutID);\n timeoutID = 0;\n }\n timeoutID = setTimeout(reset, delay);\n callCount += 1;\n if (callCount >= limit) {\n clearTimeout(timeoutID);\n reset();\n return callback();\n }\n };\n}\nexports.observeOverload = observeOverload;\n/**\n *\n * @param context\n * @param excludeNested\n * @param excludedTypes\n */\nfunction getContextComponents(context, excludeNested = false, excludedTypes = []) {\n const values = [];\n context.utils.eachComponent(context.instance.options.editForm.components, (component, path) => {\n const addToContextComponents = excludeNested ? !component.tree : true;\n if (component.key !== context.data.key && addToContextComponents && !lodash_1.default.includes(excludedTypes, component.type)) {\n values.push({\n label: `${component.label || component.key} (${path})`,\n value: path,\n });\n }\n });\n return values;\n}\nexports.getContextComponents = getContextComponents;\n/**\n *\n * @param context\n */\nfunction getContextButtons(context) {\n const values = [];\n context.utils.eachComponent(context.instance.options.editForm.components, (component) => {\n if (component.type === 'button') {\n values.push({\n label: `${component.key} (${component.label})`,\n value: component.key,\n });\n }\n });\n return values;\n}\nexports.getContextButtons = getContextButtons;\n// Tags that could be in text, that should be ommited or handled in a special way\nconst inTextTags = ['#text', 'A', 'B', 'EM', 'I', 'SMALL', 'STRONG', 'SUB', 'SUP', 'INS', 'DEL', 'MARK', 'CODE'];\n/**\n * Helper function for 'translateHTMLTemplate'. Translates text value of the passed html element.\n * @param {HTMLElement} elem\n * @param {Function} translate\n * @returns {string}\n * Translated element template.\n */\nfunction translateElemValue(elem, translate) {\n if (!elem.innerText) {\n return elem.innerHTML;\n }\n const elemValue = elem.innerText.replace(Evaluator_1.Evaluator.templateSettings.interpolate, '').replace(/\\s\\s+/g, ' ').trim();\n const translatedValue = translate(elemValue);\n if (elemValue !== translatedValue) {\n const links = elem.innerHTML.match(/<a[^>]*>(.*?)<\\/a>/g);\n if (links && links.length) {\n if (links.length === 1 && links[0].length === elem.innerHTML.length) {\n return elem.innerHTML.replace(elemValue, translatedValue);\n }\n const translatedLinks = links.map(link => {\n const linkElem = document.createElement('a');\n linkElem.innerHTML = link;\n return translateElemValue(linkElem, translate);\n });\n return `${translatedValue} (${translatedLinks.join(', ')})`;\n }\n else {\n return elem.innerText.replace(elemValue, translatedValue);\n }\n }\n else {\n return elem.innerHTML;\n }\n}\n/**\n * Helper function for 'translateHTMLTemplate'. Goes deep through html tag children and calls function to translate their text values.\n * @param {HTMLElement} tag\n * @param {Function} translate\n * @returns {void}\n */\nfunction translateDeepTag(tag, translate) {\n const children = tag.children.length && [...tag.children];\n const shouldTranslateEntireContent = children && children.every(child => child.children.length === 0\n && inTextTags.some(tag => child.nodeName === tag));\n if (!children || shouldTranslateEntireContent) {\n tag.innerHTML = translateElemValue(tag, translate);\n }\n else {\n children.forEach(child => translateDeepTag(child, translate));\n }\n}\n/**\n * Translates text values in html template.\n * @param {string} template\n * @param {Function} translate\n * @returns {string}\n * Html template with translated values.\n */\nfunction translateHTMLTemplate(template, translate) {\n const isHTML = /<[^>]*>/.test(template);\n if (!isHTML) {\n return translate(template);\n }\n const tempElem = document.createElement('div');\n tempElem.innerHTML = template;\n if (tempElem.innerText && tempElem.children.length) {\n translateDeepTag(tempElem, translate);\n return tempElem.innerHTML;\n }\n return template;\n}\nexports.translateHTMLTemplate = translateHTMLTemplate;\n/**\n * Sanitize an html string.\n * @param string\n * @param options\n * @returns {*}\n */\nfunction sanitize(string, options) {\n if (typeof dompurify_1.default.sanitize !== 'function') {\n return string;\n }\n // Dompurify configuration\n const sanitizeOptions = {\n ADD_ATTR: ['ref', 'target'],\n USE_PROFILES: { html: true }\n };\n // Use profiles\n if (options.sanitizeConfig && options.sanitizeConfig.useProfiles) {\n Object.keys(options.sanitizeConfig.useProfiles).forEach(key => {\n sanitizeOptions.USE_PROFILES[key] = options.sanitizeConfig.useProfiles[key];\n });\n }\n // Add attrs\n if (options.sanitizeConfig && Array.isArray(options.sanitizeConfig.addAttr) && options.sanitizeConfig.addAttr.length > 0) {\n options.sanitizeConfig.addAttr.forEach((attr) => {\n sanitizeOptions.ADD_ATTR.push(attr);\n });\n }\n // Add tags\n if (options.sanitizeConfig && Array.isArray(options.sanitizeConfig.addTags) && options.sanitizeConfig.addTags.length > 0) {\n sanitizeOptions.ADD_TAGS = options.sanitizeConfig.addTags;\n }\n // Allow tags\n if (options.sanitizeConfig && Array.isArray(options.sanitizeConfig.allowedTags) && options.sanitizeConfig.allowedTags.length > 0) {\n sanitizeOptions.ALLOWED_TAGS = options.sanitizeConfig.allowedTags;\n }\n // Allow attributes\n if (options.sanitizeConfig && Array.isArray(options.sanitizeConfig.allowedAttrs) && options.sanitizeConfig.allowedAttrs.length > 0) {\n sanitizeOptions.ALLOWED_ATTR = options.sanitizeConfig.allowedAttrs;\n }\n // Allowd URI Regex\n if (options.sanitizeConfig && options.sanitizeConfig.allowedUriRegex) {\n const allowedUriRegex = options.sanitizeConfig.allowedUriRegex;\n sanitizeOptions.ALLOWED_URI_REGEXP = lodash_1.default.isString(allowedUriRegex) ? new RegExp(allowedUriRegex) : allowedUriRegex;\n }\n // Allow to extend the existing array of elements that are safe for URI-like values\n if (options.sanitizeConfig && Array.isArray(options.sanitizeConfig.addUriSafeAttr) && options.sanitizeConfig.addUriSafeAttr.length > 0) {\n sanitizeOptions.ADD_URI_SAFE_ATTR = options.sanitizeConfig.addUriSafeAttr;\n }\n return dompurify_1.default.sanitize(string, sanitizeOptions);\n}\nexports.sanitize = sanitize;\n/**\n * Fast cloneDeep for JSON objects only.\n * @param obj\n */\nfunction fastCloneDeep(obj) {\n return obj ? JSON.parse(JSON.stringify(obj)) : obj;\n}\nexports.fastCloneDeep = fastCloneDeep;\n/**\n *\n * @param componentJson\n */\nfunction isInputComponent(componentJson) {\n if (componentJson.input === false || componentJson.input === true) {\n return componentJson.input;\n }\n switch (componentJson.type) {\n case 'htmlelement':\n case 'content':\n case 'columns':\n case 'fieldset':\n case 'panel':\n case 'table':\n case 'tabs':\n case 'well':\n case 'button':\n return false;\n default:\n return true;\n }\n}\nexports.isInputComponent = isInputComponent;\n/**\n *\n * @param pathStr\n */\nfunction getArrayFromComponentPath(pathStr) {\n if (!pathStr || !lodash_1.default.isString(pathStr)) {\n if (!lodash_1.default.isArray(pathStr)) {\n return [pathStr];\n }\n return pathStr;\n }\n return pathStr.replace(/[[\\]]/g, '.')\n .replace(/\\.\\./g, '.')\n .replace(/(^\\.)|(\\.$)/g, '')\n .split('.')\n .map(part => lodash_1.default.defaultTo(lodash_1.default.toNumber(part), part));\n}\nexports.getArrayFromComponentPath = getArrayFromComponentPath;\n/**\n *\n * @param child\n * @param parent\n */\nfunction isChildOf(child, parent) {\n while (child && child.parent) {\n if (child.parent === parent) {\n return true;\n }\n child = child.parent;\n }\n return false;\n}\nexports.isChildOf = isChildOf;\n/**\n *\n * @param path\n */\nfunction getStringFromComponentPath(path) {\n if (!lodash_1.default.isArray(path)) {\n return path;\n }\n let strPath = '';\n path.forEach((part, i) => {\n if (lodash_1.default.isNumber(part)) {\n strPath += `[${part}]`;\n }\n else {\n strPath += i === 0 ? part : `.${part}`;\n }\n });\n return strPath;\n}\nexports.getStringFromComponentPath = getStringFromComponentPath;\n/**\n *\n * @param number\n * @param precision\n */\nfunction round(number, precision) {\n if (lodash_1.default.isNumber(number)) {\n return number.toFixed(precision);\n }\n return number;\n}\nexports.round = round;\n/**\n * Check for Internet Explorer browser version\n * @returns {(number|null)}\n */\nfunction getIEBrowserVersion() {\n const { ie, version } = getBrowserInfo();\n return ie ? version : null;\n}\nexports.getIEBrowserVersion = getIEBrowserVersion;\n/**\n * Get browser name and version (modified from 'jquery-browser-plugin')\n * @returns {object} -- {{browser name, version, isWebkit?}}\n * Possible browser names: chrome, safari, ie, edge, opera, mozilla, yabrowser\n */\nfunction getBrowserInfo() {\n const browser = {};\n if (typeof window === 'undefined') {\n return browser;\n }\n const ua = window.navigator.userAgent.toLowerCase();\n const match = /(edge|edg)\\/([\\w.]+)/.exec(ua) ||\n /(opr)[/]([\\w.]+)/.exec(ua) ||\n /(yabrowser)[ /]([\\w.]+)/.exec(ua) ||\n /(chrome)[ /]([\\w.]+)/.exec(ua) ||\n /(iemobile)[/]([\\w.]+)/.exec(ua) ||\n /(version)(applewebkit)[ /]([\\w.]+).*(safari)[ /]([\\w.]+)/.exec(ua) ||\n /(webkit)[ /]([\\w.]+).*(version)[ /]([\\w.]+).*(safari)[ /]([\\w.]+)/.exec(ua) ||\n /(webkit)[ /]([\\w.]+)/.exec(ua) ||\n /(opera)(?:.*version|)[ /]([\\w.]+)/.exec(ua) ||\n /(msie) ([\\w.]+)/.exec(ua) ||\n ua.indexOf('trident') >= 0 && /(rv)(?::| )([\\w.]+)/.exec(ua) ||\n ua.indexOf('compatible') < 0 && /(mozilla)(?:.*? rv:([\\w.]+)|)/.exec(ua) ||\n [];\n const matched = {\n browser: match[5] || match[3] || match[1] || '',\n version: match[4] || match[2] || '0'\n };\n if (matched.browser) {\n browser[matched.browser] = true;\n browser.version = parseInt(matched.version, 10);\n }\n // Chrome, Opera 15+, Safari and Yandex.Browser are webkit based browsers\n if (browser.chrome || browser.opr || browser.safari || browser.edg || browser.yabrowser) {\n browser.isWebkit = true;\n }\n // IE11 has a new token so we will assign it ie to avoid breaking changes\n if (browser.rv || browser.iemobile) {\n browser.ie = true;\n }\n // Edge has a new token since it became webkit based\n if (browser.edg) {\n browser.edge = true;\n }\n // Opera 15+ are identified as opr\n if (browser.opr) {\n browser.opera = true;\n }\n return browser;\n}\nexports.getBrowserInfo = getBrowserInfo;\n/**\n *\n * @param path\n */\nfunction getComponentPathWithoutIndicies(path = '') {\n return path.replace(/\\[\\d+\\]/, '');\n}\nexports.getComponentPathWithoutIndicies = getComponentPathWithoutIndicies;\n/**\n * Returns a path to the component which based on its schema\n * @param {*} component is a component's schema containing link to its parent's schema in the 'parent' property\n * @param path\n */\nfunction getComponentPath(component, path = '') {\n var _a;\n if (!component || !component.key || ((_a = component === null || component === void 0 ? void 0 : component._form) === null || _a === void 0 ? void 0 : _a.display) === 'wizard') { // unlike the Webform, the Wizard has the key and it is a duplicate of the panel key\n return path;\n }\n path = component.isInputComponent || component.input === true ? `${component.key}${path ? '.' : ''}${path}` : path;\n return getComponentPath(component.parent, path);\n}\nexports.getComponentPath = getComponentPath;\n/**\n * Returns a parent component of the passed component instance skipping all the Layout components\n * @param {*} componentInstance\n * @returns {(Component|undefined)}\n */\nfunction getDataParentComponent(componentInstance) {\n if (!componentInstance) {\n return;\n }\n const { parent } = componentInstance;\n if (parent && (parent.isInputComponent || parent.input)) {\n return parent;\n }\n else {\n return getDataParentComponent(parent);\n }\n}\nexports.getDataParentComponent = getDataParentComponent;\n/**\n * Returns whether the value is a promise\n * @param value\n * @returns {boolean}\n */\nfunction isPromise(value) {\n return value\n && value.then\n && typeof value.then === 'function'\n && Object.prototype.toString.call(value) === '[object Promise]';\n}\nexports.isPromise = isPromise;\n/**\n * Determines if the component has a scoping parent in tree (a component which scopes its children and manages its\n * changes by itself, e.g. EditGrid)\n * @param componentInstance\n * @param firstPass\n * @returns {boolean|boolean|*}\n */\nfunction isInsideScopingComponent(componentInstance, firstPass = true) {\n if (!firstPass && (componentInstance === null || componentInstance === void 0 ? void 0 : componentInstance.hasScopedChildren)) {\n return true;\n }\n const dataParent = getDataParentComponent(componentInstance);\n if (dataParent === null || dataParent === void 0 ? void 0 : dataParent.hasScopedChildren) {\n return true;\n }\n else if (dataParent === null || dataParent === void 0 ? void 0 : dataParent.parent) {\n return isInsideScopingComponent(dataParent.parent, false);\n }\n return false;\n}\nexports.isInsideScopingComponent = isInsideScopingComponent;\n/**\n *\n * @param element\n */\nfunction getFocusableElements(element) {\n const focusableSelector = `button:not([disabled]), input:not([disabled]), select:not([disabled]),\n textarea:not([disabled]), button:not([disabled]), [href]`;\n return element.querySelectorAll(focusableSelector);\n}\nexports.getFocusableElements = getFocusableElements;\nexports.componentValueTypes = {\n number: 'number',\n string: 'string',\n boolean: 'boolean',\n array: 'array',\n object: 'object',\n date: 'date',\n any: 'any',\n};\n/**\n *\n * @param fullSchema\n */\nfunction getComponentSavedTypes(fullSchema) {\n const schema = fullSchema || {};\n if (schema.persistent !== true) {\n return [];\n }\n if (schema.multiple) {\n return [exports.componentValueTypes.array];\n }\n return null;\n}\nexports.getComponentSavedTypes = getComponentSavedTypes;\n/**\n * Interpolates @formio/core errors so that they are compatible with the renderer\n * @param component\n * @param {FieldError[]} errors\n * @param firstPass\n * @param interpolateFn\n * @returns {[]}\n */\nconst interpolateErrors = (component, errors, interpolateFn) => {\n return errors.map((error) => {\n error.component = component;\n const { errorKeyOrMessage, context } = error;\n const toInterpolate = component.errors && component.errors[errorKeyOrMessage] ? component.errors[errorKeyOrMessage] : errorKeyOrMessage;\n return Object.assign(Object.assign({}, error), { message: unescapeHTML(interpolateFn(toInterpolate, context)), context: Object.assign({}, context) });\n });\n};\nexports.interpolateErrors = interpolateErrors;\n/**\n *\n * @param template\n */\nfunction getItemTemplateKeys(template) {\n const templateKeys = [];\n if (!template) {\n return templateKeys;\n }\n const keys = template.match(/({{\\s*(.*?)\\s*}})/g);\n if (keys) {\n keys.forEach((key) => {\n const propKey = key.match(/{{\\s*item\\.(.*?)\\s*}}/);\n if (propKey && propKey.length > 1) {\n templateKeys.push(propKey[1]);\n }\n });\n }\n return templateKeys;\n}\nexports.getItemTemplateKeys = getItemTemplateKeys;\n/**\n *\n * @param comp\n */\nfunction isSelectResourceWithObjectValue(comp = {}) {\n const { reference, dataSrc, valueProperty } = comp;\n return reference || (dataSrc === 'resource' && (!valueProperty || valueProperty === 'data'));\n}\nexports.isSelectResourceWithObjectValue = isSelectResourceWithObjectValue;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/utils/utils.js?");
|
3483
|
+
eval("\n/* global jQuery */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.observeOverload = exports.withSwitch = exports.firstNonNil = exports.unfold = exports.bootstrapVersion = exports.uniqueKey = exports.iterateKey = exports.delay = exports.fieldData = exports.getCurrencyAffixes = exports.getNumberDecimalLimit = exports.getNumberSeparators = exports.matchInputMask = exports.unmaskValue = exports.getInputMask = exports.convertFormatToMask = exports.convertFormatToMoment = exports.convertFormatToFlatpickr = exports.getLocaleDateFormatInfo = exports.formatOffset = exports.formatDate = exports.momentDate = exports.loadZones = exports.shouldLoadZones = exports.zonesLoaded = exports.offsetDate = exports.currentTimezone = exports.isValidDate = exports.getDateSetting = exports.guid = exports.uniqueName = exports.convertStringToHTMLElement = exports.unescapeHTML = exports.setActionProperty = exports.checkTrigger = exports.checkCondition = exports.checkJsonConditional = exports.checkCustomConditional = exports.getComponentActualValue = exports.checkSimpleConditional = exports.checkCalculated = exports.isMongoId = exports.boolValue = exports.getElementRect = exports.getPropertyValue = exports.getRandomComponentId = exports.evaluate = exports.moment = exports.ConditionOperators = exports.jsonLogic = void 0;\nexports.isSelectResourceWithObjectValue = exports.getItemTemplateKeys = exports.interpolateErrors = exports.getComponentSavedTypes = exports.componentValueTypes = exports._ = exports.getFocusableElements = exports.isInsideScopingComponent = exports.isPromise = exports.getDataParentComponent = exports.getComponentPath = exports.getComponentPathWithoutIndicies = exports.getBrowserInfo = exports.getIEBrowserVersion = exports.round = exports.getStringFromComponentPath = exports.isChildOf = exports.getArrayFromComponentPath = exports.isInputComponent = exports.interpolate = exports.Evaluator = exports.fastCloneDeep = exports.sanitize = exports.translateHTMLTemplate = exports.getContextButtons = exports.getContextComponents = void 0;\nconst lodash_1 = __importDefault(__webpack_require__(/*! lodash */ \"./node_modules/lodash/lodash.js\"));\nexports._ = lodash_1.default;\nconst fetch_ponyfill_1 = __importDefault(__webpack_require__(/*! fetch-ponyfill */ \"./node_modules/fetch-ponyfill/build/fetch-browser.js\"));\nconst json_logic_js_1 = __importDefault(__webpack_require__(/*! json-logic-js */ \"./node_modules/json-logic-js/logic.js\"));\nexports.jsonLogic = json_logic_js_1.default;\nconst moment_timezone_1 = __importDefault(__webpack_require__(/*! moment-timezone/moment-timezone */ \"./node_modules/moment-timezone/moment-timezone.js\"));\nconst jstimezonedetect_1 = __importDefault(__webpack_require__(/*! jstimezonedetect */ \"./node_modules/jstimezonedetect/dist/jstz.min.js\"));\nconst operators_1 = __webpack_require__(/*! ./jsonlogic/operators */ \"./lib/cjs/utils/jsonlogic/operators.js\");\nconst dompurify_1 = __importDefault(__webpack_require__(/*! dompurify */ \"./node_modules/dompurify/dist/purify.js\"));\nconst formUtils_1 = __webpack_require__(/*! ./formUtils */ \"./lib/cjs/utils/formUtils.js\");\nconst Evaluator_1 = __webpack_require__(/*! ./Evaluator */ \"./lib/cjs/utils/Evaluator.js\");\nObject.defineProperty(exports, \"Evaluator\", ({ enumerable: true, get: function () { return Evaluator_1.Evaluator; } }));\nconst conditionOperators_1 = __importDefault(__webpack_require__(/*! ./conditionOperators */ \"./lib/cjs/utils/conditionOperators/index.js\"));\nexports.ConditionOperators = conditionOperators_1.default;\nconst interpolate = Evaluator_1.Evaluator.interpolate;\nexports.interpolate = interpolate;\nconst { fetch } = (0, fetch_ponyfill_1.default)({\n Promise: Promise\n});\n__exportStar(__webpack_require__(/*! ./formUtils */ \"./lib/cjs/utils/formUtils.js\"), exports);\n// Configure JsonLogic\noperators_1.lodashOperators.forEach((name) => json_logic_js_1.default.add_operation(`_${name}`, lodash_1.default[name]));\n// Retrieve Any Date\njson_logic_js_1.default.add_operation('getDate', (date) => {\n return (0, moment_timezone_1.default)(date).toISOString();\n});\n// Set Relative Minimum Date\njson_logic_js_1.default.add_operation('relativeMinDate', (relativeMinDate) => {\n return (0, moment_timezone_1.default)().subtract(relativeMinDate, 'days').toISOString();\n});\n// Set Relative Maximum Date\njson_logic_js_1.default.add_operation('relativeMaxDate', (relativeMaxDate) => {\n return (0, moment_timezone_1.default)().add(relativeMaxDate, 'days').toISOString();\n});\nexports.moment = __importStar(__webpack_require__(/*! moment-timezone/moment-timezone */ \"./node_modules/moment-timezone/moment-timezone.js\"));\n/**\n * Sets the path to the component and parent schema.\n * @param {import('@formio/core').Component} component - The component to set the path for.\n */\nfunction setPathToComponentAndPerentSchema(component) {\n component.path = getComponentPath(component);\n const dataParent = getDataParentComponent(component);\n if (dataParent && typeof dataParent === 'object') {\n dataParent.path = getComponentPath(dataParent);\n }\n}\n/**\n * Evaluate a method.\n * @param {Function|string|object} func - The function to evaluate.\n * @param {*} args - A map of arguments to pass to the function.\n * @param {string} ret - The name of the \"return\" variable in the script.\n * @param {boolean} tokenize - True if the script should be interpolated before being executed.\n * @returns {*} - The result of the evaluation.\n */\nfunction evaluate(func, args, ret, tokenize) {\n let returnVal = null;\n const component = args.component ? args.component : { key: 'unknown' };\n if (!args.form && args.instance) {\n args.form = lodash_1.default.get(args.instance, 'root._form', {});\n }\n const componentKey = component.key;\n if (typeof func === 'string') {\n if (ret) {\n func += `;return ${ret}`;\n }\n if (tokenize) {\n // Replace all {{ }} references with actual data.\n func = func.replace(/({{\\s+(.*)\\s+}})/, (match, $1, $2) => {\n if ($2.indexOf('data.') === 0) {\n return lodash_1.default.get(args.data, $2.replace('data.', ''));\n }\n else if ($2.indexOf('row.') === 0) {\n return lodash_1.default.get(args.row, $2.replace('row.', ''));\n }\n // Support legacy...\n return lodash_1.default.get(args.data, $2);\n });\n }\n try {\n func = Evaluator_1.Evaluator.evaluator(func, args);\n args = lodash_1.default.values(args);\n }\n catch (err) {\n console.warn(`An error occured within the custom function for ${componentKey}`, err);\n returnVal = null;\n func = false;\n }\n }\n if (typeof func === 'function') {\n try {\n returnVal = Evaluator_1.Evaluator.evaluate(func, args);\n }\n catch (err) {\n returnVal = null;\n console.warn(`An error occured within custom function for ${componentKey}`, err);\n }\n }\n else if (typeof func === 'object') {\n try {\n returnVal = json_logic_js_1.default.apply(func, args);\n }\n catch (err) {\n returnVal = null;\n console.warn(`An error occured within custom function for ${componentKey}`, err);\n }\n }\n else if (func) {\n console.warn(`Unknown function type for ${componentKey}`);\n }\n return returnVal;\n}\nexports.evaluate = evaluate;\n/**\n * Returns a random compoennt ID.\n * @returns {string} - A random component ID.\n */\nfunction getRandomComponentId() {\n return `e${Math.random().toString(36).substring(7)}`;\n}\nexports.getRandomComponentId = getRandomComponentId;\n/**\n * Get a property value of an element.\n * @param {CSSStyleDeclaration} style - The style element to get the property value from.\n * @param {string} prop - The property to get the value for.\n * @returns {number} - The value of the property.\n */\nfunction getPropertyValue(style, prop) {\n let value = style.getPropertyValue(prop);\n value = value ? value.replace(/[^0-9.]/g, '') : '0';\n return parseFloat(value);\n}\nexports.getPropertyValue = getPropertyValue;\n/**\n * Get an elements bounding rectagle.\n * @param {HTMLElement} element - A DOM element to get the bounding rectangle for.\n * @returns {{x: number, y: number, width: number, height: number}} - The bounding rectangle.\n */\nfunction getElementRect(element) {\n const style = window.getComputedStyle(element, null);\n return {\n x: getPropertyValue(style, 'left'),\n y: getPropertyValue(style, 'top'),\n width: getPropertyValue(style, 'width'),\n height: getPropertyValue(style, 'height')\n };\n}\nexports.getElementRect = getElementRect;\n/**\n * Determines the boolean value of a setting.\n * @param {string|boolean} value - A string or boolean value to convert to boolean.\n * @returns {boolean} - The boolean value of the setting.\n */\nfunction boolValue(value) {\n if (lodash_1.default.isBoolean(value)) {\n return value;\n }\n else if (lodash_1.default.isString(value)) {\n return (value.toLowerCase() === 'true');\n }\n else {\n return !!value;\n }\n}\nexports.boolValue = boolValue;\n/**\n * Check to see if an ID is a mongoID.\n * @param {string} text - The text to check if it is a mongoID.\n * @returns {boolean} - TRUE if the text is a mongoID; FALSE otherwise.\n */\nfunction isMongoId(text) {\n return !!text.toString().match(/^[0-9a-fA-F]{24}$/);\n}\nexports.isMongoId = isMongoId;\n/**\n * Checks the calculated value for a provided component and data.\n * @param {import('@formio/core').Component} component - The component to check for the calculated value.\n * @param {import('@formio/core').Submission} submission - A submission object.\n * @param {*} rowData - The contextual row data for the component.\n */\nfunction checkCalculated(component, submission, rowData) {\n // Process calculated value stuff if present.\n if (component.calculateValue) {\n lodash_1.default.set(rowData, component.key, evaluate(component.calculateValue, {\n value: undefined,\n data: submission ? submission.data : rowData,\n row: rowData,\n util: this,\n component\n }, 'value'));\n }\n}\nexports.checkCalculated = checkCalculated;\n/**\n * Check if a simple conditional evaluates to true.\n * @param {import('@formio/core').Component} component - The component to check for the conditional.\n * @param {import('@formio/core').SimpleConditional} condition - The condition to check.\n * @param {*} row - The row data for the component.\n * @param {*} data - The full submission data.\n * @param {import('../../src/components/_classes/component/Component').Component} instance - The instance of the component.\n * @returns {boolean} - TRUE if the condition is true; FALSE otherwise.\n */\nfunction checkSimpleConditional(component, condition, row, data, instance) {\n if (condition.when) {\n const value = getComponentActualValue(condition.when, data, row);\n const eq = String(condition.eq);\n const show = String(condition.show);\n // Special check for selectboxes component.\n if (lodash_1.default.isObject(value) && lodash_1.default.has(value, condition.eq)) {\n return String(value[condition.eq]) === show;\n }\n // FOR-179 - Check for multiple values.\n if (Array.isArray(value) && value.map(String).includes(eq)) {\n return show === 'true';\n }\n return (String(value) === eq) === (show === 'true');\n }\n else {\n const { conditions = [], conjunction = 'all', show = true } = condition;\n if (!conditions.length) {\n return true;\n }\n const conditionsResult = lodash_1.default.map(conditions, (cond) => {\n const { value: comparedValue, operator, component: conditionComponentPath } = cond;\n if (!conditionComponentPath) {\n return true;\n }\n const value = getComponentActualValue(conditionComponentPath, data, row);\n const ConditionOperator = conditionOperators_1.default[operator];\n return ConditionOperator\n ? new ConditionOperator().getResult({ value, comparedValue, instance, component, conditionComponentPath })\n : true;\n });\n let result = false;\n switch (conjunction) {\n case 'any':\n result = lodash_1.default.some(conditionsResult, res => !!res);\n break;\n default:\n result = lodash_1.default.every(conditionsResult, res => !!res);\n }\n return show ? result : !result;\n }\n}\nexports.checkSimpleConditional = checkSimpleConditional;\n/**\n * Returns a components normalized value.\n * @param {string} compPath - The full path to the component.\n * @param {*} data - The data object to get the value from.\n * @param {*} row - The contextual row data for the component.\n * @returns {*} - The normalized value of the component.\n */\nfunction getComponentActualValue(compPath, data, row) {\n let value = null;\n if (row) {\n value = (0, formUtils_1.getValue)({ data: row }, compPath);\n }\n if (data && lodash_1.default.isNil(value)) {\n value = (0, formUtils_1.getValue)({ data }, compPath);\n }\n // FOR-400 - Fix issue where falsey values were being evaluated as show=true\n if (lodash_1.default.isNil(value) || (lodash_1.default.isObject(value) && lodash_1.default.isEmpty(value))) {\n value = '';\n }\n return value;\n}\nexports.getComponentActualValue = getComponentActualValue;\n/**\n * Check custom javascript conditional.\n * @param {import('@formio/core').Component} component - The component to check for the conditional.\n * @param {string} custom - The custom conditional string to evaluate.\n * @param {*} row - The row data for the component.\n * @param {*} data - The full submission data.\n * @param {import('@formio/core').Form} form - The form object.\n * @param {string} variable - The variable name for the result of the custom conditional.\n * @param {*} onError - A custom return if there is an error or the value is null from the evaluation.\n * @param {import('../../src/components/_classes/component/Component').Component} instance - The component instance.\n * @returns {*} - The result of the evaulation.\n */\nfunction checkCustomConditional(component, custom, row, data, form, variable, onError, instance) {\n if (typeof custom === 'string') {\n custom = `var ${variable} = true; ${custom}; return ${variable};`;\n }\n const value = (instance && instance.evaluate) ?\n instance.evaluate(custom, { row, data, form }) :\n evaluate(custom, { row, data, form });\n if (value === null) {\n return onError;\n }\n return value;\n}\nexports.checkCustomConditional = checkCustomConditional;\n/**\n * Check a component for JSON conditionals.\n * @param {import('@formio/core').Component} component - The component\n * @param {import('@formio/core').JSONConditional} json - The json conditional to check.\n * @param {*} row - The contextual row data for the component.\n * @param {*} data - The full submission data.\n * @param {import('@formio/core').Form} form - The Form JSON of the form.\n * @param {*} onError - Custom return value if there is an error.\n * @returns {boolean} - TRUE if the condition is true; FALSE otherwise.\n */\nfunction checkJsonConditional(component, json, row, data, form, onError) {\n try {\n return json_logic_js_1.default.apply(json, {\n data,\n row,\n form,\n _: lodash_1.default,\n });\n }\n catch (err) {\n console.warn(`An error occurred in jsonLogic advanced condition for ${component.key}`, err);\n return onError;\n }\n}\nexports.checkJsonConditional = checkJsonConditional;\n/**\n * Returns the contextual row data for a component.\n * @param {import('@formio/core').Component} component - The component to get the row data for.\n * @param {*} row - The row data for the component.\n * @param {import('../../src/components/_classes/component/Component').Component} instance - The component instance.\n * @param {*} conditional - The component conditional.\n * @returns {*} - The contextual row data for the component.\n */\nfunction getRow(component, row, instance, conditional) {\n var _a;\n const condition = conditional || component.conditional;\n // If no component's instance passed (happens only in 6.x server), calculate its path based on the schema\n if (!instance) {\n instance = lodash_1.default.cloneDeep(component);\n setPathToComponentAndPerentSchema(instance);\n }\n const dataParent = getDataParentComponent(instance);\n const parentPath = dataParent ? getComponentPath(dataParent) : null;\n const isTriggerCondtionComponentPath = condition.when || !condition.conditions\n ? (_a = condition.when) === null || _a === void 0 ? void 0 : _a.startsWith(parentPath)\n : lodash_1.default.some(condition.conditions, cond => cond.component.startsWith(parentPath));\n if (dataParent && isTriggerCondtionComponentPath) {\n const newRow = {};\n lodash_1.default.set(newRow, parentPath, row);\n row = newRow;\n }\n return row;\n}\n/**\n * Checks the conditions for a provided component and data.\n * @param {import('@formio/core').Component} component - The component to check for the condition.\n * @param {*} row - The data within a row\n * @param {*} data - The full submission data.\n * @param {import('@formio/core').Form} form - The form object.\n * @param {import('../../src/components/_classes/component/Component').Component} instance - The component instance.\n * @returns {boolean} - TRUE if the condition is true; FALSE otherwise.\n */\nfunction checkCondition(component, row, data, form, instance) {\n const { customConditional, conditional } = component;\n if (customConditional) {\n return checkCustomConditional(component, customConditional, row, data, form, 'show', true, instance);\n }\n else if (conditional && (conditional.when || lodash_1.default.some(conditional.conditions || [], condition => condition.component && condition.operator))) {\n row = getRow(component, row, instance);\n return checkSimpleConditional(component, conditional, row, data, instance);\n }\n else if (conditional && conditional.json) {\n return checkJsonConditional(component, conditional.json, row, data, form, true);\n }\n // Default to show.\n return true;\n}\nexports.checkCondition = checkCondition;\n/**\n * Test a trigger on a component.\n * @param {import('@formio/core').Component} component - The component to test the trigger against.\n * @param {import('@formio/core').LogicTrigger} trigger - The trigger configuration.\n * @param {import('@formio/core').DataObject} row - The contextual row data.\n * @param {import('@formio/core').DataObject} data - The root data object.\n * @param {import('@formio/core').Form} form - The form object.\n * @param {any} instance - The component that is performing the trigger.\n * @returns {boolean} - TRUE if the trigger should fire; FALSE otherwise.\n */\nfunction checkTrigger(component, trigger, row, data, form, instance) {\n // If trigger is empty, don't fire it\n if (!trigger || !trigger[trigger.type]) {\n return false;\n }\n switch (trigger.type) {\n case 'simple':\n row = getRow(component, row, instance, trigger.simple);\n return checkSimpleConditional(component, trigger.simple, row, data, instance);\n case 'javascript':\n return checkCustomConditional(component, trigger.javascript, row, data, form, 'result', false, instance);\n case 'json':\n return checkJsonConditional(component, trigger.json, row, data, form, false);\n }\n // If none of the types matched, don't fire the trigger.\n return false;\n}\nexports.checkTrigger = checkTrigger;\n/**\n * Sets a property on a component via an executed Logic action.\n * @param {import('@formio/core').Component} component - The component to set the property on.\n * @param {import('@formio/core').LogicAction} action - The action to perform on the component.\n * @param {string} result - The name of the variable in the evaulation to use as the result.\n * @param {import('@formio/core').DataObject} row - The contextual row data.\n * @param {import('@formio/core').DataObject} data - The full submission data.\n * @param {any} instance - The component instance.\n * @returns {import('@formio/core').Component} - The modified component.\n */\nfunction setActionProperty(component, action, result, row, data, instance) {\n const property = action.property.value;\n switch (action.property.type) {\n case 'boolean': {\n const currentValue = lodash_1.default.get(component, property, false).toString();\n const newValue = action.state.toString();\n if (currentValue !== newValue) {\n lodash_1.default.set(component, property, newValue === 'true');\n }\n break;\n }\n case 'string': {\n const evalData = {\n data,\n row,\n component,\n result,\n };\n const textValue = action.property.component ? action[action.property.component] : action.text;\n const currentValue = lodash_1.default.get(component, property, '');\n const newValue = (instance && instance.interpolate)\n ? instance.interpolate(textValue, evalData)\n : Evaluator_1.Evaluator.interpolate(textValue, evalData);\n if (newValue !== currentValue) {\n lodash_1.default.set(component, property, newValue);\n }\n break;\n }\n }\n return component;\n}\nexports.setActionProperty = setActionProperty;\n/**\n * Unescape HTML characters like <, >, & and etc.\n * @param {string} str - The string to unescape.\n * @returns {string} - The unescaped string.\n */\nfunction unescapeHTML(str) {\n if (typeof window === 'undefined' || !('DOMParser' in window)) {\n return str;\n }\n const doc = new window.DOMParser().parseFromString(str, 'text/html');\n return doc.documentElement.textContent;\n}\nexports.unescapeHTML = unescapeHTML;\n/**\n * Make HTML element from string\n * @param {string} str - The string to convert to an HTML element.\n * @param {string} selector - The selector to use to get the element once it is created.\n * @returns {HTMLElement} - The HTML element that was created.\n */\nfunction convertStringToHTMLElement(str, selector) {\n const doc = new window.DOMParser().parseFromString(str, 'text/html');\n return doc.body.querySelector(selector);\n}\nexports.convertStringToHTMLElement = convertStringToHTMLElement;\n/**\n * Make a filename guaranteed to be unique.\n * @param {string} name - The original name of the file.\n * @param {string} template - The template to use for the unique name.\n * @param {object} evalContext - The context to use for the evaluation.\n * @returns {string} - A unique filename.\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\n ? `.${lodash_1.default.last(parts)}`\n : '';\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;\n/**\n * Returns a GUID\n * @returns {string} - A GUID.\n */\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'\n ? r\n : (r & 0x3 | 0x8);\n return v.toString(16);\n });\n}\nexports.guid = guid;\n/**\n * Return a translated date setting.\n * @param {string|Date} date - The date to translate.\n * @returns {(null|Date)} - The translated date.\n */\nfunction getDateSetting(date) {\n if (lodash_1.default.isNil(date) || lodash_1.default.isNaN(date) || date === '') {\n return null;\n }\n if (date instanceof Date) {\n return date;\n }\n else if (typeof date.toDate === 'function') {\n return date.isValid() ? date.toDate() : null;\n }\n let dateSetting = ((typeof date !== 'string') || (date.indexOf('moment(') === -1)) ? (0, moment_timezone_1.default)(date) : null;\n if (dateSetting && dateSetting.isValid()) {\n return dateSetting.toDate();\n }\n dateSetting = null;\n try {\n const value = Evaluator_1.Evaluator.evaluator(`return ${date};`, 'moment')(moment_timezone_1.default);\n if (typeof value === 'string') {\n dateSetting = (0, moment_timezone_1.default)(value);\n }\n else if (typeof value.toDate === 'function') {\n dateSetting = (0, moment_timezone_1.default)(value.toDate().toUTCString());\n }\n else if (value instanceof Date) {\n dateSetting = (0, moment_timezone_1.default)(value);\n }\n }\n catch (e) {\n return null;\n }\n if (!dateSetting) {\n return null;\n }\n // Ensure this is a date.\n if (!dateSetting.isValid()) {\n return null;\n }\n return dateSetting.toDate();\n}\nexports.getDateSetting = getDateSetting;\n/**\n * Returns true if the date is a valid date. False otherwise.\n * @param {Date|string} date - The date to check for validity.\n * @returns {boolean} - TRUE if the date is valid; FALSE otherwise.\n */\nfunction isValidDate(date) {\n return lodash_1.default.isDate(date) && !lodash_1.default.isNaN(date.getDate());\n}\nexports.isValidDate = isValidDate;\n/**\n * Get the current timezone string.\n * @returns {string} - The current timezone.\n */\nfunction currentTimezone() {\n if (moment_timezone_1.default.currentTimezone) {\n return moment_timezone_1.default.currentTimezone;\n }\n moment_timezone_1.default.currentTimezone = jstimezonedetect_1.default.determine().name();\n return moment_timezone_1.default.currentTimezone;\n}\nexports.currentTimezone = currentTimezone;\n/**\n * Get an offset date provided a date object and timezone object.\n * @param {Date} date - The date to offset.\n * @param {string} timezone - The timezone to offset the date to.\n * @returns {Date} - The offset date.\n */\nfunction offsetDate(date, timezone) {\n if (timezone === 'UTC') {\n return {\n date: new Date(date.getTime() + (date.getTimezoneOffset() * 60000)),\n abbr: 'UTC'\n };\n }\n const dateMoment = (0, moment_timezone_1.default)(date).tz(timezone);\n return {\n date: new Date(date.getTime() + ((dateMoment.utcOffset() + date.getTimezoneOffset()) * 60000)),\n abbr: dateMoment.format('z')\n };\n}\nexports.offsetDate = offsetDate;\n/**\n * Returns if the zones are loaded.\n * @returns {boolean} - TRUE if the zones are loaded; FALSE otherwise.\n */\nfunction zonesLoaded() {\n return moment_timezone_1.default.zonesLoaded;\n}\nexports.zonesLoaded = zonesLoaded;\n/**\n * Returns if we should load the zones.\n * @param {string} timezone - The timezone to check if we should load the zones.\n * @returns {boolean} - TRUE if we should load the zones; FALSE otherwise.\n */\nfunction shouldLoadZones(timezone) {\n if (timezone === currentTimezone() || timezone === 'UTC') {\n return false;\n }\n return true;\n}\nexports.shouldLoadZones = shouldLoadZones;\n/**\n * Externally load the timezone data.\n * @param {string} url - The URL to load the timezone data from.\n * @param {string} timezone - The timezone to load.\n * @returns {Promise<any> | *} - Resolves when the zones for this timezone are loaded.\n */\nfunction loadZones(url, timezone) {\n if (timezone && !shouldLoadZones(timezone)) {\n // Return non-resolving promise.\n return new Promise(lodash_1.default.noop);\n }\n if (moment_timezone_1.default.zonesPromise) {\n return moment_timezone_1.default.zonesPromise;\n }\n return moment_timezone_1.default.zonesPromise = fetch(url)\n .then(resp => resp.json().then(zones => {\n moment_timezone_1.default.tz.load(zones);\n moment_timezone_1.default.zonesLoaded = true;\n // Trigger a global event that the timezones have finished loading.\n if (document && document.createEvent && document.body && document.body.dispatchEvent) {\n var event = document.createEvent('Event');\n event.initEvent('zonesLoaded', true, true);\n document.body.dispatchEvent(event);\n }\n }));\n}\nexports.loadZones = loadZones;\n/**\n * Get the moment date object for translating dates with timezones.\n * @param {string|Date} value - The value to convert into a moment date.\n * @param {string} format - The format to convert the date to.\n * @param {string} timezone - The timezone to convert the date to.\n * @returns {Date} - The moment date object.\n */\nfunction momentDate(value, format, timezone) {\n const momentDate = (0, moment_timezone_1.default)(value);\n if (!timezone) {\n return momentDate;\n }\n if (timezone === 'UTC') {\n timezone = 'Etc/UTC';\n }\n if ((timezone !== currentTimezone() || (format && format.match(/\\s(z$|z\\s)/))) && moment_timezone_1.default.zonesLoaded) {\n return momentDate.tz(timezone);\n }\n return momentDate;\n}\nexports.momentDate = momentDate;\n/**\n * Format a date provided a value, format, and timezone object.\n * @param {string} timezonesUrl - The URL to load the timezone data from.\n * @param {string|Date} value - The value to format.\n * @param {string} format - The format to format the date to.\n * @param {string} timezone - The timezone to format the date to.\n * @param {string} flatPickrInputFormat - The format to use for flatpickr input.\n * @returns {string} - The formatted date.\n */\nfunction formatDate(timezonesUrl, value, format, timezone, flatPickrInputFormat) {\n const momentDate = (0, moment_timezone_1.default)(value, flatPickrInputFormat || undefined);\n if (timezone === currentTimezone()) {\n // See if our format contains a \"z\" timezone character.\n if (format.match(/\\s(z$|z\\s)/)) {\n loadZones(timezonesUrl);\n if (moment_timezone_1.default.zonesLoaded) {\n return momentDate.tz(timezone).format(convertFormatToMoment(format));\n }\n else {\n return momentDate.format(convertFormatToMoment(format.replace(/\\s(z$|z\\s)/, '')));\n }\n }\n // Return the standard format.\n return momentDate.format(convertFormatToMoment(format));\n }\n if (timezone === 'UTC') {\n const offset = offsetDate(momentDate.toDate(), 'UTC');\n return `${(0, moment_timezone_1.default)(offset.date).format(convertFormatToMoment(format))} UTC`;\n }\n // Load the zones since we need timezone information.\n loadZones(timezonesUrl);\n if (moment_timezone_1.default.zonesLoaded && timezone) {\n return momentDate.tz(timezone).format(`${convertFormatToMoment(format)} z`);\n }\n else {\n return momentDate.format(convertFormatToMoment(format));\n }\n}\nexports.formatDate = formatDate;\n/**\n * Pass a format function to format within a timezone.\n * @param {string} timezonesUrl - The URL to load the timezone data from.\n * @param {Function} formatFn - The format function to use.\n * @param {Date|string} date - The date to format.\n * @param {string} format - The format to format the date to.\n * @param {string} timezone - The timezone to format the date to.\n * @returns {string} - The formatted date.\n */\nfunction formatOffset(timezonesUrl, formatFn, date, format, timezone) {\n if (timezone === currentTimezone()) {\n return formatFn(date, format);\n }\n if (timezone === 'UTC') {\n return `${formatFn(offsetDate(date, 'UTC').date, format)} UTC`;\n }\n // Load the zones since we need timezone information.\n loadZones(timezonesUrl);\n if (moment_timezone_1.default.zonesLoaded) {\n const offset = offsetDate(date, timezone);\n return `${formatFn(offset.date, format)} ${offset.abbr}`;\n }\n else {\n return formatFn(date, format);\n }\n}\nexports.formatOffset = formatOffset;\n/**\n * Returns the local date format information.\n * @param {Intl.LocalesArgument} locale - The locale to get the date format for.\n * @returns {object} - The local date format information.\n */\nfunction getLocaleDateFormatInfo(locale) {\n const formatInfo = {};\n const day = 21;\n const exampleDate = new Date(2017, 11, day);\n const localDateString = exampleDate.toLocaleDateString(locale);\n formatInfo.dayFirst = localDateString.slice(0, 2) === day.toString();\n return formatInfo;\n}\nexports.getLocaleDateFormatInfo = getLocaleDateFormatInfo;\n/**\n * Convert the format from the angular-datepicker module to flatpickr format.\n * @param {string} format - The format to convert.\n * @returns {string} - The converted format.\n */\nfunction convertFormatToFlatpickr(format) {\n return format\n // Remove the Z timezone offset, not supported by flatpickr.\n .replace(/Z/g, '')\n // Year conversion.\n .replace(/y/g, 'Y')\n .replace('YYYY', 'Y')\n .replace('YY', 'y')\n // Month conversion.\n .replace('MMMM', 'F')\n .replace(/M/g, 'n')\n .replace('nnn', 'M')\n .replace('nn', 'm')\n // Day in month.\n .replace(/d/g, 'j')\n .replace(/jj/g, 'd')\n // Day in week.\n .replace('EEEE', 'l')\n .replace('EEE', 'D')\n // Hours, minutes, seconds\n .replace('HH', 'H')\n .replace('hh', 'G')\n .replace('mm', 'i')\n .replace('ss', 'S')\n .replace(/a/g, 'K');\n}\nexports.convertFormatToFlatpickr = convertFormatToFlatpickr;\n/**\n * Convert the format from the angular-datepicker module to moment format.\n * @param {string} format - The format to convert.\n * @returns {string} - The converted format.\n */\nfunction convertFormatToMoment(format) {\n return format\n // Year conversion.\n .replace(/y/g, 'Y')\n // Day in month.\n .replace(/d/g, 'D')\n // Day in week.\n .replace(/E/g, 'd')\n // AM/PM marker\n .replace(/a/g, 'A')\n // Unix Timestamp\n .replace(/U/g, 'X');\n}\nexports.convertFormatToMoment = convertFormatToMoment;\n/**\n * Convert the format from the angular-datepicker module to mask format.\n * @param {string} format - The format to convert.\n * @returns {string} - The converted format.\n */\nfunction convertFormatToMask(format) {\n return format\n // Long month replacement.\n .replace(/M{4}/g, 'MM')\n // Initial short month conversion.\n .replace(/M{3}/g, '***')\n // Short month conversion if input as text.\n .replace(/e/g, 'Q')\n // Month number conversion.\n .replace(/W/g, '99')\n // Year conversion.\n .replace(/[ydhmswHMG]/g, '9')\n // AM/PM conversion.\n .replace(/a/g, 'AA');\n}\nexports.convertFormatToMask = convertFormatToMask;\n/**\n * Returns an input mask that is compatible with the input mask library.\n * @param {string} mask - The Form.io input mask.\n * @param {string} placeholderChar - Char which is used as a placeholder.\n * @returns {Array} - The input mask for the mask library.\n */\nfunction getInputMask(mask, placeholderChar) {\n if (mask instanceof Array) {\n return mask;\n }\n const maskArray = [];\n maskArray.numeric = true;\n for (let i = 0; i < mask.length; i++) {\n switch (mask[i]) {\n case '9':\n maskArray.push(/\\d/);\n break;\n case 'A':\n maskArray.numeric = false;\n maskArray.push(/[a-zA-Z]/);\n break;\n case 'a':\n maskArray.numeric = false;\n maskArray.push(/[a-z]/);\n break;\n case '*':\n maskArray.numeric = false;\n maskArray.push(/[a-zA-Z0-9]/);\n break;\n // If char which is used inside mask placeholder was used in the mask, replace it with space to prevent errors\n case placeholderChar:\n maskArray.numeric = false;\n maskArray.push(' ');\n break;\n default:\n maskArray.numeric = false;\n maskArray.push(mask[i]);\n break;\n }\n }\n return maskArray;\n}\nexports.getInputMask = getInputMask;\n/**\n * Unmasks a value using the provided mask and placeholder characters.\n * @param {string} value - The value to unmask.\n * @param {string} mask - The mask to use for unmasking.\n * @param {string} placeholderChar - The placeholder character to use for unmasking.\n * @returns {string} - The unmasked value.\n */\nfunction unmaskValue(value, mask, placeholderChar) {\n if (!mask || !value || value.length > mask.length) {\n return value;\n }\n let unmaskedValue = value.split('');\n for (let i = 0; i < mask.length; i++) {\n const char = value[i] || '';\n const charPart = mask[i];\n if (!lodash_1.default.isRegExp(charPart) && char === charPart) {\n unmaskedValue[i] = '';\n }\n }\n unmaskedValue = unmaskedValue.join('').replace(placeholderChar, '');\n return unmaskedValue;\n}\nexports.unmaskValue = unmaskValue;\n/**\n * Returns true if the value matches the input mask format.\n * @param {string} value - The value to check.\n * @param {string} inputMask - The input mask to check against.\n * @returns {boolean} - TRUE if the value matches the input mask; FALSE otherwise.\n */\nfunction matchInputMask(value, inputMask) {\n if (!inputMask) {\n return true;\n }\n // If value is longer than mask, it isn't valid.\n if (value.length > inputMask.length) {\n return false;\n }\n for (let i = 0; i < inputMask.length; i++) {\n const char = value[i] || '';\n const charPart = inputMask[i];\n if (!(lodash_1.default.isRegExp(charPart) && charPart.test(char) || charPart === char)) {\n return false;\n }\n }\n return true;\n}\nexports.matchInputMask = matchInputMask;\n/**\n * Returns the number separators (i.e. 1,000) for the provided language.\n * @param {string} lang - The language code to get the number separators for.\n * @returns {{delimiter: string, decimalSeparator: string}} - The number separators.\n */\nfunction getNumberSeparators(lang = 'en') {\n const formattedNumberString = (12345.6789).toLocaleString(lang);\n const delimeters = formattedNumberString.match(/..(.)...(.)../);\n if (!delimeters) {\n return {\n delimiter: ',',\n decimalSeparator: '.'\n };\n }\n return {\n delimiter: (delimeters.length > 1) ? delimeters[1] : ',',\n decimalSeparator: (delimeters.length > 2) ? delimeters[2] : '.',\n };\n}\nexports.getNumberSeparators = getNumberSeparators;\n/**\n * Returns the number for the maximum amount of decimal places for a number.\n * @param {import('@formio/core').Component} component - The component to check for decimal limits.\n * @param {number} defaultLimit - The default limit to use if none is provided in the component.\n * @returns {number} - The number of decimal places allowed.\n */\nfunction getNumberDecimalLimit(component, defaultLimit) {\n if (lodash_1.default.has(component, 'decimalLimit')) {\n return lodash_1.default.get(component, 'decimalLimit');\n }\n // Determine the decimal limit. Defaults to 20 but can be overridden by validate.step or decimalLimit settings.\n let decimalLimit = defaultLimit || 20;\n const step = lodash_1.default.get(component, 'validate.step', 'any');\n if (step !== 'any') {\n const parts = step.toString().split('.');\n if (parts.length > 1) {\n decimalLimit = parts[1].length;\n }\n }\n return decimalLimit;\n}\nexports.getNumberDecimalLimit = getNumberDecimalLimit;\n/**\n * Returns the currency affixes for a specific language.\n * @param {object} arg0 - The arguments object.\n * @param {string} arg0.currency - The currency code to get the affixes for.\n * @param {number} arg0.decimalLimit - The number of decimal places to use.\n * @param {string} arg0.decimalSeparator - The decimal separator to use.\n * @param {string} arg0.lang - The language code to use.\n * @returns {{prefix: string, suffix: string}} - The currency affixes.\n */\nfunction getCurrencyAffixes({ currency, decimalLimit, decimalSeparator, lang, }) {\n // Get the prefix and suffix from the localized string.\n let regex = `(.*)?${(100).toLocaleString(lang)}`;\n if (decimalLimit) {\n regex += `${decimalSeparator === '.' ? '\\\\.' : decimalSeparator}${(0).toLocaleString(lang)}{${decimalLimit}}`;\n }\n regex += '(.*)?';\n const parts = (100).toLocaleString(lang, {\n style: 'currency',\n currency: currency ? currency : 'USD',\n useGrouping: true,\n maximumFractionDigits: decimalLimit || 0,\n minimumFractionDigits: decimalLimit || 0\n }).replace('.', decimalSeparator).match(new RegExp(regex));\n return {\n prefix: (parts === null || parts === void 0 ? void 0 : parts[1]) || '',\n suffix: (parts === null || parts === void 0 ? void 0 : parts[2]) || ''\n };\n}\nexports.getCurrencyAffixes = getCurrencyAffixes;\n/**\n * Fetch the field data provided a component.\n * @param {import('@formio/core').DataObject} data - The data object to fetch the field data from.\n * @param {import('@formio/core').Component} component - The component to fetch the field data for.\n * @returns {*} - The field data.\n */\nfunction fieldData(data, component) {\n if (!data) {\n return '';\n }\n if (!component || !component.key) {\n return data;\n }\n if (component.key.includes('.')) {\n let value = data;\n const parts = component.key.split('.');\n let key = '';\n for (let i = 0; i < parts.length; i++) {\n key = parts[i];\n // Handle nested resources\n if (value.hasOwnProperty('_id')) {\n value = value.data;\n }\n // Return if the key is not found on the value.\n if (!value.hasOwnProperty(key)) {\n return;\n }\n // Convert old single field data in submissions to multiple\n if (key === parts[parts.length - 1] && component.multiple && !Array.isArray(value[key])) {\n value[key] = [value[key]];\n }\n // Set the value of this key.\n value = value[key];\n }\n return value;\n }\n else {\n // Convert old single field data in submissions to multiple\n if (component.multiple && !Array.isArray(data[component.key])) {\n data[component.key] = [data[component.key]];\n }\n // Fix for checkbox type radio submission values in tableView\n if (component.type === 'checkbox' && component.inputType === 'radio') {\n return data[component.name] === component.value;\n }\n return data[component.key];\n }\n}\nexports.fieldData = fieldData;\n/**\n * Delays function execution with possibility to execute function synchronously or cancel it.\n * @param {Function} fn - Function to delay\n * @param {number} delay - Delay time\n * @param {...any} args - Arguments to pass to the function\n * @returns {*} - Function to cancel the delay\n */\nfunction delay(fn, delay = 0, ...args) {\n const timer = setTimeout(fn, delay, ...args);\n /**\n *\n */\n function cancel() {\n clearTimeout(timer);\n }\n /**\n * Execute the function early.\n * @returns {*} - The result of the function.\n */\n function earlyCall() {\n cancel();\n return fn(...args);\n }\n earlyCall.timer = timer;\n earlyCall.cancel = cancel;\n return earlyCall;\n}\nexports.delay = delay;\n/**\n * Iterate the given key to make it unique.\n * @param {string} key\n * Modify the component key to be unique.\n * @returns {string}\n * The new component key.\n */\nfunction iterateKey(key) {\n if (!key.match(/(\\d+)$/)) {\n return `${key}1`;\n }\n return key.replace(/(\\d+)$/, function (suffix) {\n return Number(suffix) + 1;\n });\n}\nexports.iterateKey = iterateKey;\n/**\n * Determines a unique key within a map provided the base key.\n * @param map\n * @param base\n * @returns {*}\n */\nfunction uniqueKey(map, base) {\n let newKey = base;\n while (map.hasOwnProperty(newKey)) {\n newKey = iterateKey(newKey);\n }\n return newKey;\n}\nexports.uniqueKey = uniqueKey;\n/**\n * Determines the major version number of bootstrap.\n * @param options\n * @returns {number}\n */\nfunction bootstrapVersion(options) {\n if (options.bootstrap) {\n return options.bootstrap;\n }\n if ((typeof jQuery === 'function') && (typeof jQuery().collapse === 'function')) {\n return parseInt(jQuery.fn.collapse.Constructor.VERSION.split('.')[0], 10);\n }\n if (window.bootstrap && window.bootstrap.Collapse) {\n return parseInt(window.bootstrap.Collapse.VERSION.split('.')[0], 10);\n }\n return 0;\n}\nexports.bootstrapVersion = bootstrapVersion;\n/**\n * Retrun provided argument.\n * If argument is a function, returns the result of a function call.\n * @param {*} e;\n * @param e\n * @returns {*}\n */\nfunction unfold(e) {\n if (typeof e === 'function') {\n return e();\n }\n return e;\n}\nexports.unfold = unfold;\n/**\n * Map values through unfold and return first non-nil value.\n * @param {Array<T>} collection;\n * @returns {T}\n */\nexports.firstNonNil = lodash_1.default.flow([\n lodash_1.default.partialRight(lodash_1.default.map, unfold),\n lodash_1.default.partialRight(lodash_1.default.find, v => !lodash_1.default.isUndefined(v))\n]);\n/*\n * Create enclosed state.\n * Returns functions to getting and cycling between states.\n * @param {*} a - initial state.\n * @param {*} b - next state.\n * @return {Functions[]} -- [get, toggle];\n */\n/**\n *\n * @param a\n * @param b\n */\nfunction withSwitch(a, b) {\n let state = a;\n let next = b;\n /**\n *\n */\n function get() {\n return state;\n }\n /**\n *\n */\n function toggle() {\n const prev = state;\n state = next;\n next = prev;\n }\n return [get, toggle];\n}\nexports.withSwitch = withSwitch;\n/**\n *\n * @param callback\n * @param options\n */\nfunction observeOverload(callback, options = {}) {\n const { limit = 50, delay = 500 } = options;\n let callCount = 0;\n let timeoutID = 0;\n const reset = () => callCount = 0;\n return () => {\n if (timeoutID !== 0) {\n clearTimeout(timeoutID);\n timeoutID = 0;\n }\n timeoutID = setTimeout(reset, delay);\n callCount += 1;\n if (callCount >= limit) {\n clearTimeout(timeoutID);\n reset();\n return callback();\n }\n };\n}\nexports.observeOverload = observeOverload;\n/**\n *\n * @param context\n * @param excludeNested\n * @param excludedTypes\n */\nfunction getContextComponents(context, excludeNested = false, excludedTypes = []) {\n const values = [];\n context.utils.eachComponent(context.instance.options.editForm.components, (component, path) => {\n const addToContextComponents = excludeNested ? !component.tree : true;\n if (component.key !== context.data.key && addToContextComponents && !lodash_1.default.includes(excludedTypes, component.type)) {\n values.push({\n label: `${component.label || component.key} (${path})`,\n value: path,\n });\n }\n });\n return values;\n}\nexports.getContextComponents = getContextComponents;\n/**\n *\n * @param context\n */\nfunction getContextButtons(context) {\n const values = [];\n context.utils.eachComponent(context.instance.options.editForm.components, (component) => {\n if (component.type === 'button') {\n values.push({\n label: `${component.key} (${component.label})`,\n value: component.key,\n });\n }\n });\n return values;\n}\nexports.getContextButtons = getContextButtons;\n// Tags that could be in text, that should be ommited or handled in a special way\nconst inTextTags = ['#text', 'A', 'B', 'EM', 'I', 'SMALL', 'STRONG', 'SUB', 'SUP', 'INS', 'DEL', 'MARK', 'CODE'];\n/**\n * Helper function for 'translateHTMLTemplate'. Translates text value of the passed html element.\n * @param {HTMLElement} elem\n * @param {Function} translate\n * @returns {string}\n * Translated element template.\n */\nfunction translateElemValue(elem, translate) {\n if (!elem.innerText) {\n return elem.innerHTML;\n }\n const elemValue = elem.innerText.replace(Evaluator_1.Evaluator.templateSettings.interpolate, '').replace(/\\s\\s+/g, ' ').trim();\n const translatedValue = translate(elemValue);\n if (elemValue !== translatedValue) {\n const links = elem.innerHTML.match(/<a[^>]*>(.*?)<\\/a>/g);\n if (links && links.length) {\n if (links.length === 1 && links[0].length === elem.innerHTML.length) {\n return elem.innerHTML.replace(elemValue, translatedValue);\n }\n const translatedLinks = links.map(link => {\n const linkElem = document.createElement('a');\n linkElem.innerHTML = link;\n return translateElemValue(linkElem, translate);\n });\n return `${translatedValue} (${translatedLinks.join(', ')})`;\n }\n else {\n return elem.innerText.replace(elemValue, translatedValue);\n }\n }\n else {\n return elem.innerHTML;\n }\n}\n/**\n * Helper function for 'translateHTMLTemplate'. Goes deep through html tag children and calls function to translate their text values.\n * @param {HTMLElement} tag\n * @param {Function} translate\n * @returns {void}\n */\nfunction translateDeepTag(tag, translate) {\n const children = tag.children.length && [...tag.children];\n const shouldTranslateEntireContent = children && children.every(child => child.children.length === 0\n && inTextTags.some(tag => child.nodeName === tag));\n if (!children || shouldTranslateEntireContent) {\n tag.innerHTML = translateElemValue(tag, translate);\n }\n else {\n children.forEach(child => translateDeepTag(child, translate));\n }\n}\n/**\n * Translates text values in html template.\n * @param {string} template\n * @param {Function} translate\n * @returns {string}\n * Html template with translated values.\n */\nfunction translateHTMLTemplate(template, translate) {\n const isHTML = /<[^>]*>/.test(template);\n if (!isHTML) {\n return translate(template);\n }\n const tempElem = document.createElement('div');\n tempElem.innerHTML = template;\n if (tempElem.innerText && tempElem.children.length) {\n translateDeepTag(tempElem, translate);\n return tempElem.innerHTML;\n }\n return template;\n}\nexports.translateHTMLTemplate = translateHTMLTemplate;\n/**\n * Sanitize an html string.\n * @param string\n * @param options\n * @returns {*}\n */\nfunction sanitize(string, options) {\n if (typeof dompurify_1.default.sanitize !== 'function') {\n return string;\n }\n // Dompurify configuration\n const sanitizeOptions = {\n ADD_ATTR: ['ref', 'target'],\n USE_PROFILES: { html: true }\n };\n // Use profiles\n if (options.sanitizeConfig && options.sanitizeConfig.useProfiles) {\n Object.keys(options.sanitizeConfig.useProfiles).forEach(key => {\n sanitizeOptions.USE_PROFILES[key] = options.sanitizeConfig.useProfiles[key];\n });\n }\n // Add attrs\n if (options.sanitizeConfig && Array.isArray(options.sanitizeConfig.addAttr) && options.sanitizeConfig.addAttr.length > 0) {\n options.sanitizeConfig.addAttr.forEach((attr) => {\n sanitizeOptions.ADD_ATTR.push(attr);\n });\n }\n // Add tags\n if (options.sanitizeConfig && Array.isArray(options.sanitizeConfig.addTags) && options.sanitizeConfig.addTags.length > 0) {\n sanitizeOptions.ADD_TAGS = options.sanitizeConfig.addTags;\n }\n // Allow tags\n if (options.sanitizeConfig && Array.isArray(options.sanitizeConfig.allowedTags) && options.sanitizeConfig.allowedTags.length > 0) {\n sanitizeOptions.ALLOWED_TAGS = options.sanitizeConfig.allowedTags;\n }\n // Allow attributes\n if (options.sanitizeConfig && Array.isArray(options.sanitizeConfig.allowedAttrs) && options.sanitizeConfig.allowedAttrs.length > 0) {\n sanitizeOptions.ALLOWED_ATTR = options.sanitizeConfig.allowedAttrs;\n }\n // Allowd URI Regex\n if (options.sanitizeConfig && options.sanitizeConfig.allowedUriRegex) {\n const allowedUriRegex = options.sanitizeConfig.allowedUriRegex;\n sanitizeOptions.ALLOWED_URI_REGEXP = lodash_1.default.isString(allowedUriRegex) ? new RegExp(allowedUriRegex) : allowedUriRegex;\n }\n // Allow to extend the existing array of elements that are safe for URI-like values\n if (options.sanitizeConfig && Array.isArray(options.sanitizeConfig.addUriSafeAttr) && options.sanitizeConfig.addUriSafeAttr.length > 0) {\n sanitizeOptions.ADD_URI_SAFE_ATTR = options.sanitizeConfig.addUriSafeAttr;\n }\n return dompurify_1.default.sanitize(string, sanitizeOptions);\n}\nexports.sanitize = sanitize;\n/**\n * Fast cloneDeep for JSON objects only.\n * @param obj\n */\nfunction fastCloneDeep(obj) {\n return obj ? JSON.parse(JSON.stringify(obj)) : obj;\n}\nexports.fastCloneDeep = fastCloneDeep;\n/**\n *\n * @param componentJson\n */\nfunction isInputComponent(componentJson) {\n if (componentJson.input === false || componentJson.input === true) {\n return componentJson.input;\n }\n switch (componentJson.type) {\n case 'htmlelement':\n case 'content':\n case 'columns':\n case 'fieldset':\n case 'panel':\n case 'table':\n case 'tabs':\n case 'well':\n case 'button':\n return false;\n default:\n return true;\n }\n}\nexports.isInputComponent = isInputComponent;\n/**\n *\n * @param pathStr\n */\nfunction getArrayFromComponentPath(pathStr) {\n if (!pathStr || !lodash_1.default.isString(pathStr)) {\n if (!lodash_1.default.isArray(pathStr)) {\n return [pathStr];\n }\n return pathStr;\n }\n return pathStr.replace(/[[\\]]/g, '.')\n .replace(/\\.\\./g, '.')\n .replace(/(^\\.)|(\\.$)/g, '')\n .split('.')\n .map(part => lodash_1.default.defaultTo(lodash_1.default.toNumber(part), part));\n}\nexports.getArrayFromComponentPath = getArrayFromComponentPath;\n/**\n *\n * @param child\n * @param parent\n */\nfunction isChildOf(child, parent) {\n while (child && child.parent) {\n if (child.parent === parent) {\n return true;\n }\n child = child.parent;\n }\n return false;\n}\nexports.isChildOf = isChildOf;\n/**\n *\n * @param path\n */\nfunction getStringFromComponentPath(path) {\n if (!lodash_1.default.isArray(path)) {\n return path;\n }\n let strPath = '';\n path.forEach((part, i) => {\n if (lodash_1.default.isNumber(part)) {\n strPath += `[${part}]`;\n }\n else {\n strPath += i === 0 ? part : `.${part}`;\n }\n });\n return strPath;\n}\nexports.getStringFromComponentPath = getStringFromComponentPath;\n/**\n *\n * @param number\n * @param precision\n */\nfunction round(number, precision) {\n if (lodash_1.default.isNumber(number)) {\n return number.toFixed(precision);\n }\n return number;\n}\nexports.round = round;\n/**\n * Check for Internet Explorer browser version\n * @returns {(number|null)}\n */\nfunction getIEBrowserVersion() {\n const { ie, version } = getBrowserInfo();\n return ie ? version : null;\n}\nexports.getIEBrowserVersion = getIEBrowserVersion;\n/**\n * Get browser name and version (modified from 'jquery-browser-plugin')\n * @returns {object} -- {{browser name, version, isWebkit?}}\n * Possible browser names: chrome, safari, ie, edge, opera, mozilla, yabrowser\n */\nfunction getBrowserInfo() {\n const browser = {};\n if (typeof window === 'undefined') {\n return browser;\n }\n const ua = window.navigator.userAgent.toLowerCase();\n const match = /(edge|edg)\\/([\\w.]+)/.exec(ua) ||\n /(opr)[/]([\\w.]+)/.exec(ua) ||\n /(yabrowser)[ /]([\\w.]+)/.exec(ua) ||\n /(chrome)[ /]([\\w.]+)/.exec(ua) ||\n /(iemobile)[/]([\\w.]+)/.exec(ua) ||\n /(version)(applewebkit)[ /]([\\w.]+).*(safari)[ /]([\\w.]+)/.exec(ua) ||\n /(webkit)[ /]([\\w.]+).*(version)[ /]([\\w.]+).*(safari)[ /]([\\w.]+)/.exec(ua) ||\n /(webkit)[ /]([\\w.]+)/.exec(ua) ||\n /(opera)(?:.*version|)[ /]([\\w.]+)/.exec(ua) ||\n /(msie) ([\\w.]+)/.exec(ua) ||\n ua.indexOf('trident') >= 0 && /(rv)(?::| )([\\w.]+)/.exec(ua) ||\n ua.indexOf('compatible') < 0 && /(mozilla)(?:.*? rv:([\\w.]+)|)/.exec(ua) ||\n [];\n const matched = {\n browser: match[5] || match[3] || match[1] || '',\n version: match[4] || match[2] || '0'\n };\n if (matched.browser) {\n browser[matched.browser] = true;\n browser.version = parseInt(matched.version, 10);\n }\n // Chrome, Opera 15+, Safari and Yandex.Browser are webkit based browsers\n if (browser.chrome || browser.opr || browser.safari || browser.edg || browser.yabrowser) {\n browser.isWebkit = true;\n }\n // IE11 has a new token so we will assign it ie to avoid breaking changes\n if (browser.rv || browser.iemobile) {\n browser.ie = true;\n }\n // Edge has a new token since it became webkit based\n if (browser.edg) {\n browser.edge = true;\n }\n // Opera 15+ are identified as opr\n if (browser.opr) {\n browser.opera = true;\n }\n return browser;\n}\nexports.getBrowserInfo = getBrowserInfo;\n/**\n *\n * @param path\n */\nfunction getComponentPathWithoutIndicies(path = '') {\n return path.replace(/\\[\\d+\\]/, '');\n}\nexports.getComponentPathWithoutIndicies = getComponentPathWithoutIndicies;\n/**\n * Returns a path to the component which based on its schema\n * @param {*} component is a component's schema containing link to its parent's schema in the 'parent' property\n * @param path\n */\nfunction getComponentPath(component, path = '') {\n var _a;\n if (!component || !component.key || ((_a = component === null || component === void 0 ? void 0 : component._form) === null || _a === void 0 ? void 0 : _a.display) === 'wizard') { // unlike the Webform, the Wizard has the key and it is a duplicate of the panel key\n return path;\n }\n path = component.isInputComponent || component.input === true ? `${component.key}${path ? '.' : ''}${path}` : path;\n return getComponentPath(component.parent, path);\n}\nexports.getComponentPath = getComponentPath;\n/**\n * Returns a parent component of the passed component instance skipping all the Layout components\n * @param {*} componentInstance\n * @returns {(Component|undefined)}\n */\nfunction getDataParentComponent(componentInstance) {\n if (!componentInstance) {\n return;\n }\n const { parent } = componentInstance;\n if (parent && (parent.isInputComponent || parent.input)) {\n return parent;\n }\n else {\n return getDataParentComponent(parent);\n }\n}\nexports.getDataParentComponent = getDataParentComponent;\n/**\n * Returns whether the value is a promise\n * @param value\n * @returns {boolean}\n */\nfunction isPromise(value) {\n return value\n && value.then\n && typeof value.then === 'function'\n && Object.prototype.toString.call(value) === '[object Promise]';\n}\nexports.isPromise = isPromise;\n/**\n * Determines if the component has a scoping parent in tree (a component which scopes its children and manages its\n * changes by itself, e.g. EditGrid)\n * @param componentInstance\n * @param firstPass\n * @returns {boolean|boolean|*}\n */\nfunction isInsideScopingComponent(componentInstance, firstPass = true) {\n if (!firstPass && (componentInstance === null || componentInstance === void 0 ? void 0 : componentInstance.hasScopedChildren)) {\n return true;\n }\n const dataParent = getDataParentComponent(componentInstance);\n if (dataParent === null || dataParent === void 0 ? void 0 : dataParent.hasScopedChildren) {\n return true;\n }\n else if (dataParent === null || dataParent === void 0 ? void 0 : dataParent.parent) {\n return isInsideScopingComponent(dataParent.parent, false);\n }\n return false;\n}\nexports.isInsideScopingComponent = isInsideScopingComponent;\n/**\n *\n * @param element\n */\nfunction getFocusableElements(element) {\n const focusableSelector = `button:not([disabled]), input:not([disabled]), select:not([disabled]),\n textarea:not([disabled]), button:not([disabled]), [href]`;\n return element.querySelectorAll(focusableSelector);\n}\nexports.getFocusableElements = getFocusableElements;\nexports.componentValueTypes = {\n number: 'number',\n string: 'string',\n boolean: 'boolean',\n array: 'array',\n object: 'object',\n date: 'date',\n any: 'any',\n};\n/**\n *\n * @param fullSchema\n */\nfunction getComponentSavedTypes(fullSchema) {\n const schema = fullSchema || {};\n if (schema.persistent !== true) {\n return [];\n }\n if (schema.multiple) {\n return [exports.componentValueTypes.array];\n }\n return null;\n}\nexports.getComponentSavedTypes = getComponentSavedTypes;\n/**\n * Interpolates @formio/core errors so that they are compatible with the renderer\n * @param component\n * @param {FieldError[]} errors\n * @param firstPass\n * @param interpolateFn\n * @returns {[]}\n */\nconst interpolateErrors = (component, errors, interpolateFn) => {\n return errors.map((error) => {\n error.component = component;\n const { errorKeyOrMessage, context } = error;\n const toInterpolate = component.errors && component.errors[errorKeyOrMessage] ? component.errors[errorKeyOrMessage] : errorKeyOrMessage;\n return Object.assign(Object.assign({}, error), { message: unescapeHTML(interpolateFn(toInterpolate, context)), context: Object.assign({}, context) });\n });\n};\nexports.interpolateErrors = interpolateErrors;\n/**\n *\n * @param template\n */\nfunction getItemTemplateKeys(template) {\n const templateKeys = [];\n if (!template) {\n return templateKeys;\n }\n const keys = template.match(/({{\\s*(.*?)\\s*}})/g);\n if (keys) {\n keys.forEach((key) => {\n const propKey = key.match(/{{\\s*item\\.(.*?)\\s*}}/);\n if (propKey && propKey.length > 1) {\n templateKeys.push(propKey[1]);\n }\n });\n }\n return templateKeys;\n}\nexports.getItemTemplateKeys = getItemTemplateKeys;\n/**\n *\n * @param comp\n */\nfunction isSelectResourceWithObjectValue(comp = {}) {\n const { reference, dataSrc, valueProperty } = comp;\n return reference || (dataSrc === 'resource' && (!valueProperty || valueProperty === 'data'));\n}\nexports.isSelectResourceWithObjectValue = isSelectResourceWithObjectValue;\n\n\n//# sourceURL=webpack://Formio/./lib/cjs/utils/utils.js?");
|
3644
3484
|
|
3645
3485
|
/***/ }),
|
3646
3486
|
|