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