@jjrawlins/cdk-diff-pr-github-action 1.1.4 → 1.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/.jsii +4 -4
  2. package/lib/CdkDiffIamTemplate.js +2 -2
  3. package/lib/CdkDiffIamTemplateStackSet.js +2 -2
  4. package/lib/CdkDiffStackWorkflow.js +1 -1
  5. package/lib/CdkDriftDetectionWorkflow.js +1 -1
  6. package/lib/CdkDriftIamTemplate.js +2 -2
  7. package/node_modules/@aws-sdk/client-cloudformation/package.json +6 -6
  8. package/node_modules/@aws-sdk/client-sso/package.json +5 -5
  9. package/node_modules/@aws-sdk/core/package.json +2 -2
  10. package/node_modules/@aws-sdk/credential-provider-env/package.json +2 -2
  11. package/node_modules/@aws-sdk/credential-provider-http/package.json +2 -2
  12. package/node_modules/@aws-sdk/credential-provider-ini/package.json +9 -9
  13. package/node_modules/@aws-sdk/credential-provider-login/package.json +3 -3
  14. package/node_modules/@aws-sdk/credential-provider-node/package.json +7 -7
  15. package/node_modules/@aws-sdk/credential-provider-process/package.json +2 -2
  16. package/node_modules/@aws-sdk/credential-provider-sso/package.json +4 -4
  17. package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +3 -3
  18. package/node_modules/@aws-sdk/middleware-user-agent/package.json +3 -3
  19. package/node_modules/@aws-sdk/nested-clients/package.json +5 -5
  20. package/node_modules/@aws-sdk/token-providers/package.json +3 -3
  21. package/node_modules/@aws-sdk/util-endpoints/package.json +1 -1
  22. package/node_modules/@aws-sdk/util-user-agent-node/package.json +2 -2
  23. package/node_modules/@aws-sdk/xml-builder/package.json +3 -3
  24. package/node_modules/@smithy/core/package.json +2 -2
  25. package/node_modules/@smithy/middleware-endpoint/package.json +2 -2
  26. package/node_modules/@smithy/middleware-retry/package.json +2 -2
  27. package/node_modules/@smithy/node-http-handler/dist-cjs/index.js +2 -2
  28. package/node_modules/@smithy/node-http-handler/dist-es/node-http-handler.js +2 -2
  29. package/node_modules/@smithy/node-http-handler/package.json +5 -5
  30. package/node_modules/@smithy/smithy-client/package.json +4 -4
  31. package/node_modules/@smithy/util-defaults-mode-browser/package.json +2 -2
  32. package/node_modules/@smithy/util-defaults-mode-node/package.json +2 -2
  33. package/node_modules/@smithy/util-stream/package.json +6 -6
  34. package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/CHANGELOG.md +16 -0
  35. package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/README.md +7 -6
  36. package/node_modules/fast-xml-parser/lib/fxp.cjs +1 -0
  37. package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/lib/fxp.d.cts +1 -1
  38. package/node_modules/fast-xml-parser/lib/fxp.min.js +2 -0
  39. package/node_modules/fast-xml-parser/lib/fxp.min.js.map +1 -0
  40. package/node_modules/fast-xml-parser/lib/fxparser.min.js +2 -0
  41. package/node_modules/fast-xml-parser/lib/fxparser.min.js.map +1 -0
  42. package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/package.json +4 -2
  43. package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/fxp.d.ts +2 -2
  44. package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/OutputBuilders/JsMinArrBuilder.js +1 -1
  45. package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/OutputBuilders/ParserOptionsBuilder.js +4 -4
  46. package/node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js +379 -0
  47. package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/xmlparser/OrderedObjParser.js +55 -22
  48. package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/xmlparser/XMLParser.js +4 -4
  49. package/package.json +3 -3
  50. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxp.cjs +0 -1
  51. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxp.min.js +0 -2
  52. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxp.min.js.map +0 -1
  53. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxparser.min.js +0 -2
  54. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/lib/fxparser.min.js.map +0 -1
  55. package/node_modules/@aws-sdk/xml-builder/node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js +0 -369
  56. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/LICENSE +0 -0
  57. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/lib/fxbuilder.min.js +0 -0
  58. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/lib/fxbuilder.min.js.map +0 -0
  59. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/lib/fxvalidator.min.js +0 -0
  60. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/lib/fxvalidator.min.js.map +0 -0
  61. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/cli/cli.js +0 -0
  62. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/cli/man.js +0 -0
  63. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/cli/read.js +0 -0
  64. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/fxp.js +0 -0
  65. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/ignoreAttributes.js +0 -0
  66. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/util.js +0 -0
  67. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/CharsSymbol.js +0 -0
  68. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/EntitiesParser.js +0 -0
  69. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/OptionsBuilder.js +0 -0
  70. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/OutputBuilders/BaseOutputBuilder.js +0 -0
  71. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/OutputBuilders/JsArrBuilder.js +0 -0
  72. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/OutputBuilders/JsObjBuilder.js +0 -0
  73. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/Report.js +0 -0
  74. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/TagPath.js +0 -0
  75. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/TagPathMatcher.js +0 -0
  76. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/XMLParser.js +0 -0
  77. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/Xml2JsParser.js +0 -0
  78. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/XmlPartReader.js +0 -0
  79. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/XmlSpecialTagsReader.js +0 -0
  80. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/inputSource/BufferSource.js +0 -0
  81. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/inputSource/StringSource.js +0 -0
  82. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/valueParsers/EntitiesParser.js +0 -0
  83. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/valueParsers/booleanParser.js +0 -0
  84. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/valueParsers/booleanParserExt.js +0 -0
  85. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/valueParsers/currency.js +0 -0
  86. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/valueParsers/join.js +0 -0
  87. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/valueParsers/number.js +0 -0
  88. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/v6/valueParsers/trim.js +0 -0
  89. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/validator.js +0 -0
  90. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/xmlbuilder/json2xml.js +0 -0
  91. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/xmlbuilder/orderedJs2Xml.js +0 -0
  92. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/xmlbuilder/prettifyJs2Xml.js +0 -0
  93. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/xmlparser/OptionsBuilder.js +0 -0
  94. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/xmlparser/node2json.js +0 -0
  95. /package/node_modules/{@aws-sdk/xml-builder/node_modules/fast-xml-parser → fast-xml-parser}/src/xmlparser/xmlNode.js +0 -0
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@aws-sdk/xml-builder",
3
- "version": "3.972.2",
4
- "description": "XML builder for the AWS SDK",
3
+ "version": "3.972.4",
4
+ "description": "XML utilities for the AWS SDK",
5
5
  "dependencies": {
6
6
  "@smithy/types": "^4.12.0",
7
- "fast-xml-parser": "5.2.5",
7
+ "fast-xml-parser": "5.3.4",
8
8
  "tslib": "^2.6.2"
9
9
  },
10
10
  "scripts": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/core",
3
- "version": "3.22.0",
3
+ "version": "3.22.1",
4
4
  "scripts": {
5
5
  "build": "yarn lint && concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
6
6
  "build:cjs": "node ../../scripts/inline core",
@@ -85,7 +85,7 @@
85
85
  "@smithy/util-base64": "^4.3.0",
86
86
  "@smithy/util-body-length-browser": "^4.2.0",
87
87
  "@smithy/util-middleware": "^4.2.8",
88
- "@smithy/util-stream": "^4.5.10",
88
+ "@smithy/util-stream": "^4.5.11",
89
89
  "@smithy/util-utf8": "^4.2.0",
90
90
  "@smithy/uuid": "^1.1.0",
91
91
  "tslib": "^2.6.2"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/middleware-endpoint",
3
- "version": "4.4.12",
3
+ "version": "4.4.13",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
6
6
  "build:cjs": "node ../../scripts/inline middleware-endpoint",
@@ -25,7 +25,7 @@
25
25
  "license": "Apache-2.0",
26
26
  "sideEffects": false,
27
27
  "dependencies": {
28
- "@smithy/core": "^3.22.0",
28
+ "@smithy/core": "^3.22.1",
29
29
  "@smithy/middleware-serde": "^4.2.9",
30
30
  "@smithy/node-config-provider": "^4.3.8",
31
31
  "@smithy/shared-ini-file-loader": "^4.4.3",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/middleware-retry",
3
- "version": "4.4.29",
3
+ "version": "4.4.30",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
6
6
  "build:cjs": "node ../../scripts/inline middleware-retry",
@@ -37,7 +37,7 @@
37
37
  "@smithy/node-config-provider": "^4.3.8",
38
38
  "@smithy/protocol-http": "^5.3.8",
39
39
  "@smithy/service-error-classification": "^4.2.8",
40
- "@smithy/smithy-client": "^4.11.1",
40
+ "@smithy/smithy-client": "^4.11.2",
41
41
  "@smithy/types": "^4.12.0",
42
42
  "@smithy/util-middleware": "^4.2.8",
43
43
  "@smithy/util-retry": "^4.2.8",
@@ -231,7 +231,7 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
231
231
  });
232
232
  }
233
233
  resolveDefaultConfig(options) {
234
- const { requestTimeout, connectionTimeout, socketTimeout, socketAcquisitionWarningTimeout, httpAgent, httpsAgent, throwOnRequestTimeout, } = options || {};
234
+ const { requestTimeout, connectionTimeout, socketTimeout, socketAcquisitionWarningTimeout, httpAgent, httpsAgent, throwOnRequestTimeout, logger, } = options || {};
235
235
  const keepAlive = true;
236
236
  const maxSockets = 50;
237
237
  return {
@@ -254,7 +254,7 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
254
254
  }
255
255
  return new https.Agent({ keepAlive, maxSockets, ...httpsAgent });
256
256
  })(),
257
- logger: console,
257
+ logger,
258
258
  };
259
259
  }
260
260
  destroy() {
@@ -61,7 +61,7 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
61
61
  });
62
62
  }
63
63
  resolveDefaultConfig(options) {
64
- const { requestTimeout, connectionTimeout, socketTimeout, socketAcquisitionWarningTimeout, httpAgent, httpsAgent, throwOnRequestTimeout, } = options || {};
64
+ const { requestTimeout, connectionTimeout, socketTimeout, socketAcquisitionWarningTimeout, httpAgent, httpsAgent, throwOnRequestTimeout, logger, } = options || {};
65
65
  const keepAlive = true;
66
66
  const maxSockets = 50;
67
67
  return {
@@ -84,7 +84,7 @@ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler conf
84
84
  }
85
85
  return new hsAgent({ keepAlive, maxSockets, ...httpsAgent });
86
86
  })(),
87
- logger: console,
87
+ logger,
88
88
  };
89
89
  }
90
90
  destroy() {
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@smithy/node-http-handler",
3
- "version": "4.4.8",
3
+ "version": "4.4.9",
4
4
  "description": "Provides a way to make requests",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
7
7
  "build:cjs": "node ../../scripts/inline node-http-handler",
8
8
  "build:es": "yarn g:tsc -p tsconfig.es.json",
9
9
  "build:types": "yarn g:tsc -p tsconfig.types.json",
10
- "build:types:downlevel": "rimraf dist-types/ts3.4 && downlevel-dts dist-types dist-types/ts3.4",
11
- "stage-release": "rimraf ./.release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz",
12
- "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo || exit 0",
10
+ "build:types:downlevel": "premove dist-types/ts3.4 && downlevel-dts dist-types dist-types/ts3.4",
11
+ "stage-release": "premove .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz",
12
+ "clean": "premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo",
13
13
  "lint": "eslint -c ../../.eslintrc.js \"src/**/*.ts\"",
14
14
  "format": "prettier --config ../../prettier.config.js --ignore-path ../../.prettierignore --write \"**/*.{ts,md,json}\"",
15
15
  "extract:docs": "api-extractor run --local",
@@ -37,7 +37,7 @@
37
37
  "@types/node": "^18.11.9",
38
38
  "concurrently": "7.0.0",
39
39
  "downlevel-dts": "0.10.1",
40
- "rimraf": "5.0.10",
40
+ "premove": "4.0.0",
41
41
  "typedoc": "0.23.23"
42
42
  },
