lakutata 2.0.82 → 2.0.83

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 (464) hide show
  1. package/com/docker.cjs +1 -1
  2. package/com/docker.mjs +1 -1
  3. package/decorator/orm.cjs +84 -84
  4. package/decorator/orm.mjs +42 -128
  5. package/orm.cjs +871 -1408
  6. package/orm.mjs +712 -1462
  7. package/package.json +1 -1
  8. package/src/components/Database.cjs +2 -2
  9. package/src/components/Database.mjs +6 -6
  10. package/src/components/cacher/Cacher.cjs +129 -129
  11. package/src/components/cacher/Cacher.mjs +117 -117
  12. package/src/components/cacher/adapters/CreateFileCacheAdapter.cjs +303 -312
  13. package/src/components/cacher/adapters/CreateFileCacheAdapter.mjs +304 -313
  14. package/src/components/cacher/adapters/CreateMemcacheCacheAdapter.cjs +12 -12
  15. package/src/components/cacher/adapters/CreateMemcacheCacheAdapter.mjs +11 -11
  16. package/src/components/cacher/adapters/CreateMongoCacheAdapter.cjs +16 -16
  17. package/src/components/cacher/adapters/CreateMongoCacheAdapter.mjs +14 -14
  18. package/src/components/cacher/adapters/CreateMysqlCacheAdapter.cjs +11 -11
  19. package/src/components/cacher/adapters/CreateMysqlCacheAdapter.mjs +11 -11
  20. package/src/components/cacher/adapters/CreatePostgresCacheAdapter.cjs +12 -12
  21. package/src/components/cacher/adapters/CreatePostgresCacheAdapter.mjs +13 -13
  22. package/src/components/cacher/adapters/CreateRedisCacheAdapter.cjs +2 -2
  23. package/src/components/cacher/adapters/CreateRedisCacheAdapter.mjs +2 -2
  24. package/src/components/cacher/adapters/CreateSqliteCacheAdapter.cjs +10 -10
  25. package/src/components/cacher/adapters/CreateSqliteCacheAdapter.mjs +10 -10
  26. package/src/components/cacher/lib/IsDriverPackageInstalled.cjs +2 -2
  27. package/src/components/cacher/lib/IsDriverPackageInstalled.mjs +5 -5
  28. package/src/components/docker/ConnectionOptionsBuilder.cjs +11 -11
  29. package/src/components/docker/ConnectionOptionsBuilder.mjs +7 -7
  30. package/src/components/docker/Docker.cjs +5067 -4956
  31. package/src/components/docker/Docker.mjs +4982 -4871
  32. package/src/components/docker/lib/DockerContainer.cjs +1 -1
  33. package/src/components/docker/lib/DockerContainer.mjs +1 -1
  34. package/src/components/docker/lib/DockerContainerTTY.cjs +1 -1
  35. package/src/components/docker/lib/DockerContainerTTY.mjs +1 -1
  36. package/src/components/docker/lib/ParseEnvToRecord.cjs +2 -2
  37. package/src/components/docker/lib/ParseEnvToRecord.mjs +12 -12
  38. package/src/components/docker/lib/ParseRepositoryTag.cjs +9 -9
  39. package/src/components/docker/lib/ParseRepositoryTag.mjs +11 -11
  40. package/src/components/entrypoint/Entrypoint.cjs +1678 -2168
  41. package/src/components/entrypoint/Entrypoint.mjs +1680 -2170
  42. package/src/components/monitor/AliveMonitor.cjs +2 -2
  43. package/src/components/monitor/AliveMonitor.mjs +2 -2
  44. package/src/components/monitor/MemoryMonitor.cjs +3 -3
  45. package/src/decorators/asst/After.cjs +3 -3
  46. package/src/decorators/asst/After.mjs +2 -2
  47. package/src/decorators/asst/Before.cjs +2 -2
  48. package/src/decorators/asst/Before.mjs +4 -4
  49. package/src/decorators/ctrl/CLIAction.cjs +2 -2
  50. package/src/decorators/ctrl/CLIAction.mjs +7 -7
  51. package/src/decorators/ctrl/HTTPAction.cjs +6 -6
  52. package/src/decorators/ctrl/HTTPAction.mjs +4 -4
  53. package/src/decorators/ctrl/ServiceAction.cjs +3 -3
  54. package/src/decorators/ctrl/ServiceAction.mjs +4 -4
  55. package/src/decorators/ctrl/http/DELETE.cjs +2 -2
  56. package/src/decorators/ctrl/http/DELETE.mjs +2 -2
  57. package/src/decorators/ctrl/http/GET.cjs +2 -2
  58. package/src/decorators/ctrl/http/GET.mjs +2 -2
  59. package/src/decorators/ctrl/http/HEAD.cjs +2 -2
  60. package/src/decorators/ctrl/http/HEAD.mjs +2 -2
  61. package/src/decorators/ctrl/http/OPTIONS.cjs +2 -2
  62. package/src/decorators/ctrl/http/OPTIONS.mjs +2 -2
  63. package/src/decorators/ctrl/http/PATCH.cjs +2 -2
  64. package/src/decorators/ctrl/http/PATCH.mjs +2 -2
  65. package/src/decorators/ctrl/http/POST.cjs +2 -2
  66. package/src/decorators/ctrl/http/POST.mjs +2 -2
  67. package/src/decorators/ctrl/http/PUT.cjs +2 -2
  68. package/src/decorators/ctrl/http/PUT.mjs +2 -2
  69. package/src/decorators/di/Autoload.cjs +2 -2
  70. package/src/decorators/di/Autoload.mjs +2 -2
  71. package/src/decorators/di/Configurable.cjs +3 -3
  72. package/src/decorators/di/Configurable.mjs +2 -2
  73. package/src/decorators/di/Inject.cjs +6 -6
  74. package/src/decorators/di/Inject.mjs +11 -11
  75. package/src/decorators/di/Lifetime.cjs +18 -18
  76. package/src/decorators/di/Lifetime.mjs +13 -13
  77. package/src/decorators/dto/Accept.cjs +3 -3
  78. package/src/decorators/dto/Accept.mjs +2 -2
  79. package/src/decorators/dto/Expect.cjs +2 -2
  80. package/src/decorators/dto/Expect.mjs +3 -3
  81. package/src/decorators/dto/IndexSignature.cjs +2 -2
  82. package/src/decorators/dto/IndexSignature.mjs +3 -3
  83. package/src/decorators/dto/Return.cjs +3 -3
  84. package/src/decorators/dto/Return.mjs +2 -2
  85. package/src/decorators/orm/AfterInsert.cjs +26 -4
  86. package/src/decorators/orm/AfterInsert.mjs +25 -5
  87. package/src/decorators/orm/AfterLoad.cjs +26 -4
  88. package/src/decorators/orm/AfterLoad.mjs +25 -5
  89. package/src/decorators/orm/AfterRecover.cjs +26 -4
  90. package/src/decorators/orm/AfterRecover.mjs +25 -5
  91. package/src/decorators/orm/AfterRemove.cjs +26 -4
  92. package/src/decorators/orm/AfterRemove.mjs +25 -5
  93. package/src/decorators/orm/AfterSoftRemove.cjs +26 -4
  94. package/src/decorators/orm/AfterSoftRemove.mjs +25 -5
  95. package/src/decorators/orm/AfterUpdate.cjs +26 -4
  96. package/src/decorators/orm/AfterUpdate.mjs +25 -5
  97. package/src/decorators/orm/BeforeInsert.cjs +26 -4
  98. package/src/decorators/orm/BeforeInsert.mjs +25 -5
  99. package/src/decorators/orm/BeforeRecover.cjs +26 -4
  100. package/src/decorators/orm/BeforeRecover.mjs +25 -5
  101. package/src/decorators/orm/BeforeRemove.cjs +26 -4
  102. package/src/decorators/orm/BeforeRemove.mjs +25 -5
  103. package/src/decorators/orm/BeforeSoftRemove.cjs +26 -4
  104. package/src/decorators/orm/BeforeSoftRemove.mjs +25 -5
  105. package/src/decorators/orm/BeforeUpdate.cjs +26 -4
  106. package/src/decorators/orm/BeforeUpdate.mjs +25 -5
  107. package/src/decorators/orm/Check.cjs +29 -4
  108. package/src/decorators/orm/Check.mjs +28 -5
  109. package/src/decorators/orm/ChildEntity.cjs +29 -4
  110. package/src/decorators/orm/ChildEntity.mjs +28 -5
  111. package/src/decorators/orm/Column.cjs +61 -4
  112. package/src/decorators/orm/Column.mjs +61 -6
  113. package/src/decorators/orm/CreateDateColumn.cjs +25 -4
  114. package/src/decorators/orm/CreateDateColumn.mjs +24 -5
  115. package/src/decorators/orm/DeleteDateColumn.cjs +25 -4
  116. package/src/decorators/orm/DeleteDateColumn.mjs +23 -4
  117. package/src/decorators/orm/Entity.cjs +35 -4
  118. package/src/decorators/orm/Entity.mjs +33 -4
  119. package/src/decorators/orm/EventSubscriber.cjs +22 -4
  120. package/src/decorators/orm/EventSubscriber.mjs +21 -5
  121. package/src/decorators/orm/Exclusion.cjs +29 -4
  122. package/src/decorators/orm/Exclusion.mjs +28 -5
  123. package/src/decorators/orm/Generated.cjs +24 -4
  124. package/src/decorators/orm/Generated.mjs +23 -5
  125. package/src/decorators/orm/Index.cjs +41 -4
  126. package/src/decorators/orm/Index.mjs +41 -6
  127. package/src/decorators/orm/JoinColumn.cjs +29 -4
  128. package/src/decorators/orm/JoinColumn.mjs +28 -5
  129. package/src/decorators/orm/JoinTable.cjs +30 -4
  130. package/src/decorators/orm/JoinTable.mjs +28 -4
  131. package/src/decorators/orm/ManyToMany.cjs +42 -4
  132. package/src/decorators/orm/ManyToMany.mjs +40 -4
  133. package/src/decorators/orm/ManyToOne.cjs +42 -4
  134. package/src/decorators/orm/ManyToOne.mjs +40 -4
  135. package/src/decorators/orm/ObjectIdColumn.cjs +28 -4
  136. package/src/decorators/orm/ObjectIdColumn.mjs +27 -5
  137. package/src/decorators/orm/OneToMany.cjs +34 -4
  138. package/src/decorators/orm/OneToMany.mjs +34 -6
  139. package/src/decorators/orm/OneToOne.cjs +42 -4
  140. package/src/decorators/orm/OneToOne.mjs +40 -4
  141. package/src/decorators/orm/PrimaryColumn.cjs +49 -4
  142. package/src/decorators/orm/PrimaryColumn.mjs +49 -6
  143. package/src/decorators/orm/PrimaryGeneratedColumn.cjs +54 -4
  144. package/src/decorators/orm/PrimaryGeneratedColumn.mjs +54 -6
  145. package/src/decorators/orm/RelationId.cjs +26 -4
  146. package/src/decorators/orm/RelationId.mjs +25 -5
  147. package/src/decorators/orm/TableInheritance.cjs +26 -4
  148. package/src/decorators/orm/TableInheritance.mjs +25 -5
  149. package/src/decorators/orm/Tree.cjs +24 -4
  150. package/src/decorators/orm/Tree.mjs +23 -5
  151. package/src/decorators/orm/TreeChildren.cjs +31 -4
  152. package/src/decorators/orm/TreeChildren.mjs +29 -4
  153. package/src/decorators/orm/TreeLevelColumn.cjs +25 -4
  154. package/src/decorators/orm/TreeLevelColumn.mjs +23 -4
  155. package/src/decorators/orm/TreeParent.cjs +31 -4
  156. package/src/decorators/orm/TreeParent.mjs +29 -4
  157. package/src/decorators/orm/Unique.cjs +44 -4
  158. package/src/decorators/orm/Unique.mjs +44 -6
  159. package/src/decorators/orm/UpdateDateColumn.cjs +25 -4
  160. package/src/decorators/orm/UpdateDateColumn.mjs +24 -5
  161. package/src/decorators/orm/VersionColumn.cjs +25 -4
  162. package/src/decorators/orm/VersionColumn.mjs +24 -5
  163. package/src/decorators/orm/ViewColumn.cjs +25 -4
  164. package/src/decorators/orm/ViewColumn.mjs +24 -5
  165. package/src/decorators/orm/ViewEntity.cjs +34 -4
  166. package/src/decorators/orm/ViewEntity.mjs +33 -5
  167. package/src/decorators/orm/VirtualColumn.cjs +42 -4
  168. package/src/decorators/orm/VirtualColumn.mjs +40 -4
  169. package/src/lib/base/EventEmitter.cjs +1195 -1202
  170. package/src/lib/base/EventEmitter.mjs +1195 -1202
  171. package/src/lib/base/async-constructor/Append.cjs +11 -11
  172. package/src/lib/base/async-constructor/Append.mjs +7 -7
  173. package/src/lib/base/internal/BasicInfo.cjs +10 -10
  174. package/src/lib/base/internal/BasicInfo.mjs +9 -9
  175. package/src/lib/base/internal/CamelCase.cjs +4 -4
  176. package/src/lib/base/internal/CamelCase.mjs +11 -11
  177. package/src/lib/base/internal/ConfigurableRecordsInjection.cjs +19 -19
  178. package/src/lib/base/internal/ConfigurableRecordsInjection.mjs +18 -18
  179. package/src/lib/base/internal/ConstructorSymbol.cjs +10 -10
  180. package/src/lib/base/internal/ConstructorSymbol.mjs +8 -8
  181. package/src/lib/base/internal/ControllerEntrypoint.cjs +65 -65
  182. package/src/lib/base/internal/ControllerEntrypoint.mjs +36 -36
  183. package/src/lib/base/internal/DataValidator.cjs +185 -174
  184. package/src/lib/base/internal/DataValidator.mjs +230 -219
  185. package/src/lib/base/internal/GetActionDTOAndOptions.cjs +9 -9
  186. package/src/lib/base/internal/GetActionDTOAndOptions.mjs +10 -10
  187. package/src/lib/base/internal/IEEE754.cjs +74 -74
  188. package/src/lib/base/internal/IEEE754.mjs +70 -70
  189. package/src/lib/base/internal/MethodAssistantFunction.cjs +28 -28
  190. package/src/lib/base/internal/MethodAssistantFunction.mjs +38 -38
  191. package/src/lib/base/internal/MethodValidation.cjs +25 -25
  192. package/src/lib/base/internal/MethodValidation.mjs +20 -20
  193. package/src/lib/base/internal/ObjectConfiguration.cjs +10 -10
  194. package/src/lib/base/internal/ObjectConfiguration.mjs +15 -15
  195. package/src/lib/base/internal/ObjectContainer.cjs +7 -7
  196. package/src/lib/base/internal/ObjectContainer.mjs +6 -6
  197. package/src/lib/base/internal/ObjectInjection.cjs +16 -16
  198. package/src/lib/base/internal/ObjectInjection.mjs +13 -13
  199. package/src/lib/base/internal/ObjectLifetime.cjs +10 -10
  200. package/src/lib/base/internal/ObjectLifetime.mjs +9 -9
  201. package/src/lib/base/internal/ObjectWeakRefs.cjs +11 -11
  202. package/src/lib/base/internal/ObjectWeakRefs.mjs +9 -9
  203. package/src/lib/base/internal/PatternManager.cjs +739 -744
  204. package/src/lib/base/internal/PatternManager.mjs +743 -748
  205. package/src/lib/base/internal/StringifyPattern.cjs +26 -26
  206. package/src/lib/base/internal/StringifyPattern.mjs +26 -26
  207. package/src/lib/base/internal/ThrowWarning.cjs +2 -2
  208. package/src/lib/base/internal/ThrowWarning.mjs +2 -2
  209. package/src/lib/core/Alias.cjs +5 -5
  210. package/src/lib/core/Application.cjs +115 -128
  211. package/src/lib/core/Application.mjs +135 -148
  212. package/src/lib/helpers/ArrayToSet.cjs +2 -2
  213. package/src/lib/helpers/ArrayToSet.mjs +3 -3
  214. package/src/lib/helpers/As.cjs +2 -2
  215. package/src/lib/helpers/As.mjs +2 -2
  216. package/src/lib/helpers/ConvertArrayLikeToIterable.cjs +3 -3
  217. package/src/lib/helpers/ConvertArrayLikeToIterable.mjs +3 -3
  218. package/src/lib/helpers/ConvertArrayLikeToStream.cjs +2 -2
  219. package/src/lib/helpers/ConvertArrayLikeToStream.mjs +2 -2
  220. package/src/lib/helpers/Delay.cjs +2 -2
  221. package/src/lib/helpers/Delay.mjs +2 -2
  222. package/src/lib/helpers/DevNull.cjs +2 -2
  223. package/src/lib/helpers/DevNull.mjs +2 -2
  224. package/src/lib/helpers/GetObjectNestingDepth.cjs +12 -12
  225. package/src/lib/helpers/GetObjectNestingDepth.mjs +11 -11
  226. package/src/lib/helpers/GetObjectPropertyPaths.cjs +7 -7
  227. package/src/lib/helpers/GetObjectPropertyPaths.mjs +9 -9
  228. package/src/lib/helpers/Glob.cjs +890 -890
  229. package/src/lib/helpers/Glob.mjs +889 -889
  230. package/src/lib/helpers/GraceExit.cjs +3 -3
  231. package/src/lib/helpers/GraceExit.mjs +7 -7
  232. package/src/lib/helpers/HexToIEEE754.cjs +4 -4
  233. package/src/lib/helpers/HexToIEEE754.mjs +2 -2
  234. package/src/lib/helpers/HexToSigned.cjs +5 -5
  235. package/src/lib/helpers/HexToSigned.mjs +4 -4
  236. package/src/lib/helpers/HexToUnsigned.cjs +2 -2
  237. package/src/lib/helpers/HexToUnsigned.mjs +2 -2
  238. package/src/lib/helpers/IEEE754ToHex.cjs +5 -5
  239. package/src/lib/helpers/IEEE754ToHex.mjs +5 -5
  240. package/src/lib/helpers/IsAbortError.cjs +2 -2
  241. package/src/lib/helpers/IsAbortError.mjs +3 -3
  242. package/src/lib/helpers/IsEmptyObject.cjs +3 -3
  243. package/src/lib/helpers/IsEmptyObject.mjs +3 -3
  244. package/src/lib/helpers/IsExists.cjs +5 -5
  245. package/src/lib/helpers/IsExists.mjs +4 -4
  246. package/src/lib/helpers/IsHtml.cjs +8 -18
  247. package/src/lib/helpers/IsHtml.mjs +8 -18
  248. package/src/lib/helpers/IsNativeFunction.cjs +2 -2
  249. package/src/lib/helpers/IsNativeFunction.mjs +2 -2
  250. package/src/lib/helpers/IsPath.cjs +2 -2
  251. package/src/lib/helpers/IsPath.mjs +5 -5
  252. package/src/lib/helpers/IsPromise.cjs +2 -2
  253. package/src/lib/helpers/IsPromise.mjs +2 -2
  254. package/src/lib/helpers/IsPromiseLike.cjs +5 -5
  255. package/src/lib/helpers/IsPromiseLike.mjs +6 -6
  256. package/src/lib/helpers/IsXML.cjs +1531 -1525
  257. package/src/lib/helpers/IsXML.mjs +1527 -1521
  258. package/src/lib/helpers/MD5.cjs +2 -2
  259. package/src/lib/helpers/MD5.mjs +2 -2
  260. package/src/lib/helpers/MergeArray.cjs +3 -3
  261. package/src/lib/helpers/MergeArray.mjs +3 -3
  262. package/src/lib/helpers/MergeMap.cjs +3 -3
  263. package/src/lib/helpers/MergeMap.mjs +3 -3
  264. package/src/lib/helpers/MergeSet.cjs +2 -2
  265. package/src/lib/helpers/MergeSet.mjs +3 -3
  266. package/src/lib/helpers/NoCase.cjs +27 -27
  267. package/src/lib/helpers/NoCase.mjs +24 -24
  268. package/src/lib/helpers/NonceStr.cjs +2 -2
  269. package/src/lib/helpers/NonceStr.mjs +2 -2
  270. package/src/lib/helpers/ObjectConstructor.cjs +2 -2
  271. package/src/lib/helpers/ObjectConstructor.mjs +4 -4
  272. package/src/lib/helpers/ObjectHash.cjs +377 -384
  273. package/src/lib/helpers/ObjectHash.mjs +373 -380
  274. package/src/lib/helpers/ObjectParentConstructor.cjs +2 -2
  275. package/src/lib/helpers/ObjectParentConstructor.mjs +5 -5
  276. package/src/lib/helpers/ObjectParentConstructors.cjs +6 -6
  277. package/src/lib/helpers/ObjectParentConstructors.mjs +2 -2
  278. package/src/lib/helpers/ObjectPrototype.cjs +2 -2
  279. package/src/lib/helpers/ObjectPrototype.mjs +2 -2
  280. package/src/lib/helpers/ObjectToMap.cjs +2 -2
  281. package/src/lib/helpers/ObjectToMap.mjs +3 -3
  282. package/src/lib/helpers/Paginator.cjs +2 -2
  283. package/src/lib/helpers/Paginator.mjs +6 -6
  284. package/src/lib/helpers/RandomString.cjs +148 -169
  285. package/src/lib/helpers/RandomString.mjs +145 -166
  286. package/src/lib/helpers/SHA1.cjs +2 -2
  287. package/src/lib/helpers/SHA1.mjs +2 -2
  288. package/src/lib/helpers/SHA256.cjs +2 -2
  289. package/src/lib/helpers/SHA256.mjs +2 -2
  290. package/src/lib/helpers/SetToArray.cjs +2 -2
  291. package/src/lib/helpers/SetToArray.mjs +2 -2
  292. package/src/lib/helpers/SignedToHex.cjs +4 -4
  293. package/src/lib/helpers/SignedToHex.mjs +4 -4
  294. package/src/lib/helpers/SortArray.cjs +16 -16
  295. package/src/lib/helpers/SortArray.mjs +15 -15
  296. package/src/lib/helpers/SortKeys.cjs +41 -41
  297. package/src/lib/helpers/SortKeys.mjs +41 -41
  298. package/src/lib/helpers/SortObject.cjs +2 -2
  299. package/src/lib/helpers/SortObject.mjs +2 -2
  300. package/src/lib/helpers/Templating.cjs +25 -25
  301. package/src/lib/helpers/Templating.mjs +25 -25
  302. package/src/lib/helpers/URLBuilder.cjs +355 -355
  303. package/src/lib/helpers/URLBuilder.mjs +349 -349
  304. package/src/lib/helpers/UniqueArray.cjs +3 -3
  305. package/src/lib/helpers/UniqueArray.mjs +2 -2
  306. package/src/lib/helpers/UnsignedToHex.cjs +3 -3
  307. package/src/lib/helpers/UnsignedToHex.mjs +3 -3
  308. package/src/lib/ioc/DependencyInjectionContainer.cjs +106 -106
  309. package/src/lib/ioc/DependencyInjectionContainer.mjs +122 -122
  310. package/src/lib/ioc/FunctionTokenizer.cjs +115 -115
  311. package/src/lib/ioc/FunctionTokenizer.mjs +102 -102
  312. package/src/lib/ioc/Lifetime.cjs +5 -5
  313. package/src/lib/ioc/Lifetime.mjs +5 -5
  314. package/src/lib/ioc/ListModules.cjs +5298 -5221
  315. package/src/lib/ioc/ListModules.mjs +5258 -5181
  316. package/src/lib/ioc/LoadModules.cjs +56 -56
  317. package/src/lib/ioc/LoadModules.mjs +69 -69
  318. package/src/lib/ioc/ParamParser.cjs +30 -30
  319. package/src/lib/ioc/ParamParser.mjs +41 -41
  320. package/src/lib/ioc/Resolvers.cjs +87 -87
  321. package/src/lib/ioc/Resolvers.mjs +109 -109
  322. package/src/lib/ioc/Utils.cjs +12 -12
  323. package/src/lib/ioc/Utils.mjs +18 -18
  324. package/src/lib/validation/VLD.cjs +4025 -4202
  325. package/src/lib/validation/VLD.mjs +2972 -3149
  326. package/src/providers/Database.cjs +2 -2
  327. package/src/providers/Database.mjs +7 -7
  328. package/src/providers/PasswordHash.cjs +330 -330
  329. package/src/providers/PasswordHash.mjs +397 -397
  330. package/src/providers/migration/GenerateMigration.cjs +2 -2
  331. package/src/providers/migration/GenerateMigration.mjs +2 -2
  332. package/vendor/Package.1.cjs +256 -256
  333. package/vendor/Package.1.mjs +254 -254
  334. package/vendor/Package.112.cjs +42157 -42076
  335. package/vendor/Package.112.mjs +42222 -42081
  336. package/vendor/Package.13.cjs +36 -36
  337. package/vendor/Package.13.mjs +24 -24
  338. package/vendor/Package.16.cjs +12351 -12233
  339. package/vendor/Package.16.mjs +12348 -12230
  340. package/vendor/Package.17.cjs +924 -924
  341. package/vendor/Package.17.mjs +943 -943
  342. package/vendor/Package.18.cjs +48229 -20
  343. package/vendor/Package.18.mjs +48192 -24
  344. package/vendor/Package.2.cjs +5824 -5853
  345. package/vendor/Package.2.mjs +5780 -5809
  346. package/vendor/Package.3.cjs +60 -60
  347. package/vendor/Package.3.mjs +85 -85
  348. package/vendor/Package.4.cjs +874 -884
  349. package/vendor/Package.4.mjs +877 -887
  350. package/vendor/Package.5.cjs +15 -19
  351. package/vendor/Package.5.mjs +10 -14
  352. package/vendor/Package.6.cjs +2058 -2067
  353. package/vendor/Package.6.mjs +2064 -2073
  354. package/vendor/Package.610.cjs +9 -9
  355. package/vendor/Package.611.cjs +39 -39
  356. package/vendor/Package.611.mjs +22 -22
  357. package/vendor/Package.612.cjs +33 -33
  358. package/vendor/Package.612.mjs +17 -17
  359. package/vendor/Package.613.cjs +62 -62
  360. package/vendor/Package.613.mjs +29 -29
  361. package/vendor/Package.62.cjs +295 -298
  362. package/vendor/Package.62.mjs +278 -281
  363. package/vendor/Package.63.cjs +354 -354
  364. package/vendor/Package.63.mjs +229 -229
  365. package/vendor/Package.64.cjs +74 -74
  366. package/vendor/Package.64.mjs +74 -74
  367. package/vendor/Package.65.cjs +1851 -1858
  368. package/vendor/Package.65.mjs +1693 -1700
  369. package/vendor/Package.66.cjs +16 -16
  370. package/vendor/Package.66.mjs +16 -16
  371. package/vendor/Package.67.cjs +87 -87
  372. package/vendor/Package.67.mjs +85 -85
  373. package/vendor/Package.68.cjs +14 -14
  374. package/vendor/Package.68.mjs +6 -6
  375. package/vendor/Package.69.cjs +8 -8
  376. package/vendor/Package.7.cjs +3 -3
  377. package/vendor/Package.7.mjs +3 -3
  378. package/vendor/Package.9.cjs +124 -138
  379. package/vendor/Package.9.mjs +121 -135
  380. package/vendor/TypeDef.internal.3.d.ts +0 -14
  381. package/vendor/Package.19.cjs +0 -37
  382. package/vendor/Package.19.mjs +0 -35
  383. package/vendor/Package.20.cjs +0 -37
  384. package/vendor/Package.20.mjs +0 -35
  385. package/vendor/Package.21.cjs +0 -37
  386. package/vendor/Package.21.mjs +0 -35
  387. package/vendor/Package.22.cjs +0 -37
  388. package/vendor/Package.22.mjs +0 -35
  389. package/vendor/Package.23.cjs +0 -37
  390. package/vendor/Package.23.mjs +0 -35
  391. package/vendor/Package.24.cjs +0 -37
  392. package/vendor/Package.24.mjs +0 -35
  393. package/vendor/Package.25.cjs +0 -37
  394. package/vendor/Package.25.mjs +0 -35
  395. package/vendor/Package.26.cjs +0 -37
  396. package/vendor/Package.26.mjs +0 -35
  397. package/vendor/Package.27.cjs +0 -37
  398. package/vendor/Package.27.mjs +0 -35
  399. package/vendor/Package.28.cjs +0 -37
  400. package/vendor/Package.28.mjs +0 -35
  401. package/vendor/Package.29.cjs +0 -40
  402. package/vendor/Package.29.mjs +0 -38
  403. package/vendor/Package.30.cjs +0 -41
  404. package/vendor/Package.30.mjs +0 -39
  405. package/vendor/Package.31.cjs +0 -72
  406. package/vendor/Package.31.mjs +0 -70
  407. package/vendor/Package.32.cjs +0 -37
  408. package/vendor/Package.32.mjs +0 -35
  409. package/vendor/Package.33.cjs +0 -37
  410. package/vendor/Package.33.mjs +0 -35
  411. package/vendor/Package.34.cjs +0 -46
  412. package/vendor/Package.34.mjs +0 -44
  413. package/vendor/Package.35.cjs +0 -34
  414. package/vendor/Package.35.mjs +0 -32
  415. package/vendor/Package.36.cjs +0 -40
  416. package/vendor/Package.36.mjs +0 -38
  417. package/vendor/Package.37.cjs +0 -36
  418. package/vendor/Package.37.mjs +0 -34
  419. package/vendor/Package.38.cjs +0 -52
  420. package/vendor/Package.38.mjs +0 -50
  421. package/vendor/Package.39.cjs +0 -41
  422. package/vendor/Package.39.mjs +0 -39
  423. package/vendor/Package.40.cjs +0 -42
  424. package/vendor/Package.40.mjs +0 -40
  425. package/vendor/Package.41.cjs +0 -53
  426. package/vendor/Package.41.mjs +0 -51
  427. package/vendor/Package.42.cjs +0 -53
  428. package/vendor/Package.42.mjs +0 -51
  429. package/vendor/Package.43.cjs +0 -40
  430. package/vendor/Package.43.mjs +0 -38
  431. package/vendor/Package.44.cjs +0 -46
  432. package/vendor/Package.44.mjs +0 -44
  433. package/vendor/Package.45.cjs +0 -53
  434. package/vendor/Package.45.mjs +0 -51
  435. package/vendor/Package.46.cjs +0 -59
  436. package/vendor/Package.46.mjs +0 -57
  437. package/vendor/Package.47.cjs +0 -65
  438. package/vendor/Package.47.mjs +0 -63
  439. package/vendor/Package.48.cjs +0 -38
  440. package/vendor/Package.48.mjs +0 -36
  441. package/vendor/Package.49.cjs +0 -38
  442. package/vendor/Package.49.mjs +0 -36
  443. package/vendor/Package.50.cjs +0 -36
  444. package/vendor/Package.50.mjs +0 -34
  445. package/vendor/Package.51.cjs +0 -43
  446. package/vendor/Package.51.mjs +0 -41
  447. package/vendor/Package.52.cjs +0 -37
  448. package/vendor/Package.52.mjs +0 -35
  449. package/vendor/Package.53.cjs +0 -43
  450. package/vendor/Package.53.mjs +0 -41
  451. package/vendor/Package.54.cjs +0 -55
  452. package/vendor/Package.54.mjs +0 -53
  453. package/vendor/Package.55.cjs +0 -37
  454. package/vendor/Package.55.mjs +0 -35
  455. package/vendor/Package.56.cjs +0 -37
  456. package/vendor/Package.56.mjs +0 -35
  457. package/vendor/Package.57.cjs +0 -37
  458. package/vendor/Package.57.mjs +0 -35
  459. package/vendor/Package.58.cjs +0 -45
  460. package/vendor/Package.58.mjs +0 -43
  461. package/vendor/Package.59.cjs +0 -53
  462. package/vendor/Package.59.mjs +0 -51
  463. package/vendor/Package.60.cjs +0 -47649
  464. package/vendor/Package.60.mjs +0 -47606