43
43
  "engines": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/smithy-client",
3
- "version": "4.11.1",
3
+ "version": "4.11.2",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
6
6
  "build:cjs": "node ../../scripts/inline smithy-client",
@@ -25,12 +25,12 @@
25
25
  "license": "Apache-2.0",
26
26
  "sideEffects": false,
27
27
  "dependencies": {
28
- "@smithy/core": "^3.22.0",
29
- "@smithy/middleware-endpoint": "^4.4.12",
28
+ "@smithy/core": "^3.22.1",
29
+ "@smithy/middleware-endpoint": "^4.4.13",
30
30
  "@smithy/middleware-stack": "^4.2.8",
31
31
  "@smithy/protocol-http": "^5.3.8",
32
32
  "@smithy/types": "^4.12.0",
33
- "@smithy/util-stream": "^4.5.10",
33
+ "@smithy/util-stream": "^4.5.11",
34
34
  "tslib": "^2.6.2"
35
35
  },
36
36
  "engines": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/util-defaults-mode-browser",
3
- "version": "4.3.28",
3
+ "version": "4.3.29",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
6
6
  "build:cjs": "node ../../scripts/inline util-defaults-mode-browser",
@@ -25,7 +25,7 @@
25
25
  "sideEffects": false,
26
26
  "dependencies": {
27
27
  "@smithy/property-provider": "^4.2.8",
28
- "@smithy/smithy-client": "^4.11.1",
28
+ "@smithy/smithy-client": "^4.11.2",
29
29
  "@smithy/types": "^4.12.0",
30
30
  "tslib": "^2.6.2"
31
31
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithy/util-defaults-mode-node",
3
- "version": "4.2.31",
3
+ "version": "4.2.32",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
6
6
  "build:cjs": "node ../../scripts/inline util-defaults-mode-node",
@@ -28,7 +28,7 @@
28
28
  "@smithy/credential-provider-imds": "^4.2.8",
29
29
  "@smithy/node-config-provider": "^4.3.8",
30
30
  "@smithy/property-provider": "^4.2.8",
31
- "@smithy/smithy-client": "^4.11.1",
31
+ "@smithy/smithy-client": "^4.11.2",
32
32
  "@smithy/types": "^4.12.0",
33
33
  "tslib": "^2.6.2"
34
34
  },
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@smithy/util-stream",
3
- "version": "4.5.10",
3
+ "version": "4.5.11",
4
4
  "scripts": {
5
5
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
6
6
  "build:cjs": "node ../../scripts/inline util-stream",
7
7
  "build:es": "yarn g:tsc -p tsconfig.es.json",
8
8
  "build:types": "yarn g:tsc -p tsconfig.types.json",
9
- "build:types:downlevel": "rimraf dist-types/ts3.4 && downlevel-dts dist-types dist-types/ts3.4",
10
- "stage-release": "rimraf ./.release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz",
11
- "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo || exit 0",
9
+ "build:types:downlevel": "premove dist-types/ts3.4 && downlevel-dts dist-types dist-types/ts3.4",
10
+ "stage-release": "premove .release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz",
11
+ "clean": "premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo",
12
12
  "lint": "eslint -c ../../.eslintrc.js \"src/**/*.ts\"",
13
13
  "format": "prettier --config ../../prettier.config.js --ignore-path ../../.prettierignore --write \"**/*.{ts,md,json}\"",
14
14
  "extract:docs": "api-extractor run --local",
@@ -30,7 +30,7 @@
30
30
  "sideEffects": false,
31
31
  "dependencies": {
32
32
  "@smithy/fetch-http-handler": "^5.3.9",
33
- "@smithy/node-http-handler": "^4.4.8",
33
+ "@smithy/node-http-handler": "^4.4.9",
34
34
  "@smithy/types": "^4.12.0",
35
35
  "@smithy/util-base64": "^4.3.0",
36
36
  "@smithy/util-buffer-from": "^4.2.0",
@@ -43,7 +43,7 @@
43
43
  "@types/node": "^18.11.9",
44
44
  "concurrently": "7.0.0",
45
45
  "downlevel-dts": "0.10.1",
46
- "rimraf": "5.0.10",
46
+ "premove": "4.0.0",
47
47
  "typedoc": "0.23.23"
48
48
  },
49
49
  "engines": {
@@ -1,5 +1,21 @@
1
1
  <small>Note: If you find missing information about particular minor version, that version must have been changed without any functional change in this library.</small>
2
2
 
3
+ **5.3.4 / 2026-01-30**
4
+ - fix: handle HTML numeric and hex entities when out of range
5
+
6
+
7
+ **5.3.3 / 2025-12-12**
8
+ - fix #775: transformTagName with allowBooleanAttributes adds an unnecessary attribute
9
+
10
+ **5.3.2 / 2025-11-14**
11
+ - fix for import statement for v6
12
+
13
+ **5.3.1 / 2025-11-03**
14
+ - Performance improvement for stopNodes (By [Maciek Lamberski](https://github.com/macieklamberski))
15
+
16
+ **5.3.0 / 2025-10-03**
17
+ - Use `Uint8Array` in place of `Buffer` in Parser
18
+
3
19
  **5.2.5 / 2025-06-08**
4
20
  - Inform user to use [fxp-cli](https://github.com/NaturalIntelligence/fxp-cli) instead of in-built CLI feature
5
21
  - Export typings for direct use
@@ -7,7 +7,7 @@ Validate XML, Parse XML to JS Object, or Build XML from JS Object without C/C++
7
7
  <img align="right" src="static/img/fxp_logo.png" width="180px" alt="FXP logo"/>
8
8
 
9
9
  * Validate XML data syntactically. Use [detailed-xml-validator](https://github.com/NaturalIntelligence/detailed-xml-validator/) to verify business rules.
10
- * Parse XML to JS Objectand vice versa
10
+ * Parse XML to JS Objects and vice versa
11
11
  * Common JS, ESM, and browser compatible
12
12
  * Faster than any other pure JS implementation.
13
13
 
@@ -18,10 +18,11 @@ It can handle big files (tested up to 100mb). XML Entities, HTML entities, and D
18
18
 
19
19
  ## Try out our New Thoughts
20
20
 
21
- We've recently launched **Flowgger**
22
- <a href="https://github.com/solothought/flowgger"> <img src="static/img/flowgger_h.webp" alt="Flowgger Logging Framework" /></a>
23
-
24
- Don't forget to check our new library [Text2Chart](https://solothought.com/text2chart/flow) that constructs flow chart out of simple text. Very helpful in creating or alayzing an algorithm, and documentation purpose.
21
+ - WishIn - You need it if negative thoughts take over all the time <br>
22
+ <a href="https://play.google.com/store/apps/details?id=com.solothought.wishin"> <img src="https://solothought.com/products/assets/images/wishin/YouTubeThumbnail.png" width="500px"/> </a>
23
+ - **Flowgger**: 90% less logs size and 90% less debugging time<br>
24
+ <a href="https://github.com/solothought/flowgger"> <img src="static/img/flowgger_h.webp" alt="Flowgger Logging Framework" width="300px"/></a>
25
+ - [Text2Chart](https://solothought.com/text2chart/flow): interactive flow chart out of simple text.
25
26
 
26
27
  ## Financial Support
27
28
 
@@ -170,7 +171,7 @@ Bundle size
170
171
  </table>
171
172
 
172
173
  **note**:
173
- - Version 6 is released with version 4 for experimental use. Based on it's demand, it'll be developed and the features can be different in final release.
174
+ - Version 6 is released with version 4 for experimental use. Based on its demand, it'll be developed and the features can be different in final release.
174
175
  - Version 5 has the same functionalities as version 4.
175
176
 
176
177
  ## Performance
@@ -0,0 +1 @@
1
+ (()=>{"use strict";var t={d:(e,i)=>{for(var n in i)t.o(i,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:i[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{XMLBuilder:()=>ut,XMLParser:()=>et,XMLValidator:()=>ft});const i=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",n=new RegExp("^["+i+"]["+i+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$");function s(t,e){const i=[];let n=e.exec(t);for(;n;){const s=[];s.startIndex=e.lastIndex-n[0].length;const r=n.length;for(let t=0;t<r;t++)s.push(n[t]);i.push(s),n=e.exec(t)}return i}const r=function(t){return!(null==n.exec(t))},o={allowBooleanAttributes:!1,unpairedTags:[]};function a(t,e){e=Object.assign({},o,e);const i=[];let n=!1,s=!1;"\ufeff"===t[0]&&(t=t.substr(1));for(let o=0;o<t.length;o++)if("<"===t[o]&&"?"===t[o+1]){if(o+=2,o=u(t,o),o.err)return o}else{if("<"!==t[o]){if(l(t[o]))continue;return x("InvalidChar","char '"+t[o]+"' is not expected.",b(t,o))}{let a=o;if(o++,"!"===t[o]){o=h(t,o);continue}{let d=!1;"/"===t[o]&&(d=!0,o++);let p="";for(;o<t.length&&">"!==t[o]&&" "!==t[o]&&"\t"!==t[o]&&"\n"!==t[o]&&"\r"!==t[o];o++)p+=t[o];if(p=p.trim(),"/"===p[p.length-1]&&(p=p.substring(0,p.length-1),o--),!r(p)){let e;return e=0===p.trim().length?"Invalid space after '<'.":"Tag '"+p+"' is an invalid name.",x("InvalidTag",e,b(t,o))}const c=f(t,o);if(!1===c)return x("InvalidAttr","Attributes for '"+p+"' have open quote.",b(t,o));let N=c.value;if(o=c.index,"/"===N[N.length-1]){const i=o-N.length;N=N.substring(0,N.length-1);const s=g(N,e);if(!0!==s)return x(s.err.code,s.err.msg,b(t,i+s.err.line));n=!0}else if(d){if(!c.tagClosed)return x("InvalidTag","Closing tag '"+p+"' doesn't have proper closing.",b(t,o));if(N.trim().length>0)return x("InvalidTag","Closing tag '"+p+"' can't have attributes or invalid starting.",b(t,a));if(0===i.length)return x("InvalidTag","Closing tag '"+p+"' has not been opened.",b(t,a));{const e=i.pop();if(p!==e.tagName){let i=b(t,e.tagStartPos);return x("InvalidTag","Expected closing tag '"+e.tagName+"' (opened in line "+i.line+", col "+i.col+") instead of closing tag '"+p+"'.",b(t,a))}0==i.length&&(s=!0)}}else{const r=g(N,e);if(!0!==r)return x(r.err.code,r.err.msg,b(t,o-N.length+r.err.line));if(!0===s)return x("InvalidXml","Multiple possible root nodes found.",b(t,o));-1!==e.unpairedTags.indexOf(p)||i.push({tagName:p,tagStartPos:a}),n=!0}for(o++;o<t.length;o++)if("<"===t[o]){if("!"===t[o+1]){o++,o=h(t,o);continue}if("?"!==t[o+1])break;if(o=u(t,++o),o.err)return o}else if("&"===t[o]){const e=m(t,o);if(-1==e)return x("InvalidChar","char '&' is not expected.",b(t,o));o=e}else if(!0===s&&!l(t[o]))return x("InvalidXml","Extra text at the end",b(t,o));"<"===t[o]&&o--}}}return n?1==i.length?x("InvalidTag","Unclosed tag '"+i[0].tagName+"'.",b(t,i[0].tagStartPos)):!(i.length>0)||x("InvalidXml","Invalid '"+JSON.stringify(i.map((t=>t.tagName)),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):x("InvalidXml","Start tag expected.",1)}function l(t){return" "===t||"\t"===t||"\n"===t||"\r"===t}function u(t,e){const i=e;for(;e<t.length;e++)if("?"!=t[e]&&" "!=t[e]);else{const n=t.substr(i,e-i);if(e>5&&"xml"===n)return x("InvalidXml","XML declaration allowed only at the start of the document.",b(t,e));if("?"==t[e]&&">"==t[e+1]){e++;break}}return e}function h(t,e){if(t.length>e+5&&"-"===t[e+1]&&"-"===t[e+2]){for(e+=3;e<t.length;e++)if("-"===t[e]&&"-"===t[e+1]&&">"===t[e+2]){e+=2;break}}else if(t.length>e+8&&"D"===t[e+1]&&"O"===t[e+2]&&"C"===t[e+3]&&"T"===t[e+4]&&"Y"===t[e+5]&&"P"===t[e+6]&&"E"===t[e+7]){let i=1;for(e+=8;e<t.length;e++)if("<"===t[e])i++;else if(">"===t[e]&&(i--,0===i))break}else if(t.length>e+9&&"["===t[e+1]&&"C"===t[e+2]&&"D"===t[e+3]&&"A"===t[e+4]&&"T"===t[e+5]&&"A"===t[e+6]&&"["===t[e+7])for(e+=8;e<t.length;e++)if("]"===t[e]&&"]"===t[e+1]&&">"===t[e+2]){e+=2;break}return e}const d='"',p="'";function f(t,e){let i="",n="",s=!1;for(;e<t.length;e++){if(t[e]===d||t[e]===p)""===n?n=t[e]:n!==t[e]||(n="");else if(">"===t[e]&&""===n){s=!0;break}i+=t[e]}return""===n&&{value:i,index:e,tagClosed:s}}const c=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function g(t,e){const i=s(t,c),n={};for(let t=0;t<i.length;t++){if(0===i[t][1].length)return x("InvalidAttr","Attribute '"+i[t][2]+"' has no space in starting.",E(i[t]));if(void 0!==i[t][3]&&void 0===i[t][4])return x("InvalidAttr","Attribute '"+i[t][2]+"' is without value.",E(i[t]));if(void 0===i[t][3]&&!e.allowBooleanAttributes)return x("InvalidAttr","boolean attribute '"+i[t][2]+"' is not allowed.",E(i[t]));const s=i[t][2];if(!N(s))return x("InvalidAttr","Attribute '"+s+"' is an invalid name.",E(i[t]));if(n.hasOwnProperty(s))return x("InvalidAttr","Attribute '"+s+"' is repeated.",E(i[t]));n[s]=1}return!0}function m(t,e){if(";"===t[++e])return-1;if("#"===t[e])return function(t,e){let i=/\d/;for("x"===t[e]&&(e++,i=/[\da-fA-F]/);e<t.length;e++){if(";"===t[e])return e;if(!t[e].match(i))break}return-1}(t,++e);let i=0;for(;e<t.length;e++,i++)if(!(t[e].match(/\w/)&&i<20)){if(";"===t[e])break;return-1}return e}function x(t,e,i){return{err:{code:t,msg:e,line:i.line||i,col:i.col}}}function N(t){return r(t)}function b(t,e){const i=t.substring(0,e).split(/\r?\n/);return{line:i.length,col:i[i.length-1].length+1}}function E(t){return t.startIndex+t[1].length}const v={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(t,e,i){return t},captureMetaData:!1};let T;T="function"!=typeof Symbol?"@@xmlMetadata":Symbol("XML Node Metadata");class y{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,e){"__proto__"===t&&(t="#__proto__"),this.child.push({[t]:e})}addChild(t,e){"__proto__"===t.tagname&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child}),void 0!==e&&(this.child[this.child.length-1][T]={startIndex:e})}static getMetaDataSymbol(){return T}}class w{constructor(t){this.suppressValidationErr=!t}readDocType(t,e){const i={};if("O"!==t[e+3]||"C"!==t[e+4]||"T"!==t[e+5]||"Y"!==t[e+6]||"P"!==t[e+7]||"E"!==t[e+8])throw new Error("Invalid Tag instead of DOCTYPE");{e+=9;let n=1,s=!1,r=!1,o="";for(;e<t.length;e++)if("<"!==t[e]||r)if(">"===t[e]){if(r?"-"===t[e-1]&&"-"===t[e-2]&&(r=!1,n--):n--,0===n)break}else"["===t[e]?s=!0:o+=t[e];else{if(s&&P(t,"!ENTITY",e)){let n,s;e+=7,[n,s,e]=this.readEntityExp(t,e+1,this.suppressValidationErr),-1===s.indexOf("&")&&(i[n]={regx:RegExp(`&${n};`,"g"),val:s})}else if(s&&P(t,"!ELEMENT",e)){e+=8;const{index:i}=this.readElementExp(t,e+1);e=i}else if(s&&P(t,"!ATTLIST",e))e+=8;else if(s&&P(t,"!NOTATION",e)){e+=9;const{index:i}=this.readNotationExp(t,e+1,this.suppressValidationErr);e=i}else{if(!P(t,"!--",e))throw new Error("Invalid DOCTYPE");r=!0}n++,o=""}if(0!==n)throw new Error("Unclosed DOCTYPE")}return{entities:i,i:e}}readEntityExp(t,e){e=I(t,e);let i="";for(;e<t.length&&!/\s/.test(t[e])&&'"'!==t[e]&&"'"!==t[e];)i+=t[e],e++;if(O(i),e=I(t,e),!this.suppressValidationErr){if("SYSTEM"===t.substring(e,e+6).toUpperCase())throw new Error("External entities are not supported");if("%"===t[e])throw new Error("Parameter entities are not supported")}let n="";return[e,n]=this.readIdentifierVal(t,e,"entity"),[i,n,--e]}readNotationExp(t,e){e=I(t,e);let i="";for(;e<t.length&&!/\s/.test(t[e]);)i+=t[e],e++;!this.suppressValidationErr&&O(i),e=I(t,e);const n=t.substring(e,e+6).toUpperCase();if(!this.suppressValidationErr&&"SYSTEM"!==n&&"PUBLIC"!==n)throw new Error(`Expected SYSTEM or PUBLIC, found "${n}"`);e+=n.length,e=I(t,e);let s=null,r=null;if("PUBLIC"===n)[e,s]=this.readIdentifierVal(t,e,"publicIdentifier"),'"'!==t[e=I(t,e)]&&"'"!==t[e]||([e,r]=this.readIdentifierVal(t,e,"systemIdentifier"));else if("SYSTEM"===n&&([e,r]=this.readIdentifierVal(t,e,"systemIdentifier"),!this.suppressValidationErr&&!r))throw new Error("Missing mandatory system identifier for SYSTEM notation");return{notationName:i,publicIdentifier:s,systemIdentifier:r,index:--e}}readIdentifierVal(t,e,i){let n="";const s=t[e];if('"'!==s&&"'"!==s)throw new Error(`Expected quoted string, found "${s}"`);for(e++;e<t.length&&t[e]!==s;)n+=t[e],e++;if(t[e]!==s)throw new Error(`Unterminated ${i} value`);return[++e,n]}readElementExp(t,e){e=I(t,e);let i="";for(;e<t.length&&!/\s/.test(t[e]);)i+=t[e],e++;if(!this.suppressValidationErr&&!r(i))throw new Error(`Invalid element name: "${i}"`);let n="";if("E"===t[e=I(t,e)]&&P(t,"MPTY",e))e+=4;else if("A"===t[e]&&P(t,"NY",e))e+=2;else if("("===t[e]){for(e++;e<t.length&&")"!==t[e];)n+=t[e],e++;if(")"!==t[e])throw new Error("Unterminated content model")}else if(!this.suppressValidationErr)throw new Error(`Invalid Element Expression, found "${t[e]}"`);return{elementName:i,contentModel:n.trim(),index:e}}readAttlistExp(t,e){e=I(t,e);let i="";for(;e<t.length&&!/\s/.test(t[e]);)i+=t[e],e++;O(i),e=I(t,e);let n="";for(;e<t.length&&!/\s/.test(t[e]);)n+=t[e],e++;if(!O(n))throw new Error(`Invalid attribute name: "${n}"`);e=I(t,e);let s="";if("NOTATION"===t.substring(e,e+8).toUpperCase()){if(s="NOTATION","("!==t[e=I(t,e+=8)])throw new Error(`Expected '(', found "${t[e]}"`);e++;let i=[];for(;e<t.length&&")"!==t[e];){let n="";for(;e<t.length&&"|"!==t[e]&&")"!==t[e];)n+=t[e],e++;if(n=n.trim(),!O(n))throw new Error(`Invalid notation name: "${n}"`);i.push(n),"|"===t[e]&&(e++,e=I(t,e))}if(")"!==t[e])throw new Error("Unterminated list of notations");e++,s+=" ("+i.join("|")+")"}else{for(;e<t.length&&!/\s/.test(t[e]);)s+=t[e],e++;const i=["CDATA","ID","IDREF","IDREFS","ENTITY","ENTITIES","NMTOKEN","NMTOKENS"];if(!this.suppressValidationErr&&!i.includes(s.toUpperCase()))throw new Error(`Invalid attribute type: "${s}"`)}e=I(t,e);let r="";return"#REQUIRED"===t.substring(e,e+8).toUpperCase()?(r="#REQUIRED",e+=8):"#IMPLIED"===t.substring(e,e+7).toUpperCase()?(r="#IMPLIED",e+=7):[e,r]=this.readIdentifierVal(t,e,"ATTLIST"),{elementName:i,attributeName:n,attributeType:s,defaultValue:r,index:e}}}const I=(t,e)=>{for(;e<t.length&&/\s/.test(t[e]);)e++;return e};function P(t,e,i){for(let n=0;n<e.length;n++)if(e[n]!==t[i+n+1])return!1;return!0}function O(t){if(r(t))return t;throw new Error(`Invalid entity name ${t}`)}const A=/^[-+]?0x[a-fA-F0-9]+$/,S=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,C={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};const V=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function $(t){return"function"==typeof t?t:Array.isArray(t)?e=>{for(const i of t){if("string"==typeof i&&e===i)return!0;if(i instanceof RegExp&&i.test(e))return!0}}:()=>!1}class D{constructor(t){if(this.options=t,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(t,e)=>Z(e,10,"&#")},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(t,e)=>Z(e,16,"&#x")}},this.addExternalEntities=j,this.parseXml=L,this.parseTextData=M,this.resolveNameSpace=F,this.buildAttributesMap=k,this.isItStopNode=Y,this.replaceEntitiesValue=B,this.readStopNodeData=W,this.saveTextToParentTag=R,this.addChild=U,this.ignoreAttributesFn=$(this.options.ignoreAttributes),this.options.stopNodes&&this.options.stopNodes.length>0){this.stopNodesExact=new Set,this.stopNodesWildcard=new Set;for(let t=0;t<this.options.stopNodes.length;t++){const e=this.options.stopNodes[t];"string"==typeof e&&(e.startsWith("*.")?this.stopNodesWildcard.add(e.substring(2)):this.stopNodesExact.add(e))}}}}function j(t){const e=Object.keys(t);for(let i=0;i<e.length;i++){const n=e[i];this.lastEntities[n]={regex:new RegExp("&"+n+";","g"),val:t[n]}}}function M(t,e,i,n,s,r,o){if(void 0!==t&&(this.options.trimValues&&!n&&(t=t.trim()),t.length>0)){o||(t=this.replaceEntitiesValue(t));const n=this.options.tagValueProcessor(e,t,i,s,r);return null==n?t:typeof n!=typeof t||n!==t?n:this.options.trimValues||t.trim()===t?q(t,this.options.parseTagValue,this.options.numberParseOptions):t}}function F(t){if(this.options.removeNSPrefix){const e=t.split(":"),i="/"===t.charAt(0)?"/":"";if("xmlns"===e[0])return"";2===e.length&&(t=i+e[1])}return t}const _=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function k(t,e){if(!0!==this.options.ignoreAttributes&&"string"==typeof t){const i=s(t,_),n=i.length,r={};for(let t=0;t<n;t++){const n=this.resolveNameSpace(i[t][1]);if(this.ignoreAttributesFn(n,e))continue;let s=i[t][4],o=this.options.attributeNamePrefix+n;if(n.length)if(this.options.transformAttributeName&&(o=this.options.transformAttributeName(o)),"__proto__"===o&&(o="#__proto__"),void 0!==s){this.options.trimValues&&(s=s.trim()),s=this.replaceEntitiesValue(s);const t=this.options.attributeValueProcessor(n,s,e);r[o]=null==t?s:typeof t!=typeof s||t!==s?t:q(s,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(r[o]=!0)}if(!Object.keys(r).length)return;if(this.options.attributesGroupName){const t={};return t[this.options.attributesGroupName]=r,t}return r}}const L=function(t){t=t.replace(/\r\n?/g,"\n");const e=new y("!xml");let i=e,n="",s="";const r=new w(this.options.processEntities);for(let o=0;o<t.length;o++)if("<"===t[o])if("/"===t[o+1]){const e=G(t,">",o,"Closing Tag is not closed.");let r=t.substring(o+2,e).trim();if(this.options.removeNSPrefix){const t=r.indexOf(":");-1!==t&&(r=r.substr(t+1))}this.options.transformTagName&&(r=this.options.transformTagName(r)),i&&(n=this.saveTextToParentTag(n,i,s));const a=s.substring(s.lastIndexOf(".")+1);if(r&&-1!==this.options.unpairedTags.indexOf(r))throw new Error(`Unpaired tag can not be used as closing tag: </${r}>`);let l=0;a&&-1!==this.options.unpairedTags.indexOf(a)?(l=s.lastIndexOf(".",s.lastIndexOf(".")-1),this.tagsNodeStack.pop()):l=s.lastIndexOf("."),s=s.substring(0,l),i=this.tagsNodeStack.pop(),n="",o=e}else if("?"===t[o+1]){let e=X(t,o,!1,"?>");if(!e)throw new Error("Pi Tag is not closed.");if(n=this.saveTextToParentTag(n,i,s),this.options.ignoreDeclaration&&"?xml"===e.tagName||this.options.ignorePiTags);else{const t=new y(e.tagName);t.add(this.options.textNodeName,""),e.tagName!==e.tagExp&&e.attrExpPresent&&(t[":@"]=this.buildAttributesMap(e.tagExp,s)),this.addChild(i,t,s,o)}o=e.closeIndex+1}else if("!--"===t.substr(o+1,3)){const e=G(t,"--\x3e",o+4,"Comment is not closed.");if(this.options.commentPropName){const r=t.substring(o+4,e-2);n=this.saveTextToParentTag(n,i,s),i.add(this.options.commentPropName,[{[this.options.textNodeName]:r}])}o=e}else if("!D"===t.substr(o+1,2)){const e=r.readDocType(t,o);this.docTypeEntities=e.entities,o=e.i}else if("!["===t.substr(o+1,2)){const e=G(t,"]]>",o,"CDATA is not closed.")-2,r=t.substring(o+9,e);n=this.saveTextToParentTag(n,i,s);let a=this.parseTextData(r,i.tagname,s,!0,!1,!0,!0);null==a&&(a=""),this.options.cdataPropName?i.add(this.options.cdataPropName,[{[this.options.textNodeName]:r}]):i.add(this.options.textNodeName,a),o=e+2}else{let r=X(t,o,this.options.removeNSPrefix),a=r.tagName;const l=r.rawTagName;let u=r.tagExp,h=r.attrExpPresent,d=r.closeIndex;if(this.options.transformTagName){const t=this.options.transformTagName(a);u===a&&(u=t),a=t}i&&n&&"!xml"!==i.tagname&&(n=this.saveTextToParentTag(n,i,s,!1));const p=i;p&&-1!==this.options.unpairedTags.indexOf(p.tagname)&&(i=this.tagsNodeStack.pop(),s=s.substring(0,s.lastIndexOf("."))),a!==e.tagname&&(s+=s?"."+a:a);const f=o;if(this.isItStopNode(this.stopNodesExact,this.stopNodesWildcard,s,a)){let e="";if(u.length>0&&u.lastIndexOf("/")===u.length-1)"/"===a[a.length-1]?(a=a.substr(0,a.length-1),s=s.substr(0,s.length-1),u=a):u=u.substr(0,u.length-1),o=r.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(a))o=r.closeIndex;else{const i=this.readStopNodeData(t,l,d+1);if(!i)throw new Error(`Unexpected end of ${l}`);o=i.i,e=i.tagContent}const n=new y(a);a!==u&&h&&(n[":@"]=this.buildAttributesMap(u,s)),e&&(e=this.parseTextData(e,a,s,!0,h,!0,!0)),s=s.substr(0,s.lastIndexOf(".")),n.add(this.options.textNodeName,e),this.addChild(i,n,s,f)}else{if(u.length>0&&u.lastIndexOf("/")===u.length-1){if("/"===a[a.length-1]?(a=a.substr(0,a.length-1),s=s.substr(0,s.length-1),u=a):u=u.substr(0,u.length-1),this.options.transformTagName){const t=this.options.transformTagName(a);u===a&&(u=t),a=t}const t=new y(a);a!==u&&h&&(t[":@"]=this.buildAttributesMap(u,s)),this.addChild(i,t,s,f),s=s.substr(0,s.lastIndexOf("."))}else{const t=new y(a);this.tagsNodeStack.push(i),a!==u&&h&&(t[":@"]=this.buildAttributesMap(u,s)),this.addChild(i,t,s,f),i=t}n="",o=d}}else n+=t[o];return e.child};function U(t,e,i,n){this.options.captureMetaData||(n=void 0);const s=this.options.updateTag(e.tagname,i,e[":@"]);!1===s||("string"==typeof s?(e.tagname=s,t.addChild(e,n)):t.addChild(e,n))}const B=function(t){if(this.options.processEntities){for(let e in this.docTypeEntities){const i=this.docTypeEntities[e];t=t.replace(i.regx,i.val)}for(let e in this.lastEntities){const i=this.lastEntities[e];t=t.replace(i.regex,i.val)}if(this.options.htmlEntities)for(let e in this.htmlEntities){const i=this.htmlEntities[e];t=t.replace(i.regex,i.val)}t=t.replace(this.ampEntity.regex,this.ampEntity.val)}return t};function R(t,e,i,n){return t&&(void 0===n&&(n=0===e.child.length),void 0!==(t=this.parseTextData(t,e.tagname,i,!1,!!e[":@"]&&0!==Object.keys(e[":@"]).length,n))&&""!==t&&e.add(this.options.textNodeName,t),t=""),t}function Y(t,e,i,n){return!(!e||!e.has(n))||!(!t||!t.has(i))}function G(t,e,i,n){const s=t.indexOf(e,i);if(-1===s)throw new Error(n);return s+e.length-1}function X(t,e,i,n=">"){const s=function(t,e,i=">"){let n,s="";for(let r=e;r<t.length;r++){let e=t[r];if(n)e===n&&(n="");else if('"'===e||"'"===e)n=e;else if(e===i[0]){if(!i[1])return{data:s,index:r};if(t[r+1]===i[1])return{data:s,index:r}}else"\t"===e&&(e=" ");s+=e}}(t,e+1,n);if(!s)return;let r=s.data;const o=s.index,a=r.search(/\s/);let l=r,u=!0;-1!==a&&(l=r.substring(0,a),r=r.substring(a+1).trimStart());const h=l;if(i){const t=l.indexOf(":");-1!==t&&(l=l.substr(t+1),u=l!==s.data.substr(t+1))}return{tagName:l,tagExp:r,closeIndex:o,attrExpPresent:u,rawTagName:h}}function W(t,e,i){const n=i;let s=1;for(;i<t.length;i++)if("<"===t[i])if("/"===t[i+1]){const r=G(t,">",i,`${e} is not closed`);if(t.substring(i+2,r).trim()===e&&(s--,0===s))return{tagContent:t.substring(n,i),i:r};i=r}else if("?"===t[i+1])i=G(t,"?>",i+1,"StopNode is not closed.");else if("!--"===t.substr(i+1,3))i=G(t,"--\x3e",i+3,"StopNode is not closed.");else if("!["===t.substr(i+1,2))i=G(t,"]]>",i,"StopNode is not closed.")-2;else{const n=X(t,i,">");n&&((n&&n.tagName)===e&&"/"!==n.tagExp[n.tagExp.length-1]&&s++,i=n.closeIndex)}}function q(t,e,i){if(e&&"string"==typeof t){const e=t.trim();return"true"===e||"false"!==e&&function(t,e={}){if(e=Object.assign({},C,e),!t||"string"!=typeof t)return t;let i=t.trim();if(void 0!==e.skipLike&&e.skipLike.test(i))return t;if("0"===t)return 0;if(e.hex&&A.test(i))return function(t){if(parseInt)return parseInt(t,16);if(Number.parseInt)return Number.parseInt(t,16);if(window&&window.parseInt)return window.parseInt(t,16);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}(i);if(-1!==i.search(/.+[eE].+/))return function(t,e,i){if(!i.eNotation)return t;const n=e.match(V);if(n){let s=n[1]||"";const r=-1===n[3].indexOf("e")?"E":"e",o=n[2],a=s?t[o.length+1]===r:t[o.length]===r;return o.length>1&&a?t:1!==o.length||!n[3].startsWith(`.${r}`)&&n[3][0]!==r?i.leadingZeros&&!a?(e=(n[1]||"")+n[3],Number(e)):t:Number(e)}return t}(t,i,e);{const s=S.exec(i);if(s){const r=s[1]||"",o=s[2];let a=(n=s[3])&&-1!==n.indexOf(".")?("."===(n=n.replace(/0+$/,""))?n="0":"."===n[0]?n="0"+n:"."===n[n.length-1]&&(n=n.substring(0,n.length-1)),n):n;const l=r?"."===t[o.length+1]:"."===t[o.length];if(!e.leadingZeros&&(o.length>1||1===o.length&&!l))return t;{const n=Number(i),s=String(n);if(0===n||-0===n)return n;if(-1!==s.search(/[eE]/))return e.eNotation?n:t;if(-1!==i.indexOf("."))return"0"===s||s===a||s===`${r}${a}`?n:t;let l=o?a:i;return o?l===s||r+l===s?n:t:l===s||l===r+s?n:t}}return t}var n}(t,i)}return void 0!==t?t:""}function Z(t,e,i){const n=Number.parseInt(t,e);return n>=0&&n<=1114111?String.fromCodePoint(n):i+t+";"}const K=y.getMetaDataSymbol();function Q(t,e){return z(t,e)}function z(t,e,i){let n;const s={};for(let r=0;r<t.length;r++){const o=t[r],a=J(o);let l="";if(l=void 0===i?a:i+"."+a,a===e.textNodeName)void 0===n?n=o[a]:n+=""+o[a];else{if(void 0===a)continue;if(o[a]){let t=z(o[a],e,l);const i=tt(t,e);void 0!==o[K]&&(t[K]=o[K]),o[":@"]?H(t,o[":@"],l,e):1!==Object.keys(t).length||void 0===t[e.textNodeName]||e.alwaysCreateTextNode?0===Object.keys(t).length&&(e.alwaysCreateTextNode?t[e.textNodeName]="":t=""):t=t[e.textNodeName],void 0!==s[a]&&s.hasOwnProperty(a)?(Array.isArray(s[a])||(s[a]=[s[a]]),s[a].push(t)):e.isArray(a,l,i)?s[a]=[t]:s[a]=t}}}return"string"==typeof n?n.length>0&&(s[e.textNodeName]=n):void 0!==n&&(s[e.textNodeName]=n),s}function J(t){const e=Object.keys(t);for(let t=0;t<e.length;t++){const i=e[t];if(":@"!==i)return i}}function H(t,e,i,n){if(e){const s=Object.keys(e),r=s.length;for(let o=0;o<r;o++){const r=s[o];n.isArray(r,i+"."+r,!0,!0)?t[r]=[e[r]]:t[r]=e[r]}}}function tt(t,e){const{textNodeName:i}=e,n=Object.keys(t).length;return 0===n||!(1!==n||!t[i]&&"boolean"!=typeof t[i]&&0!==t[i])}class et{constructor(t){this.externalEntities={},this.options=function(t){return Object.assign({},v,t)}(t)}parse(t,e){if("string"!=typeof t&&t.toString)t=t.toString();else if("string"!=typeof t)throw new Error("XML data is accepted in String or Bytes[] form.");if(e){!0===e&&(e={});const i=a(t,e);if(!0!==i)throw Error(`${i.err.msg}:${i.err.line}:${i.err.col}`)}const i=new D(this.options);i.addExternalEntities(this.externalEntities);const n=i.parseXml(t);return this.options.preserveOrder||void 0===n?n:Q(n,this.options)}addEntity(t,e){if(-1!==e.indexOf("&"))throw new Error("Entity value can't have '&'");if(-1!==t.indexOf("&")||-1!==t.indexOf(";"))throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if("&"===e)throw new Error("An entity with value '&' is not permitted");this.externalEntities[t]=e}static getMetaDataSymbol(){return y.getMetaDataSymbol()}}function it(t,e){let i="";return e.format&&e.indentBy.length>0&&(i="\n"),nt(t,e,"",i)}function nt(t,e,i,n){let s="",r=!1;for(let o=0;o<t.length;o++){const a=t[o],l=st(a);if(void 0===l)continue;let u="";if(u=0===i.length?l:`${i}.${l}`,l===e.textNodeName){let t=a[l];ot(u,e)||(t=e.tagValueProcessor(l,t),t=at(t,e)),r&&(s+=n),s+=t,r=!1;continue}if(l===e.cdataPropName){r&&(s+=n),s+=`<![CDATA[${a[l][0][e.textNodeName]}]]>`,r=!1;continue}if(l===e.commentPropName){s+=n+`\x3c!--${a[l][0][e.textNodeName]}--\x3e`,r=!0;continue}if("?"===l[0]){const t=rt(a[":@"],e),i="?xml"===l?"":n;let o=a[l][0][e.textNodeName];o=0!==o.length?" "+o:"",s+=i+`<${l}${o}${t}?>`,r=!0;continue}let h=n;""!==h&&(h+=e.indentBy);const d=n+`<${l}${rt(a[":@"],e)}`,p=nt(a[l],e,u,h);-1!==e.unpairedTags.indexOf(l)?e.suppressUnpairedNode?s+=d+">":s+=d+"/>":p&&0!==p.length||!e.suppressEmptyNode?p&&p.endsWith(">")?s+=d+`>${p}${n}</${l}>`:(s+=d+">",p&&""!==n&&(p.includes("/>")||p.includes("</"))?s+=n+e.indentBy+p+n:s+=p,s+=`</${l}>`):s+=d+"/>",r=!0}return s}function st(t){const e=Object.keys(t);for(let i=0;i<e.length;i++){const n=e[i];if(t.hasOwnProperty(n)&&":@"!==n)return n}}function rt(t,e){let i="";if(t&&!e.ignoreAttributes)for(let n in t){if(!t.hasOwnProperty(n))continue;let s=e.attributeValueProcessor(n,t[n]);s=at(s,e),!0===s&&e.suppressBooleanAttributes?i+=` ${n.substr(e.attributeNamePrefix.length)}`:i+=` ${n.substr(e.attributeNamePrefix.length)}="${s}"`}return i}function ot(t,e){let i=(t=t.substr(0,t.length-e.textNodeName.length-1)).substr(t.lastIndexOf(".")+1);for(let n in e.stopNodes)if(e.stopNodes[n]===t||e.stopNodes[n]==="*."+i)return!0;return!1}function at(t,e){if(t&&t.length>0&&e.processEntities)for(let i=0;i<e.entities.length;i++){const n=e.entities[i];t=t.replace(n.regex,n.val)}return t}const lt={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1};function ut(t){this.options=Object.assign({},lt,t),!0===this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=$(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=pt),this.processTextOrObjNode=ht,this.options.format?(this.indentate=dt,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function ht(t,e,i,n){const s=this.j2x(t,i+1,n.concat(e));return void 0!==t[this.options.textNodeName]&&1===Object.keys(t).length?this.buildTextValNode(t[this.options.textNodeName],e,s.attrStr,i):this.buildObjectNode(s.val,e,s.attrStr,i)}function dt(t){return this.options.indentBy.repeat(t)}function pt(t){return!(!t.startsWith(this.options.attributeNamePrefix)||t===this.options.textNodeName)&&t.substr(this.attrPrefixLen)}ut.prototype.build=function(t){return this.options.preserveOrder?it(t,this.options):(Array.isArray(t)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(t={[this.options.arrayNodeName]:t}),this.j2x(t,0,[]).val)},ut.prototype.j2x=function(t,e,i){let n="",s="";const r=i.join(".");for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o))if(void 0===t[o])this.isAttribute(o)&&(s+="");else if(null===t[o])this.isAttribute(o)||o===this.options.cdataPropName?s+="":"?"===o[0]?s+=this.indentate(e)+"<"+o+"?"+this.tagEndChar:s+=this.indentate(e)+"<"+o+"/"+this.tagEndChar;else if(t[o]instanceof Date)s+=this.buildTextValNode(t[o],o,"",e);else if("object"!=typeof t[o]){const i=this.isAttribute(o);if(i&&!this.ignoreAttributesFn(i,r))n+=this.buildAttrPairStr(i,""+t[o]);else if(!i)if(o===this.options.textNodeName){let e=this.options.tagValueProcessor(o,""+t[o]);s+=this.replaceEntitiesValue(e)}else s+=this.buildTextValNode(t[o],o,"",e)}else if(Array.isArray(t[o])){const n=t[o].length;let r="",a="";for(let l=0;l<n;l++){const n=t[o][l];if(void 0===n);else if(null===n)"?"===o[0]?s+=this.indentate(e)+"<"+o+"?"+this.tagEndChar:s+=this.indentate(e)+"<"+o+"/"+this.tagEndChar;else if("object"==typeof n)if(this.options.oneListGroup){const t=this.j2x(n,e+1,i.concat(o));r+=t.val,this.options.attributesGroupName&&n.hasOwnProperty(this.options.attributesGroupName)&&(a+=t.attrStr)}else r+=this.processTextOrObjNode(n,o,e,i);else if(this.options.oneListGroup){let t=this.options.tagValueProcessor(o,n);t=this.replaceEntitiesValue(t),r+=t}else r+=this.buildTextValNode(n,o,"",e)}this.options.oneListGroup&&(r=this.buildObjectNode(r,o,a,e)),s+=r}else if(this.options.attributesGroupName&&o===this.options.attributesGroupName){const e=Object.keys(t[o]),i=e.length;for(let s=0;s<i;s++)n+=this.buildAttrPairStr(e[s],""+t[o][e[s]])}else s+=this.processTextOrObjNode(t[o],o,e,i);return{attrStr:n,val:s}},ut.prototype.buildAttrPairStr=function(t,e){return e=this.options.attributeValueProcessor(t,""+e),e=this.replaceEntitiesValue(e),this.options.suppressBooleanAttributes&&"true"===e?" "+t:" "+t+'="'+e+'"'},ut.prototype.buildObjectNode=function(t,e,i,n){if(""===t)return"?"===e[0]?this.indentate(n)+"<"+e+i+"?"+this.tagEndChar:this.indentate(n)+"<"+e+i+this.closeTag(e)+this.tagEndChar;{let s="</"+e+this.tagEndChar,r="";return"?"===e[0]&&(r="?",s=""),!i&&""!==i||-1!==t.indexOf("<")?!1!==this.options.commentPropName&&e===this.options.commentPropName&&0===r.length?this.indentate(n)+`\x3c!--${t}--\x3e`+this.newLine:this.indentate(n)+"<"+e+i+r+this.tagEndChar+t+this.indentate(n)+s:this.indentate(n)+"<"+e+i+r+">"+t+s}},ut.prototype.closeTag=function(t){let e="";return-1!==this.options.unpairedTags.indexOf(t)?this.options.suppressUnpairedNode||(e="/"):e=this.options.suppressEmptyNode?"/":`></${t}`,e},ut.prototype.buildTextValNode=function(t,e,i,n){if(!1!==this.options.cdataPropName&&e===this.options.cdataPropName)return this.indentate(n)+`<![CDATA[${t}]]>`+this.newLine;if(!1!==this.options.commentPropName&&e===this.options.commentPropName)return this.indentate(n)+`\x3c!--${t}--\x3e`+this.newLine;if("?"===e[0])return this.indentate(n)+"<"+e+i+"?"+this.tagEndChar;{let s=this.options.tagValueProcessor(e,t);return s=this.replaceEntitiesValue(s),""===s?this.indentate(n)+"<"+e+i+this.closeTag(e)+this.tagEndChar:this.indentate(n)+"<"+e+i+">"+s+"</"+e+this.tagEndChar}},ut.prototype.replaceEntitiesValue=function(t){if(t&&t.length>0&&this.options.processEntities)for(let e=0;e<this.options.entities.length;e++){const i=this.options.entities[e];t=t.replace(i.regex,i.val)}return t};const ft={validate:a};module.exports=e})();
@@ -406,7 +406,7 @@ type ValidationError = {
406
406
 
407
407
  declare class XMLParser {
408
408
  constructor(options?: X2jOptions);
409
- parse(xmlData: string | Buffer ,validationOptions?: validationOptions | boolean): any;
409
+ parse(xmlData: string | Uint8Array ,validationOptions?: validationOptions | boolean): any;
410
410
  /**
411
411
  * Add Entity which is not by default supported by this library
412
412
  * @param entityIdentifier {string} Eg: 'ent' for &ent;
@@ -0,0 +1,2 @@
1
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.fxp=e():t.fxp=e()}(this,(()=>(()=>{"use strict";var t={d:(e,r)=>{for(var i in r)t.o(r,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:r[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{XMLBuilder:()=>dt,XMLParser:()=>rt,XMLValidator:()=>gt});var r=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",i=new RegExp("^["+r+"]["+r+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$");function n(t,e){for(var r=[],i=e.exec(t);i;){var n=[];n.startIndex=e.lastIndex-i[0].length;for(var s=i.length,a=0;a<s;a++)n.push(i[a]);r.push(n),i=e.exec(t)}return r}var s=function(t){return!(null==i.exec(t))},a={allowBooleanAttributes:!1,unpairedTags:[]};function o(t,e){e=Object.assign({},a,e);var r=[],i=!1,n=!1;"\ufeff"===t[0]&&(t=t.substr(1));for(var o=0;o<t.length;o++)if("<"===t[o]&&"?"===t[o+1]){if((o=u(t,o+=2)).err)return o}else{if("<"!==t[o]){if(l(t[o]))continue;return m("InvalidChar","char '"+t[o]+"' is not expected.",b(t,o))}var h=o;if("!"===t[++o]){o=d(t,o);continue}var f=!1;"/"===t[o]&&(f=!0,o++);for(var g="";o<t.length&&">"!==t[o]&&" "!==t[o]&&"\t"!==t[o]&&"\n"!==t[o]&&"\r"!==t[o];o++)g+=t[o];if("/"===(g=g.trim())[g.length-1]&&(g=g.substring(0,g.length-1),o--),!s(g))return m("InvalidTag",0===g.trim().length?"Invalid space after '<'.":"Tag '"+g+"' is an invalid name.",b(t,o));var x=p(t,o);if(!1===x)return m("InvalidAttr","Attributes for '"+g+"' have open quote.",b(t,o));var N=x.value;if(o=x.index,"/"===N[N.length-1]){var E=o-N.length,y=c(N=N.substring(0,N.length-1),e);if(!0!==y)return m(y.err.code,y.err.msg,b(t,E+y.err.line));i=!0}else if(f){if(!x.tagClosed)return m("InvalidTag","Closing tag '"+g+"' doesn't have proper closing.",b(t,o));if(N.trim().length>0)return m("InvalidTag","Closing tag '"+g+"' can't have attributes or invalid starting.",b(t,h));if(0===r.length)return m("InvalidTag","Closing tag '"+g+"' has not been opened.",b(t,h));var T=r.pop();if(g!==T.tagName){var w=b(t,T.tagStartPos);return m("InvalidTag","Expected closing tag '"+T.tagName+"' (opened in line "+w.line+", col "+w.col+") instead of closing tag '"+g+"'.",b(t,h))}0==r.length&&(n=!0)}else{var I=c(N,e);if(!0!==I)return m(I.err.code,I.err.msg,b(t,o-N.length+I.err.line));if(!0===n)return m("InvalidXml","Multiple possible root nodes found.",b(t,o));-1!==e.unpairedTags.indexOf(g)||r.push({tagName:g,tagStartPos:h}),i=!0}for(o++;o<t.length;o++)if("<"===t[o]){if("!"===t[o+1]){o=d(t,++o);continue}if("?"!==t[o+1])break;if((o=u(t,++o)).err)return o}else if("&"===t[o]){var A=v(t,o);if(-1==A)return m("InvalidChar","char '&' is not expected.",b(t,o));o=A}else if(!0===n&&!l(t[o]))return m("InvalidXml","Extra text at the end",b(t,o));"<"===t[o]&&o--}return i?1==r.length?m("InvalidTag","Unclosed tag '"+r[0].tagName+"'.",b(t,r[0].tagStartPos)):!(r.length>0)||m("InvalidXml","Invalid '"+JSON.stringify(r.map((function(t){return t.tagName})),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):m("InvalidXml","Start tag expected.",1)}function l(t){return" "===t||"\t"===t||"\n"===t||"\r"===t}function u(t,e){for(var r=e;e<t.length;e++)if("?"!=t[e]&&" "!=t[e]);else{var i=t.substr(r,e-r);if(e>5&&"xml"===i)return m("InvalidXml","XML declaration allowed only at the start of the document.",b(t,e));if("?"==t[e]&&">"==t[e+1]){e++;break}}return e}function d(t,e){if(t.length>e+5&&"-"===t[e+1]&&"-"===t[e+2]){for(e+=3;e<t.length;e++)if("-"===t[e]&&"-"===t[e+1]&&">"===t[e+2]){e+=2;break}}else if(t.length>e+8&&"D"===t[e+1]&&"O"===t[e+2]&&"C"===t[e+3]&&"T"===t[e+4]&&"Y"===t[e+5]&&"P"===t[e+6]&&"E"===t[e+7]){var r=1;for(e+=8;e<t.length;e++)if("<"===t[e])r++;else if(">"===t[e]&&0==--r)break}else if(t.length>e+9&&"["===t[e+1]&&"C"===t[e+2]&&"D"===t[e+3]&&"A"===t[e+4]&&"T"===t[e+5]&&"A"===t[e+6]&&"["===t[e+7])for(e+=8;e<t.length;e++)if("]"===t[e]&&"]"===t[e+1]&&">"===t[e+2]){e+=2;break}return e}var h='"',f="'";function p(t,e){for(var r="",i="",n=!1;e<t.length;e++){if(t[e]===h||t[e]===f)""===i?i=t[e]:i!==t[e]||(i="");else if(">"===t[e]&&""===i){n=!0;break}r+=t[e]}return""===i&&{value:r,index:e,tagClosed:n}}var g=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function c(t,e){for(var r=n(t,g),i={},s=0;s<r.length;s++){if(0===r[s][1].length)return m("InvalidAttr","Attribute '"+r[s][2]+"' has no space in starting.",N(r[s]));if(void 0!==r[s][3]&&void 0===r[s][4])return m("InvalidAttr","Attribute '"+r[s][2]+"' is without value.",N(r[s]));if(void 0===r[s][3]&&!e.allowBooleanAttributes)return m("InvalidAttr","boolean attribute '"+r[s][2]+"' is not allowed.",N(r[s]));var a=r[s][2];if(!x(a))return m("InvalidAttr","Attribute '"+a+"' is an invalid name.",N(r[s]));if(i.hasOwnProperty(a))return m("InvalidAttr","Attribute '"+a+"' is repeated.",N(r[s]));i[a]=1}return!0}function v(t,e){if(";"===t[++e])return-1;if("#"===t[e])return function(t,e){var r=/\d/;for("x"===t[e]&&(e++,r=/[\da-fA-F]/);e<t.length;e++){if(";"===t[e])return e;if(!t[e].match(r))break}return-1}(t,++e);for(var r=0;e<t.length;e++,r++)if(!(t[e].match(/\w/)&&r<20)){if(";"===t[e])break;return-1}return e}function m(t,e,r){return{err:{code:t,msg:e,line:r.line||r,col:r.col}}}function x(t){return s(t)}function b(t,e){var r=t.substring(0,e).split(/\r?\n/);return{line:r.length,col:r[r.length-1].length+1}}function N(t){return t.startIndex+t[1].length}var E,y={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},stopNodes:[],alwaysCreateTextNode:!1,isArray:function(){return!1},commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(t,e,r){return t},captureMetaData:!1};E="function"!=typeof Symbol?"@@xmlMetadata":Symbol("XML Node Metadata");var T=function(){function t(t){this.tagname=t,this.child=[],this[":@"]={}}var e=t.prototype;return e.add=function(t,e){var r;"__proto__"===t&&(t="#__proto__"),this.child.push(((r={})[t]=e,r))},e.addChild=function(t,e){var r,i;"__proto__"===t.tagname&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push(((r={})[t.tagname]=t.child,r[":@"]=t[":@"],r)):this.child.push(((i={})[t.tagname]=t.child,i)),void 0!==e&&(this.child[this.child.length-1][E]={startIndex:e})},t.getMetaDataSymbol=function(){return E},t}(),w=function(){function t(t){this.suppressValidationErr=!t}var e=t.prototype;return e.readDocType=function(t,e){var r={};if("O"!==t[e+3]||"C"!==t[e+4]||"T"!==t[e+5]||"Y"!==t[e+6]||"P"!==t[e+7]||"E"!==t[e+8])throw new Error("Invalid Tag instead of DOCTYPE");e+=9;for(var i=1,n=!1,s=!1;e<t.length;e++)if("<"!==t[e]||s)if(">"===t[e]){if(s?"-"===t[e-1]&&"-"===t[e-2]&&(s=!1,i--):i--,0===i)break}else"["===t[e]?n=!0:t[e];else{if(n&&A(t,"!ENTITY",e)){e+=7;var a,o=void 0,l=this.readEntityExp(t,e+1,this.suppressValidationErr);a=l[0],o=l[1],e=l[2],-1===o.indexOf("&")&&(r[a]={regx:RegExp("&"+a+";","g"),val:o})}else if(n&&A(t,"!ELEMENT",e))e+=8,e=this.readElementExp(t,e+1).index;else if(n&&A(t,"!ATTLIST",e))e+=8;else if(n&&A(t,"!NOTATION",e))e+=9,e=this.readNotationExp(t,e+1,this.suppressValidationErr).index;else{if(!A(t,"!--",e))throw new Error("Invalid DOCTYPE");s=!0}i++}if(0!==i)throw new Error("Unclosed DOCTYPE");return{entities:r,i:e}},e.readEntityExp=function(t,e){e=I(t,e);for(var r="";e<t.length&&!/\s/.test(t[e])&&'"'!==t[e]&&"'"!==t[e];)r+=t[e],e++;if(P(r),e=I(t,e),!this.suppressValidationErr){if("SYSTEM"===t.substring(e,e+6).toUpperCase())throw new Error("External entities are not supported");if("%"===t[e])throw new Error("Parameter entities are not supported")}var i=this.readIdentifierVal(t,e,"entity");return e=i[0],[r,i[1],--e]},e.readNotationExp=function(t,e){e=I(t,e);for(var r="";e<t.length&&!/\s/.test(t[e]);)r+=t[e],e++;!this.suppressValidationErr&&P(r),e=I(t,e);var i=t.substring(e,e+6).toUpperCase();if(!this.suppressValidationErr&&"SYSTEM"!==i&&"PUBLIC"!==i)throw new Error('Expected SYSTEM or PUBLIC, found "'+i+'"');e+=i.length,e=I(t,e);var n=null,s=null;if("PUBLIC"===i){var a=this.readIdentifierVal(t,e,"publicIdentifier");if(e=a[0],n=a[1],'"'===t[e=I(t,e)]||"'"===t[e]){var o=this.readIdentifierVal(t,e,"systemIdentifier");e=o[0],s=o[1]}}else if("SYSTEM"===i){var l=this.readIdentifierVal(t,e,"systemIdentifier");if(e=l[0],s=l[1],!this.suppressValidationErr&&!s)throw new Error("Missing mandatory system identifier for SYSTEM notation")}return{notationName:r,publicIdentifier:n,systemIdentifier:s,index:--e}},e.readIdentifierVal=function(t,e,r){var i="",n=t[e];if('"'!==n&&"'"!==n)throw new Error('Expected quoted string, found "'+n+'"');for(e++;e<t.length&&t[e]!==n;)i+=t[e],e++;if(t[e]!==n)throw new Error("Unterminated "+r+" value");return[++e,i]},e.readElementExp=function(t,e){e=I(t,e);for(var r="";e<t.length&&!/\s/.test(t[e]);)r+=t[e],e++;if(!this.suppressValidationErr&&!s(r))throw new Error('Invalid element name: "'+r+'"');var i="";if("E"===t[e=I(t,e)]&&A(t,"MPTY",e))e+=4;else if("A"===t[e]&&A(t,"NY",e))e+=2;else if("("===t[e]){for(e++;e<t.length&&")"!==t[e];)i+=t[e],e++;if(")"!==t[e])throw new Error("Unterminated content model")}else if(!this.suppressValidationErr)throw new Error('Invalid Element Expression, found "'+t[e]+'"');return{elementName:r,contentModel:i.trim(),index:e}},e.readAttlistExp=function(t,e){e=I(t,e);for(var r="";e<t.length&&!/\s/.test(t[e]);)r+=t[e],e++;P(r),e=I(t,e);for(var i="";e<t.length&&!/\s/.test(t[e]);)i+=t[e],e++;if(!P(i))throw new Error('Invalid attribute name: "'+i+'"');e=I(t,e);var n="";if("NOTATION"===t.substring(e,e+8).toUpperCase()){if(n="NOTATION","("!==t[e=I(t,e+=8)])throw new Error("Expected '(', found \""+t[e]+'"');e++;for(var s=[];e<t.length&&")"!==t[e];){for(var a="";e<t.length&&"|"!==t[e]&&")"!==t[e];)a+=t[e],e++;if(!P(a=a.trim()))throw new Error('Invalid notation name: "'+a+'"');s.push(a),"|"===t[e]&&(e++,e=I(t,e))}if(")"!==t[e])throw new Error("Unterminated list of notations");e++,n+=" ("+s.join("|")+")"}else{for(;e<t.length&&!/\s/.test(t[e]);)n+=t[e],e++;if(!this.suppressValidationErr&&!["CDATA","ID","IDREF","IDREFS","ENTITY","ENTITIES","NMTOKEN","NMTOKENS"].includes(n.toUpperCase()))throw new Error('Invalid attribute type: "'+n+'"')}e=I(t,e);var o="";if("#REQUIRED"===t.substring(e,e+8).toUpperCase())o="#REQUIRED",e+=8;else if("#IMPLIED"===t.substring(e,e+7).toUpperCase())o="#IMPLIED",e+=7;else{var l=this.readIdentifierVal(t,e,"ATTLIST");e=l[0],o=l[1]}return{elementName:r,attributeName:i,attributeType:n,defaultValue:o,index:e}},t}(),I=function(t,e){for(;e<t.length&&/\s/.test(t[e]);)e++;return e};function A(t,e,r){for(var i=0;i<e.length;i++)if(e[i]!==t[r+i+1])return!1;return!0}function P(t){if(s(t))return t;throw new Error("Invalid entity name "+t)}const O=/^[-+]?0x[a-fA-F0-9]+$/,S=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,C={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};const V=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function D(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,i=Array(e);r<e;r++)i[r]=t[r];return i}function j(t){return"function"==typeof t?t:Array.isArray(t)?function(e){for(var r,i=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return D(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?D(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var i=0;return function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(t);!(r=i()).done;){var n=r.value;if("string"==typeof n&&e===n)return!0;if(n instanceof RegExp&&n.test(e))return!0}}:function(){return!1}}var M=function(t){if(this.options=t,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:function(t,e){return K(e,10,"&#")}},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:function(t,e){return K(e,16,"&#x")}}},this.addExternalEntities=F,this.parseXml=B,this.parseTextData=_,this.resolveNameSpace=k,this.buildAttributesMap=U,this.isItStopNode=X,this.replaceEntitiesValue=Y,this.readStopNodeData=q,this.saveTextToParentTag=G,this.addChild=R,this.ignoreAttributesFn=j(this.options.ignoreAttributes),this.options.stopNodes&&this.options.stopNodes.length>0){this.stopNodesExact=new Set,this.stopNodesWildcard=new Set;for(var e=0;e<this.options.stopNodes.length;e++){var r=this.options.stopNodes[e];"string"==typeof r&&(r.startsWith("*.")?this.stopNodesWildcard.add(r.substring(2)):this.stopNodesExact.add(r))}}};function F(t){for(var e=Object.keys(t),r=0;r<e.length;r++){var i=e[r];this.lastEntities[i]={regex:new RegExp("&"+i+";","g"),val:t[i]}}}function _(t,e,r,i,n,s,a){if(void 0!==t&&(this.options.trimValues&&!i&&(t=t.trim()),t.length>0)){a||(t=this.replaceEntitiesValue(t));var o=this.options.tagValueProcessor(e,t,r,n,s);return null==o?t:typeof o!=typeof t||o!==t?o:this.options.trimValues||t.trim()===t?Z(t,this.options.parseTagValue,this.options.numberParseOptions):t}}function k(t){if(this.options.removeNSPrefix){var e=t.split(":"),r="/"===t.charAt(0)?"/":"";if("xmlns"===e[0])return"";2===e.length&&(t=r+e[1])}return t}var L=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function U(t,e){if(!0!==this.options.ignoreAttributes&&"string"==typeof t){for(var r=n(t,L),i=r.length,s={},a=0;a<i;a++){var o=this.resolveNameSpace(r[a][1]);if(!this.ignoreAttributesFn(o,e)){var l=r[a][4],u=this.options.attributeNamePrefix+o;if(o.length)if(this.options.transformAttributeName&&(u=this.options.transformAttributeName(u)),"__proto__"===u&&(u="#__proto__"),void 0!==l){this.options.trimValues&&(l=l.trim()),l=this.replaceEntitiesValue(l);var d=this.options.attributeValueProcessor(o,l,e);s[u]=null==d?l:typeof d!=typeof l||d!==l?d:Z(l,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(s[u]=!0)}}if(!Object.keys(s).length)return;if(this.options.attributesGroupName){var h={};return h[this.options.attributesGroupName]=s,h}return s}}var B=function(t){t=t.replace(/\r\n?/g,"\n");for(var e=new T("!xml"),r=e,i="",n="",s=new w(this.options.processEntities),a=0;a<t.length;a++)if("<"===t[a])if("/"===t[a+1]){var o=$(t,">",a,"Closing Tag is not closed."),l=t.substring(a+2,o).trim();if(this.options.removeNSPrefix){var u=l.indexOf(":");-1!==u&&(l=l.substr(u+1))}this.options.transformTagName&&(l=this.options.transformTagName(l)),r&&(i=this.saveTextToParentTag(i,r,n));var d=n.substring(n.lastIndexOf(".")+1);if(l&&-1!==this.options.unpairedTags.indexOf(l))throw new Error("Unpaired tag can not be used as closing tag: </"+l+">");var h=0;d&&-1!==this.options.unpairedTags.indexOf(d)?(h=n.lastIndexOf(".",n.lastIndexOf(".")-1),this.tagsNodeStack.pop()):h=n.lastIndexOf("."),n=n.substring(0,h),r=this.tagsNodeStack.pop(),i="",a=o}else if("?"===t[a+1]){var f=W(t,a,!1,"?>");if(!f)throw new Error("Pi Tag is not closed.");if(i=this.saveTextToParentTag(i,r,n),this.options.ignoreDeclaration&&"?xml"===f.tagName||this.options.ignorePiTags);else{var p=new T(f.tagName);p.add(this.options.textNodeName,""),f.tagName!==f.tagExp&&f.attrExpPresent&&(p[":@"]=this.buildAttributesMap(f.tagExp,n)),this.addChild(r,p,n,a)}a=f.closeIndex+1}else if("!--"===t.substr(a+1,3)){var g=$(t,"--\x3e",a+4,"Comment is not closed.");if(this.options.commentPropName){var c,v=t.substring(a+4,g-2);i=this.saveTextToParentTag(i,r,n),r.add(this.options.commentPropName,[(c={},c[this.options.textNodeName]=v,c)])}a=g}else if("!D"===t.substr(a+1,2)){var m=s.readDocType(t,a);this.docTypeEntities=m.entities,a=m.i}else if("!["===t.substr(a+1,2)){var x=$(t,"]]>",a,"CDATA is not closed.")-2,b=t.substring(a+9,x);i=this.saveTextToParentTag(i,r,n);var N,E=this.parseTextData(b,r.tagname,n,!0,!1,!0,!0);null==E&&(E=""),this.options.cdataPropName?r.add(this.options.cdataPropName,[(N={},N[this.options.textNodeName]=b,N)]):r.add(this.options.textNodeName,E),a=x+2}else{var y=W(t,a,this.options.removeNSPrefix),I=y.tagName,A=y.rawTagName,P=y.tagExp,O=y.attrExpPresent,S=y.closeIndex;if(this.options.transformTagName){var C=this.options.transformTagName(I);P===I&&(P=C),I=C}r&&i&&"!xml"!==r.tagname&&(i=this.saveTextToParentTag(i,r,n,!1));var V=r;V&&-1!==this.options.unpairedTags.indexOf(V.tagname)&&(r=this.tagsNodeStack.pop(),n=n.substring(0,n.lastIndexOf("."))),I!==e.tagname&&(n+=n?"."+I:I);var D=a;if(this.isItStopNode(this.stopNodesExact,this.stopNodesWildcard,n,I)){var j="";if(P.length>0&&P.lastIndexOf("/")===P.length-1)"/"===I[I.length-1]?(I=I.substr(0,I.length-1),n=n.substr(0,n.length-1),P=I):P=P.substr(0,P.length-1),a=y.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(I))a=y.closeIndex;else{var M=this.readStopNodeData(t,A,S+1);if(!M)throw new Error("Unexpected end of "+A);a=M.i,j=M.tagContent}var F=new T(I);I!==P&&O&&(F[":@"]=this.buildAttributesMap(P,n)),j&&(j=this.parseTextData(j,I,n,!0,O,!0,!0)),n=n.substr(0,n.lastIndexOf(".")),F.add(this.options.textNodeName,j),this.addChild(r,F,n,D)}else{if(P.length>0&&P.lastIndexOf("/")===P.length-1){if("/"===I[I.length-1]?(I=I.substr(0,I.length-1),n=n.substr(0,n.length-1),P=I):P=P.substr(0,P.length-1),this.options.transformTagName){var _=this.options.transformTagName(I);P===I&&(P=_),I=_}var k=new T(I);I!==P&&O&&(k[":@"]=this.buildAttributesMap(P,n)),this.addChild(r,k,n,D),n=n.substr(0,n.lastIndexOf("."))}else{var L=new T(I);this.tagsNodeStack.push(r),I!==P&&O&&(L[":@"]=this.buildAttributesMap(P,n)),this.addChild(r,L,n,D),r=L}i="",a=S}}else i+=t[a];return e.child};function R(t,e,r,i){this.options.captureMetaData||(i=void 0);var n=this.options.updateTag(e.tagname,r,e[":@"]);!1===n||("string"==typeof n?(e.tagname=n,t.addChild(e,i)):t.addChild(e,i))}var Y=function(t){if(this.options.processEntities){for(var e in this.docTypeEntities){var r=this.docTypeEntities[e];t=t.replace(r.regx,r.val)}for(var i in this.lastEntities){var n=this.lastEntities[i];t=t.replace(n.regex,n.val)}if(this.options.htmlEntities)for(var s in this.htmlEntities){var a=this.htmlEntities[s];t=t.replace(a.regex,a.val)}t=t.replace(this.ampEntity.regex,this.ampEntity.val)}return t};function G(t,e,r,i){return t&&(void 0===i&&(i=0===e.child.length),void 0!==(t=this.parseTextData(t,e.tagname,r,!1,!!e[":@"]&&0!==Object.keys(e[":@"]).length,i))&&""!==t&&e.add(this.options.textNodeName,t),t=""),t}function X(t,e,r,i){return!(!e||!e.has(i))||!(!t||!t.has(r))}function $(t,e,r,i){var n=t.indexOf(e,r);if(-1===n)throw new Error(i);return n+e.length-1}function W(t,e,r,i){void 0===i&&(i=">");var n=function(t,e,r){var i;void 0===r&&(r=">");for(var n="",s=e;s<t.length;s++){var a=t[s];if(i)a===i&&(i="");else if('"'===a||"'"===a)i=a;else if(a===r[0]){if(!r[1])return{data:n,index:s};if(t[s+1]===r[1])return{data:n,index:s}}else"\t"===a&&(a=" ");n+=a}}(t,e+1,i);if(n){var s=n.data,a=n.index,o=s.search(/\s/),l=s,u=!0;-1!==o&&(l=s.substring(0,o),s=s.substring(o+1).trimStart());var d=l;if(r){var h=l.indexOf(":");-1!==h&&(u=(l=l.substr(h+1))!==n.data.substr(h+1))}return{tagName:l,tagExp:s,closeIndex:a,attrExpPresent:u,rawTagName:d}}}function q(t,e,r){for(var i=r,n=1;r<t.length;r++)if("<"===t[r])if("/"===t[r+1]){var s=$(t,">",r,e+" is not closed");if(t.substring(r+2,s).trim()===e&&0==--n)return{tagContent:t.substring(i,r),i:s};r=s}else if("?"===t[r+1])r=$(t,"?>",r+1,"StopNode is not closed.");else if("!--"===t.substr(r+1,3))r=$(t,"--\x3e",r+3,"StopNode is not closed.");else if("!["===t.substr(r+1,2))r=$(t,"]]>",r,"StopNode is not closed.")-2;else{var a=W(t,r,">");a&&((a&&a.tagName)===e&&"/"!==a.tagExp[a.tagExp.length-1]&&n++,r=a.closeIndex)}}function Z(t,e,r){if(e&&"string"==typeof t){var i=t.trim();return"true"===i||"false"!==i&&function(t,e={}){if(e=Object.assign({},C,e),!t||"string"!=typeof t)return t;let r=t.trim();if(void 0!==e.skipLike&&e.skipLike.test(r))return t;if("0"===t)return 0;if(e.hex&&O.test(r))return function(t){if(parseInt)return parseInt(t,16);if(Number.parseInt)return Number.parseInt(t,16);if(window&&window.parseInt)return window.parseInt(t,16);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}(r);if(-1!==r.search(/.+[eE].+/))return function(t,e,r){if(!r.eNotation)return t;const i=e.match(V);if(i){let n=i[1]||"";const s=-1===i[3].indexOf("e")?"E":"e",a=i[2],o=n?t[a.length+1]===s:t[a.length]===s;return a.length>1&&o?t:1!==a.length||!i[3].startsWith(`.${s}`)&&i[3][0]!==s?r.leadingZeros&&!o?(e=(i[1]||"")+i[3],Number(e)):t:Number(e)}return t}(t,r,e);{const n=S.exec(r);if(n){const s=n[1]||"",a=n[2];let o=(i=n[3])&&-1!==i.indexOf(".")?("."===(i=i.replace(/0+$/,""))?i="0":"."===i[0]?i="0"+i:"."===i[i.length-1]&&(i=i.substring(0,i.length-1)),i):i;const l=s?"."===t[a.length+1]:"."===t[a.length];if(!e.leadingZeros&&(a.length>1||1===a.length&&!l))return t;{const i=Number(r),n=String(i);if(0===i||-0===i)return i;if(-1!==n.search(/[eE]/))return e.eNotation?i:t;if(-1!==r.indexOf("."))return"0"===n||n===o||n===`${s}${o}`?i:t;let l=a?o:r;return a?l===n||s+l===n?i:t:l===n||l===s+n?i:t}}return t}var i}(t,r)}return void 0!==t?t:""}function K(t,e,r){var i=Number.parseInt(t,e);return i>=0&&i<=1114111?String.fromCodePoint(i):r+t+";"}var Q=T.getMetaDataSymbol();function z(t,e){return J(t,e)}function J(t,e,r){for(var i,n={},s=0;s<t.length;s++){var a,o=t[s],l=H(o);if(a=void 0===r?l:r+"."+l,l===e.textNodeName)void 0===i?i=o[l]:i+=""+o[l];else{if(void 0===l)continue;if(o[l]){var u=J(o[l],e,a),d=et(u,e);void 0!==o[Q]&&(u[Q]=o[Q]),o[":@"]?tt(u,o[":@"],a,e):1!==Object.keys(u).length||void 0===u[e.textNodeName]||e.alwaysCreateTextNode?0===Object.keys(u).length&&(e.alwaysCreateTextNode?u[e.textNodeName]="":u=""):u=u[e.textNodeName],void 0!==n[l]&&n.hasOwnProperty(l)?(Array.isArray(n[l])||(n[l]=[n[l]]),n[l].push(u)):e.isArray(l,a,d)?n[l]=[u]:n[l]=u}}}return"string"==typeof i?i.length>0&&(n[e.textNodeName]=i):void 0!==i&&(n[e.textNodeName]=i),n}function H(t){for(var e=Object.keys(t),r=0;r<e.length;r++){var i=e[r];if(":@"!==i)return i}}function tt(t,e,r,i){if(e)for(var n=Object.keys(e),s=n.length,a=0;a<s;a++){var o=n[a];i.isArray(o,r+"."+o,!0,!0)?t[o]=[e[o]]:t[o]=e[o]}}function et(t,e){var r=e.textNodeName,i=Object.keys(t).length;return 0===i||!(1!==i||!t[r]&&"boolean"!=typeof t[r]&&0!==t[r])}var rt=function(){function t(t){this.externalEntities={},this.options=function(t){return Object.assign({},y,t)}(t)}var e=t.prototype;return e.parse=function(t,e){if("string"!=typeof t&&t.toString)t=t.toString();else if("string"!=typeof t)throw new Error("XML data is accepted in String or Bytes[] form.");if(e){!0===e&&(e={});var r=o(t,e);if(!0!==r)throw Error(r.err.msg+":"+r.err.line+":"+r.err.col)}var i=new M(this.options);i.addExternalEntities(this.externalEntities);var n=i.parseXml(t);return this.options.preserveOrder||void 0===n?n:z(n,this.options)},e.addEntity=function(t,e){if(-1!==e.indexOf("&"))throw new Error("Entity value can't have '&'");if(-1!==t.indexOf("&")||-1!==t.indexOf(";"))throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if("&"===e)throw new Error("An entity with value '&' is not permitted");this.externalEntities[t]=e},t.getMetaDataSymbol=function(){return T.getMetaDataSymbol()},t}();function it(t,e){var r="";return e.format&&e.indentBy.length>0&&(r="\n"),nt(t,e,"",r)}function nt(t,e,r,i){for(var n="",s=!1,a=0;a<t.length;a++){var o=t[a],l=st(o);if(void 0!==l){var u;if(u=0===r.length?l:r+"."+l,l!==e.textNodeName)if(l!==e.cdataPropName)if(l!==e.commentPropName)if("?"!==l[0]){var d=i;""!==d&&(d+=e.indentBy);var h=i+"<"+l+at(o[":@"],e),f=nt(o[l],e,u,d);-1!==e.unpairedTags.indexOf(l)?e.suppressUnpairedNode?n+=h+">":n+=h+"/>":f&&0!==f.length||!e.suppressEmptyNode?f&&f.endsWith(">")?n+=h+">"+f+i+"</"+l+">":(n+=h+">",f&&""!==i&&(f.includes("/>")||f.includes("</"))?n+=i+e.indentBy+f+i:n+=f,n+="</"+l+">"):n+=h+"/>",s=!0}else{var p=at(o[":@"],e),g="?xml"===l?"":i,c=o[l][0][e.textNodeName];n+=g+"<"+l+(c=0!==c.length?" "+c:"")+p+"?>",s=!0}else n+=i+"\x3c!--"+o[l][0][e.textNodeName]+"--\x3e",s=!0;else s&&(n+=i),n+="<![CDATA["+o[l][0][e.textNodeName]+"]]>",s=!1;else{var v=o[l];ot(u,e)||(v=lt(v=e.tagValueProcessor(l,v),e)),s&&(n+=i),n+=v,s=!1}}}return n}function st(t){for(var e=Object.keys(t),r=0;r<e.length;r++){var i=e[r];if(t.hasOwnProperty(i)&&":@"!==i)return i}}function at(t,e){var r="";if(t&&!e.ignoreAttributes)for(var i in t)if(t.hasOwnProperty(i)){var n=e.attributeValueProcessor(i,t[i]);!0===(n=lt(n,e))&&e.suppressBooleanAttributes?r+=" "+i.substr(e.attributeNamePrefix.length):r+=" "+i.substr(e.attributeNamePrefix.length)+'="'+n+'"'}return r}function ot(t,e){var r=(t=t.substr(0,t.length-e.textNodeName.length-1)).substr(t.lastIndexOf(".")+1);for(var i in e.stopNodes)if(e.stopNodes[i]===t||e.stopNodes[i]==="*."+r)return!0;return!1}function lt(t,e){if(t&&t.length>0&&e.processEntities)for(var r=0;r<e.entities.length;r++){var i=e.entities[r];t=t.replace(i.regex,i.val)}return t}var ut={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1};function dt(t){this.options=Object.assign({},ut,t),!0===this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=j(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=pt),this.processTextOrObjNode=ht,this.options.format?(this.indentate=ft,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function ht(t,e,r,i){var n=this.j2x(t,r+1,i.concat(e));return void 0!==t[this.options.textNodeName]&&1===Object.keys(t).length?this.buildTextValNode(t[this.options.textNodeName],e,n.attrStr,r):this.buildObjectNode(n.val,e,n.attrStr,r)}function ft(t){return this.options.indentBy.repeat(t)}function pt(t){return!(!t.startsWith(this.options.attributeNamePrefix)||t===this.options.textNodeName)&&t.substr(this.attrPrefixLen)}dt.prototype.build=function(t){return this.options.preserveOrder?it(t,this.options):(Array.isArray(t)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&((e={})[this.options.arrayNodeName]=t,t=e),this.j2x(t,0,[]).val);var e},dt.prototype.j2x=function(t,e,r){var i="",n="",s=r.join(".");for(var a in t)if(Object.prototype.hasOwnProperty.call(t,a))if(void 0===t[a])this.isAttribute(a)&&(n+="");else if(null===t[a])this.isAttribute(a)||a===this.options.cdataPropName?n+="":"?"===a[0]?n+=this.indentate(e)+"<"+a+"?"+this.tagEndChar:n+=this.indentate(e)+"<"+a+"/"+this.tagEndChar;else if(t[a]instanceof Date)n+=this.buildTextValNode(t[a],a,"",e);else if("object"!=typeof t[a]){var o=this.isAttribute(a);if(o&&!this.ignoreAttributesFn(o,s))i+=this.buildAttrPairStr(o,""+t[a]);else if(!o)if(a===this.options.textNodeName){var l=this.options.tagValueProcessor(a,""+t[a]);n+=this.replaceEntitiesValue(l)}else n+=this.buildTextValNode(t[a],a,"",e)}else if(Array.isArray(t[a])){for(var u=t[a].length,d="",h="",f=0;f<u;f++){var p=t[a][f];if(void 0===p);else if(null===p)"?"===a[0]?n+=this.indentate(e)+"<"+a+"?"+this.tagEndChar:n+=this.indentate(e)+"<"+a+"/"+this.tagEndChar;else if("object"==typeof p)if(this.options.oneListGroup){var g=this.j2x(p,e+1,r.concat(a));d+=g.val,this.options.attributesGroupName&&p.hasOwnProperty(this.options.attributesGroupName)&&(h+=g.attrStr)}else d+=this.processTextOrObjNode(p,a,e,r);else if(this.options.oneListGroup){var c=this.options.tagValueProcessor(a,p);d+=c=this.replaceEntitiesValue(c)}else d+=this.buildTextValNode(p,a,"",e)}this.options.oneListGroup&&(d=this.buildObjectNode(d,a,h,e)),n+=d}else if(this.options.attributesGroupName&&a===this.options.attributesGroupName)for(var v=Object.keys(t[a]),m=v.length,x=0;x<m;x++)i+=this.buildAttrPairStr(v[x],""+t[a][v[x]]);else n+=this.processTextOrObjNode(t[a],a,e,r);return{attrStr:i,val:n}},dt.prototype.buildAttrPairStr=function(t,e){return e=this.options.attributeValueProcessor(t,""+e),e=this.replaceEntitiesValue(e),this.options.suppressBooleanAttributes&&"true"===e?" "+t:" "+t+'="'+e+'"'},dt.prototype.buildObjectNode=function(t,e,r,i){if(""===t)return"?"===e[0]?this.indentate(i)+"<"+e+r+"?"+this.tagEndChar:this.indentate(i)+"<"+e+r+this.closeTag(e)+this.tagEndChar;var n="</"+e+this.tagEndChar,s="";return"?"===e[0]&&(s="?",n=""),!r&&""!==r||-1!==t.indexOf("<")?!1!==this.options.commentPropName&&e===this.options.commentPropName&&0===s.length?this.indentate(i)+"\x3c!--"+t+"--\x3e"+this.newLine:this.indentate(i)+"<"+e+r+s+this.tagEndChar+t+this.indentate(i)+n:this.indentate(i)+"<"+e+r+s+">"+t+n},dt.prototype.closeTag=function(t){var e="";return-1!==this.options.unpairedTags.indexOf(t)?this.options.suppressUnpairedNode||(e="/"):e=this.options.suppressEmptyNode?"/":"></"+t,e},dt.prototype.buildTextValNode=function(t,e,r,i){if(!1!==this.options.cdataPropName&&e===this.options.cdataPropName)return this.indentate(i)+"<![CDATA["+t+"]]>"+this.newLine;if(!1!==this.options.commentPropName&&e===this.options.commentPropName)return this.indentate(i)+"\x3c!--"+t+"--\x3e"+this.newLine;if("?"===e[0])return this.indentate(i)+"<"+e+r+"?"+this.tagEndChar;var n=this.options.tagValueProcessor(e,t);return""===(n=this.replaceEntitiesValue(n))?this.indentate(i)+"<"+e+r+this.closeTag(e)+this.tagEndChar:this.indentate(i)+"<"+e+r+">"+n+"</"+e+this.tagEndChar},dt.prototype.replaceEntitiesValue=function(t){if(t&&t.length>0&&this.options.processEntities)for(var e=0;e<this.options.entities.length;e++){var r=this.options.entities[e];t=t.replace(r.regex,r.val)}return t};var gt={validate:o};return e})()));
2
+ //# sourceMappingURL=fxp.min.js.map