@@ -4,1763 +4,1769 @@ Object.defineProperty(exports, Symbol.toStringTag, {
4
4
  value: "Module"
5
5
  });
6
6
 
7
- const e = require("../../../vendor/Package.5.cjs");
7
+ const t = require("../../../vendor/Package.5.cjs");
8
8
 
9
- var t = {};
9
+ var e = {};
10
10
 
11
- var i = {};
11
+ var n = {};
12
12
 
13
- var r;
14
-
15
- function requireUtil() {
16
- if (r) return i;
17
- r = 1;
18
- (function(e) {
19
- "use strict";
20
- const t = ":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";
21
- const i = t + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040";
22
- const r = "[" + t + "][" + i + "]*";
23
- const n = new RegExp("^" + r + "$");
24
- const getAllMatches = function(e, t) {
13
+ (function(t) {
14
+ "use strict";
15
+ const e = ":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";
16
+ const n = e + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040";
17
+ const s = "[" + e + "][" + n + "]*";
18
+ const i = new RegExp("^" + s + "$");
19
+ const r = function(t, e) {
20
+ const n = [];
21
+ let s = e.exec(t);
22
+ while (s) {
25
23
  const i = [];
26
- let r = t.exec(e);
27
- while (r) {
28
- const n = [];
29
- n.startIndex = t.lastIndex - r[0].length;
30
- const s = r.length;
31
- for (let e = 0; e < s; e++) {
32
- n.push(r[e]);
33
- }
34
- i.push(n);
35
- r = t.exec(e);
24
+ i.startIndex = e.lastIndex - s[0].length;
25
+ const r = s.length;
26
+ for (let t = 0; t < r; t++) {
27
+ i.push(s[t]);
36
28
  }
37
- return i;
38
- };
39
- const isName = function(e) {
40
- const t = n.exec(e);
41
- return !(t === null || typeof t === "undefined");
42
- };
43
- e.isExist = function(e) {
44
- return typeof e !== "undefined";
45
- };
46
- e.isEmptyObject = function(e) {
47
- return Object.keys(e).length === 0;
48
- };
49
- e.merge = function(e, t, i) {
50
- if (t) {
51
- const r = Object.keys(t);
52
- const n = r.length;
53
- for (let s = 0; s < n; s++) {
54
- if (i === "strict") {
55
- e[r[s]] = [ t[r[s]] ];
56
- } else {
57
- e[r[s]] = t[r[s]];
58
- }
29
+ n.push(i);
30
+ s = e.exec(t);
31
+ }
32
+ return n;
33
+ };
34
+ const o = function(t) {
35
+ const e = i.exec(t);
36
+ return !(e === null || typeof e === "undefined");
37
+ };
38
+ t.isExist = function(t) {
39
+ return typeof t !== "undefined";
40
+ };
41
+ t.isEmptyObject = function(t) {
42
+ return Object.keys(t).length === 0;
43
+ };
44
+ t.merge = function(t, e, n) {
45
+ if (e) {
46
+ const s = Object.keys(e);
47
+ const i = s.length;
48
+ for (let r = 0; r < i; r++) {
49
+ if (n === "strict") {
50
+ t[s[r]] = [ e[s[r]] ];
51
+ } else {
52
+ t[s[r]] = e[s[r]];
59
53
  }
60
54
  }
61
- };
62
- e.getValue = function(t) {
63
- if (e.isExist(t)) {
64
- return t;
65
- } else {
66
- return "";
67
- }
68
- };
69
- e.isName = isName;
70
- e.getAllMatches = getAllMatches;
71
- e.nameRegexp = r;
72
- })(i);
73
- return i;
74
- }
75
-
76
- var n;
77
-
78
- function requireValidator() {
79
- if (n) return t;
80
- n = 1;
81
- "use strict";
82
- const e = requireUtil();
83
- const i = {
84
- allowBooleanAttributes: false,
85
- unpairedTags: []
55
+ }
86
56
  };
87
- t.validate = function(e, t) {
88
- t = Object.assign({}, i, t);
89
- const r = [];
90
- let n = false;
91
- let s = false;
92
- if (e[0] === "\ufeff") {
93
- e = e.substr(1);
57
+ t.getValue = function(e) {
58
+ if (t.isExist(e)) {
59
+ return e;
60
+ } else {
61
+ return "";
94
62
  }
95
- for (let i = 0; i < e.length; i++) {
96
- if (e[i] === "<" && e[i + 1] === "?") {
97
- i += 2;
98
- i = readPI(e, i);
99
- if (i.err) return i;
100
- } else if (e[i] === "<") {
101
- let o = i;
102
- i++;
103
- if (e[i] === "!") {
104
- i = readCommentAndCDATA(e, i);
105
- continue;
106
- } else {
107
- let a = false;
108
- if (e[i] === "/") {
109
- a = true;
110
- i++;
111
- }
112
- let l = "";
113
- for (;i < e.length && e[i] !== ">" && e[i] !== " " && e[i] !== "\t" && e[i] !== "\n" && e[i] !== "\r"; i++) {
114
- l += e[i];
63
+ };
64
+ t.isName = o;
65
+ t.getAllMatches = r;
66
+ t.nameRegexp = s;
67
+ })(n);
68
+
69
+ const s = t.getDefaultExportFromCjs(n);
70
+
71
+ "use strict";
72
+
73
+ const i = n;
74
+
75
+ const r = {
76
+ allowBooleanAttributes: false,
77
+ unpairedTags: []
78
+ };
79
+
80
+ var o = e.validate = function(t, e) {
81
+ e = Object.assign({}, r, e);
82
+ const n = [];
83
+ let s = false;
84
+ let i = false;
85
+ if (t[0] === "\ufeff") {
86
+ t = t.substr(1);
87
+ }
88
+ for (let r = 0; r < t.length; r++) {
89
+ if (t[r] === "<" && t[r + 1] === "?") {
90
+ r += 2;
91
+ r = l(t, r);
92
+ if (r.err) return r;
93
+ } else if (t[r] === "<") {
94
+ let o = r;
95
+ r++;
96
+ if (t[r] === "!") {
97
+ r = u(t, r);
98
+ continue;
99
+ } else {
100
+ let f = false;
101
+ if (t[r] === "/") {
102
+ f = true;
103
+ r++;
104
+ }
105
+ let c = "";
106
+ for (;r < t.length && t[r] !== ">" && t[r] !== " " && t[r] !== "\t" && t[r] !== "\n" && t[r] !== "\r"; r++) {
107
+ c += t[r];
108
+ }
109
+ c = c.trim();
110
+ if (c[c.length - 1] === "/") {
111
+ c = c.substring(0, c.length - 1);
112
+ r--;
113
+ }
114
+ if (!b(c)) {
115
+ let e;
116
+ if (c.trim().length === 0) {
117
+ e = "Invalid space after '<'.";
118
+ } else {
119
+ e = "Tag '" + c + "' is an invalid name.";
115
120
  }
116
- l = l.trim();
117
- if (l[l.length - 1] === "/") {
118
- l = l.substring(0, l.length - 1);
119
- i--;
121
+ return x("InvalidTag", e, E(t, r));
122
+ }
123
+ const d = h(t, r);
124
+ if (d === false) {
125
+ return x("InvalidAttr", "Attributes for '" + c + "' have open quote.", E(t, r));
126
+ }
127
+ let g = d.value;
128
+ r = d.index;
129
+ if (g[g.length - 1] === "/") {
130
+ const n = r - g.length;
131
+ g = g.substring(0, g.length - 1);
132
+ const i = p(g, e);
133
+ if (i === true) {
134
+ s = true;
135
+ } else {
136
+ return x(i.err.code, i.err.msg, E(t, n + i.err.line));
120
137
  }
121
- if (!validateTagName(l)) {
122
- let t;
123
- if (l.trim().length === 0) {
124
- t = "Invalid space after '<'.";
125
- } else {
126
- t = "Tag '" + l + "' is an invalid name.";
138
+ } else if (f) {
139
+ if (!d.tagClosed) {
140
+ return x("InvalidTag", "Closing tag '" + c + "' doesn't have proper closing.", E(t, r));
141
+ } else if (g.trim().length > 0) {
142
+ return x("InvalidTag", "Closing tag '" + c + "' can't have attributes or invalid starting.", E(t, o));
143
+ } else if (n.length === 0) {
144
+ return x("InvalidTag", "Closing tag '" + c + "' has not been opened.", E(t, o));
145
+ } else {
146
+ const e = n.pop();
147
+ if (c !== e.tagName) {
148
+ let n = E(t, e.tagStartPos);
149
+ return x("InvalidTag", "Expected closing tag '" + e.tagName + "' (opened in line " + n.line + ", col " + n.col + ") instead of closing tag '" + c + "'.", E(t, o));
150
+ }
151
+ if (n.length == 0) {
152
+ i = true;
127
153
  }
128
- return getErrorObject("InvalidTag", t, getLineNumberForPosition(e, i));
129
154
  }
130
- const u = readAttributeStr(e, i);
131
- if (u === false) {
132
- return getErrorObject("InvalidAttr", "Attributes for '" + l + "' have open quote.", getLineNumberForPosition(e, i));
155
+ } else {
156
+ const a = p(g, e);
157
+ if (a !== true) {
158
+ return x(a.err.code, a.err.msg, E(t, r - g.length + a.err.line));
133
159
  }
134
- let f = u.value;
135
- i = u.index;
136
- if (f[f.length - 1] === "/") {
137
- const r = i - f.length;
138
- f = f.substring(0, f.length - 1);
139
- const s = validateAttributeString(f, t);
140
- if (s === true) {
141
- n = true;
142
- } else {
143
- return getErrorObject(s.err.code, s.err.msg, getLineNumberForPosition(e, r + s.err.line));
144
- }
145
- } else if (a) {
146
- if (!u.tagClosed) {
147
- return getErrorObject("InvalidTag", "Closing tag '" + l + "' doesn't have proper closing.", getLineNumberForPosition(e, i));
148
- } else if (f.trim().length > 0) {
149
- return getErrorObject("InvalidTag", "Closing tag '" + l + "' can't have attributes or invalid starting.", getLineNumberForPosition(e, o));
150
- } else if (r.length === 0) {
151
- return getErrorObject("InvalidTag", "Closing tag '" + l + "' has not been opened.", getLineNumberForPosition(e, o));
160
+ if (i === true) {
161
+ return x("InvalidXml", "Multiple possible root nodes found.", E(t, r));
162
+ } else if (e.unpairedTags.indexOf(c) !== -1) {} else {
163
+ n.push({
164
+ tagName: c,
165
+ tagStartPos: o
166
+ });
167
+ }
168
+ s = true;
169
+ }
170
+ for (r++; r < t.length; r++) {
171
+ if (t[r] === "<") {
172
+ if (t[r + 1] === "!") {
173
+ r++;
174
+ r = u(t, r);
175
+ continue;
176
+ } else if (t[r + 1] === "?") {
177
+ r = l(t, ++r);
178
+ if (r.err) return r;
152
179
  } else {
153
- const t = r.pop();
154
- if (l !== t.tagName) {
155
- let i = getLineNumberForPosition(e, t.tagStartPos);
156
- return getErrorObject("InvalidTag", "Expected closing tag '" + t.tagName + "' (opened in line " + i.line + ", col " + i.col + ") instead of closing tag '" + l + "'.", getLineNumberForPosition(e, o));
157
- }
158
- if (r.length == 0) {
159
- s = true;
160
- }
180
+ break;
161
181
  }
182
+ } else if (t[r] === "&") {
183
+ const e = m(t, r);
184
+ if (e == -1) return x("InvalidChar", "char '&' is not expected.", E(t, r));
185
+ r = e;
162
186
  } else {
163
- const a = validateAttributeString(f, t);
164
- if (a !== true) {
165
- return getErrorObject(a.err.code, a.err.msg, getLineNumberForPosition(e, i - f.length + a.err.line));
166
- }
167
- if (s === true) {
168
- return getErrorObject("InvalidXml", "Multiple possible root nodes found.", getLineNumberForPosition(e, i));
169
- } else if (t.unpairedTags.indexOf(l) !== -1) {} else {
170
- r.push({
171
- tagName: l,
172
- tagStartPos: o
173
- });
174
- }
175
- n = true;
176
- }
177
- for (i++; i < e.length; i++) {
178
- if (e[i] === "<") {
179
- if (e[i + 1] === "!") {
180
- i++;
181
- i = readCommentAndCDATA(e, i);
182
- continue;
183
- } else if (e[i + 1] === "?") {
184
- i = readPI(e, ++i);
185
- if (i.err) return i;
186
- } else {
187
- break;
188
- }
189
- } else if (e[i] === "&") {
190
- const t = validateAmpersand(e, i);
191
- if (t == -1) return getErrorObject("InvalidChar", "char '&' is not expected.", getLineNumberForPosition(e, i));
192
- i = t;
193
- } else {
194
- if (s === true && !isWhiteSpace(e[i])) {
195
- return getErrorObject("InvalidXml", "Extra text at the end", getLineNumberForPosition(e, i));
196
- }
187
+ if (i === true && !a(t[r])) {
188
+ return x("InvalidXml", "Extra text at the end", E(t, r));
197
189
  }
198
190
  }
199
- if (e[i] === "<") {
200
- i--;
201
- }
202
191
  }
203
- } else {
204
- if (isWhiteSpace(e[i])) {
205
- continue;
192
+ if (t[r] === "<") {
193
+ r--;
206
194
  }
207
- return getErrorObject("InvalidChar", "char '" + e[i] + "' is not expected.", getLineNumberForPosition(e, i));
208
195
  }
209
- }
210
- if (!n) {
211
- return getErrorObject("InvalidXml", "Start tag expected.", 1);
212
- } else if (r.length == 1) {
213
- return getErrorObject("InvalidTag", "Unclosed tag '" + r[0].tagName + "'.", getLineNumberForPosition(e, r[0].tagStartPos));
214
- } else if (r.length > 0) {
215
- return getErrorObject("InvalidXml", "Invalid '" + JSON.stringify(r.map((e => e.tagName)), null, 4).replace(/\r?\n/g, "") + "' found.", {
216
- line: 1,
217
- col: 1
218
- });
219
- }
220
- return true;
221
- };
222
- function isWhiteSpace(e) {
223
- return e === " " || e === "\t" || e === "\n" || e === "\r";
224
- }
225
- function readPI(e, t) {
226
- const i = t;
227
- for (;t < e.length; t++) {
228
- if (e[t] == "?" || e[t] == " ") {
229
- const r = e.substr(i, t - i);
230
- if (t > 5 && r === "xml") {
231
- return getErrorObject("InvalidXml", "XML declaration allowed only at the start of the document.", getLineNumberForPosition(e, t));
232
- } else if (e[t] == "?" && e[t + 1] == ">") {
233
- t++;
234
- break;
235
- } else {
236
- continue;
237
- }
196
+ } else {
197
+ if (a(t[r])) {
198
+ continue;
238
199
  }
200
+ return x("InvalidChar", "char '" + t[r] + "' is not expected.", E(t, r));
239
201
  }
240
- return t;
241
202
  }
242
- function readCommentAndCDATA(e, t) {
243
- if (e.length > t + 5 && e[t + 1] === "-" && e[t + 2] === "-") {
244
- for (t += 3; t < e.length; t++) {
245
- if (e[t] === "-" && e[t + 1] === "-" && e[t + 2] === ">") {
246
- t += 2;
247
- break;
248
- }
249
- }
250
- } else if (e.length > t + 8 && e[t + 1] === "D" && e[t + 2] === "O" && e[t + 3] === "C" && e[t + 4] === "T" && e[t + 5] === "Y" && e[t + 6] === "P" && e[t + 7] === "E") {
251
- let i = 1;
252
- for (t += 8; t < e.length; t++) {
253
- if (e[t] === "<") {
254
- i++;
255
- } else if (e[t] === ">") {
256
- i--;
257
- if (i === 0) {
258
- break;
259
- }
260
- }
261
- }
262
- } else if (e.length > t + 9 && e[t + 1] === "[" && e[t + 2] === "C" && e[t + 3] === "D" && e[t + 4] === "A" && e[t + 5] === "T" && e[t + 6] === "A" && e[t + 7] === "[") {
263
- for (t += 8; t < e.length; t++) {
264
- if (e[t] === "]" && e[t + 1] === "]" && e[t + 2] === ">") {
265
- t += 2;
266
- break;
267
- }
203
+ if (!s) {
204
+ return x("InvalidXml", "Start tag expected.", 1);
205
+ } else if (n.length == 1) {
206
+ return x("InvalidTag", "Unclosed tag '" + n[0].tagName + "'.", E(t, n[0].tagStartPos));
207
+ } else if (n.length > 0) {
208
+ return x("InvalidXml", "Invalid '" + JSON.stringify(n.map((t => t.tagName)), null, 4).replace(/\r?\n/g, "") + "' found.", {
209
+ line: 1,
210
+ col: 1
211
+ });
212
+ }
213
+ return true;
214
+ };
215
+
216
+ function a(t) {
217
+ return t === " " || t === "\t" || t === "\n" || t === "\r";
218
+ }
219
+
220
+ function l(t, e) {
221
+ const n = e;
222
+ for (;e < t.length; e++) {
223
+ if (t[e] == "?" || t[e] == " ") {
224
+ const s = t.substr(n, e - n);
225
+ if (e > 5 && s === "xml") {
226
+ return x("InvalidXml", "XML declaration allowed only at the start of the document.", E(t, e));
227
+ } else if (t[e] == "?" && t[e + 1] == ">") {
228
+ e++;
229
+ break;
230
+ } else {
231
+ continue;
268
232
  }
269
233
  }
270
- return t;
271
234
  }
272
- const r = '"';
273
- const s = "'";
274
- function readAttributeStr(e, t) {
275
- let i = "";
276
- let n = "";
277
- let o = false;
278
- for (;t < e.length; t++) {
279
- if (e[t] === r || e[t] === s) {
280
- if (n === "") {
281
- n = e[t];
282
- } else if (n !== e[t]) {} else {
283
- n = "";
284
- }
285
- } else if (e[t] === ">") {
286
- if (n === "") {
287
- o = true;
235
+ return e;
236
+ }
237
+
238
+ function u(t, e) {
239
+ if (t.length > e + 5 && t[e + 1] === "-" && t[e + 2] === "-") {
240
+ for (e += 3; e < t.length; e++) {
241
+ if (t[e] === "-" && t[e + 1] === "-" && t[e + 2] === ">") {
242
+ e += 2;
243
+ break;
244
+ }
245
+ }
246
+ } else if (t.length > e + 8 && t[e + 1] === "D" && t[e + 2] === "O" && t[e + 3] === "C" && t[e + 4] === "T" && t[e + 5] === "Y" && t[e + 6] === "P" && t[e + 7] === "E") {
247
+ let n = 1;
248
+ for (e += 8; e < t.length; e++) {
249
+ if (t[e] === "<") {
250
+ n++;
251
+ } else if (t[e] === ">") {
252
+ n--;
253
+ if (n === 0) {
288
254
  break;
289
255
  }
290
256
  }
291
- i += e[t];
292
257
  }
293
- if (n !== "") {
294
- return false;
258
+ } else if (t.length > e + 9 && t[e + 1] === "[" && t[e + 2] === "C" && t[e + 3] === "D" && t[e + 4] === "A" && t[e + 5] === "T" && t[e + 6] === "A" && t[e + 7] === "[") {
259
+ for (e += 8; e < t.length; e++) {
260
+ if (t[e] === "]" && t[e + 1] === "]" && t[e + 2] === ">") {
261
+ e += 2;
262
+ break;
263
+ }
295
264
  }
296
- return {
297
- value: i,
298
- index: t,
299
- tagClosed: o
300
- };
301
265
  }
302
- const o = new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?", "g");
303
- function validateAttributeString(t, i) {
304
- const r = e.getAllMatches(t, o);
305
- const n = {};
306
- for (let e = 0; e < r.length; e++) {
307
- if (r[e][1].length === 0) {
308
- return getErrorObject("InvalidAttr", "Attribute '" + r[e][2] + "' has no space in starting.", getPositionFromMatch(r[e]));
309
- } else if (r[e][3] !== undefined && r[e][4] === undefined) {
310
- return getErrorObject("InvalidAttr", "Attribute '" + r[e][2] + "' is without value.", getPositionFromMatch(r[e]));
311
- } else if (r[e][3] === undefined && !i.allowBooleanAttributes) {
312
- return getErrorObject("InvalidAttr", "boolean attribute '" + r[e][2] + "' is not allowed.", getPositionFromMatch(r[e]));
313
- }
314
- const t = r[e][2];
315
- if (!validateAttrName(t)) {
316
- return getErrorObject("InvalidAttr", "Attribute '" + t + "' is an invalid name.", getPositionFromMatch(r[e]));
266
+ return e;
267
+ }
268
+
269
+ const f = '"';
270
+
271
+ const c = "'";
272
+
273
+ function h(t, e) {
274
+ let n = "";
275
+ let s = "";
276
+ let i = false;
277
+ for (;e < t.length; e++) {
278
+ if (t[e] === f || t[e] === c) {
279
+ if (s === "") {
280
+ s = t[e];
281
+ } else if (s !== t[e]) {} else {
282
+ s = "";
317
283
  }
318
- if (!n.hasOwnProperty(t)) {
319
- n[t] = 1;
320
- } else {
321
- return getErrorObject("InvalidAttr", "Attribute '" + t + "' is repeated.", getPositionFromMatch(r[e]));
284
+ } else if (t[e] === ">") {
285
+ if (s === "") {
286
+ i = true;
287
+ break;
322
288
  }
323
289
  }
324
- return true;
290
+ n += t[e];
325
291
  }
326
- function validateNumberAmpersand(e, t) {
327
- let i = /\d/;
328
- if (e[t] === "x") {
329
- t++;
330
- i = /[\da-fA-F]/;
331
- }
332
- for (;t < e.length; t++) {
333
- if (e[t] === ";") return t;
334
- if (!e[t].match(i)) break;
335
- }
336
- return -1;
292
+ if (s !== "") {
293
+ return false;
337
294
  }
338
- function validateAmpersand(e, t) {
339
- t++;
340
- if (e[t] === ";") return -1;
341
- if (e[t] === "#") {
342
- t++;
343
- return validateNumberAmpersand(e, t);
344
- }
345
- let i = 0;
346
- for (;t < e.length; t++, i++) {
347
- if (e[t].match(/\w/) && i < 20) continue;
348
- if (e[t] === ";") break;
349
- return -1;
295
+ return {
296
+ value: n,
297
+ index: e,
298
+ tagClosed: i
299
+ };
300
+ }
301
+
302
+ const d = new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?", "g");
303
+
304
+ function p(t, e) {
305
+ const n = i.getAllMatches(t, d);
306
+ const s = {};
307
+ for (let t = 0; t < n.length; t++) {
308
+ if (n[t][1].length === 0) {
309
+ return x("InvalidAttr", "Attribute '" + n[t][2] + "' has no space in starting.", v(n[t]));
310
+ } else if (n[t][3] !== undefined && n[t][4] === undefined) {
311
+ return x("InvalidAttr", "Attribute '" + n[t][2] + "' is without value.", v(n[t]));
312
+ } else if (n[t][3] === undefined && !e.allowBooleanAttributes) {
313
+ return x("InvalidAttr", "boolean attribute '" + n[t][2] + "' is not allowed.", v(n[t]));
314
+ }
315
+ const i = n[t][2];
316
+ if (!N(i)) {
317
+ return x("InvalidAttr", "Attribute '" + i + "' is an invalid name.", v(n[t]));
318
+ }
319
+ if (!s.hasOwnProperty(i)) {
320
+ s[i] = 1;
321
+ } else {
322
+ return x("InvalidAttr", "Attribute '" + i + "' is repeated.", v(n[t]));
350
323
  }
351
- return t;
352
324
  }
353
- function getErrorObject(e, t, i) {
354
- return {
355
- err: {
356
- code: e,
357
- msg: t,
358
- line: i.line || i,
359
- col: i.col
360
- }
361
- };
362
- }
363
- function validateAttrName(t) {
364
- return e.isName(t);
325
+ return true;
326
+ }
327
+
328
+ function g(t, e) {
329
+ let n = /\d/;
330
+ if (t[e] === "x") {
331
+ e++;
332
+ n = /[\da-fA-F]/;
365
333
  }
366
- function validateTagName(t) {
367
- return e.isName(t);
334
+ for (;e < t.length; e++) {
335
+ if (t[e] === ";") return e;
336
+ if (!t[e].match(n)) break;
368
337
  }
369
- function getLineNumberForPosition(e, t) {
370
- const i = e.substring(0, t).split(/\r?\n/);
371
- return {
372
- line: i.length,
373
- col: i[i.length - 1].length + 1
374
- };
338
+ return -1;
339
+ }
340
+
341
+ function m(t, e) {
342
+ e++;
343
+ if (t[e] === ";") return -1;
344
+ if (t[e] === "#") {
345
+ e++;
346
+ return g(t, e);
375
347
  }
376
- function getPositionFromMatch(e) {
377
- return e.startIndex + e[1].length;
348
+ let n = 0;
349
+ for (;e < t.length; e++, n++) {
350
+ if (t[e].match(/\w/) && n < 20) continue;
351
+ if (t[e] === ";") break;
352
+ return -1;
378
353
  }
379
- return t;
354
+ return e;
380
355
  }
381
356
 
382
- var s = {};
383
-
384
- var o;
385
-
386
- function requireOptionsBuilder() {
387
- if (o) return s;
388
- o = 1;
389
- const e = {
390
- preserveOrder: false,
391
- attributeNamePrefix: "@_",
392
- attributesGroupName: false,
393
- textNodeName: "#text",
394
- ignoreAttributes: true,
395
- removeNSPrefix: false,
396
- allowBooleanAttributes: false,
397
- parseTagValue: true,
398
- parseAttributeValue: false,
399
- trimValues: true,
400
- cdataPropName: false,
401
- numberParseOptions: {
402
- hex: true,
403
- leadingZeros: true,
404
- eNotation: true
405
- },
406
- tagValueProcessor: function(e, t) {
407
- return t;
408
- },
409
- attributeValueProcessor: function(e, t) {
410
- return t;
411
- },
412
- stopNodes: [],
413
- alwaysCreateTextNode: false,
414
- isArray: () => false,
415
- commentPropName: false,
416
- unpairedTags: [],
417
- processEntities: true,
418
- htmlEntities: false,
419
- ignoreDeclaration: false,
420
- ignorePiTags: false,
421
- transformTagName: false,
422
- transformAttributeName: false,
423
- updateTag: function(e, t, i) {
424
- return e;
357
+ function x(t, e, n) {
358
+ return {
359
+ err: {
360
+ code: t,
361
+ msg: e,
362
+ line: n.line || n,
363
+ col: n.col
425
364
  }
426
365
  };
427
- const buildOptions = function(t) {
428
- return Object.assign({}, e, t);
366
+ }
367
+
368
+ function N(t) {
369
+ return i.isName(t);
370
+ }
371
+
372
+ function b(t) {
373
+ return i.isName(t);
374
+ }
375
+
376
+ function E(t, e) {
377
+ const n = t.substring(0, e).split(/\r?\n/);
378
+ return {
379
+ line: n.length,
380
+ col: n[n.length - 1].length + 1
429
381
  };
430
- s.buildOptions = buildOptions;
431
- s.defaultOptions = e;
432
- return s;
433
382
  }
434
383
 
435
- var a;
384
+ function v(t) {
385
+ return t.startIndex + t[1].length;
386
+ }
436
387
 
437
- var l;
388
+ var y = {};
438
389
 
439
- function requireXmlNode() {
440
- if (l) return a;
441
- l = 1;
442
- "use strict";
443
- class XmlNode {
444
- constructor(e) {
445
- this.tagname = e;
446
- this.child = [];
447
- this[":@"] = {};
448
- }
449
- add(e, t) {
450
- if (e === "__proto__") e = "#__proto__";
390
+ const T = {
391
+ preserveOrder: false,
392
+ attributeNamePrefix: "@_",
393
+ attributesGroupName: false,
394
+ textNodeName: "#text",
395
+ ignoreAttributes: true,
396
+ removeNSPrefix: false,
397
+ allowBooleanAttributes: false,
398
+ parseTagValue: true,
399
+ parseAttributeValue: false,
400
+ trimValues: true,
401
+ cdataPropName: false,
402
+ numberParseOptions: {
403
+ hex: true,
404
+ leadingZeros: true,
405
+ eNotation: true
406
+ },
407
+ tagValueProcessor: function(t, e) {
408
+ return e;
409
+ },
410
+ attributeValueProcessor: function(t, e) {
411
+ return e;
412
+ },
413
+ stopNodes: [],
414
+ alwaysCreateTextNode: false,
415
+ isArray: () => false,
416
+ commentPropName: false,
417
+ unpairedTags: [],
418
+ processEntities: true,
419
+ htmlEntities: false,
420
+ ignoreDeclaration: false,
421
+ ignorePiTags: false,
422
+ transformTagName: false,
423
+ transformAttributeName: false,
424
+ updateTag: function(t, e, n) {
425
+ return t;
426
+ }
427
+ };
428
+
429
+ const O = function(t) {
430
+ return Object.assign({}, T, t);
431
+ };
432
+
433
+ var P = y.buildOptions = O;
434
+
435
+ var w = y.defaultOptions = T;
436
+
437
+ "use strict";
438
+
439
+ class XmlNode {
440
+ constructor(t) {
441
+ this.tagname = t;
442
+ this.child = [];
443
+ this[":@"] = {};
444
+ }
445
+ add(t, e) {
446
+ if (t === "__proto__") t = "#__proto__";
447
+ this.child.push({
448
+ [t]: e
449
+ });
450
+ }
451
+ addChild(t) {
452
+ if (t.tagname === "__proto__") t.tagname = "#__proto__";
453
+ if (t[":@"] && Object.keys(t[":@"]).length > 0) {
451
454
  this.child.push({
452
- [e]: t
455
+ [t.tagname]: t.child,
456
+ [":@"]: t[":@"]
457
+ });
458
+ } else {
459
+ this.child.push({
460
+ [t.tagname]: t.child
453
461
  });
454
- }
455
- addChild(e) {
456
- if (e.tagname === "__proto__") e.tagname = "#__proto__";
457
- if (e[":@"] && Object.keys(e[":@"]).length > 0) {
458
- this.child.push({
459
- [e.tagname]: e.child,
460
- [":@"]: e[":@"]
461
- });
462
- } else {
463
- this.child.push({
464
- [e.tagname]: e.child
465
- });
466
- }
467
462
  }
468
463
  }
469
- a = XmlNode;
470
- return a;
471
464
  }
472
465
 
473
- var u;
466
+ var A = XmlNode;
474
467
 
475
- var f;
468
+ const C = t.getDefaultExportFromCjs(A);
476
469
 
477
- function requireDocTypeReader() {
478
- if (f) return u;
479
- f = 1;
480
- const e = requireUtil();
481
- function readDocType(e, t) {
482
- const i = {};
483
- if (e[t + 3] === "O" && e[t + 4] === "C" && e[t + 5] === "T" && e[t + 6] === "Y" && e[t + 7] === "P" && e[t + 8] === "E") {
484
- t = t + 9;
485
- let r = 1;
486
- let n = false, s = false;
487
- let o = "";
488
- for (;t < e.length; t++) {
489
- if (e[t] === "<" && !s) {
490
- if (n && isEntity(e, t)) {
491
- t += 7;
492
- let r, n;
493
- [r, n, t] = readEntityExp(e, t + 1);
494
- if (n.indexOf("&") === -1) i[validateEntityName(r)] = {
495
- regx: RegExp(`&${r};`, "g"),
496
- val: n
497
- };
498
- } else if (n && isElement(e, t)) t += 8; else if (n && isAttlist(e, t)) t += 8; else if (n && isNotation(e, t)) t += 9; else if (isComment) s = true; else throw new Error("Invalid DOCTYPE");
499
- r++;
500
- o = "";
501
- } else if (e[t] === ">") {
502
- if (s) {
503
- if (e[t - 1] === "-" && e[t - 2] === "-") {
504
- s = false;
505
- r--;
506
- }
507
- } else {
508
- r--;
509
- }
510
- if (r === 0) {
511
- break;
470
+ const I = n;
471
+
472
+ function j(t, e) {
473
+ const n = {};
474
+ if (t[e + 3] === "O" && t[e + 4] === "C" && t[e + 5] === "T" && t[e + 6] === "Y" && t[e + 7] === "P" && t[e + 8] === "E") {
475
+ e = e + 9;
476
+ let s = 1;
477
+ let i = false, r = false;
478
+ let o = "";
479
+ for (;e < t.length; e++) {
480
+ if (t[e] === "<" && !r) {
481
+ if (i && D(t, e)) {
482
+ e += 7;
483
+ let s, i;
484
+ [s, i, e] = S(t, e + 1);
485
+ if (i.indexOf("&") === -1) n[_(s)] = {
486
+ regx: RegExp(`&${s};`, "g"),
487
+ val: i
488
+ };
489
+ } else if (i && V(t, e)) e += 8; else if (i && k(t, e)) e += 8; else if (i && $(t, e)) e += 9; else if (F) r = true; else throw new Error("Invalid DOCTYPE");
490
+ s++;
491
+ o = "";
492
+ } else if (t[e] === ">") {
493
+ if (r) {
494
+ if (t[e - 1] === "-" && t[e - 2] === "-") {
495
+ r = false;
496
+ s--;
512
497
  }
513
- } else if (e[t] === "[") {
514
- n = true;
515
498
  } else {
516
- o += e[t];
499
+ s--;
517
500
  }
501
+ if (s === 0) {
502
+ break;
503
+ }
504
+ } else if (t[e] === "[") {
505
+ i = true;
506
+ } else {
507
+ o += t[e];
518
508
  }
519
- if (r !== 0) {
520
- throw new Error(`Unclosed DOCTYPE`);
521
- }
522
- } else {
523
- throw new Error(`Invalid Tag instead of DOCTYPE`);
524
509
  }
525
- return {
526
- entities: i,
527
- i: t
528
- };
529
- }
530
- function readEntityExp(e, t) {
531
- let i = "";
532
- for (;t < e.length && (e[t] !== "'" && e[t] !== '"'); t++) {
533
- i += e[t];
510
+ if (s !== 0) {
511
+ throw new Error(`Unclosed DOCTYPE`);
534
512
  }
535
- i = i.trim();
536
- if (i.indexOf(" ") !== -1) throw new Error("External entites are not supported");
537
- const r = e[t++];
538
- let n = "";
539
- for (;t < e.length && e[t] !== r; t++) {
540
- n += e[t];
541
- }
542
- return [ i, n, t ];
513
+ } else {
514
+ throw new Error(`Invalid Tag instead of DOCTYPE`);
543
515
  }
544
- function isComment(e, t) {
545
- if (e[t + 1] === "!" && e[t + 2] === "-" && e[t + 3] === "-") return true;
546
- return false;
547
- }
548
- function isEntity(e, t) {
549
- if (e[t + 1] === "!" && e[t + 2] === "E" && e[t + 3] === "N" && e[t + 4] === "T" && e[t + 5] === "I" && e[t + 6] === "T" && e[t + 7] === "Y") return true;
550
- return false;
551
- }
552
- function isElement(e, t) {
553
- if (e[t + 1] === "!" && e[t + 2] === "E" && e[t + 3] === "L" && e[t + 4] === "E" && e[t + 5] === "M" && e[t + 6] === "E" && e[t + 7] === "N" && e[t + 8] === "T") return true;
554
- return false;
555
- }
556
- function isAttlist(e, t) {
557
- if (e[t + 1] === "!" && e[t + 2] === "A" && e[t + 3] === "T" && e[t + 4] === "T" && e[t + 5] === "L" && e[t + 6] === "I" && e[t + 7] === "S" && e[t + 8] === "T") return true;
558
- return false;
559
- }
560
- function isNotation(e, t) {
561
- if (e[t + 1] === "!" && e[t + 2] === "N" && e[t + 3] === "O" && e[t + 4] === "T" && e[t + 5] === "A" && e[t + 6] === "T" && e[t + 7] === "I" && e[t + 8] === "O" && e[t + 9] === "N") return true;
562
- return false;
516
+ return {
517
+ entities: n,
518
+ i: e
519
+ };
520
+ }
521
+
522
+ function S(t, e) {
523
+ let n = "";
524
+ for (;e < t.length && (t[e] !== "'" && t[e] !== '"'); e++) {
525
+ n += t[e];
563
526
  }
564
- function validateEntityName(t) {
565
- if (e.isName(t)) return t; else throw new Error(`Invalid entity name ${t}`);
527
+ n = n.trim();
528
+ if (n.indexOf(" ") !== -1) throw new Error("External entites are not supported");
529
+ const s = t[e++];
530
+ let i = "";
531
+ for (;e < t.length && t[e] !== s; e++) {
532
+ i += t[e];
566
533
  }
567
- u = readDocType;
568
- return u;
534
+ return [ n, i, e ];
569
535
  }
570
536
 
571
- var d;
537
+ function F(t, e) {
538
+ if (t[e + 1] === "!" && t[e + 2] === "-" && t[e + 3] === "-") return true;
539
+ return false;
540
+ }
572
541
 
573
- var c;
542
+ function D(t, e) {
543
+ if (t[e + 1] === "!" && t[e + 2] === "E" && t[e + 3] === "N" && t[e + 4] === "T" && t[e + 5] === "I" && t[e + 6] === "T" && t[e + 7] === "Y") return true;
544
+ return false;
545
+ }
574
546
 
575
- function requireStrnum() {
576
- if (c) return d;
577
- c = 1;
578
- const e = /^[-+]?0x[a-fA-F0-9]+$/;
579
- const t = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/;
580
- const i = {
581
- hex: true,
582
- leadingZeros: true,
583
- decimalPoint: ".",
584
- eNotation: true
585
- };
586
- function toNumber(r, n = {}) {
587
- n = Object.assign({}, i, n);
588
- if (!r || typeof r !== "string") return r;
589
- let s = r.trim();
590
- if (n.skipLike !== undefined && n.skipLike.test(s)) return r; else if (r === "0") return 0; else if (n.hex && e.test(s)) {
591
- return parse_int(s, 16);
592
- } else if (s.search(/[eE]/) !== -1) {
593
- const e = s.match(/^([-\+])?(0*)([0-9]*(\.[0-9]*)?[eE][-\+]?[0-9]+)$/);
594
- if (e) {
595
- if (n.leadingZeros) {
596
- s = (e[1] || "") + e[3];
597
- } else {
598
- if (e[2] === "0" && e[3][0] === ".") {} else {
599
- return r;
600
- }
601
- }
602
- return n.eNotation ? Number(s) : r;
547
+ function V(t, e) {
548
+ if (t[e + 1] === "!" && t[e + 2] === "E" && t[e + 3] === "L" && t[e + 4] === "E" && t[e + 5] === "M" && t[e + 6] === "E" && t[e + 7] === "N" && t[e + 8] === "T") return true;
549
+ return false;
550
+ }
551
+
552
+ function k(t, e) {
553
+ if (t[e + 1] === "!" && t[e + 2] === "A" && t[e + 3] === "T" && t[e + 4] === "T" && t[e + 5] === "L" && t[e + 6] === "I" && t[e + 7] === "S" && t[e + 8] === "T") return true;
554
+ return false;
555
+ }
556
+
557
+ function $(t, e) {
558
+ if (t[e + 1] === "!" && t[e + 2] === "N" && t[e + 3] === "O" && t[e + 4] === "T" && t[e + 5] === "A" && t[e + 6] === "T" && t[e + 7] === "I" && t[e + 8] === "O" && t[e + 9] === "N") return true;
559
+ return false;
560
+ }
561
+
562
+ function _(t) {
563
+ if (I.isName(t)) return t; else throw new Error(`Invalid entity name ${t}`);
564
+ }
565
+
566
+ var L = j;
567
+
568
+ const M = t.getDefaultExportFromCjs(L);
569
+
570
+ const X = /^[-+]?0x[a-fA-F0-9]+$/;
571
+
572
+ const B = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/;
573
+
574
+ const G = {
575
+ hex: true,
576
+ leadingZeros: true,
577
+ decimalPoint: ".",
578
+ eNotation: true
579
+ };
580
+
581
+ function R(t, e = {}) {
582
+ e = Object.assign({}, G, e);
583
+ if (!t || typeof t !== "string") return t;
584
+ let n = t.trim();
585
+ if (e.skipLike !== undefined && e.skipLike.test(n)) return t; else if (t === "0") return 0; else if (e.hex && X.test(n)) {
586
+ return Z(n, 16);
587
+ } else if (n.search(/[eE]/) !== -1) {
588
+ const s = n.match(/^([-\+])?(0*)([0-9]*(\.[0-9]*)?[eE][-\+]?[0-9]+)$/);
589
+ if (s) {
590
+ if (e.leadingZeros) {
591
+ n = (s[1] || "") + s[3];
603
592
  } else {
604
- return r;
593
+ if (s[2] === "0" && s[3][0] === ".") {} else {
594
+ return t;
595
+ }
605
596
  }
597
+ return e.eNotation ? Number(n) : t;
606
598
  } else {
607
- const e = t.exec(s);
608
- if (e) {
609
- const t = e[1];
610
- const i = e[2];
611
- let o = trimZeros(e[3]);
612
- if (!n.leadingZeros && i.length > 0 && t && s[2] !== ".") return r; else if (!n.leadingZeros && i.length > 0 && !t && s[1] !== ".") return r; else if (n.leadingZeros && i === r) return 0; else {
613
- const e = Number(s);
614
- const a = "" + e;
615
- if (a.search(/[eE]/) !== -1) {
616
- if (n.eNotation) return e; else return r;
617
- } else if (s.indexOf(".") !== -1) {
618
- if (a === "0" && o === "") return e; else if (a === o) return e; else if (t && a === "-" + o) return e; else return r;
619
- }
620
- if (i) {
621
- return o === a || t + o === a ? e : r;
622
- } else {
623
- return s === a || s === t + a ? e : r;
624
- }
599
+ return t;
600
+ }
601
+ } else {
602
+ const s = B.exec(n);
603
+ if (s) {
604
+ const i = s[1];
605
+ const r = s[2];
606
+ let o = U(s[3]);
607
+ if (!e.leadingZeros && r.length > 0 && i && n[2] !== ".") return t; else if (!e.leadingZeros && r.length > 0 && !i && n[1] !== ".") return t; else if (e.leadingZeros && r === t) return 0; else {
608
+ const s = Number(n);
609
+ const a = "" + s;
610
+ if (a.search(/[eE]/) !== -1) {
611
+ if (e.eNotation) return s; else return t;
612
+ } else if (n.indexOf(".") !== -1) {
613
+ if (a === "0" && o === "") return s; else if (a === o) return s; else if (i && a === "-" + o) return s; else return t;
614
+ }
615
+ if (r) {
616
+ return o === a || i + o === a ? s : t;
617
+ } else {
618
+ return n === a || n === i + a ? s : t;
625
619
  }
626
- } else {
627
- return r;
628
620
  }
621
+ } else {
622
+ return t;
629
623
  }
630
624
  }
631
- function trimZeros(e) {
632
- if (e && e.indexOf(".") !== -1) {
633
- e = e.replace(/0+$/, "");
634
- if (e === ".") e = "0"; else if (e[0] === ".") e = "0" + e; else if (e[e.length - 1] === ".") e = e.substr(0, e.length - 1);
635
- return e;
636
- }
637
- return e;
638
- }
639
- function parse_int(e, t) {
640
- if (parseInt) return parseInt(e, t); else if (Number.parseInt) return Number.parseInt(e, t); else if (window && window.parseInt) return window.parseInt(e, t); else throw new Error("parseInt, Number.parseInt, window.parseInt are not supported");
625
+ }
626
+
627
+ function U(t) {
628
+ if (t && t.indexOf(".") !== -1) {
629
+ t = t.replace(/0+$/, "");
630
+ if (t === ".") t = "0"; else if (t[0] === ".") t = "0" + t; else if (t[t.length - 1] === ".") t = t.substr(0, t.length - 1);
631
+ return t;
641
632
  }
642
- d = toNumber;
643
- return d;
633
+ return t;
644
634
  }
645
635
 
646
- var g;
636
+ function Z(t, e) {
637
+ if (parseInt) return parseInt(t, e); else if (Number.parseInt) return Number.parseInt(t, e); else if (window && window.parseInt) return window.parseInt(t, e); else throw new Error("parseInt, Number.parseInt, window.parseInt are not supported");
638
+ }
647
639
 
648
- var p;
640
+ var Y = R;
649
641
 
650
- function requireIgnoreAttributes() {
651
- if (p) return g;
652
- p = 1;
653
- function getIgnoreAttributesFn(e) {
654
- if (typeof e === "function") {
655
- return e;
656
- }
657
- if (Array.isArray(e)) {
658
- return t => {
659
- for (const i of e) {
660
- if (typeof i === "string" && t === i) {
661
- return true;
662
- }
663
- if (i instanceof RegExp && i.test(t)) {
664
- return true;
665
- }
642
+ const q = t.getDefaultExportFromCjs(Y);
643
+
644
+ function W(t) {
645
+ if (typeof t === "function") {
646
+ return t;
647
+ }
648
+ if (Array.isArray(t)) {
649
+ return e => {
650
+ for (const n of t) {
651
+ if (typeof n === "string" && e === n) {
652
+ return true;
666
653
  }
667
- };
668
- }
669
- return () => false;
654
+ if (n instanceof RegExp && n.test(e)) {
655
+ return true;
656
+ }
657
+ }
658
+ };
670
659
  }
671
- g = getIgnoreAttributesFn;
672
- return g;
660
+ return () => false;
673
661
  }
674
662
 
675
- var h;
663
+ var z = W;
676
664
 
677
- var m;
665
+ const J = t.getDefaultExportFromCjs(z);
678
666
 
679
- function requireOrderedObjParser() {
680
- if (m) return h;
681
- m = 1;
682
- "use strict";
683
- const e = requireUtil();
684
- const t = requireXmlNode();
685
- const i = requireDocTypeReader();
686
- const r = requireStrnum();
687
- const n = requireIgnoreAttributes();
688
- class OrderedObjParser {
689
- constructor(e) {
690
- this.options = e;
691
- this.currentNode = null;
692
- this.tagsNodeStack = [];
693
- this.docTypeEntities = {};
694
- this.lastEntities = {
695
- apos: {
696
- regex: /&(apos|#39|#x27);/g,
697
- val: "'"
698
- },
699
- gt: {
700
- regex: /&(gt|#62|#x3E);/g,
701
- val: ">"
702
- },
703
- lt: {
704
- regex: /&(lt|#60|#x3C);/g,
705
- val: "<"
706
- },
707
- quot: {
708
- regex: /&(quot|#34|#x22);/g,
709
- val: '"'
710
- }
711
- };
712
- this.ampEntity = {
713
- regex: /&(amp|#38|#x26);/g,
714
- val: "&"
715
- };
716
- this.htmlEntities = {
717
- space: {
718
- regex: /&(nbsp|#160);/g,
719
- val: " "
720
- },
721
- cent: {
722
- regex: /&(cent|#162);/g,
723
- val: "¢"
724
- },
725
- pound: {
726
- regex: /&(pound|#163);/g,
727
- val: "£"
728
- },
729
- yen: {
730
- regex: /&(yen|#165);/g,
731
- val: "¥"
732
- },
733
- euro: {
734
- regex: /&(euro|#8364);/g,
735
- val: "€"
736
- },
737
- copyright: {
738
- regex: /&(copy|#169);/g,
739
- val: "©"
740
- },
741
- reg: {
742
- regex: /&(reg|#174);/g,
743
- val: "®"
744
- },
745
- inr: {
746
- regex: /&(inr|#8377);/g,
747
- val: "₹"
748
- },
749
- num_dec: {
750
- regex: /&#([0-9]{1,7});/g,
751
- val: (e, t) => String.fromCharCode(Number.parseInt(t, 10))
752
- },
753
- num_hex: {
754
- regex: /&#x([0-9a-fA-F]{1,6});/g,
755
- val: (e, t) => String.fromCharCode(Number.parseInt(t, 16))
756
- }
757
- };
758
- this.addExternalEntities = addExternalEntities;
759
- this.parseXml = parseXml;
760
- this.parseTextData = parseTextData;
761
- this.resolveNameSpace = resolveNameSpace;
762
- this.buildAttributesMap = buildAttributesMap;
763
- this.isItStopNode = isItStopNode;
764
- this.replaceEntitiesValue = replaceEntitiesValue;
765
- this.readStopNodeData = readStopNodeData;
766
- this.saveTextToParentTag = saveTextToParentTag;
767
- this.addChild = addChild;
768
- this.ignoreAttributesFn = n(this.options.ignoreAttributes);
769
- }
667
+ "use strict";
668
+
669
+ const H = n;
670
+
671
+ const K = A;
672
+
673
+ const Q = L;
674
+
675
+ const tt = Y;
676
+
677
+ const et = z;
678
+
679
+ let nt = class OrderedObjParser {
680
+ constructor(t) {
681
+ this.options = t;
682
+ this.currentNode = null;
683
+ this.tagsNodeStack = [];
684
+ this.docTypeEntities = {};
685
+ this.lastEntities = {
686
+ apos: {
687
+ regex: /&(apos|#39|#x27);/g,
688
+ val: "'"
689
+ },
690
+ gt: {
691
+ regex: /&(gt|#62|#x3E);/g,
692
+ val: ">"
693
+ },
694
+ lt: {
695
+ regex: /&(lt|#60|#x3C);/g,
696
+ val: "<"
697
+ },
698
+ quot: {
699
+ regex: /&(quot|#34|#x22);/g,
700
+ val: '"'
701
+ }
702
+ };
703
+ this.ampEntity = {
704
+ regex: /&(amp|#38|#x26);/g,
705
+ val: "&"
706
+ };
707
+ this.htmlEntities = {
708
+ space: {
709
+ regex: /&(nbsp|#160);/g,
710
+ val: " "
711
+ },
712
+ cent: {
713
+ regex: /&(cent|#162);/g,
714
+ val: "¢"
715
+ },
716
+ pound: {
717
+ regex: /&(pound|#163);/g,
718
+ val: "£"
719
+ },
720
+ yen: {
721
+ regex: /&(yen|#165);/g,
722
+ val: "¥"
723
+ },
724
+ euro: {
725
+ regex: /&(euro|#8364);/g,
726
+ val: "€"
727
+ },
728
+ copyright: {
729
+ regex: /&(copy|#169);/g,
730
+ val: "©"
731
+ },
732
+ reg: {
733
+ regex: /&(reg|#174);/g,
734
+ val: "®"
735
+ },
736
+ inr: {
737
+ regex: /&(inr|#8377);/g,
738
+ val: "₹"
739
+ },
740
+ num_dec: {
741
+ regex: /&#([0-9]{1,7});/g,
742
+ val: (t, e) => String.fromCharCode(Number.parseInt(e, 10))
743
+ },
744
+ num_hex: {
745
+ regex: /&#x([0-9a-fA-F]{1,6});/g,
746
+ val: (t, e) => String.fromCharCode(Number.parseInt(e, 16))
747
+ }
748
+ };
749
+ this.addExternalEntities = st;
750
+ this.parseXml = lt;
751
+ this.parseTextData = it;
752
+ this.resolveNameSpace = rt;
753
+ this.buildAttributesMap = at;
754
+ this.isItStopNode = ht;
755
+ this.replaceEntitiesValue = ft;
756
+ this.readStopNodeData = mt;
757
+ this.saveTextToParentTag = ct;
758
+ this.addChild = ut;
759
+ this.ignoreAttributesFn = et(this.options.ignoreAttributes);
770
760
  }
771
- function addExternalEntities(e) {
772
- const t = Object.keys(e);
773
- for (let i = 0; i < t.length; i++) {
774
- const r = t[i];
775
- this.lastEntities[r] = {
776
- regex: new RegExp("&" + r + ";", "g"),
777
- val: e[r]
778
- };
779
- }
761
+ };
762
+
763
+ function st(t) {
764
+ const e = Object.keys(t);
765
+ for (let n = 0; n < e.length; n++) {
766
+ const s = e[n];
767
+ this.lastEntities[s] = {
768
+ regex: new RegExp("&" + s + ";", "g"),
769
+ val: t[s]
770
+ };
780
771
  }
781
- function parseTextData(e, t, i, r, n, s, o) {
782
- if (e !== undefined) {
783
- if (this.options.trimValues && !r) {
784
- e = e.trim();
785
- }
786
- if (e.length > 0) {
787
- if (!o) e = this.replaceEntitiesValue(e);
788
- const r = this.options.tagValueProcessor(t, e, i, n, s);
789
- if (r === null || r === undefined) {
790
- return e;
791
- } else if (typeof r !== typeof e || r !== e) {
792
- return r;
793
- } else if (this.options.trimValues) {
794
- return parseValue(e, this.options.parseTagValue, this.options.numberParseOptions);
772
+ }
773
+
774
+ function it(t, e, n, s, i, r, o) {
775
+ if (t !== undefined) {
776
+ if (this.options.trimValues && !s) {
777
+ t = t.trim();
778
+ }
779
+ if (t.length > 0) {
780
+ if (!o) t = this.replaceEntitiesValue(t);
781
+ const s = this.options.tagValueProcessor(e, t, n, i, r);
782
+ if (s === null || s === undefined) {
783
+ return t;
784
+ } else if (typeof s !== typeof t || s !== t) {
785
+ return s;
786
+ } else if (this.options.trimValues) {
787
+ return xt(t, this.options.parseTagValue, this.options.numberParseOptions);
788
+ } else {
789
+ const e = t.trim();
790
+ if (e === t) {
791
+ return xt(t, this.options.parseTagValue, this.options.numberParseOptions);
795
792
  } else {
796
- const t = e.trim();
797
- if (t === e) {
798
- return parseValue(e, this.options.parseTagValue, this.options.numberParseOptions);
799
- } else {
800
- return e;
801
- }
793
+ return t;
802
794
  }
803
795
  }
804
796
  }
805
797
  }
806
- function resolveNameSpace(e) {
807
- if (this.options.removeNSPrefix) {
808
- const t = e.split(":");
809
- const i = e.charAt(0) === "/" ? "/" : "";
810
- if (t[0] === "xmlns") {
811
- return "";
812
- }
813
- if (t.length === 2) {
814
- e = i + t[1];
815
- }
798
+ }
799
+
800
+ function rt(t) {
801
+ if (this.options.removeNSPrefix) {
802
+ const e = t.split(":");
803
+ const n = t.charAt(0) === "/" ? "/" : "";
804
+ if (e[0] === "xmlns") {
805
+ return "";
806
+ }
807
+ if (e.length === 2) {
808
+ t = n + e[1];
816
809
  }
817
- return e;
818
810
  }
819
- const s = new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?", "gm");
820
- function buildAttributesMap(t, i, r) {
821
- if (this.options.ignoreAttributes !== true && typeof t === "string") {
822
- const r = e.getAllMatches(t, s);
823
- const n = r.length;
824
- const o = {};
825
- for (let e = 0; e < n; e++) {
826
- const t = this.resolveNameSpace(r[e][1]);
827
- if (this.ignoreAttributesFn(t, i)) {
828
- continue;
811
+ return t;
812
+ }
813
+
814
+ const ot = new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?", "gm");
815
+
816
+ function at(t, e, n) {
817
+ if (this.options.ignoreAttributes !== true && typeof t === "string") {
818
+ const n = H.getAllMatches(t, ot);
819
+ const s = n.length;
820
+ const i = {};
821
+ for (let t = 0; t < s; t++) {
822
+ const s = this.resolveNameSpace(n[t][1]);
823
+ if (this.ignoreAttributesFn(s, e)) {
824
+ continue;
825
+ }
826
+ let r = n[t][4];
827
+ let o = this.options.attributeNamePrefix + s;
828
+ if (s.length) {
829
+ if (this.options.transformAttributeName) {
830
+ o = this.options.transformAttributeName(o);
829
831
  }
830
- let n = r[e][4];
831
- let s = this.options.attributeNamePrefix + t;
832
- if (t.length) {
833
- if (this.options.transformAttributeName) {
834
- s = this.options.transformAttributeName(s);
832
+ if (o === "__proto__") o = "#__proto__";
833
+ if (r !== undefined) {
834
+ if (this.options.trimValues) {
835
+ r = r.trim();
835
836
  }
836
- if (s === "__proto__") s = "#__proto__";
837
- if (n !== undefined) {
838
- if (this.options.trimValues) {
839
- n = n.trim();
840
- }
841
- n = this.replaceEntitiesValue(n);
842
- const e = this.options.attributeValueProcessor(t, n, i);
843
- if (e === null || e === undefined) {
844
- o[s] = n;
845
- } else if (typeof e !== typeof n || e !== n) {
846
- o[s] = e;
847
- } else {
848
- o[s] = parseValue(n, this.options.parseAttributeValue, this.options.numberParseOptions);
849
- }
850
- } else if (this.options.allowBooleanAttributes) {
851
- o[s] = true;
837
+ r = this.replaceEntitiesValue(r);
838
+ const t = this.options.attributeValueProcessor(s, r, e);
839
+ if (t === null || t === undefined) {
840
+ i[o] = r;
841
+ } else if (typeof t !== typeof r || t !== r) {
842
+ i[o] = t;
843
+ } else {
844
+ i[o] = xt(r, this.options.parseAttributeValue, this.options.numberParseOptions);
852
845
  }
846
+ } else if (this.options.allowBooleanAttributes) {
847
+ i[o] = true;
853
848
  }
854
849
  }
855
- if (!Object.keys(o).length) {
856
- return;
857
- }
858
- if (this.options.attributesGroupName) {
859
- const e = {};
860
- e[this.options.attributesGroupName] = o;
861
- return e;
862
- }
863
- return o;
864
850
  }
851
+ if (!Object.keys(i).length) {
852
+ return;
853
+ }
854
+ if (this.options.attributesGroupName) {
855
+ const t = {};
856
+ t[this.options.attributesGroupName] = i;
857
+ return t;
858
+ }
859
+ return i;
865
860
  }
866
- const parseXml = function(e) {
867
- e = e.replace(/\r\n?/g, "\n");
868
- const r = new t("!xml");
869
- let n = r;
870
- let s = "";
871
- let o = "";
872
- for (let a = 0; a < e.length; a++) {
873
- const l = e[a];
874
- if (l === "<") {
875
- if (e[a + 1] === "/") {
876
- const t = findClosingIndex(e, ">", a, "Closing Tag is not closed.");
877
- let i = e.substring(a + 2, t).trim();
878
- if (this.options.removeNSPrefix) {
879
- const e = i.indexOf(":");
880
- if (e !== -1) {
881
- i = i.substr(e + 1);
882
- }
883
- }
884
- if (this.options.transformTagName) {
885
- i = this.options.transformTagName(i);
886
- }
887
- if (n) {
888
- s = this.saveTextToParentTag(s, n, o);
889
- }
890
- const r = o.substring(o.lastIndexOf(".") + 1);
891
- if (i && this.options.unpairedTags.indexOf(i) !== -1) {
892
- throw new Error(`Unpaired tag can not be used as closing tag: </${i}>`);
893
- }
894
- let l = 0;
895
- if (r && this.options.unpairedTags.indexOf(r) !== -1) {
896
- l = o.lastIndexOf(".", o.lastIndexOf(".") - 1);
897
- this.tagsNodeStack.pop();
898
- } else {
899
- l = o.lastIndexOf(".");
900
- }
901
- o = o.substring(0, l);
902
- n = this.tagsNodeStack.pop();
903
- s = "";
904
- a = t;
905
- } else if (e[a + 1] === "?") {
906
- let i = readTagExp(e, a, false, "?>");
907
- if (!i) throw new Error("Pi Tag is not closed.");
908
- s = this.saveTextToParentTag(s, n, o);
909
- if (this.options.ignoreDeclaration && i.tagName === "?xml" || this.options.ignorePiTags) {} else {
910
- const e = new t(i.tagName);
911
- e.add(this.options.textNodeName, "");
912
- if (i.tagName !== i.tagExp && i.attrExpPresent) {
913
- e[":@"] = this.buildAttributesMap(i.tagExp, o, i.tagName);
914
- }
915
- this.addChild(n, e, o);
916
- }
917
- a = i.closeIndex + 1;
918
- } else if (e.substr(a + 1, 3) === "!--") {
919
- const t = findClosingIndex(e, "--\x3e", a + 4, "Comment is not closed.");
920
- if (this.options.commentPropName) {
921
- const i = e.substring(a + 4, t - 2);
922
- s = this.saveTextToParentTag(s, n, o);
923
- n.add(this.options.commentPropName, [ {
924
- [this.options.textNodeName]: i
925
- } ]);
861
+ }
862
+
863
+ const lt = function(t) {
864
+ t = t.replace(/\r\n?/g, "\n");
865
+ const e = new K("!xml");
866
+ let n = e;
867
+ let s = "";
868
+ let i = "";
869
+ for (let r = 0; r < t.length; r++) {
870
+ const o = t[r];
871
+ if (o === "<") {
872
+ if (t[r + 1] === "/") {
873
+ const e = pt(t, ">", r, "Closing Tag is not closed.");
874
+ let o = t.substring(r + 2, e).trim();
875
+ if (this.options.removeNSPrefix) {
876
+ const t = o.indexOf(":");
877
+ if (t !== -1) {
878
+ o = o.substr(t + 1);
926
879
  }
927
- a = t;
928
- } else if (e.substr(a + 1, 2) === "!D") {
929
- const t = i(e, a);
930
- this.docTypeEntities = t.entities;
931
- a = t.i;
932
- } else if (e.substr(a + 1, 2) === "![") {
933
- const t = findClosingIndex(e, "]]>", a, "CDATA is not closed.") - 2;
934
- const i = e.substring(a + 9, t);
935
- s = this.saveTextToParentTag(s, n, o);
936
- let r = this.parseTextData(i, n.tagname, o, true, false, true, true);
937
- if (r == undefined) r = "";
938
- if (this.options.cdataPropName) {
939
- n.add(this.options.cdataPropName, [ {
940
- [this.options.textNodeName]: i
941
- } ]);
942
- } else {
943
- n.add(this.options.textNodeName, r);
880
+ }
881
+ if (this.options.transformTagName) {
882
+ o = this.options.transformTagName(o);
883
+ }
884
+ if (n) {
885
+ s = this.saveTextToParentTag(s, n, i);
886
+ }
887
+ const a = i.substring(i.lastIndexOf(".") + 1);
888
+ if (o && this.options.unpairedTags.indexOf(o) !== -1) {
889
+ throw new Error(`Unpaired tag can not be used as closing tag: </${o}>`);
890
+ }
891
+ let l = 0;
892
+ if (a && this.options.unpairedTags.indexOf(a) !== -1) {
893
+ l = i.lastIndexOf(".", i.lastIndexOf(".") - 1);
894
+ this.tagsNodeStack.pop();
895
+ } else {
896
+ l = i.lastIndexOf(".");
897
+ }
898
+ i = i.substring(0, l);
899
+ n = this.tagsNodeStack.pop();
900
+ s = "";
901
+ r = e;
902
+ } else if (t[r + 1] === "?") {
903
+ let e = gt(t, r, false, "?>");
904
+ if (!e) throw new Error("Pi Tag is not closed.");
905
+ s = this.saveTextToParentTag(s, n, i);
906
+ if (this.options.ignoreDeclaration && e.tagName === "?xml" || this.options.ignorePiTags) {} else {
907
+ const t = new K(e.tagName);
908
+ t.add(this.options.textNodeName, "");
909
+ if (e.tagName !== e.tagExp && e.attrExpPresent) {
910
+ t[":@"] = this.buildAttributesMap(e.tagExp, i, e.tagName);
944
911
  }
945
- a = t + 2;
912
+ this.addChild(n, t, i);
913
+ }
914
+ r = e.closeIndex + 1;
915
+ } else if (t.substr(r + 1, 3) === "!--") {
916
+ const e = pt(t, "--\x3e", r + 4, "Comment is not closed.");
917
+ if (this.options.commentPropName) {
918
+ const o = t.substring(r + 4, e - 2);
919
+ s = this.saveTextToParentTag(s, n, i);
920
+ n.add(this.options.commentPropName, [ {
921
+ [this.options.textNodeName]: o
922
+ } ]);
923
+ }
924
+ r = e;
925
+ } else if (t.substr(r + 1, 2) === "!D") {
926
+ const e = Q(t, r);
927
+ this.docTypeEntities = e.entities;
928
+ r = e.i;
929
+ } else if (t.substr(r + 1, 2) === "![") {
930
+ const e = pt(t, "]]>", r, "CDATA is not closed.") - 2;
931
+ const o = t.substring(r + 9, e);
932
+ s = this.saveTextToParentTag(s, n, i);
933
+ let a = this.parseTextData(o, n.tagname, i, true, false, true, true);
934
+ if (a == undefined) a = "";
935
+ if (this.options.cdataPropName) {
936
+ n.add(this.options.cdataPropName, [ {
937
+ [this.options.textNodeName]: o
938
+ } ]);
946
939
  } else {
947
- let i = readTagExp(e, a, this.options.removeNSPrefix);
948
- let l = i.tagName;
949
- const u = i.rawTagName;
950
- let f = i.tagExp;
951
- let d = i.attrExpPresent;
952
- let c = i.closeIndex;
953
- if (this.options.transformTagName) {
954
- l = this.options.transformTagName(l);
940
+ n.add(this.options.textNodeName, a);
941
+ }
942
+ r = e + 2;
943
+ } else {
944
+ let o = gt(t, r, this.options.removeNSPrefix);
945
+ let a = o.tagName;
946
+ const l = o.rawTagName;
947
+ let u = o.tagExp;
948
+ let f = o.attrExpPresent;
949
+ let c = o.closeIndex;
950
+ if (this.options.transformTagName) {
951
+ a = this.options.transformTagName(a);
952
+ }
953
+ if (n && s) {
954
+ if (n.tagname !== "!xml") {
955
+ s = this.saveTextToParentTag(s, n, i, false);
955
956
  }
956
- if (n && s) {
957
- if (n.tagname !== "!xml") {
958
- s = this.saveTextToParentTag(s, n, o, false);
957
+ }
958
+ const h = n;
959
+ if (h && this.options.unpairedTags.indexOf(h.tagname) !== -1) {
960
+ n = this.tagsNodeStack.pop();
961
+ i = i.substring(0, i.lastIndexOf("."));
962
+ }
963
+ if (a !== e.tagname) {
964
+ i += i ? "." + a : a;
965
+ }
966
+ if (this.isItStopNode(this.options.stopNodes, i, a)) {
967
+ let e = "";
968
+ if (u.length > 0 && u.lastIndexOf("/") === u.length - 1) {
969
+ if (a[a.length - 1] === "/") {
970
+ a = a.substr(0, a.length - 1);
971
+ i = i.substr(0, i.length - 1);
972
+ u = a;
973
+ } else {
974
+ u = u.substr(0, u.length - 1);
959
975
  }
976
+ r = o.closeIndex;
977
+ } else if (this.options.unpairedTags.indexOf(a) !== -1) {
978
+ r = o.closeIndex;
979
+ } else {
980
+ const n = this.readStopNodeData(t, l, c + 1);
981
+ if (!n) throw new Error(`Unexpected end of ${l}`);
982
+ r = n.i;
983
+ e = n.tagContent;
960
984
  }
961
- const g = n;
962
- if (g && this.options.unpairedTags.indexOf(g.tagname) !== -1) {
963
- n = this.tagsNodeStack.pop();
964
- o = o.substring(0, o.lastIndexOf("."));
985
+ const s = new K(a);
986
+ if (a !== u && f) {
987
+ s[":@"] = this.buildAttributesMap(u, i, a);
965
988
  }
966
- if (l !== r.tagname) {
967
- o += o ? "." + l : l;
989
+ if (e) {
990
+ e = this.parseTextData(e, a, i, true, f, true, true);
968
991
  }
969
- if (this.isItStopNode(this.options.stopNodes, o, l)) {
970
- let r = "";
971
- if (f.length > 0 && f.lastIndexOf("/") === f.length - 1) {
972
- if (l[l.length - 1] === "/") {
973
- l = l.substr(0, l.length - 1);
974
- o = o.substr(0, o.length - 1);
975
- f = l;
976
- } else {
977
- f = f.substr(0, f.length - 1);
978
- }
979
- a = i.closeIndex;
980
- } else if (this.options.unpairedTags.indexOf(l) !== -1) {
981
- a = i.closeIndex;
992
+ i = i.substr(0, i.lastIndexOf("."));
993
+ s.add(this.options.textNodeName, e);
994
+ this.addChild(n, s, i);
995
+ } else {
996
+ if (u.length > 0 && u.lastIndexOf("/") === u.length - 1) {
997
+ if (a[a.length - 1] === "/") {
998
+ a = a.substr(0, a.length - 1);
999
+ i = i.substr(0, i.length - 1);
1000
+ u = a;
982
1001
  } else {
983
- const t = this.readStopNodeData(e, u, c + 1);
984
- if (!t) throw new Error(`Unexpected end of ${u}`);
985
- a = t.i;
986
- r = t.tagContent;
1002
+ u = u.substr(0, u.length - 1);
987
1003
  }
988
- const s = new t(l);
989
- if (l !== f && d) {
990
- s[":@"] = this.buildAttributesMap(f, o, l);
1004
+ if (this.options.transformTagName) {
1005
+ a = this.options.transformTagName(a);
991
1006
  }
992
- if (r) {
993
- r = this.parseTextData(r, l, o, true, d, true, true);
1007
+ const t = new K(a);
1008
+ if (a !== u && f) {
1009
+ t[":@"] = this.buildAttributesMap(u, i, a);
994
1010
  }
995
- o = o.substr(0, o.lastIndexOf("."));
996
- s.add(this.options.textNodeName, r);
997
- this.addChild(n, s, o);
1011
+ this.addChild(n, t, i);
1012
+ i = i.substr(0, i.lastIndexOf("."));
998
1013
  } else {
999
- if (f.length > 0 && f.lastIndexOf("/") === f.length - 1) {
1000
- if (l[l.length - 1] === "/") {
1001
- l = l.substr(0, l.length - 1);
1002
- o = o.substr(0, o.length - 1);
1003
- f = l;
1004
- } else {
1005
- f = f.substr(0, f.length - 1);
1006
- }
1007
- if (this.options.transformTagName) {
1008
- l = this.options.transformTagName(l);
1009
- }
1010
- const e = new t(l);
1011
- if (l !== f && d) {
1012
- e[":@"] = this.buildAttributesMap(f, o, l);
1013
- }
1014
- this.addChild(n, e, o);
1015
- o = o.substr(0, o.lastIndexOf("."));
1016
- } else {
1017
- const e = new t(l);
1018
- this.tagsNodeStack.push(n);
1019
- if (l !== f && d) {
1020
- e[":@"] = this.buildAttributesMap(f, o, l);
1021
- }
1022
- this.addChild(n, e, o);
1023
- n = e;
1014
+ const t = new K(a);
1015
+ this.tagsNodeStack.push(n);
1016
+ if (a !== u && f) {
1017
+ t[":@"] = this.buildAttributesMap(u, i, a);
1024
1018
  }
1025
- s = "";
1026
- a = c;
1019
+ this.addChild(n, t, i);
1020
+ n = t;
1027
1021
  }
1022
+ s = "";
1023
+ r = c;
1028
1024
  }
1029
- } else {
1030
- s += e[a];
1031
1025
  }
1032
- }
1033
- return r.child;
1034
- };
1035
- function addChild(e, t, i) {
1036
- const r = this.options.updateTag(t.tagname, i, t[":@"]);
1037
- if (r === false) {} else if (typeof r === "string") {
1038
- t.tagname = r;
1039
- e.addChild(t);
1040
1026
  } else {
1041
- e.addChild(t);
1027
+ s += t[r];
1042
1028
  }
1043
1029
  }
1044
- const replaceEntitiesValue = function(e) {
1045
- if (this.options.processEntities) {
1046
- for (let t in this.docTypeEntities) {
1047
- const i = this.docTypeEntities[t];
1048
- e = e.replace(i.regx, i.val);
1049
- }
1050
- for (let t in this.lastEntities) {
1051
- const i = this.lastEntities[t];
1052
- e = e.replace(i.regex, i.val);
1053
- }
1054
- if (this.options.htmlEntities) {
1055
- for (let t in this.htmlEntities) {
1056
- const i = this.htmlEntities[t];
1057
- e = e.replace(i.regex, i.val);
1058
- }
1030
+ return e.child;
1031
+ };
1032
+
1033
+ function ut(t, e, n) {
1034
+ const s = this.options.updateTag(e.tagname, n, e[":@"]);
1035
+ if (s === false) {} else if (typeof s === "string") {
1036
+ e.tagname = s;
1037
+ t.addChild(e);
1038
+ } else {
1039
+ t.addChild(e);
1040
+ }
1041
+ }
1042
+
1043
+ const ft = function(t) {
1044
+ if (this.options.processEntities) {
1045
+ for (let e in this.docTypeEntities) {
1046
+ const n = this.docTypeEntities[e];
1047
+ t = t.replace(n.regx, n.val);
1048
+ }
1049
+ for (let e in this.lastEntities) {
1050
+ const n = this.lastEntities[e];
1051
+ t = t.replace(n.regex, n.val);
1052
+ }
1053
+ if (this.options.htmlEntities) {
1054
+ for (let e in this.htmlEntities) {
1055
+ const n = this.htmlEntities[e];
1056
+ t = t.replace(n.regex, n.val);
1059
1057
  }
1060
- e = e.replace(this.ampEntity.regex, this.ampEntity.val);
1061
- }
1062
- return e;
1063
- };
1064
- function saveTextToParentTag(e, t, i, r) {
1065
- if (e) {
1066
- if (r === undefined) r = t.child.length === 0;
1067
- e = this.parseTextData(e, t.tagname, i, false, t[":@"] ? Object.keys(t[":@"]).length !== 0 : false, r);
1068
- if (e !== undefined && e !== "") t.add(this.options.textNodeName, e);
1069
- e = "";
1070
1058
  }
1071
- return e;
1059
+ t = t.replace(this.ampEntity.regex, this.ampEntity.val);
1072
1060
  }
1073
- function isItStopNode(e, t, i) {
1074
- const r = "*." + i;
1075
- for (const i in e) {
1076
- const n = e[i];
1077
- if (r === n || t === n) return true;
1078
- }
1079
- return false;
1061
+ return t;
1062
+ };
1063
+
1064
+ function ct(t, e, n, s) {
1065
+ if (t) {
1066
+ if (s === undefined) s = e.child.length === 0;
1067
+ t = this.parseTextData(t, e.tagname, n, false, e[":@"] ? Object.keys(e[":@"]).length !== 0 : false, s);
1068
+ if (t !== undefined && t !== "") e.add(this.options.textNodeName, t);
1069
+ t = "";
1080
1070
  }
1081
- function tagExpWithClosingIndex(e, t, i = ">") {
1082
- let r;
1083
- let n = "";
1084
- for (let s = t; s < e.length; s++) {
1085
- let t = e[s];
1086
- if (r) {
1087
- if (t === r) r = "";
1088
- } else if (t === '"' || t === "'") {
1089
- r = t;
1090
- } else if (t === i[0]) {
1091
- if (i[1]) {
1092
- if (e[s + 1] === i[1]) {
1093
- return {
1094
- data: n,
1095
- index: s
1096
- };
1097
- }
1098
- } else {
1071
+ return t;
1072
+ }
1073
+
1074
+ function ht(t, e, n) {
1075
+ const s = "*." + n;
1076
+ for (const n in t) {
1077
+ const i = t[n];
1078
+ if (s === i || e === i) return true;
1079
+ }
1080
+ return false;
1081
+ }
1082
+
1083
+ function dt(t, e, n = ">") {
1084
+ let s;
1085
+ let i = "";
1086
+ for (let r = e; r < t.length; r++) {
1087
+ let e = t[r];
1088
+ if (s) {
1089
+ if (e === s) s = "";
1090
+ } else if (e === '"' || e === "'") {
1091
+ s = e;
1092
+ } else if (e === n[0]) {
1093
+ if (n[1]) {
1094
+ if (t[r + 1] === n[1]) {
1099
1095
  return {
1100
- data: n,
1101
- index: s
1096
+ data: i,
1097
+ index: r
1102
1098
  };
1103
1099
  }
1104
- } else if (t === "\t") {
1105
- t = " ";
1100
+ } else {
1101
+ return {
1102
+ data: i,
1103
+ index: r
1104
+ };
1106
1105
  }
1107
- n += t;
1106
+ } else if (e === "\t") {
1107
+ e = " ";
1108
1108
  }
1109
+ i += e;
1109
1110
  }
1110
- function findClosingIndex(e, t, i, r) {
1111
- const n = e.indexOf(t, i);
1112
- if (n === -1) {
1113
- throw new Error(r);
1114
- } else {
1115
- return n + t.length - 1;
1116
- }
1111
+ }
1112
+
1113
+ function pt(t, e, n, s) {
1114
+ const i = t.indexOf(e, n);
1115
+ if (i === -1) {
1116
+ throw new Error(s);
1117
+ } else {
1118
+ return i + e.length - 1;
1117
1119
  }
1118
- function readTagExp(e, t, i, r = ">") {
1119
- const n = tagExpWithClosingIndex(e, t + 1, r);
1120
- if (!n) return;
1121
- let s = n.data;
1122
- const o = n.index;
1123
- const a = s.search(/\s/);
1124
- let l = s;
1125
- let u = true;
1126
- if (a !== -1) {
1127
- l = s.substring(0, a);
1128
- s = s.substring(a + 1).trimStart();
1129
- }
1130
- const f = l;
1131
- if (i) {
1132
- const e = l.indexOf(":");
1133
- if (e !== -1) {
1134
- l = l.substr(e + 1);
1135
- u = l !== n.data.substr(e + 1);
1136
- }
1120
+ }
1121
+
1122
+ function gt(t, e, n, s = ">") {
1123
+ const i = dt(t, e + 1, s);
1124
+ if (!i) return;
1125
+ let r = i.data;
1126
+ const o = i.index;
1127
+ const a = r.search(/\s/);
1128
+ let l = r;
1129
+ let u = true;
1130
+ if (a !== -1) {
1131
+ l = r.substring(0, a);
1132
+ r = r.substring(a + 1).trimStart();
1133
+ }
1134
+ const f = l;
1135
+ if (n) {
1136
+ const t = l.indexOf(":");
1137
+ if (t !== -1) {
1138
+ l = l.substr(t + 1);
1139
+ u = l !== i.data.substr(t + 1);
1137
1140
  }
1138
- return {
1139
- tagName: l,
1140
- tagExp: s,
1141
- closeIndex: o,
1142
- attrExpPresent: u,
1143
- rawTagName: f
1144
- };
1145
1141
  }
1146
- function readStopNodeData(e, t, i) {
1147
- const r = i;
1148
- let n = 1;
1149
- for (;i < e.length; i++) {
1150
- if (e[i] === "<") {
1151
- if (e[i + 1] === "/") {
1152
- const s = findClosingIndex(e, ">", i, `${t} is not closed`);
1153
- let o = e.substring(i + 2, s).trim();
1154
- if (o === t) {
1155
- n--;
1156
- if (n === 0) {
1157
- return {
1158
- tagContent: e.substring(r, i),
1159
- i: s
1160
- };
1161
- }
1142
+ return {
1143
+ tagName: l,
1144
+ tagExp: r,
1145
+ closeIndex: o,
1146
+ attrExpPresent: u,
1147
+ rawTagName: f
1148
+ };
1149
+ }
1150
+
1151
+ function mt(t, e, n) {
1152
+ const s = n;
1153
+ let i = 1;
1154
+ for (;n < t.length; n++) {
1155
+ if (t[n] === "<") {
1156
+ if (t[n + 1] === "/") {
1157
+ const r = pt(t, ">", n, `${e} is not closed`);
1158
+ let o = t.substring(n + 2, r).trim();
1159
+ if (o === e) {
1160
+ i--;
1161
+ if (i === 0) {
1162
+ return {
1163
+ tagContent: t.substring(s, n),
1164
+ i: r
1165
+ };
1162
1166
  }
1163
- i = s;
1164
- } else if (e[i + 1] === "?") {
1165
- const t = findClosingIndex(e, "?>", i + 1, "StopNode is not closed.");
1166
- i = t;
1167
- } else if (e.substr(i + 1, 3) === "!--") {
1168
- const t = findClosingIndex(e, "--\x3e", i + 3, "StopNode is not closed.");
1169
- i = t;
1170
- } else if (e.substr(i + 1, 2) === "![") {
1171
- const t = findClosingIndex(e, "]]>", i, "StopNode is not closed.") - 2;
1172
- i = t;
1173
- } else {
1174
- const r = readTagExp(e, i, ">");
1175
- if (r) {
1176
- const e = r && r.tagName;
1177
- if (e === t && r.tagExp[r.tagExp.length - 1] !== "/") {
1178
- n++;
1179
- }
1180
- i = r.closeIndex;
1167
+ }
1168
+ n = r;
1169
+ } else if (t[n + 1] === "?") {
1170
+ const e = pt(t, "?>", n + 1, "StopNode is not closed.");
1171
+ n = e;
1172
+ } else if (t.substr(n + 1, 3) === "!--") {
1173
+ const e = pt(t, "--\x3e", n + 3, "StopNode is not closed.");
1174
+ n = e;
1175
+ } else if (t.substr(n + 1, 2) === "![") {
1176
+ const e = pt(t, "]]>", n, "StopNode is not closed.") - 2;
1177
+ n = e;
1178
+ } else {
1179
+ const s = gt(t, n, ">");
1180
+ if (s) {
1181
+ const t = s && s.tagName;
1182
+ if (t === e && s.tagExp[s.tagExp.length - 1] !== "/") {
1183
+ i++;
1181
1184
  }
1185
+ n = s.closeIndex;
1182
1186
  }
1183
1187
  }
1184
1188
  }
1185
1189
  }
1186
- function parseValue(t, i, n) {
1187
- if (i && typeof t === "string") {
1188
- const e = t.trim();
1189
- if (e === "true") return true; else if (e === "false") return false; else return r(t, n);
1190
+ }
1191
+
1192
+ function xt(t, e, n) {
1193
+ if (e && typeof t === "string") {
1194
+ const e = t.trim();
1195
+ if (e === "true") return true; else if (e === "false") return false; else return tt(t, n);
1196
+ } else {
1197
+ if (H.isExist(t)) {
1198
+ return t;
1190
1199
  } else {
1191
- if (e.isExist(t)) {
1192
- return t;
1193
- } else {
1194
- return "";
1195
- }
1200
+ return "";
1196
1201
  }
1197
1202
  }
1198
- h = OrderedObjParser;
1199
- return h;
1200
1203
  }
1201
1204
 
1202
- var b = {};
1205
+ var Nt = nt;
1203
1206
 
1204
- var x;
1207
+ const bt = t.getDefaultExportFromCjs(Nt);
1205
1208
 
1206
- function requireNode2json() {
1207
- if (x) return b;
1208
- x = 1;
1209
- "use strict";
1210
- function prettify(e, t) {
1211
- return compress(e, t);
1212
- }
1213
- function compress(e, t, i) {
1214
- let r;
1215
- const n = {};
1216
- for (let s = 0; s < e.length; s++) {
1217
- const o = e[s];
1218
- const a = propName(o);
1219
- let l = "";
1220
- if (i === undefined) l = a; else l = i + "." + a;
1221
- if (a === t.textNodeName) {
1222
- if (r === undefined) r = o[a]; else r += "" + o[a];
1223
- } else if (a === undefined) {
1224
- continue;
1225
- } else if (o[a]) {
1226
- let e = compress(o[a], t, l);
1227
- const i = isLeafTag(e, t);
1228
- if (o[":@"]) {
1229
- assignAttributes(e, o[":@"], l, t);
1230
- } else if (Object.keys(e).length === 1 && e[t.textNodeName] !== undefined && !t.alwaysCreateTextNode) {
1231
- e = e[t.textNodeName];
1232
- } else if (Object.keys(e).length === 0) {
1233
- if (t.alwaysCreateTextNode) e[t.textNodeName] = ""; else e = "";
1209
+ var Et = {};
1210
+
1211
+ "use strict";
1212
+
1213
+ function vt(t, e) {
1214
+ return yt(t, e);
1215
+ }
1216
+
1217
+ function yt(t, e, n) {
1218
+ let s;
1219
+ const i = {};
1220
+ for (let r = 0; r < t.length; r++) {
1221
+ const o = t[r];
1222
+ const a = Tt(o);
1223
+ let l = "";
1224
+ if (n === undefined) l = a; else l = n + "." + a;
1225
+ if (a === e.textNodeName) {
1226
+ if (s === undefined) s = o[a]; else s += "" + o[a];
1227
+ } else if (a === undefined) {
1228
+ continue;
1229
+ } else if (o[a]) {
1230
+ let t = yt(o[a], e, l);
1231
+ const n = Pt(t, e);
1232
+ if (o[":@"]) {
1233
+ Ot(t, o[":@"], l, e);
1234
+ } else if (Object.keys(t).length === 1 && t[e.textNodeName] !== undefined && !e.alwaysCreateTextNode) {
1235
+ t = t[e.textNodeName];
1236
+ } else if (Object.keys(t).length === 0) {
1237
+ if (e.alwaysCreateTextNode) t[e.textNodeName] = ""; else t = "";
1238
+ }
1239
+ if (i[a] !== undefined && i.hasOwnProperty(a)) {
1240
+ if (!Array.isArray(i[a])) {
1241
+ i[a] = [ i[a] ];
1234
1242
  }
1235
- if (n[a] !== undefined && n.hasOwnProperty(a)) {
1236
- if (!Array.isArray(n[a])) {
1237
- n[a] = [ n[a] ];
1238
- }
1239
- n[a].push(e);
1243
+ i[a].push(t);
1244
+ } else {
1245
+ if (e.isArray(a, l, n)) {
1246
+ i[a] = [ t ];
1240
1247
  } else {
1241
- if (t.isArray(a, l, i)) {
1242
- n[a] = [ e ];
1243
- } else {
1244
- n[a] = e;
1245
- }
1248
+ i[a] = t;
1246
1249
  }
1247
1250
  }
1248
1251
  }
1249
- if (typeof r === "string") {
1250
- if (r.length > 0) n[t.textNodeName] = r;
1251
- } else if (r !== undefined) n[t.textNodeName] = r;
1252
- return n;
1253
1252
  }
1254
- function propName(e) {
1255
- const t = Object.keys(e);
1256
- for (let e = 0; e < t.length; e++) {
1257
- const i = t[e];
1258
- if (i !== ":@") return i;
1259
- }
1253
+ if (typeof s === "string") {
1254
+ if (s.length > 0) i[e.textNodeName] = s;
1255
+ } else if (s !== undefined) i[e.textNodeName] = s;
1256
+ return i;
1257
+ }
1258
+
1259
+ function Tt(t) {
1260
+ const e = Object.keys(t);
1261
+ for (let t = 0; t < e.length; t++) {
1262
+ const n = e[t];
1263
+ if (n !== ":@") return n;
1260
1264
  }
1261
- function assignAttributes(e, t, i, r) {
1262
- if (t) {
1263
- const n = Object.keys(t);
1264
- const s = n.length;
1265
- for (let o = 0; o < s; o++) {
1266
- const s = n[o];
1267
- if (r.isArray(s, i + "." + s, true, true)) {
1268
- e[s] = [ t[s] ];
1269
- } else {
1270
- e[s] = t[s];
1271
- }
1265
+ }
1266
+
1267
+ function Ot(t, e, n, s) {
1268
+ if (e) {
1269
+ const i = Object.keys(e);
1270
+ const r = i.length;
1271
+ for (let o = 0; o < r; o++) {
1272
+ const r = i[o];
1273
+ if (s.isArray(r, n + "." + r, true, true)) {
1274
+ t[r] = [ e[r] ];
1275
+ } else {
1276
+ t[r] = e[r];
1272
1277
  }
1273
1278
  }
1274
1279
  }
1275
- function isLeafTag(e, t) {
1276
- const {textNodeName: i} = t;
1277
- const r = Object.keys(e).length;
1278
- if (r === 0) {
1279
- return true;
1280
- }
1281
- if (r === 1 && (e[i] || typeof e[i] === "boolean" || e[i] === 0)) {
1282
- return true;
1283
- }
1284
- return false;
1280
+ }
1281
+
1282
+ function Pt(t, e) {
1283
+ const {textNodeName: n} = e;
1284
+ const s = Object.keys(t).length;
1285
+ if (s === 0) {
1286
+ return true;
1287
+ }
1288
+ if (s === 1 && (t[n] || typeof t[n] === "boolean" || t[n] === 0)) {
1289
+ return true;
1285
1290
  }
1286
- b.prettify = prettify;
1287
- return b;
1291
+ return false;
1288
1292
  }
1289
1293
 
1290
- var N;
1291
-
1292
- var E;
1293
-
1294
- function requireXMLParser() {
1295
- if (E) return N;
1296
- E = 1;
1297
- const {buildOptions: e} = requireOptionsBuilder();
1298
- const t = requireOrderedObjParser();
1299
- const {prettify: i} = requireNode2json();
1300
- const r = requireValidator();
1301
- class XMLParser {
1302
- constructor(t) {
1303
- this.externalEntities = {};
1304
- this.options = e(t);
1294
+ var wt = Et.prettify = vt;
1295
+
1296
+ const {buildOptions: At} = y;
1297
+
1298
+ const Ct = Nt;
1299
+
1300
+ const {prettify: It} = Et;
1301
+
1302
+ const jt = e;
1303
+
1304
+ let St = class XMLParser {
1305
+ constructor(t) {
1306
+ this.externalEntities = {};
1307
+ this.options = At(t);
1308
+ }
1309
+ parse(t, e) {
1310
+ if (typeof t === "string") {} else if (t.toString) {
1311
+ t = t.toString();
1312
+ } else {
1313
+ throw new Error("XML data is accepted in String or Bytes[] form.");
1305
1314
  }
1306
- parse(e, n) {
1307
- if (typeof e === "string") {} else if (e.toString) {
1308
- e = e.toString();
1309
- } else {
1310
- throw new Error("XML data is accepted in String or Bytes[] form.");
1311
- }
1312
- if (n) {
1313
- if (n === true) n = {};
1314
- const t = r.validate(e, n);
1315
- if (t !== true) {
1316
- throw Error(`${t.err.msg}:${t.err.line}:${t.err.col}`);
1317
- }
1315
+ if (e) {
1316
+ if (e === true) e = {};
1317
+ const n = jt.validate(t, e);
1318
+ if (n !== true) {
1319
+ throw Error(`${n.err.msg}:${n.err.line}:${n.err.col}`);
1318
1320
  }
1319
- const s = new t(this.options);
1320
- s.addExternalEntities(this.externalEntities);
1321
- const o = s.parseXml(e);
1322
- if (this.options.preserveOrder || o === undefined) return o; else return i(o, this.options);
1323
1321
  }
1324
- addEntity(e, t) {
1325
- if (t.indexOf("&") !== -1) {
1326
- throw new Error("Entity value can't have '&'");
1327
- } else if (e.indexOf("&") !== -1 || e.indexOf(";") !== -1) {
1328
- throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");
1329
- } else if (t === "&") {
1330
- throw new Error("An entity with value '&' is not permitted");
1331
- } else {
1332
- this.externalEntities[e] = t;
1333
- }
1322
+ const n = new Ct(this.options);
1323
+ n.addExternalEntities(this.externalEntities);
1324
+ const s = n.parseXml(t);
1325
+ if (this.options.preserveOrder || s === undefined) return s; else return It(s, this.options);
1326
+ }
1327
+ addEntity(t, e) {
1328
+ if (e.indexOf("&") !== -1) {
1329
+ throw new Error("Entity value can't have '&'");
1330
+ } else if (t.indexOf("&") !== -1 || t.indexOf(";") !== -1) {
1331
+ throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");
1332
+ } else if (e === "&") {
1333
+ throw new Error("An entity with value '&' is not permitted");
1334
+ } else {
1335
+ this.externalEntities[t] = e;
1334
1336
  }
1335
1337
  }
1336
- N = XMLParser;
1337
- return N;
1338
- }
1338
+ };
1339
1339
 
1340
- var v;
1340
+ var Ft = St;
1341
1341
 
1342
- var O;
1342
+ const Dt = t.getDefaultExportFromCjs(Ft);
1343
1343
 
1344
- function requireOrderedJs2Xml() {
1345
- if (O) return v;
1346
- O = 1;
1347
- const e = "\n";
1348
- function toXml(t, i) {
1349
- let r = "";
1350
- if (i.format && i.indentBy.length > 0) {
1351
- r = e;
1352
- }
1353
- return arrToStr(t, i, "", r);
1354
- }
1355
- function arrToStr(e, t, i, r) {
1356
- let n = "";
1357
- let s = false;
1358
- for (let o = 0; o < e.length; o++) {
1359
- const a = e[o];
1360
- const l = propName(a);
1361
- if (l === undefined) continue;
1362
- let u = "";
1363
- if (i.length === 0) u = l; else u = `${i}.${l}`;
1364
- if (l === t.textNodeName) {
1365
- let e = a[l];
1366
- if (!isStopNode(u, t)) {
1367
- e = t.tagValueProcessor(l, e);
1368
- e = replaceEntitiesValue(e, t);
1369
- }
1370
- if (s) {
1371
- n += r;
1372
- }
1373
- n += e;
1374
- s = false;
1375
- continue;
1376
- } else if (l === t.cdataPropName) {
1377
- if (s) {
1378
- n += r;
1379
- }
1380
- n += `<![CDATA[${a[l][0][t.textNodeName]}]]>`;
1381
- s = false;
1382
- continue;
1383
- } else if (l === t.commentPropName) {
1384
- n += r + `\x3c!--${a[l][0][t.textNodeName]}--\x3e`;
1385
- s = true;
1386
- continue;
1387
- } else if (l[0] === "?") {
1388
- const e = attr_to_str(a[":@"], t);
1389
- const i = l === "?xml" ? "" : r;
1390
- let o = a[l][0][t.textNodeName];
1391
- o = o.length !== 0 ? " " + o : "";
1392
- n += i + `<${l}${o}${e}?>`;
1393
- s = true;
1394
- continue;
1344
+ const Vt = "\n";
1345
+
1346
+ function kt(t, e) {
1347
+ let n = "";
1348
+ if (e.format && e.indentBy.length > 0) {
1349
+ n = Vt;
1350
+ }
1351
+ return $t(t, e, "", n);
1352
+ }
1353
+
1354
+ function $t(t, e, n, s) {
1355
+ let i = "";
1356
+ let r = false;
1357
+ for (let o = 0; o < t.length; o++) {
1358
+ const a = t[o];
1359
+ const l = _t(a);
1360
+ if (l === undefined) continue;
1361
+ let u = "";
1362
+ if (n.length === 0) u = l; else u = `${n}.${l}`;
1363
+ if (l === e.textNodeName) {
1364
+ let t = a[l];
1365
+ if (!Mt(u, e)) {
1366
+ t = e.tagValueProcessor(l, t);
1367
+ t = Xt(t, e);
1395
1368
  }
1396
- let f = r;
1397
- if (f !== "") {
1398
- f += t.indentBy;
1369
+ if (r) {
1370
+ i += s;
1371
+ }
1372
+ i += t;
1373
+ r = false;
1374
+ continue;
1375
+ } else if (l === e.cdataPropName) {
1376
+ if (r) {
1377
+ i += s;
1399
1378
  }
1400
- const d = attr_to_str(a[":@"], t);
1401
- const c = r + `<${l}${d}`;
1402
- const g = arrToStr(a[l], t, u, f);
1403
- if (t.unpairedTags.indexOf(l) !== -1) {
1404
- if (t.suppressUnpairedNode) n += c + ">"; else n += c + "/>";
1405
- } else if ((!g || g.length === 0) && t.suppressEmptyNode) {
1406
- n += c + "/>";
1407
- } else if (g && g.endsWith(">")) {
1408
- n += c + `>${g}${r}</${l}>`;
1379
+ i += `<![CDATA[${a[l][0][e.textNodeName]}]]>`;
1380
+ r = false;
1381
+ continue;
1382
+ } else if (l === e.commentPropName) {
1383
+ i += s + `\x3c!--${a[l][0][e.textNodeName]}--\x3e`;
1384
+ r = true;
1385
+ continue;
1386
+ } else if (l[0] === "?") {
1387
+ const t = Lt(a[":@"], e);
1388
+ const n = l === "?xml" ? "" : s;
1389
+ let o = a[l][0][e.textNodeName];
1390
+ o = o.length !== 0 ? " " + o : "";
1391
+ i += n + `<${l}${o}${t}?>`;
1392
+ r = true;
1393
+ continue;
1394
+ }
1395
+ let f = s;
1396
+ if (f !== "") {
1397
+ f += e.indentBy;
1398
+ }
1399
+ const c = Lt(a[":@"], e);
1400
+ const h = s + `<${l}${c}`;
1401
+ const d = $t(a[l], e, u, f);
1402
+ if (e.unpairedTags.indexOf(l) !== -1) {
1403
+ if (e.suppressUnpairedNode) i += h + ">"; else i += h + "/>";
1404
+ } else if ((!d || d.length === 0) && e.suppressEmptyNode) {
1405
+ i += h + "/>";
1406
+ } else if (d && d.endsWith(">")) {
1407
+ i += h + `>${d}${s}</${l}>`;
1408
+ } else {
1409
+ i += h + ">";
1410
+ if (d && s !== "" && (d.includes("/>") || d.includes("</"))) {
1411
+ i += s + e.indentBy + d + s;
1409
1412
  } else {
1410
- n += c + ">";
1411
- if (g && r !== "" && (g.includes("/>") || g.includes("</"))) {
1412
- n += r + t.indentBy + g + r;
1413
- } else {
1414
- n += g;
1415
- }
1416
- n += `</${l}>`;
1413
+ i += d;
1417
1414
  }
1418
- s = true;
1415
+ i += `</${l}>`;
1419
1416
  }
1420
- return n;
1417
+ r = true;
1421
1418
  }
1422
- function propName(e) {
1423
- const t = Object.keys(e);
1424
- for (let i = 0; i < t.length; i++) {
1425
- const r = t[i];
1426
- if (!e.hasOwnProperty(r)) continue;
1427
- if (r !== ":@") return r;
1428
- }
1419
+ return i;
1420
+ }
1421
+
1422
+ function _t(t) {
1423
+ const e = Object.keys(t);
1424
+ for (let n = 0; n < e.length; n++) {
1425
+ const s = e[n];
1426
+ if (!t.hasOwnProperty(s)) continue;
1427
+ if (s !== ":@") return s;
1429
1428
  }
1430
- function attr_to_str(e, t) {
1431
- let i = "";
1432
- if (e && !t.ignoreAttributes) {
1433
- for (let r in e) {
1434
- if (!e.hasOwnProperty(r)) continue;
1435
- let n = t.attributeValueProcessor(r, e[r]);
1436
- n = replaceEntitiesValue(n, t);
1437
- if (n === true && t.suppressBooleanAttributes) {
1438
- i += ` ${r.substr(t.attributeNamePrefix.length)}`;
1439
- } else {
1440
- i += ` ${r.substr(t.attributeNamePrefix.length)}="${n}"`;
1441
- }
1429
+ }
1430
+
1431
+ function Lt(t, e) {
1432
+ let n = "";
1433
+ if (t && !e.ignoreAttributes) {
1434
+ for (let s in t) {
1435
+ if (!t.hasOwnProperty(s)) continue;
1436
+ let i = e.attributeValueProcessor(s, t[s]);
1437
+ i = Xt(i, e);
1438
+ if (i === true && e.suppressBooleanAttributes) {
1439
+ n += ` ${s.substr(e.attributeNamePrefix.length)}`;
1440
+ } else {
1441
+ n += ` ${s.substr(e.attributeNamePrefix.length)}="${i}"`;
1442
1442
  }
1443
1443
  }
1444
- return i;
1445
1444
  }
1446
- function isStopNode(e, t) {
1447
- e = e.substr(0, e.length - t.textNodeName.length - 1);
1448
- let i = e.substr(e.lastIndexOf(".") + 1);
1449
- for (let r in t.stopNodes) {
1450
- if (t.stopNodes[r] === e || t.stopNodes[r] === "*." + i) return true;
1451
- }
1452
- return false;
1445
+ return n;
1446
+ }
1447
+
1448
+ function Mt(t, e) {
1449
+ t = t.substr(0, t.length - e.textNodeName.length - 1);
1450
+ let n = t.substr(t.lastIndexOf(".") + 1);
1451
+ for (let s in e.stopNodes) {
1452
+ if (e.stopNodes[s] === t || e.stopNodes[s] === "*." + n) return true;
1453
1453
  }
1454
- function replaceEntitiesValue(e, t) {
1455
- if (e && e.length > 0 && t.processEntities) {
1456
- for (let i = 0; i < t.entities.length; i++) {
1457
- const r = t.entities[i];
1458
- e = e.replace(r.regex, r.val);
1459
- }
1454
+ return false;
1455
+ }
1456
+
1457
+ function Xt(t, e) {
1458
+ if (t && t.length > 0 && e.processEntities) {
1459
+ for (let n = 0; n < e.entities.length; n++) {
1460
+ const s = e.entities[n];
1461
+ t = t.replace(s.regex, s.val);
1460
1462
  }
1461
- return e;
1462
1463
  }
1463
- v = toXml;
1464
- return v;
1464
+ return t;
1465
1465
  }
1466
1466
 
1467
- var T;
1467
+ var Bt = kt;
1468
1468
 
1469
- var P;
1469
+ const Gt = t.getDefaultExportFromCjs(Bt);
1470
1470
 
1471
- function requireJson2xml() {
1472
- if (P) return T;
1473
- P = 1;
1474
- "use strict";
1475
- const e = requireOrderedJs2Xml();
1476
- const t = requireIgnoreAttributes();
1477
- const i = {
1478
- attributeNamePrefix: "@_",
1479
- attributesGroupName: false,
1480
- textNodeName: "#text",
1481
- ignoreAttributes: true,
1482
- cdataPropName: false,
1483
- format: false,
1484
- indentBy: " ",
1485
- suppressEmptyNode: false,
1486
- suppressUnpairedNode: true,
1487
- suppressBooleanAttributes: true,
1488
- tagValueProcessor: function(e, t) {
1489
- return t;
1490
- },
1491
- attributeValueProcessor: function(e, t) {
1492
- return t;
1493
- },
1494
- preserveOrder: false,
1495
- commentPropName: false,
1496
- unpairedTags: [],
1497
- entities: [ {
1498
- regex: new RegExp("&", "g"),
1499
- val: "&amp;"
1500
- }, {
1501
- regex: new RegExp(">", "g"),
1502
- val: "&gt;"
1503
- }, {
1504
- regex: new RegExp("<", "g"),
1505
- val: "&lt;"
1506
- }, {
1507
- regex: new RegExp("'", "g"),
1508
- val: "&apos;"
1509
- }, {
1510
- regex: new RegExp('"', "g"),
1511
- val: "&quot;"
1512
- } ],
1513
- processEntities: true,
1514
- stopNodes: [],
1515
- oneListGroup: false
1516
- };
1517
- function Builder(e) {
1518
- this.options = Object.assign({}, i, e);
1519
- if (this.options.ignoreAttributes === true || this.options.attributesGroupName) {
1520
- this.isAttribute = function() {
1521
- return false;
1522
- };
1523
- } else {
1524
- this.ignoreAttributesFn = t(this.options.ignoreAttributes);
1525
- this.attrPrefixLen = this.options.attributeNamePrefix.length;
1526
- this.isAttribute = isAttribute;
1527
- }
1528
- this.processTextOrObjNode = processTextOrObjNode;
1529
- if (this.options.format) {
1530
- this.indentate = indentate;
1531
- this.tagEndChar = ">\n";
1532
- this.newLine = "\n";
1533
- } else {
1534
- this.indentate = function() {
1535
- return "";
1471
+ "use strict";
1472
+
1473
+ const Rt = Bt;
1474
+
1475
+ const Ut = z;
1476
+
1477
+ const Zt = {
1478
+ attributeNamePrefix: "@_",
1479
+ attributesGroupName: false,
1480
+ textNodeName: "#text",
1481
+ ignoreAttributes: true,
1482
+ cdataPropName: false,
1483
+ format: false,
1484
+ indentBy: " ",
1485
+ suppressEmptyNode: false,
1486
+ suppressUnpairedNode: true,
1487
+ suppressBooleanAttributes: true,
1488
+ tagValueProcessor: function(t, e) {
1489
+ return e;
1490
+ },
1491
+ attributeValueProcessor: function(t, e) {
1492
+ return e;
1493
+ },
1494
+ preserveOrder: false,
1495
+ commentPropName: false,
1496
+ unpairedTags: [],
1497
+ entities: [ {
1498
+ regex: new RegExp("&", "g"),
1499
+ val: "&amp;"
1500
+ }, {
1501
+ regex: new RegExp(">", "g"),
1502
+ val: "&gt;"
1503
+ }, {
1504
+ regex: new RegExp("<", "g"),
1505
+ val: "&lt;"
1506
+ }, {
1507
+ regex: new RegExp("'", "g"),
1508
+ val: "&apos;"
1509
+ }, {
1510
+ regex: new RegExp('"', "g"),
1511
+ val: "&quot;"
1512
+ } ],
1513
+ processEntities: true,
1514
+ stopNodes: [],
1515
+ oneListGroup: false
1516
+ };
1517
+
1518
+ function Yt(t) {
1519
+ this.options = Object.assign({}, Zt, t);
1520
+ if (this.options.ignoreAttributes === true || this.options.attributesGroupName) {
1521
+ this.isAttribute = function() {
1522
+ return false;
1523
+ };
1524
+ } else {
1525
+ this.ignoreAttributesFn = Ut(this.options.ignoreAttributes);
1526
+ this.attrPrefixLen = this.options.attributeNamePrefix.length;
1527
+ this.isAttribute = Jt;
1528
+ }
1529
+ this.processTextOrObjNode = qt;
1530
+ if (this.options.format) {
1531
+ this.indentate = zt;
1532
+ this.tagEndChar = ">\n";
1533
+ this.newLine = "\n";
1534
+ } else {
1535
+ this.indentate = function() {
1536
+ return "";
1537
+ };
1538
+ this.tagEndChar = ">";
1539
+ this.newLine = "";
1540
+ }
1541
+ }
1542
+
1543
+ Yt.prototype.build = function(t) {
1544
+ if (this.options.preserveOrder) {
1545
+ return Rt(t, this.options);
1546
+ } else {
1547
+ if (Array.isArray(t) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1) {
1548
+ t = {
1549
+ [this.options.arrayNodeName]: t
1536
1550
  };
1537
- this.tagEndChar = ">";
1538
- this.newLine = "";
1539
1551
  }
1552
+ return this.j2x(t, 0, []).val;
1540
1553
  }
1541
- Builder.prototype.build = function(t) {
1542
- if (this.options.preserveOrder) {
1543
- return e(t, this.options);
1544
- } else {
1545
- if (Array.isArray(t) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1) {
1546
- t = {
1547
- [this.options.arrayNodeName]: t
1548
- };
1554
+ };
1555
+
1556
+ Yt.prototype.j2x = function(t, e, n) {
1557
+ let s = "";
1558
+ let i = "";
1559
+ const r = n.join(".");
1560
+ for (let o in t) {
1561
+ if (!Object.prototype.hasOwnProperty.call(t, o)) continue;
1562
+ if (typeof t[o] === "undefined") {
1563
+ if (this.isAttribute(o)) {
1564
+ i += "";
1549
1565
  }
1550
- return this.j2x(t, 0, []).val;
1551
- }
1552
- };
1553
- Builder.prototype.j2x = function(e, t, i) {
1554
- let r = "";
1555
- let n = "";
1556
- const s = i.join(".");
1557
- for (let o in e) {
1558
- if (!Object.prototype.hasOwnProperty.call(e, o)) continue;
1559
- if (typeof e[o] === "undefined") {
1560
- if (this.isAttribute(o)) {
1561
- n += "";
1562
- }
1563
- } else if (e[o] === null) {
1564
- if (this.isAttribute(o)) {
1565
- n += "";
1566
- } else if (o === this.options.cdataPropName) {
1567
- n += "";
1568
- } else if (o[0] === "?") {
1569
- n += this.indentate(t) + "<" + o + "?" + this.tagEndChar;
1566
+ } else if (t[o] === null) {
1567
+ if (this.isAttribute(o)) {
1568
+ i += "";
1569
+ } else if (o === this.options.cdataPropName) {
1570
+ i += "";
1571
+ } else if (o[0] === "?") {
1572
+ i += this.indentate(e) + "<" + o + "?" + this.tagEndChar;
1573
+ } else {
1574
+ i += this.indentate(e) + "<" + o + "/" + this.tagEndChar;
1575
+ }
1576
+ } else if (t[o] instanceof Date) {
1577
+ i += this.buildTextValNode(t[o], o, "", e);
1578
+ } else if (typeof t[o] !== "object") {
1579
+ const n = this.isAttribute(o);
1580
+ if (n && !this.ignoreAttributesFn(n, r)) {
1581
+ s += this.buildAttrPairStr(n, "" + t[o]);
1582
+ } else if (!n) {
1583
+ if (o === this.options.textNodeName) {
1584
+ let e = this.options.tagValueProcessor(o, "" + t[o]);
1585
+ i += this.replaceEntitiesValue(e);
1570
1586
  } else {
1571
- n += this.indentate(t) + "<" + o + "/" + this.tagEndChar;
1572
- }
1573
- } else if (e[o] instanceof Date) {
1574
- n += this.buildTextValNode(e[o], o, "", t);
1575
- } else if (typeof e[o] !== "object") {
1576
- const i = this.isAttribute(o);
1577
- if (i && !this.ignoreAttributesFn(i, s)) {
1578
- r += this.buildAttrPairStr(i, "" + e[o]);
1579
- } else if (!i) {
1580
- if (o === this.options.textNodeName) {
1581
- let t = this.options.tagValueProcessor(o, "" + e[o]);
1582
- n += this.replaceEntitiesValue(t);
1583
- } else {
1584
- n += this.buildTextValNode(e[o], o, "", t);
1585
- }
1587
+ i += this.buildTextValNode(t[o], o, "", e);
1586
1588
  }
1587
- } else if (Array.isArray(e[o])) {
1588
- const r = e[o].length;
1589
- let s = "";
1590
- let a = "";
1591
- for (let l = 0; l < r; l++) {
1592
- const r = e[o][l];
1593
- if (typeof r === "undefined") {} else if (r === null) {
1594
- if (o[0] === "?") n += this.indentate(t) + "<" + o + "?" + this.tagEndChar; else n += this.indentate(t) + "<" + o + "/" + this.tagEndChar;
1595
- } else if (typeof r === "object") {
1596
- if (this.options.oneListGroup) {
1597
- const e = this.j2x(r, t + 1, i.concat(o));
1598
- s += e.val;
1599
- if (this.options.attributesGroupName && r.hasOwnProperty(this.options.attributesGroupName)) {
1600
- a += e.attrStr;
1601
- }
1602
- } else {
1603
- s += this.processTextOrObjNode(r, o, t, i);
1589
+ }
1590
+ } else if (Array.isArray(t[o])) {
1591
+ const s = t[o].length;
1592
+ let r = "";
1593
+ let a = "";
1594
+ for (let l = 0; l < s; l++) {
1595
+ const s = t[o][l];
1596
+ if (typeof s === "undefined") {} else if (s === null) {
1597
+ if (o[0] === "?") i += this.indentate(e) + "<" + o + "?" + this.tagEndChar; else i += this.indentate(e) + "<" + o + "/" + this.tagEndChar;
1598
+ } else if (typeof s === "object") {
1599
+ if (this.options.oneListGroup) {
1600
+ const t = this.j2x(s, e + 1, n.concat(o));
1601
+ r += t.val;
1602
+ if (this.options.attributesGroupName && s.hasOwnProperty(this.options.attributesGroupName)) {
1603
+ a += t.attrStr;
1604
1604
  }
1605
1605
  } else {
1606
- if (this.options.oneListGroup) {
1607
- let e = this.options.tagValueProcessor(o, r);
1608
- e = this.replaceEntitiesValue(e);
1609
- s += e;
1610
- } else {
1611
- s += this.buildTextValNode(r, o, "", t);
1612
- }
1613
- }
1614
- }
1615
- if (this.options.oneListGroup) {
1616
- s = this.buildObjectNode(s, o, a, t);
1617
- }
1618
- n += s;
1619
- } else {
1620
- if (this.options.attributesGroupName && o === this.options.attributesGroupName) {
1621
- const t = Object.keys(e[o]);
1622
- const i = t.length;
1623
- for (let n = 0; n < i; n++) {
1624
- r += this.buildAttrPairStr(t[n], "" + e[o][t[n]]);
1606
+ r += this.processTextOrObjNode(s, o, e, n);
1625
1607
  }
1626
1608
  } else {
1627
- n += this.processTextOrObjNode(e[o], o, t, i);
1609
+ if (this.options.oneListGroup) {
1610
+ let t = this.options.tagValueProcessor(o, s);
1611
+ t = this.replaceEntitiesValue(t);
1612
+ r += t;
1613
+ } else {
1614
+ r += this.buildTextValNode(s, o, "", e);
1615
+ }
1628
1616
  }
1629
1617
  }
1630
- }
1631
- return {
1632
- attrStr: r,
1633
- val: n
1634
- };
1635
- };
1636
- Builder.prototype.buildAttrPairStr = function(e, t) {
1637
- t = this.options.attributeValueProcessor(e, "" + t);
1638
- t = this.replaceEntitiesValue(t);
1639
- if (this.options.suppressBooleanAttributes && t === "true") {
1640
- return " " + e;
1641
- } else return " " + e + '="' + t + '"';
1642
- };
1643
- function processTextOrObjNode(e, t, i, r) {
1644
- const n = this.j2x(e, i + 1, r.concat(t));
1645
- if (e[this.options.textNodeName] !== undefined && Object.keys(e).length === 1) {
1646
- return this.buildTextValNode(e[this.options.textNodeName], t, n.attrStr, i);
1647
- } else {
1648
- return this.buildObjectNode(n.val, t, n.attrStr, i);
1649
- }
1650
- }
1651
- Builder.prototype.buildObjectNode = function(e, t, i, r) {
1652
- if (e === "") {
1653
- if (t[0] === "?") return this.indentate(r) + "<" + t + i + "?" + this.tagEndChar; else {
1654
- return this.indentate(r) + "<" + t + i + this.closeTag(t) + this.tagEndChar;
1618
+ if (this.options.oneListGroup) {
1619
+ r = this.buildObjectNode(r, o, a, e);
1655
1620
  }
1621
+ i += r;
1656
1622
  } else {
1657
- let n = "</" + t + this.tagEndChar;
1658
- let s = "";
1659
- if (t[0] === "?") {
1660
- s = "?";
1661
- n = "";
1662
- }
1663
- if ((i || i === "") && e.indexOf("<") === -1) {
1664
- return this.indentate(r) + "<" + t + i + s + ">" + e + n;
1665
- } else if (this.options.commentPropName !== false && t === this.options.commentPropName && s.length === 0) {
1666
- return this.indentate(r) + `\x3c!--${e}--\x3e` + this.newLine;
1623
+ if (this.options.attributesGroupName && o === this.options.attributesGroupName) {
1624
+ const e = Object.keys(t[o]);
1625
+ const n = e.length;
1626
+ for (let i = 0; i < n; i++) {
1627
+ s += this.buildAttrPairStr(e[i], "" + t[o][e[i]]);
1628
+ }
1667
1629
  } else {
1668
- return this.indentate(r) + "<" + t + i + s + this.tagEndChar + e + this.indentate(r) + n;
1630
+ i += this.processTextOrObjNode(t[o], o, e, n);
1669
1631
  }
1670
1632
  }
1633
+ }
1634
+ return {
1635
+ attrStr: s,
1636
+ val: i
1671
1637
  };
1672
- Builder.prototype.closeTag = function(e) {
1673
- let t = "";
1674
- if (this.options.unpairedTags.indexOf(e) !== -1) {
1675
- if (!this.options.suppressUnpairedNode) t = "/";
1676
- } else if (this.options.suppressEmptyNode) {
1677
- t = "/";
1678
- } else {
1679
- t = `></${e}`;
1638
+ };
1639
+
1640
+ Yt.prototype.buildAttrPairStr = function(t, e) {
1641
+ e = this.options.attributeValueProcessor(t, "" + e);
1642
+ e = this.replaceEntitiesValue(e);
1643
+ if (this.options.suppressBooleanAttributes && e === "true") {
1644
+ return " " + t;
1645
+ } else return " " + t + '="' + e + '"';
1646
+ };
1647
+
1648
+ function qt(t, e, n, s) {
1649
+ const i = this.j2x(t, n + 1, s.concat(e));
1650
+ if (t[this.options.textNodeName] !== undefined && Object.keys(t).length === 1) {
1651
+ return this.buildTextValNode(t[this.options.textNodeName], e, i.attrStr, n);
1652
+ } else {
1653
+ return this.buildObjectNode(i.val, e, i.attrStr, n);
1654
+ }
1655
+ }
1656
+
1657
+ Yt.prototype.buildObjectNode = function(t, e, n, s) {
1658
+ if (t === "") {
1659
+ if (e[0] === "?") return this.indentate(s) + "<" + e + n + "?" + this.tagEndChar; else {
1660
+ return this.indentate(s) + "<" + e + n + this.closeTag(e) + this.tagEndChar;
1680
1661
  }
1681
- return t;
1682
- };
1683
- function buildEmptyObjNode(e, t, i, r) {
1684
- if (e !== "") {
1685
- return this.buildObjectNode(e, t, i, r);
1662
+ } else {
1663
+ let i = "</" + e + this.tagEndChar;
1664
+ let r = "";
1665
+ if (e[0] === "?") {
1666
+ r = "?";
1667
+ i = "";
1668
+ }
1669
+ if ((n || n === "") && t.indexOf("<") === -1) {
1670
+ return this.indentate(s) + "<" + e + n + r + ">" + t + i;
1671
+ } else if (this.options.commentPropName !== false && e === this.options.commentPropName && r.length === 0) {
1672
+ return this.indentate(s) + `\x3c!--${t}--\x3e` + this.newLine;
1686
1673
  } else {
1687
- if (t[0] === "?") return this.indentate(r) + "<" + t + i + "?" + this.tagEndChar; else {
1688
- return this.indentate(r) + "<" + t + i + "/" + this.tagEndChar;
1689
- }
1674
+ return this.indentate(s) + "<" + e + n + r + this.tagEndChar + t + this.indentate(s) + i;
1690
1675
  }
1691
1676
  }
1692
- Builder.prototype.buildTextValNode = function(e, t, i, r) {
1693
- if (this.options.cdataPropName !== false && t === this.options.cdataPropName) {
1694
- return this.indentate(r) + `<![CDATA[${e}]]>` + this.newLine;
1695
- } else if (this.options.commentPropName !== false && t === this.options.commentPropName) {
1696
- return this.indentate(r) + `\x3c!--${e}--\x3e` + this.newLine;
1697
- } else if (t[0] === "?") {
1698
- return this.indentate(r) + "<" + t + i + "?" + this.tagEndChar;
1699
- } else {
1700
- let n = this.options.tagValueProcessor(t, e);
1701
- n = this.replaceEntitiesValue(n);
1702
- if (n === "") {
1703
- return this.indentate(r) + "<" + t + i + this.closeTag(t) + this.tagEndChar;
1704
- } else {
1705
- return this.indentate(r) + "<" + t + i + ">" + n + "</" + t + this.tagEndChar;
1706
- }
1707
- }
1708
- };
1709
- Builder.prototype.replaceEntitiesValue = function(e) {
1710
- if (e && e.length > 0 && this.options.processEntities) {
1711
- for (let t = 0; t < this.options.entities.length; t++) {
1712
- const i = this.options.entities[t];
1713
- e = e.replace(i.regex, i.val);
1714
- }
1677
+ };
1678
+
1679
+ Yt.prototype.closeTag = function(t) {
1680
+ let e = "";
1681
+ if (this.options.unpairedTags.indexOf(t) !== -1) {
1682
+ if (!this.options.suppressUnpairedNode) e = "/";
1683
+ } else if (this.options.suppressEmptyNode) {
1684
+ e = "/";
1685
+ } else {
1686
+ e = `></${t}`;
1687
+ }
1688
+ return e;
1689
+ };
1690
+
1691
+ function Wt(t, e, n, s) {
1692
+ if (t !== "") {
1693
+ return this.buildObjectNode(t, e, n, s);
1694
+ } else {
1695
+ if (e[0] === "?") return this.indentate(s) + "<" + e + n + "?" + this.tagEndChar; else {
1696
+ return this.indentate(s) + "<" + e + n + "/" + this.tagEndChar;
1715
1697
  }
1716
- return e;
1717
- };
1718
- function indentate(e) {
1719
- return this.options.indentBy.repeat(e);
1720
1698
  }
1721
- function isAttribute(e) {
1722
- if (e.startsWith(this.options.attributeNamePrefix) && e !== this.options.textNodeName) {
1723
- return e.substr(this.attrPrefixLen);
1699
+ }
1700
+
1701
+ Yt.prototype.buildTextValNode = function(t, e, n, s) {
1702
+ if (this.options.cdataPropName !== false && e === this.options.cdataPropName) {
1703
+ return this.indentate(s) + `<![CDATA[${t}]]>` + this.newLine;
1704
+ } else if (this.options.commentPropName !== false && e === this.options.commentPropName) {
1705
+ return this.indentate(s) + `\x3c!--${t}--\x3e` + this.newLine;
1706
+ } else if (e[0] === "?") {
1707
+ return this.indentate(s) + "<" + e + n + "?" + this.tagEndChar;
1708
+ } else {
1709
+ let i = this.options.tagValueProcessor(e, t);
1710
+ i = this.replaceEntitiesValue(i);
1711
+ if (i === "") {
1712
+ return this.indentate(s) + "<" + e + n + this.closeTag(e) + this.tagEndChar;
1724
1713
  } else {
1725
- return false;
1714
+ return this.indentate(s) + "<" + e + n + ">" + i + "</" + e + this.tagEndChar;
1726
1715
  }
1727
1716
  }
1728
- T = Builder;
1729
- return T;
1730
- }
1717
+ };
1731
1718
 
1732
- var A;
1719
+ Yt.prototype.replaceEntitiesValue = function(t) {
1720
+ if (t && t.length > 0 && this.options.processEntities) {
1721
+ for (let e = 0; e < this.options.entities.length; e++) {
1722
+ const n = this.options.entities[e];
1723
+ t = t.replace(n.regex, n.val);
1724
+ }
1725
+ }
1726
+ return t;
1727
+ };
1733
1728
 
1734
- var y;
1729
+ function zt(t) {
1730
+ return this.options.indentBy.repeat(t);
1731
+ }
1735
1732
 
1736
- function requireFxp() {
1737
- if (y) return A;
1738
- y = 1;
1739
- "use strict";
1740
- const e = requireValidator();
1741
- const t = requireXMLParser();
1742
- const i = requireJson2xml();
1743
- A = {
1744
- XMLParser: t,
1745
- XMLValidator: e,
1746
- XMLBuilder: i
1747
- };
1748
- return A;
1733
+ function Jt(t) {
1734
+ if (t.startsWith(this.options.attributeNamePrefix) && t !== this.options.textNodeName) {
1735
+ return t.substr(this.attrPrefixLen);
1736
+ } else {
1737
+ return false;
1738
+ }
1749
1739
  }
1750
1740
 
1751
- var I = requireFxp();
1741
+ var Ht = Yt;
1742
+
1743
+ const Kt = t.getDefaultExportFromCjs(Ht);
1744
+
1745
+ "use strict";
1746
+
1747
+ const Qt = e;
1748
+
1749
+ const te = Ft;
1750
+
1751
+ const ee = Ht;
1752
+
1753
+ var ne = {
1754
+ XMLParser: te,
1755
+ XMLValidator: Qt,
1756
+ XMLBuilder: ee
1757
+ };
1752
1758
 
1753
- const w = e.getDefaultExportFromCjs(I);
1759
+ const se = t.getDefaultExportFromCjs(ne);
1754
1760
 
1755
- function IsXML(e) {
1761
+ function ie(t) {
1756
1762
  try {
1757
- I.XMLValidator.validate(e, {
1763
+ ne.XMLValidator.validate(t, {
1758
1764
  allowBooleanAttributes: true
1759
1765
  });
1760
1766
  return true;
1761
- } catch (e) {
1767
+ } catch (t) {
1762
1768
  return false;
1763
1769
  }
1764
1770
  }
1765
1771
 
1766
- exports.IsXML = IsXML;
1772
+ exports.IsXML = ie;