react-native-consumet 1.5.0 → 2.0.0

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 (1055) hide show
  1. package/Consumet.podspec +11 -2
  2. package/README.md +30 -14
  3. package/android/build.gradle +9 -8
  4. package/android/generated/java/com/consumet/NativeConsumetSpec.java +0 -4
  5. package/android/generated/jni/CMakeLists.txt +1 -9
  6. package/android/generated/jni/RNConsumetSpec-generated.cpp +0 -6
  7. package/android/generated/jni/react/renderer/components/RNConsumetSpec/RNConsumetSpecJSI.h +56 -93
  8. package/android/src/androidTest/AndroidManifest.xml +4 -0
  9. package/android/src/androidTest/java/com/consumet/DeobfuscatorModuleTest.kt +88 -0
  10. package/android/src/androidTest/java/com/consumet/SynchronyEngineTest.kt +75 -0
  11. package/android/src/androidTest/java/com/consumet/TestSupport.kt +115 -0
  12. package/android/src/androidTest/java/com/consumet/WebViewContractTest.kt +125 -0
  13. package/android/src/main/java/com/consumet/ConsumetModule.kt +0 -13
  14. package/android/src/main/java/com/consumet/DdosGuardModule.kt +26 -60
  15. package/android/src/main/java/com/consumet/DeobfuscatorModule.kt +59 -68
  16. package/android/src/main/java/com/consumet/HttpRequestModule.kt +171 -285
  17. package/android/src/main/java/com/consumet/Synchrony.kt +65 -0
  18. package/android/src/main/java/com/consumet/SynchronyScriptCache.kt +121 -0
  19. package/android/src/main/java/com/consumet/WebViewDebugging.kt +36 -0
  20. package/android/src/main/java/com/consumet/WebViewTask.kt +101 -0
  21. package/ios/Consumet.h +1 -1
  22. package/ios/Consumet.mm +703 -8
  23. package/ios/RCConsumetSynchronyCache.h +51 -0
  24. package/ios/RCConsumetSynchronyCache.m +246 -0
  25. package/ios/generated/Package.swift +66 -0
  26. package/ios/generated/ReactAppDependencyProvider/RCTAppDependencyProvider.h +25 -0
  27. package/ios/generated/ReactAppDependencyProvider/RCTAppDependencyProvider.mm +40 -0
  28. package/ios/generated/ReactAppDependencyProvider/ReactAppDependencyProvider.podspec +34 -0
  29. package/ios/generated/ReactCodegen/RCTModuleProviders.h +16 -0
  30. package/ios/generated/ReactCodegen/RCTModuleProviders.mm +51 -0
  31. package/ios/generated/ReactCodegen/RCTModulesConformingToProtocolsProvider.h +18 -0
  32. package/ios/generated/ReactCodegen/RCTModulesConformingToProtocolsProvider.mm +54 -0
  33. package/ios/generated/ReactCodegen/RCTThirdPartyComponentsProvider.h +16 -0
  34. package/ios/generated/ReactCodegen/RCTThirdPartyComponentsProvider.mm +30 -0
  35. package/ios/generated/ReactCodegen/RCTUnstableModulesRequiringMainQueueSetupProvider.h +14 -0
  36. package/ios/generated/ReactCodegen/RCTUnstableModulesRequiringMainQueueSetupProvider.mm +19 -0
  37. package/ios/generated/{RNConsumetSpec → ReactCodegen/RNConsumetSpec}/RNConsumetSpec-generated.mm +0 -7
  38. package/ios/generated/{RNConsumetSpec → ReactCodegen/RNConsumetSpec}/RNConsumetSpec.h +0 -2
  39. package/ios/generated/ReactCodegen/RNConsumetSpecJSI.h +88 -0
  40. package/ios/generated/ReactCodegen/ReactCodegen.podspec +114 -0
  41. package/lib/commonjs/NativeConsumet.ts +68 -2
  42. package/lib/commonjs/extension-registry.json +229 -61
  43. package/lib/commonjs/extension-registry.json.sig +1 -0
  44. package/lib/commonjs/extractors/asianload.js +11 -5
  45. package/lib/commonjs/extractors/asianload.js.map +1 -1
  46. package/lib/commonjs/extractors/filemoon.js +11 -6
  47. package/lib/commonjs/extractors/filemoon.js.map +1 -1
  48. package/lib/commonjs/extractors/flixcloud.js +0 -2
  49. package/lib/commonjs/extractors/flixcloud.js.map +1 -1
  50. package/lib/commonjs/extractors/gdflix.js +0 -2
  51. package/lib/commonjs/extractors/gdflix.js.map +1 -1
  52. package/lib/commonjs/extractors/gofile.js +0 -2
  53. package/lib/commonjs/extractors/gofile.js.map +1 -1
  54. package/lib/commonjs/extractors/gogocdn.js +13 -7
  55. package/lib/commonjs/extractors/gogocdn.js.map +1 -1
  56. package/lib/commonjs/extractors/hubcloud.js +0 -2
  57. package/lib/commonjs/extractors/hubcloud.js.map +1 -1
  58. package/lib/commonjs/extractors/index.js +28 -29
  59. package/lib/commonjs/extractors/index.js.map +1 -1
  60. package/lib/commonjs/extractors/kwik.js +0 -2
  61. package/lib/commonjs/extractors/kwik.js.map +1 -1
  62. package/lib/commonjs/extractors/megaplay.js +0 -2
  63. package/lib/commonjs/extractors/megaplay.js.map +1 -1
  64. package/lib/commonjs/extractors/megaup.js +2 -6
  65. package/lib/commonjs/extractors/megaup.js.map +1 -1
  66. package/lib/commonjs/extractors/mixdrop.js +10 -5
  67. package/lib/commonjs/extractors/mixdrop.js.map +1 -1
  68. package/lib/commonjs/extractors/mp4player.js +11 -6
  69. package/lib/commonjs/extractors/mp4player.js.map +1 -1
  70. package/lib/commonjs/extractors/mp4upload.js +10 -5
  71. package/lib/commonjs/extractors/mp4upload.js.map +1 -1
  72. package/lib/commonjs/extractors/rapidcloud.js +16 -10
  73. package/lib/commonjs/extractors/rapidcloud.js.map +1 -1
  74. package/lib/commonjs/extractors/streamhub.js +11 -6
  75. package/lib/commonjs/extractors/streamhub.js.map +1 -1
  76. package/lib/commonjs/extractors/streamlare.js +13 -8
  77. package/lib/commonjs/extractors/streamlare.js.map +1 -1
  78. package/lib/commonjs/extractors/streamsb.js +11 -6
  79. package/lib/commonjs/extractors/streamsb.js.map +1 -1
  80. package/lib/commonjs/extractors/streamtape.js +10 -5
  81. package/lib/commonjs/extractors/streamtape.js.map +1 -1
  82. package/lib/commonjs/extractors/vidhide.js +4 -4
  83. package/lib/commonjs/extractors/vidhide.js.map +1 -1
  84. package/lib/commonjs/extractors/vidmoly.js +11 -6
  85. package/lib/commonjs/extractors/vidmoly.js.map +1 -1
  86. package/lib/commonjs/extractors/vizcloud.js +11 -6
  87. package/lib/commonjs/extractors/vizcloud.js.map +1 -1
  88. package/lib/commonjs/extractors/voe.js +11 -6
  89. package/lib/commonjs/extractors/voe.js.map +1 -1
  90. package/lib/commonjs/index.js +112 -0
  91. package/lib/commonjs/index.js.map +1 -1
  92. package/lib/commonjs/models/base-provider.js +4 -0
  93. package/lib/commonjs/models/base-provider.js.map +1 -1
  94. package/lib/commonjs/models/extension-manifest.js +0 -4
  95. package/lib/commonjs/models/index.js +7 -0
  96. package/lib/commonjs/models/index.js.map +1 -1
  97. package/lib/commonjs/models/meta-error.js +36 -0
  98. package/lib/commonjs/models/meta-error.js.map +1 -0
  99. package/lib/commonjs/models/types.js +15 -0
  100. package/lib/commonjs/models/types.js.map +1 -1
  101. package/lib/commonjs/providers/anime/anikoto/anikoto.js +14 -10
  102. package/lib/commonjs/providers/anime/anikoto/anikoto.js.map +1 -1
  103. package/lib/commonjs/providers/anime/anikoto/create-anikoto.js +17 -8
  104. package/lib/commonjs/providers/anime/anikoto/create-anikoto.js.map +1 -1
  105. package/lib/commonjs/providers/anime/animekai/animekai.js +14 -8
  106. package/lib/commonjs/providers/anime/animekai/animekai.js.map +1 -1
  107. package/lib/commonjs/providers/anime/animekai/create-animekai.js +6 -4
  108. package/lib/commonjs/providers/anime/animekai/create-animekai.js.map +1 -1
  109. package/lib/commonjs/providers/anime/animepahe/animepahe.js +17 -11
  110. package/lib/commonjs/providers/anime/animepahe/animepahe.js.map +1 -1
  111. package/lib/commonjs/providers/anime/animepahe/create-animepahe.js +6 -15
  112. package/lib/commonjs/providers/anime/animepahe/create-animepahe.js.map +1 -1
  113. package/lib/commonjs/providers/anime/animeunity.js +23 -10
  114. package/lib/commonjs/providers/anime/animeunity.js.map +1 -1
  115. package/lib/commonjs/providers/anime/anineko/anineko.js +18 -8
  116. package/lib/commonjs/providers/anime/anineko/anineko.js.map +1 -1
  117. package/lib/commonjs/providers/anime/anineko/create-anineko.js +4 -2
  118. package/lib/commonjs/providers/anime/anineko/create-anineko.js.map +1 -1
  119. package/lib/commonjs/providers/anime/index.js +26 -35
  120. package/lib/commonjs/providers/anime/index.js.map +1 -1
  121. package/lib/commonjs/providers/anime/reanime/create-reanime.js +4 -5
  122. package/lib/commonjs/providers/anime/reanime/create-reanime.js.map +1 -1
  123. package/lib/commonjs/providers/anime/reanime/reanime.js +13 -8
  124. package/lib/commonjs/providers/anime/reanime/reanime.js.map +1 -1
  125. package/lib/commonjs/providers/anime/zoro/create-zoro.js +8 -8
  126. package/lib/commonjs/providers/anime/zoro/create-zoro.js.map +1 -1
  127. package/lib/commonjs/providers/anime/zoro/zoro.js +17 -11
  128. package/lib/commonjs/providers/anime/zoro/zoro.js.map +1 -1
  129. package/lib/commonjs/providers/index.js +8 -8
  130. package/lib/commonjs/providers/index.js.map +1 -1
  131. package/lib/commonjs/providers/light-novels/index.js +6 -7
  132. package/lib/commonjs/providers/light-novels/index.js.map +1 -1
  133. package/lib/commonjs/providers/light-novels/novelupdates.js +32 -11
  134. package/lib/commonjs/providers/light-novels/novelupdates.js.map +1 -1
  135. package/lib/commonjs/providers/light-novels/readlightnovels.js +15 -7
  136. package/lib/commonjs/providers/light-novels/readlightnovels.js.map +1 -1
  137. package/lib/commonjs/providers/manga/asurascans.js +12 -7
  138. package/lib/commonjs/providers/manga/asurascans.js.map +1 -1
  139. package/lib/commonjs/providers/manga/brmangas.js +12 -7
  140. package/lib/commonjs/providers/manga/brmangas.js.map +1 -1
  141. package/lib/commonjs/providers/manga/comick.js +21 -16
  142. package/lib/commonjs/providers/manga/comick.js.map +1 -1
  143. package/lib/commonjs/providers/manga/flamescans.js +12 -7
  144. package/lib/commonjs/providers/manga/flamescans.js.map +1 -1
  145. package/lib/commonjs/providers/manga/index.js +28 -31
  146. package/lib/commonjs/providers/manga/index.js.map +1 -1
  147. package/lib/commonjs/providers/manga/mangadex.js +18 -13
  148. package/lib/commonjs/providers/manga/mangadex.js.map +1 -1
  149. package/lib/commonjs/providers/manga/mangahere.js +13 -8
  150. package/lib/commonjs/providers/manga/mangahere.js.map +1 -1
  151. package/lib/commonjs/providers/manga/mangahost.js +12 -7
  152. package/lib/commonjs/providers/manga/mangahost.js.map +1 -1
  153. package/lib/commonjs/providers/manga/mangakakalot.js +12 -7
  154. package/lib/commonjs/providers/manga/mangakakalot.js.map +1 -1
  155. package/lib/commonjs/providers/manga/mangapark.js +12 -7
  156. package/lib/commonjs/providers/manga/mangapark.js.map +1 -1
  157. package/lib/commonjs/providers/manga/mangapill.js +12 -7
  158. package/lib/commonjs/providers/manga/mangapill.js.map +1 -1
  159. package/lib/commonjs/providers/manga/mangareader.js +13 -8
  160. package/lib/commonjs/providers/manga/mangareader.js.map +1 -1
  161. package/lib/commonjs/providers/manga/mangasee123.js +12 -7
  162. package/lib/commonjs/providers/manga/mangasee123.js.map +1 -1
  163. package/lib/commonjs/providers/manga/readmanga.js +20 -9
  164. package/lib/commonjs/providers/manga/readmanga.js.map +1 -1
  165. package/lib/commonjs/providers/manga/vyvymanga.js +13 -8
  166. package/lib/commonjs/providers/manga/vyvymanga.js.map +1 -1
  167. package/lib/commonjs/providers/meta/anilist.js +560 -1024
  168. package/lib/commonjs/providers/meta/anilist.js.map +1 -1
  169. package/lib/commonjs/providers/meta/index.js +1 -0
  170. package/lib/commonjs/providers/meta/index.js.map +1 -1
  171. package/lib/commonjs/providers/meta/mal.js +86 -89
  172. package/lib/commonjs/providers/meta/mal.js.map +1 -1
  173. package/lib/commonjs/providers/meta/tmdb-api-key.js +29 -0
  174. package/lib/commonjs/providers/meta/tmdb-api-key.js.map +1 -0
  175. package/lib/commonjs/providers/meta/tmdb.js +122 -94
  176. package/lib/commonjs/providers/meta/tmdb.js.map +1 -1
  177. package/lib/commonjs/providers/movies/himovies/create-himovies.js +3 -3
  178. package/lib/commonjs/providers/movies/himovies/create-himovies.js.map +1 -1
  179. package/lib/commonjs/providers/movies/himovies/himovies.js +13 -8
  180. package/lib/commonjs/providers/movies/himovies/himovies.js.map +1 -1
  181. package/lib/commonjs/providers/movies/index.js +20 -30
  182. package/lib/commonjs/providers/movies/index.js.map +1 -1
  183. package/lib/commonjs/providers/movies/multimovies/create-multimovies.js +3 -3
  184. package/lib/commonjs/providers/movies/multimovies/create-multimovies.js.map +1 -1
  185. package/lib/commonjs/providers/movies/multimovies/multimovies.js +13 -8
  186. package/lib/commonjs/providers/movies/multimovies/multimovies.js.map +1 -1
  187. package/lib/commonjs/providers/movies/multistream/index.js +28 -17
  188. package/lib/commonjs/providers/movies/multistream/index.js.map +1 -1
  189. package/lib/commonjs/providers/movies/multistream/utils.js +18 -19
  190. package/lib/commonjs/providers/movies/multistream/utils.js.map +1 -1
  191. package/lib/commonjs/providers/movies/netflixmirror/create-netflixmirror.js +451 -185
  192. package/lib/commonjs/providers/movies/netflixmirror/create-netflixmirror.js.map +1 -1
  193. package/lib/commonjs/providers/movies/netflixmirror/disneymirror.js +22 -0
  194. package/lib/commonjs/providers/movies/netflixmirror/disneymirror.js.map +1 -0
  195. package/lib/commonjs/providers/movies/netflixmirror/netflixmirror.js +11 -24
  196. package/lib/commonjs/providers/movies/netflixmirror/netflixmirror.js.map +1 -1
  197. package/lib/commonjs/providers/movies/netflixmirror/netmirror-parser.js +30 -0
  198. package/lib/commonjs/providers/movies/netflixmirror/netmirror-parser.js.map +1 -0
  199. package/lib/commonjs/providers/movies/netflixmirror/primemirror.js +22 -0
  200. package/lib/commonjs/providers/movies/netflixmirror/primemirror.js.map +1 -0
  201. package/lib/commonjs/providers/movies/vegamovies/create-vegamovies.js +67 -50
  202. package/lib/commonjs/providers/movies/vegamovies/create-vegamovies.js.map +1 -1
  203. package/lib/commonjs/providers/movies/vegamovies/vegamovies.js +11 -14
  204. package/lib/commonjs/providers/movies/vegamovies/vegamovies.js.map +1 -1
  205. package/lib/commonjs/providers/movies/yflix/create-yflix.js +2 -2
  206. package/lib/commonjs/providers/movies/yflix/create-yflix.js.map +1 -1
  207. package/lib/commonjs/providers/movies/yflix/yflix.js +13 -6
  208. package/lib/commonjs/providers/movies/yflix/yflix.js.map +1 -1
  209. package/lib/commonjs/providers/provider-args.js +17 -0
  210. package/lib/commonjs/providers/provider-args.js.map +1 -0
  211. package/lib/commonjs/registry-signing-keys.js +26 -0
  212. package/lib/commonjs/registry-signing-keys.js.map +1 -0
  213. package/lib/commonjs/utils/ExtractorManager.js +136 -247
  214. package/lib/commonjs/utils/ExtractorManager.js.map +1 -1
  215. package/lib/commonjs/utils/ProviderManager.js +179 -259
  216. package/lib/commonjs/utils/ProviderManager.js.map +1 -1
  217. package/lib/commonjs/utils/create-extractor-context.js +0 -1
  218. package/lib/commonjs/utils/create-extractor-context.js.map +1 -1
  219. package/lib/commonjs/utils/create-provider-context.js +37 -29
  220. package/lib/commonjs/utils/create-provider-context.js.map +1 -1
  221. package/lib/commonjs/utils/extension-integrity.js +62 -0
  222. package/lib/commonjs/utils/extension-integrity.js.map +1 -0
  223. package/lib/commonjs/utils/extension-modules.js +109 -0
  224. package/lib/commonjs/utils/extension-modules.js.map +1 -0
  225. package/lib/commonjs/utils/extension-utils.js +46 -40
  226. package/lib/commonjs/utils/extension-utils.js.map +1 -1
  227. package/lib/commonjs/utils/fetch-with-timeout.js +76 -0
  228. package/lib/commonjs/utils/fetch-with-timeout.js.map +1 -0
  229. package/lib/commonjs/utils/index.js +77 -2
  230. package/lib/commonjs/utils/index.js.map +1 -1
  231. package/lib/commonjs/utils/meta-http.js +42 -0
  232. package/lib/commonjs/utils/meta-http.js.map +1 -0
  233. package/lib/commonjs/utils/provider-maps.js +26 -18
  234. package/lib/commonjs/utils/provider-maps.js.map +1 -1
  235. package/lib/commonjs/utils/queries.js +24 -11
  236. package/lib/commonjs/utils/queries.js.map +1 -1
  237. package/lib/commonjs/utils/registry-schema.js +263 -0
  238. package/lib/commonjs/utils/registry-schema.js.map +1 -0
  239. package/lib/commonjs/utils/registry-signature.js +180 -0
  240. package/lib/commonjs/utils/registry-signature.js.map +1 -0
  241. package/lib/commonjs/utils/url-polyfill.js +1075 -426
  242. package/lib/commonjs/utils/url-polyfill.js.map +1 -1
  243. package/lib/commonjs/utils/utils.js +2 -30
  244. package/lib/commonjs/utils/utils.js.map +1 -1
  245. package/lib/module/NativeConsumet.ts +68 -2
  246. package/lib/module/extension-registry.json +229 -61
  247. package/lib/module/extension-registry.json.sig +1 -0
  248. package/lib/module/extractors/asianload.js +10 -5
  249. package/lib/module/extractors/asianload.js.map +1 -1
  250. package/lib/module/extractors/filemoon.js +10 -5
  251. package/lib/module/extractors/filemoon.js.map +1 -1
  252. package/lib/module/extractors/flixcloud.js +0 -1
  253. package/lib/module/extractors/flixcloud.js.map +1 -1
  254. package/lib/module/extractors/gdflix.js +0 -1
  255. package/lib/module/extractors/gdflix.js.map +1 -1
  256. package/lib/module/extractors/gofile.js +0 -1
  257. package/lib/module/extractors/gofile.js.map +1 -1
  258. package/lib/module/extractors/gogocdn.js +12 -7
  259. package/lib/module/extractors/gogocdn.js.map +1 -1
  260. package/lib/module/extractors/hubcloud.js +0 -1
  261. package/lib/module/extractors/hubcloud.js.map +1 -1
  262. package/lib/module/extractors/index.js +24 -25
  263. package/lib/module/extractors/index.js.map +1 -1
  264. package/lib/module/extractors/kwik.js +0 -1
  265. package/lib/module/extractors/kwik.js.map +1 -1
  266. package/lib/module/extractors/megaplay.js +0 -1
  267. package/lib/module/extractors/megaplay.js.map +1 -1
  268. package/lib/module/extractors/megaup.js +2 -4
  269. package/lib/module/extractors/megaup.js.map +1 -1
  270. package/lib/module/extractors/mixdrop.js +9 -4
  271. package/lib/module/extractors/mixdrop.js.map +1 -1
  272. package/lib/module/extractors/mp4player.js +10 -5
  273. package/lib/module/extractors/mp4player.js.map +1 -1
  274. package/lib/module/extractors/mp4upload.js +9 -4
  275. package/lib/module/extractors/mp4upload.js.map +1 -1
  276. package/lib/module/extractors/rapidcloud.js +15 -10
  277. package/lib/module/extractors/rapidcloud.js.map +1 -1
  278. package/lib/module/extractors/streamhub.js +10 -5
  279. package/lib/module/extractors/streamhub.js.map +1 -1
  280. package/lib/module/extractors/streamlare.js +11 -6
  281. package/lib/module/extractors/streamlare.js.map +1 -1
  282. package/lib/module/extractors/streamsb.js +10 -5
  283. package/lib/module/extractors/streamsb.js.map +1 -1
  284. package/lib/module/extractors/streamtape.js +9 -4
  285. package/lib/module/extractors/streamtape.js.map +1 -1
  286. package/lib/module/extractors/vidhide.js +4 -3
  287. package/lib/module/extractors/vidhide.js.map +1 -1
  288. package/lib/module/extractors/vidmoly.js +10 -5
  289. package/lib/module/extractors/vidmoly.js.map +1 -1
  290. package/lib/module/extractors/vizcloud.js +10 -5
  291. package/lib/module/extractors/vizcloud.js.map +1 -1
  292. package/lib/module/extractors/voe.js +10 -5
  293. package/lib/module/extractors/voe.js.map +1 -1
  294. package/lib/module/index.js +11 -7
  295. package/lib/module/index.js.map +1 -1
  296. package/lib/module/models/base-provider.js +4 -0
  297. package/lib/module/models/base-provider.js.map +1 -1
  298. package/lib/module/models/extension-manifest.js +0 -2
  299. package/lib/module/models/index.js +2 -1
  300. package/lib/module/models/index.js.map +1 -1
  301. package/lib/module/models/meta-error.js +31 -0
  302. package/lib/module/models/meta-error.js.map +1 -0
  303. package/lib/module/models/types.js +21 -0
  304. package/lib/module/models/types.js.map +1 -1
  305. package/lib/module/providers/anime/anikoto/anikoto.js +13 -8
  306. package/lib/module/providers/anime/anikoto/anikoto.js.map +1 -1
  307. package/lib/module/providers/anime/anikoto/create-anikoto.js +17 -8
  308. package/lib/module/providers/anime/anikoto/create-anikoto.js.map +1 -1
  309. package/lib/module/providers/anime/animekai/animekai.js +13 -6
  310. package/lib/module/providers/anime/animekai/animekai.js.map +1 -1
  311. package/lib/module/providers/anime/animekai/create-animekai.js +6 -4
  312. package/lib/module/providers/anime/animekai/create-animekai.js.map +1 -1
  313. package/lib/module/providers/anime/animepahe/animepahe.js +13 -8
  314. package/lib/module/providers/anime/animepahe/animepahe.js.map +1 -1
  315. package/lib/module/providers/anime/animepahe/create-animepahe.js +6 -15
  316. package/lib/module/providers/anime/animepahe/create-animepahe.js.map +1 -1
  317. package/lib/module/providers/anime/animeunity.js +21 -9
  318. package/lib/module/providers/anime/animeunity.js.map +1 -1
  319. package/lib/module/providers/anime/anineko/anineko.js +17 -6
  320. package/lib/module/providers/anime/anineko/anineko.js.map +1 -1
  321. package/lib/module/providers/anime/anineko/create-anineko.js +4 -2
  322. package/lib/module/providers/anime/anineko/create-anineko.js.map +1 -1
  323. package/lib/module/providers/anime/index.js +13 -21
  324. package/lib/module/providers/anime/index.js.map +1 -1
  325. package/lib/module/providers/anime/reanime/create-reanime.js +3 -4
  326. package/lib/module/providers/anime/reanime/create-reanime.js.map +1 -1
  327. package/lib/module/providers/anime/reanime/reanime.js +12 -6
  328. package/lib/module/providers/anime/reanime/reanime.js.map +1 -1
  329. package/lib/module/providers/anime/zoro/create-zoro.js +8 -9
  330. package/lib/module/providers/anime/zoro/create-zoro.js.map +1 -1
  331. package/lib/module/providers/anime/zoro/zoro.js +13 -8
  332. package/lib/module/providers/anime/zoro/zoro.js.map +1 -1
  333. package/lib/module/providers/index.js +4 -4
  334. package/lib/module/providers/index.js.map +1 -1
  335. package/lib/module/providers/light-novels/index.js +3 -3
  336. package/lib/module/providers/light-novels/index.js.map +1 -1
  337. package/lib/module/providers/light-novels/novelupdates.js +29 -11
  338. package/lib/module/providers/light-novels/novelupdates.js.map +1 -1
  339. package/lib/module/providers/light-novels/readlightnovels.js +12 -7
  340. package/lib/module/providers/light-novels/readlightnovels.js.map +1 -1
  341. package/lib/module/providers/manga/asurascans.js +11 -6
  342. package/lib/module/providers/manga/asurascans.js.map +1 -1
  343. package/lib/module/providers/manga/brmangas.js +11 -6
  344. package/lib/module/providers/manga/brmangas.js.map +1 -1
  345. package/lib/module/providers/manga/comick.js +20 -16
  346. package/lib/module/providers/manga/comick.js.map +1 -1
  347. package/lib/module/providers/manga/flamescans.js +11 -6
  348. package/lib/module/providers/manga/flamescans.js.map +1 -1
  349. package/lib/module/providers/manga/index.js +14 -16
  350. package/lib/module/providers/manga/index.js.map +1 -1
  351. package/lib/module/providers/manga/mangadex.js +17 -13
  352. package/lib/module/providers/manga/mangadex.js.map +1 -1
  353. package/lib/module/providers/manga/mangahere.js +12 -7
  354. package/lib/module/providers/manga/mangahere.js.map +1 -1
  355. package/lib/module/providers/manga/mangahost.js +11 -6
  356. package/lib/module/providers/manga/mangahost.js.map +1 -1
  357. package/lib/module/providers/manga/mangakakalot.js +11 -6
  358. package/lib/module/providers/manga/mangakakalot.js.map +1 -1
  359. package/lib/module/providers/manga/mangapark.js +11 -6
  360. package/lib/module/providers/manga/mangapark.js.map +1 -1
  361. package/lib/module/providers/manga/mangapill.js +11 -7
  362. package/lib/module/providers/manga/mangapill.js.map +1 -1
  363. package/lib/module/providers/manga/mangareader.js +12 -8
  364. package/lib/module/providers/manga/mangareader.js.map +1 -1
  365. package/lib/module/providers/manga/mangasee123.js +11 -7
  366. package/lib/module/providers/manga/mangasee123.js.map +1 -1
  367. package/lib/module/providers/manga/readmanga.js +19 -8
  368. package/lib/module/providers/manga/readmanga.js.map +1 -1
  369. package/lib/module/providers/manga/vyvymanga.js +12 -7
  370. package/lib/module/providers/manga/vyvymanga.js.map +1 -1
  371. package/lib/module/providers/meta/anilist.js +562 -1024
  372. package/lib/module/providers/meta/anilist.js.map +1 -1
  373. package/lib/module/providers/meta/index.js +1 -0
  374. package/lib/module/providers/meta/index.js.map +1 -1
  375. package/lib/module/providers/meta/mal.js +87 -89
  376. package/lib/module/providers/meta/mal.js.map +1 -1
  377. package/lib/module/providers/meta/tmdb-api-key.js +24 -0
  378. package/lib/module/providers/meta/tmdb-api-key.js.map +1 -0
  379. package/lib/module/providers/meta/tmdb.js +123 -93
  380. package/lib/module/providers/meta/tmdb.js.map +1 -1
  381. package/lib/module/providers/movies/himovies/create-himovies.js +3 -3
  382. package/lib/module/providers/movies/himovies/create-himovies.js.map +1 -1
  383. package/lib/module/providers/movies/himovies/himovies.js +12 -9
  384. package/lib/module/providers/movies/himovies/himovies.js.map +1 -1
  385. package/lib/module/providers/movies/index.js +14 -11
  386. package/lib/module/providers/movies/index.js.map +1 -1
  387. package/lib/module/providers/movies/multimovies/create-multimovies.js +3 -3
  388. package/lib/module/providers/movies/multimovies/create-multimovies.js.map +1 -1
  389. package/lib/module/providers/movies/multimovies/multimovies.js +12 -8
  390. package/lib/module/providers/movies/multimovies/multimovies.js.map +1 -1
  391. package/lib/module/providers/movies/multistream/index.js +27 -17
  392. package/lib/module/providers/movies/multistream/index.js.map +1 -1
  393. package/lib/module/providers/movies/multistream/utils.js +8 -9
  394. package/lib/module/providers/movies/multistream/utils.js.map +1 -1
  395. package/lib/module/providers/movies/netflixmirror/create-netflixmirror.js +449 -185
  396. package/lib/module/providers/movies/netflixmirror/create-netflixmirror.js.map +1 -1
  397. package/lib/module/providers/movies/netflixmirror/disneymirror.js +17 -0
  398. package/lib/module/providers/movies/netflixmirror/disneymirror.js.map +1 -0
  399. package/lib/module/providers/movies/netflixmirror/netflixmirror.js +9 -24
  400. package/lib/module/providers/movies/netflixmirror/netflixmirror.js.map +1 -1
  401. package/lib/module/providers/movies/netflixmirror/netmirror-parser.js +25 -0
  402. package/lib/module/providers/movies/netflixmirror/netmirror-parser.js.map +1 -0
  403. package/lib/module/providers/movies/netflixmirror/primemirror.js +17 -0
  404. package/lib/module/providers/movies/netflixmirror/primemirror.js.map +1 -0
  405. package/lib/module/providers/movies/vegamovies/create-vegamovies.js +67 -50
  406. package/lib/module/providers/movies/vegamovies/create-vegamovies.js.map +1 -1
  407. package/lib/module/providers/movies/vegamovies/vegamovies.js +12 -10
  408. package/lib/module/providers/movies/vegamovies/vegamovies.js.map +1 -1
  409. package/lib/module/providers/movies/yflix/create-yflix.js +2 -2
  410. package/lib/module/providers/movies/yflix/create-yflix.js.map +1 -1
  411. package/lib/module/providers/movies/yflix/yflix.js +12 -6
  412. package/lib/module/providers/movies/yflix/yflix.js.map +1 -1
  413. package/lib/module/providers/provider-args.js +14 -0
  414. package/lib/module/providers/provider-args.js.map +1 -0
  415. package/lib/module/registry-signing-keys.js +22 -0
  416. package/lib/module/registry-signing-keys.js.map +1 -0
  417. package/lib/module/utils/ExtractorManager.js +138 -248
  418. package/lib/module/utils/ExtractorManager.js.map +1 -1
  419. package/lib/module/utils/ProviderManager.js +178 -258
  420. package/lib/module/utils/ProviderManager.js.map +1 -1
  421. package/lib/module/utils/create-extractor-context.js +1 -2
  422. package/lib/module/utils/create-extractor-context.js.map +1 -1
  423. package/lib/module/utils/create-provider-context.js +39 -30
  424. package/lib/module/utils/create-provider-context.js.map +1 -1
  425. package/lib/module/utils/extension-integrity.js +52 -0
  426. package/lib/module/utils/extension-integrity.js.map +1 -0
  427. package/lib/module/utils/extension-modules.js +101 -0
  428. package/lib/module/utils/extension-modules.js.map +1 -0
  429. package/lib/module/utils/extension-utils.js +46 -40
  430. package/lib/module/utils/extension-utils.js.map +1 -1
  431. package/lib/module/utils/fetch-with-timeout.js +71 -0
  432. package/lib/module/utils/fetch-with-timeout.js.map +1 -0
  433. package/lib/module/utils/index.js +6 -3
  434. package/lib/module/utils/index.js.map +1 -1
  435. package/lib/module/utils/meta-http.js +37 -0
  436. package/lib/module/utils/meta-http.js.map +1 -0
  437. package/lib/module/utils/provider-maps.js +26 -18
  438. package/lib/module/utils/provider-maps.js.map +1 -1
  439. package/lib/module/utils/queries.js +22 -9
  440. package/lib/module/utils/queries.js.map +1 -1
  441. package/lib/module/utils/registry-schema.js +255 -0
  442. package/lib/module/utils/registry-schema.js.map +1 -0
  443. package/lib/module/utils/registry-signature.js +168 -0
  444. package/lib/module/utils/registry-signature.js.map +1 -0
  445. package/lib/module/utils/url-polyfill.js +1073 -425
  446. package/lib/module/utils/url-polyfill.js.map +1 -1
  447. package/lib/module/utils/utils.js +0 -26
  448. package/lib/module/utils/utils.js.map +1 -1
  449. package/lib/typescript/commonjs/src/NativeConsumet.d.ts +68 -2
  450. package/lib/typescript/commonjs/src/NativeConsumet.d.ts.map +1 -1
  451. package/lib/typescript/commonjs/src/extractors/asianload.d.ts +5 -3
  452. package/lib/typescript/commonjs/src/extractors/asianload.d.ts.map +1 -1
  453. package/lib/typescript/commonjs/src/extractors/filemoon.d.ts +5 -3
  454. package/lib/typescript/commonjs/src/extractors/filemoon.d.ts.map +1 -1
  455. package/lib/typescript/commonjs/src/extractors/flixcloud.d.ts +0 -1
  456. package/lib/typescript/commonjs/src/extractors/flixcloud.d.ts.map +1 -1
  457. package/lib/typescript/commonjs/src/extractors/gdflix.d.ts +0 -1
  458. package/lib/typescript/commonjs/src/extractors/gdflix.d.ts.map +1 -1
  459. package/lib/typescript/commonjs/src/extractors/gofile.d.ts +0 -1
  460. package/lib/typescript/commonjs/src/extractors/gofile.d.ts.map +1 -1
  461. package/lib/typescript/commonjs/src/extractors/gogocdn.d.ts +5 -3
  462. package/lib/typescript/commonjs/src/extractors/gogocdn.d.ts.map +1 -1
  463. package/lib/typescript/commonjs/src/extractors/hubcloud.d.ts +0 -1
  464. package/lib/typescript/commonjs/src/extractors/hubcloud.d.ts.map +1 -1
  465. package/lib/typescript/commonjs/src/extractors/index.d.ts +24 -25
  466. package/lib/typescript/commonjs/src/extractors/index.d.ts.map +1 -1
  467. package/lib/typescript/commonjs/src/extractors/kwik.d.ts +0 -1
  468. package/lib/typescript/commonjs/src/extractors/kwik.d.ts.map +1 -1
  469. package/lib/typescript/commonjs/src/extractors/megaplay.d.ts +0 -1
  470. package/lib/typescript/commonjs/src/extractors/megaplay.d.ts.map +1 -1
  471. package/lib/typescript/commonjs/src/extractors/megaup.d.ts +0 -1
  472. package/lib/typescript/commonjs/src/extractors/megaup.d.ts.map +1 -1
  473. package/lib/typescript/commonjs/src/extractors/mixdrop.d.ts +5 -3
  474. package/lib/typescript/commonjs/src/extractors/mixdrop.d.ts.map +1 -1
  475. package/lib/typescript/commonjs/src/extractors/mp4player.d.ts +5 -3
  476. package/lib/typescript/commonjs/src/extractors/mp4player.d.ts.map +1 -1
  477. package/lib/typescript/commonjs/src/extractors/mp4upload.d.ts +5 -3
  478. package/lib/typescript/commonjs/src/extractors/mp4upload.d.ts.map +1 -1
  479. package/lib/typescript/commonjs/src/extractors/rapidcloud.d.ts +5 -3
  480. package/lib/typescript/commonjs/src/extractors/rapidcloud.d.ts.map +1 -1
  481. package/lib/typescript/commonjs/src/extractors/streamhub.d.ts +5 -3
  482. package/lib/typescript/commonjs/src/extractors/streamhub.d.ts.map +1 -1
  483. package/lib/typescript/commonjs/src/extractors/streamlare.d.ts +5 -4
  484. package/lib/typescript/commonjs/src/extractors/streamlare.d.ts.map +1 -1
  485. package/lib/typescript/commonjs/src/extractors/streamsb.d.ts +5 -3
  486. package/lib/typescript/commonjs/src/extractors/streamsb.d.ts.map +1 -1
  487. package/lib/typescript/commonjs/src/extractors/streamtape.d.ts +5 -3
  488. package/lib/typescript/commonjs/src/extractors/streamtape.d.ts.map +1 -1
  489. package/lib/typescript/commonjs/src/extractors/vidhide.d.ts +0 -1
  490. package/lib/typescript/commonjs/src/extractors/vidhide.d.ts.map +1 -1
  491. package/lib/typescript/commonjs/src/extractors/vidmoly.d.ts +5 -3
  492. package/lib/typescript/commonjs/src/extractors/vidmoly.d.ts.map +1 -1
  493. package/lib/typescript/commonjs/src/extractors/vizcloud.d.ts +5 -3
  494. package/lib/typescript/commonjs/src/extractors/vizcloud.d.ts.map +1 -1
  495. package/lib/typescript/commonjs/src/extractors/voe.d.ts +5 -3
  496. package/lib/typescript/commonjs/src/extractors/voe.d.ts.map +1 -1
  497. package/lib/typescript/commonjs/src/index.d.ts +15 -9
  498. package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
  499. package/lib/typescript/commonjs/src/models/base-provider.d.ts +5 -1
  500. package/lib/typescript/commonjs/src/models/base-provider.d.ts.map +1 -1
  501. package/lib/typescript/commonjs/src/models/extension-manifest.d.ts +31 -5
  502. package/lib/typescript/commonjs/src/models/extension-manifest.d.ts.map +1 -1
  503. package/lib/typescript/commonjs/src/models/extractor-context.d.ts +1 -2
  504. package/lib/typescript/commonjs/src/models/extractor-context.d.ts.map +1 -1
  505. package/lib/typescript/commonjs/src/models/index.d.ts +6 -4
  506. package/lib/typescript/commonjs/src/models/index.d.ts.map +1 -1
  507. package/lib/typescript/commonjs/src/models/meta-error.d.ts +20 -0
  508. package/lib/typescript/commonjs/src/models/meta-error.d.ts.map +1 -0
  509. package/lib/typescript/commonjs/src/models/provider-context.d.ts +21 -16
  510. package/lib/typescript/commonjs/src/models/provider-context.d.ts.map +1 -1
  511. package/lib/typescript/commonjs/src/models/types.d.ts +106 -3
  512. package/lib/typescript/commonjs/src/models/types.d.ts.map +1 -1
  513. package/lib/typescript/commonjs/src/providers/anime/anikoto/anikoto.d.ts +7 -2
  514. package/lib/typescript/commonjs/src/providers/anime/anikoto/anikoto.d.ts.map +1 -1
  515. package/lib/typescript/commonjs/src/providers/anime/anikoto/create-anikoto.d.ts +3 -3
  516. package/lib/typescript/commonjs/src/providers/anime/anikoto/create-anikoto.d.ts.map +1 -1
  517. package/lib/typescript/commonjs/src/providers/anime/animekai/animekai.d.ts +7 -2
  518. package/lib/typescript/commonjs/src/providers/anime/animekai/animekai.d.ts.map +1 -1
  519. package/lib/typescript/commonjs/src/providers/anime/animekai/create-animekai.d.ts +3 -3
  520. package/lib/typescript/commonjs/src/providers/anime/animekai/create-animekai.d.ts.map +1 -1
  521. package/lib/typescript/commonjs/src/providers/anime/animepahe/animepahe.d.ts +7 -2
  522. package/lib/typescript/commonjs/src/providers/anime/animepahe/animepahe.d.ts.map +1 -1
  523. package/lib/typescript/commonjs/src/providers/anime/animepahe/create-animepahe.d.ts +3 -3
  524. package/lib/typescript/commonjs/src/providers/anime/animepahe/create-animepahe.d.ts.map +1 -1
  525. package/lib/typescript/commonjs/src/providers/anime/animeunity.d.ts +11 -3
  526. package/lib/typescript/commonjs/src/providers/anime/animeunity.d.ts.map +1 -1
  527. package/lib/typescript/commonjs/src/providers/anime/anineko/anineko.d.ts +7 -2
  528. package/lib/typescript/commonjs/src/providers/anime/anineko/anineko.d.ts.map +1 -1
  529. package/lib/typescript/commonjs/src/providers/anime/anineko/create-anineko.d.ts +3 -3
  530. package/lib/typescript/commonjs/src/providers/anime/anineko/create-anineko.d.ts.map +1 -1
  531. package/lib/typescript/commonjs/src/providers/anime/index.d.ts +13 -22
  532. package/lib/typescript/commonjs/src/providers/anime/index.d.ts.map +1 -1
  533. package/lib/typescript/commonjs/src/providers/anime/reanime/create-reanime.d.ts +1 -2
  534. package/lib/typescript/commonjs/src/providers/anime/reanime/create-reanime.d.ts.map +1 -1
  535. package/lib/typescript/commonjs/src/providers/anime/reanime/reanime.d.ts +7 -2
  536. package/lib/typescript/commonjs/src/providers/anime/reanime/reanime.d.ts.map +1 -1
  537. package/lib/typescript/commonjs/src/providers/anime/zoro/create-zoro.d.ts +3 -3
  538. package/lib/typescript/commonjs/src/providers/anime/zoro/create-zoro.d.ts.map +1 -1
  539. package/lib/typescript/commonjs/src/providers/anime/zoro/zoro.d.ts +7 -2
  540. package/lib/typescript/commonjs/src/providers/anime/zoro/zoro.d.ts.map +1 -1
  541. package/lib/typescript/commonjs/src/providers/index.d.ts +4 -4
  542. package/lib/typescript/commonjs/src/providers/index.d.ts.map +1 -1
  543. package/lib/typescript/commonjs/src/providers/light-novels/index.d.ts +3 -4
  544. package/lib/typescript/commonjs/src/providers/light-novels/index.d.ts.map +1 -1
  545. package/lib/typescript/commonjs/src/providers/light-novels/novelupdates.d.ts +7 -3
  546. package/lib/typescript/commonjs/src/providers/light-novels/novelupdates.d.ts.map +1 -1
  547. package/lib/typescript/commonjs/src/providers/light-novels/readlightnovels.d.ts +5 -3
  548. package/lib/typescript/commonjs/src/providers/light-novels/readlightnovels.d.ts.map +1 -1
  549. package/lib/typescript/commonjs/src/providers/manga/asurascans.d.ts +5 -3
  550. package/lib/typescript/commonjs/src/providers/manga/asurascans.d.ts.map +1 -1
  551. package/lib/typescript/commonjs/src/providers/manga/brmangas.d.ts +5 -3
  552. package/lib/typescript/commonjs/src/providers/manga/brmangas.d.ts.map +1 -1
  553. package/lib/typescript/commonjs/src/providers/manga/comick.d.ts +7 -4
  554. package/lib/typescript/commonjs/src/providers/manga/comick.d.ts.map +1 -1
  555. package/lib/typescript/commonjs/src/providers/manga/flamescans.d.ts +5 -3
  556. package/lib/typescript/commonjs/src/providers/manga/flamescans.d.ts.map +1 -1
  557. package/lib/typescript/commonjs/src/providers/manga/index.d.ts +14 -17
  558. package/lib/typescript/commonjs/src/providers/manga/index.d.ts.map +1 -1
  559. package/lib/typescript/commonjs/src/providers/manga/mangadex.d.ts +5 -3
  560. package/lib/typescript/commonjs/src/providers/manga/mangadex.d.ts.map +1 -1
  561. package/lib/typescript/commonjs/src/providers/manga/mangahere.d.ts +5 -3
  562. package/lib/typescript/commonjs/src/providers/manga/mangahere.d.ts.map +1 -1
  563. package/lib/typescript/commonjs/src/providers/manga/mangahost.d.ts +5 -3
  564. package/lib/typescript/commonjs/src/providers/manga/mangahost.d.ts.map +1 -1
  565. package/lib/typescript/commonjs/src/providers/manga/mangakakalot.d.ts +5 -3
  566. package/lib/typescript/commonjs/src/providers/manga/mangakakalot.d.ts.map +1 -1
  567. package/lib/typescript/commonjs/src/providers/manga/mangapark.d.ts +5 -3
  568. package/lib/typescript/commonjs/src/providers/manga/mangapark.d.ts.map +1 -1
  569. package/lib/typescript/commonjs/src/providers/manga/mangapill.d.ts +5 -3
  570. package/lib/typescript/commonjs/src/providers/manga/mangapill.d.ts.map +1 -1
  571. package/lib/typescript/commonjs/src/providers/manga/mangareader.d.ts +5 -3
  572. package/lib/typescript/commonjs/src/providers/manga/mangareader.d.ts.map +1 -1
  573. package/lib/typescript/commonjs/src/providers/manga/mangasee123.d.ts +5 -3
  574. package/lib/typescript/commonjs/src/providers/manga/mangasee123.d.ts.map +1 -1
  575. package/lib/typescript/commonjs/src/providers/manga/readmanga.d.ts +11 -3
  576. package/lib/typescript/commonjs/src/providers/manga/readmanga.d.ts.map +1 -1
  577. package/lib/typescript/commonjs/src/providers/manga/vyvymanga.d.ts +5 -3
  578. package/lib/typescript/commonjs/src/providers/manga/vyvymanga.d.ts.map +1 -1
  579. package/lib/typescript/commonjs/src/providers/meta/anilist.d.ts +26 -9
  580. package/lib/typescript/commonjs/src/providers/meta/anilist.d.ts.map +1 -1
  581. package/lib/typescript/commonjs/src/providers/meta/index.d.ts +1 -0
  582. package/lib/typescript/commonjs/src/providers/meta/index.d.ts.map +1 -1
  583. package/lib/typescript/commonjs/src/providers/meta/mal.d.ts +9 -4
  584. package/lib/typescript/commonjs/src/providers/meta/mal.d.ts.map +1 -1
  585. package/lib/typescript/commonjs/src/providers/meta/tmdb-api-key.d.ts +7 -0
  586. package/lib/typescript/commonjs/src/providers/meta/tmdb-api-key.d.ts.map +1 -0
  587. package/lib/typescript/commonjs/src/providers/meta/tmdb.d.ts +18 -5
  588. package/lib/typescript/commonjs/src/providers/meta/tmdb.d.ts.map +1 -1
  589. package/lib/typescript/commonjs/src/providers/movies/himovies/himovies.d.ts +8 -3
  590. package/lib/typescript/commonjs/src/providers/movies/himovies/himovies.d.ts.map +1 -1
  591. package/lib/typescript/commonjs/src/providers/movies/index.d.ts +14 -10
  592. package/lib/typescript/commonjs/src/providers/movies/index.d.ts.map +1 -1
  593. package/lib/typescript/commonjs/src/providers/movies/multimovies/multimovies.d.ts +8 -3
  594. package/lib/typescript/commonjs/src/providers/movies/multimovies/multimovies.d.ts.map +1 -1
  595. package/lib/typescript/commonjs/src/providers/movies/multistream/index.d.ts +10 -3
  596. package/lib/typescript/commonjs/src/providers/movies/multistream/index.d.ts.map +1 -1
  597. package/lib/typescript/commonjs/src/providers/movies/multistream/utils.d.ts +7 -6
  598. package/lib/typescript/commonjs/src/providers/movies/multistream/utils.d.ts.map +1 -1
  599. package/lib/typescript/commonjs/src/providers/movies/netflixmirror/create-netflixmirror.d.ts +2 -6
  600. package/lib/typescript/commonjs/src/providers/movies/netflixmirror/create-netflixmirror.d.ts.map +1 -1
  601. package/lib/typescript/commonjs/src/providers/movies/netflixmirror/disneymirror.d.ts +12 -0
  602. package/lib/typescript/commonjs/src/providers/movies/netflixmirror/disneymirror.d.ts.map +1 -0
  603. package/lib/typescript/commonjs/src/providers/movies/netflixmirror/netflixmirror.d.ts +9 -17
  604. package/lib/typescript/commonjs/src/providers/movies/netflixmirror/netflixmirror.d.ts.map +1 -1
  605. package/lib/typescript/commonjs/src/providers/movies/netflixmirror/netmirror-parser.d.ts +21 -0
  606. package/lib/typescript/commonjs/src/providers/movies/netflixmirror/netmirror-parser.d.ts.map +1 -0
  607. package/lib/typescript/commonjs/src/providers/movies/netflixmirror/primemirror.d.ts +12 -0
  608. package/lib/typescript/commonjs/src/providers/movies/netflixmirror/primemirror.d.ts.map +1 -0
  609. package/lib/typescript/commonjs/src/providers/movies/vegamovies/create-vegamovies.d.ts.map +1 -1
  610. package/lib/typescript/commonjs/src/providers/movies/vegamovies/vegamovies.d.ts +8 -5
  611. package/lib/typescript/commonjs/src/providers/movies/vegamovies/vegamovies.d.ts.map +1 -1
  612. package/lib/typescript/commonjs/src/providers/movies/yflix/yflix.d.ts +8 -3
  613. package/lib/typescript/commonjs/src/providers/movies/yflix/yflix.d.ts.map +1 -1
  614. package/lib/typescript/commonjs/src/providers/provider-args.d.ts +8 -0
  615. package/lib/typescript/commonjs/src/providers/provider-args.d.ts.map +1 -0
  616. package/lib/typescript/commonjs/src/registry-signing-keys.d.ts +18 -0
  617. package/lib/typescript/commonjs/src/registry-signing-keys.d.ts.map +1 -0
  618. package/lib/typescript/commonjs/src/utils/ExtractorManager.d.ts +33 -14
  619. package/lib/typescript/commonjs/src/utils/ExtractorManager.d.ts.map +1 -1
  620. package/lib/typescript/commonjs/src/utils/ProviderManager.d.ts +72 -19
  621. package/lib/typescript/commonjs/src/utils/ProviderManager.d.ts.map +1 -1
  622. package/lib/typescript/commonjs/src/utils/create-extractor-context.d.ts.map +1 -1
  623. package/lib/typescript/commonjs/src/utils/create-provider-context.d.ts.map +1 -1
  624. package/lib/typescript/commonjs/src/utils/extension-integrity.d.ts +40 -0
  625. package/lib/typescript/commonjs/src/utils/extension-integrity.d.ts.map +1 -0
  626. package/lib/typescript/commonjs/src/utils/extension-modules.d.ts +49 -0
  627. package/lib/typescript/commonjs/src/utils/extension-modules.d.ts.map +1 -0
  628. package/lib/typescript/commonjs/src/utils/extension-utils.d.ts +24 -46
  629. package/lib/typescript/commonjs/src/utils/extension-utils.d.ts.map +1 -1
  630. package/lib/typescript/commonjs/src/utils/fetch-with-timeout.d.ts +29 -0
  631. package/lib/typescript/commonjs/src/utils/fetch-with-timeout.d.ts.map +1 -0
  632. package/lib/typescript/commonjs/src/utils/index.d.ts +11 -4
  633. package/lib/typescript/commonjs/src/utils/index.d.ts.map +1 -1
  634. package/lib/typescript/commonjs/src/utils/meta-http.d.ts +16 -0
  635. package/lib/typescript/commonjs/src/utils/meta-http.d.ts.map +1 -0
  636. package/lib/typescript/commonjs/src/utils/provider-maps.d.ts +14 -7
  637. package/lib/typescript/commonjs/src/utils/provider-maps.d.ts.map +1 -1
  638. package/lib/typescript/commonjs/src/utils/queries.d.ts +17 -8
  639. package/lib/typescript/commonjs/src/utils/queries.d.ts.map +1 -1
  640. package/lib/typescript/commonjs/src/utils/registry-schema.d.ts +66 -0
  641. package/lib/typescript/commonjs/src/utils/registry-schema.d.ts.map +1 -0
  642. package/lib/typescript/commonjs/src/utils/registry-signature.d.ts +66 -0
  643. package/lib/typescript/commonjs/src/utils/registry-signature.d.ts.map +1 -0
  644. package/lib/typescript/commonjs/src/utils/url-polyfill.d.ts +20 -8
  645. package/lib/typescript/commonjs/src/utils/url-polyfill.d.ts.map +1 -1
  646. package/lib/typescript/commonjs/src/utils/utils.d.ts +0 -1
  647. package/lib/typescript/commonjs/src/utils/utils.d.ts.map +1 -1
  648. package/lib/typescript/module/src/NativeConsumet.d.ts +68 -2
  649. package/lib/typescript/module/src/NativeConsumet.d.ts.map +1 -1
  650. package/lib/typescript/module/src/extractors/asianload.d.ts +5 -3
  651. package/lib/typescript/module/src/extractors/asianload.d.ts.map +1 -1
  652. package/lib/typescript/module/src/extractors/filemoon.d.ts +5 -3
  653. package/lib/typescript/module/src/extractors/filemoon.d.ts.map +1 -1
  654. package/lib/typescript/module/src/extractors/flixcloud.d.ts +0 -1
  655. package/lib/typescript/module/src/extractors/flixcloud.d.ts.map +1 -1
  656. package/lib/typescript/module/src/extractors/gdflix.d.ts +0 -1
  657. package/lib/typescript/module/src/extractors/gdflix.d.ts.map +1 -1
  658. package/lib/typescript/module/src/extractors/gofile.d.ts +0 -1
  659. package/lib/typescript/module/src/extractors/gofile.d.ts.map +1 -1
  660. package/lib/typescript/module/src/extractors/gogocdn.d.ts +5 -3
  661. package/lib/typescript/module/src/extractors/gogocdn.d.ts.map +1 -1
  662. package/lib/typescript/module/src/extractors/hubcloud.d.ts +0 -1
  663. package/lib/typescript/module/src/extractors/hubcloud.d.ts.map +1 -1
  664. package/lib/typescript/module/src/extractors/index.d.ts +24 -25
  665. package/lib/typescript/module/src/extractors/index.d.ts.map +1 -1
  666. package/lib/typescript/module/src/extractors/kwik.d.ts +0 -1
  667. package/lib/typescript/module/src/extractors/kwik.d.ts.map +1 -1
  668. package/lib/typescript/module/src/extractors/megaplay.d.ts +0 -1
  669. package/lib/typescript/module/src/extractors/megaplay.d.ts.map +1 -1
  670. package/lib/typescript/module/src/extractors/megaup.d.ts +0 -1
  671. package/lib/typescript/module/src/extractors/megaup.d.ts.map +1 -1
  672. package/lib/typescript/module/src/extractors/mixdrop.d.ts +5 -3
  673. package/lib/typescript/module/src/extractors/mixdrop.d.ts.map +1 -1
  674. package/lib/typescript/module/src/extractors/mp4player.d.ts +5 -3
  675. package/lib/typescript/module/src/extractors/mp4player.d.ts.map +1 -1
  676. package/lib/typescript/module/src/extractors/mp4upload.d.ts +5 -3
  677. package/lib/typescript/module/src/extractors/mp4upload.d.ts.map +1 -1
  678. package/lib/typescript/module/src/extractors/rapidcloud.d.ts +5 -3
  679. package/lib/typescript/module/src/extractors/rapidcloud.d.ts.map +1 -1
  680. package/lib/typescript/module/src/extractors/streamhub.d.ts +5 -3
  681. package/lib/typescript/module/src/extractors/streamhub.d.ts.map +1 -1
  682. package/lib/typescript/module/src/extractors/streamlare.d.ts +5 -4
  683. package/lib/typescript/module/src/extractors/streamlare.d.ts.map +1 -1
  684. package/lib/typescript/module/src/extractors/streamsb.d.ts +5 -3
  685. package/lib/typescript/module/src/extractors/streamsb.d.ts.map +1 -1
  686. package/lib/typescript/module/src/extractors/streamtape.d.ts +5 -3
  687. package/lib/typescript/module/src/extractors/streamtape.d.ts.map +1 -1
  688. package/lib/typescript/module/src/extractors/vidhide.d.ts +0 -1
  689. package/lib/typescript/module/src/extractors/vidhide.d.ts.map +1 -1
  690. package/lib/typescript/module/src/extractors/vidmoly.d.ts +5 -3
  691. package/lib/typescript/module/src/extractors/vidmoly.d.ts.map +1 -1
  692. package/lib/typescript/module/src/extractors/vizcloud.d.ts +5 -3
  693. package/lib/typescript/module/src/extractors/vizcloud.d.ts.map +1 -1
  694. package/lib/typescript/module/src/extractors/voe.d.ts +5 -3
  695. package/lib/typescript/module/src/extractors/voe.d.ts.map +1 -1
  696. package/lib/typescript/module/src/index.d.ts +15 -9
  697. package/lib/typescript/module/src/index.d.ts.map +1 -1
  698. package/lib/typescript/module/src/models/base-provider.d.ts +5 -1
  699. package/lib/typescript/module/src/models/base-provider.d.ts.map +1 -1
  700. package/lib/typescript/module/src/models/extension-manifest.d.ts +31 -5
  701. package/lib/typescript/module/src/models/extension-manifest.d.ts.map +1 -1
  702. package/lib/typescript/module/src/models/extractor-context.d.ts +1 -2
  703. package/lib/typescript/module/src/models/extractor-context.d.ts.map +1 -1
  704. package/lib/typescript/module/src/models/index.d.ts +6 -4
  705. package/lib/typescript/module/src/models/index.d.ts.map +1 -1
  706. package/lib/typescript/module/src/models/meta-error.d.ts +20 -0
  707. package/lib/typescript/module/src/models/meta-error.d.ts.map +1 -0
  708. package/lib/typescript/module/src/models/provider-context.d.ts +21 -16
  709. package/lib/typescript/module/src/models/provider-context.d.ts.map +1 -1
  710. package/lib/typescript/module/src/models/types.d.ts +106 -3
  711. package/lib/typescript/module/src/models/types.d.ts.map +1 -1
  712. package/lib/typescript/module/src/providers/anime/anikoto/anikoto.d.ts +7 -2
  713. package/lib/typescript/module/src/providers/anime/anikoto/anikoto.d.ts.map +1 -1
  714. package/lib/typescript/module/src/providers/anime/anikoto/create-anikoto.d.ts +3 -3
  715. package/lib/typescript/module/src/providers/anime/anikoto/create-anikoto.d.ts.map +1 -1
  716. package/lib/typescript/module/src/providers/anime/animekai/animekai.d.ts +7 -2
  717. package/lib/typescript/module/src/providers/anime/animekai/animekai.d.ts.map +1 -1
  718. package/lib/typescript/module/src/providers/anime/animekai/create-animekai.d.ts +3 -3
  719. package/lib/typescript/module/src/providers/anime/animekai/create-animekai.d.ts.map +1 -1
  720. package/lib/typescript/module/src/providers/anime/animepahe/animepahe.d.ts +7 -2
  721. package/lib/typescript/module/src/providers/anime/animepahe/animepahe.d.ts.map +1 -1
  722. package/lib/typescript/module/src/providers/anime/animepahe/create-animepahe.d.ts +3 -3
  723. package/lib/typescript/module/src/providers/anime/animepahe/create-animepahe.d.ts.map +1 -1
  724. package/lib/typescript/module/src/providers/anime/animeunity.d.ts +11 -3
  725. package/lib/typescript/module/src/providers/anime/animeunity.d.ts.map +1 -1
  726. package/lib/typescript/module/src/providers/anime/anineko/anineko.d.ts +7 -2
  727. package/lib/typescript/module/src/providers/anime/anineko/anineko.d.ts.map +1 -1
  728. package/lib/typescript/module/src/providers/anime/anineko/create-anineko.d.ts +3 -3
  729. package/lib/typescript/module/src/providers/anime/anineko/create-anineko.d.ts.map +1 -1
  730. package/lib/typescript/module/src/providers/anime/index.d.ts +13 -22
  731. package/lib/typescript/module/src/providers/anime/index.d.ts.map +1 -1
  732. package/lib/typescript/module/src/providers/anime/reanime/create-reanime.d.ts +1 -2
  733. package/lib/typescript/module/src/providers/anime/reanime/create-reanime.d.ts.map +1 -1
  734. package/lib/typescript/module/src/providers/anime/reanime/reanime.d.ts +7 -2
  735. package/lib/typescript/module/src/providers/anime/reanime/reanime.d.ts.map +1 -1
  736. package/lib/typescript/module/src/providers/anime/zoro/create-zoro.d.ts +3 -3
  737. package/lib/typescript/module/src/providers/anime/zoro/create-zoro.d.ts.map +1 -1
  738. package/lib/typescript/module/src/providers/anime/zoro/zoro.d.ts +7 -2
  739. package/lib/typescript/module/src/providers/anime/zoro/zoro.d.ts.map +1 -1
  740. package/lib/typescript/module/src/providers/index.d.ts +4 -4
  741. package/lib/typescript/module/src/providers/index.d.ts.map +1 -1
  742. package/lib/typescript/module/src/providers/light-novels/index.d.ts +3 -4
  743. package/lib/typescript/module/src/providers/light-novels/index.d.ts.map +1 -1
  744. package/lib/typescript/module/src/providers/light-novels/novelupdates.d.ts +7 -3
  745. package/lib/typescript/module/src/providers/light-novels/novelupdates.d.ts.map +1 -1
  746. package/lib/typescript/module/src/providers/light-novels/readlightnovels.d.ts +5 -3
  747. package/lib/typescript/module/src/providers/light-novels/readlightnovels.d.ts.map +1 -1
  748. package/lib/typescript/module/src/providers/manga/asurascans.d.ts +5 -3
  749. package/lib/typescript/module/src/providers/manga/asurascans.d.ts.map +1 -1
  750. package/lib/typescript/module/src/providers/manga/brmangas.d.ts +5 -3
  751. package/lib/typescript/module/src/providers/manga/brmangas.d.ts.map +1 -1
  752. package/lib/typescript/module/src/providers/manga/comick.d.ts +7 -4
  753. package/lib/typescript/module/src/providers/manga/comick.d.ts.map +1 -1
  754. package/lib/typescript/module/src/providers/manga/flamescans.d.ts +5 -3
  755. package/lib/typescript/module/src/providers/manga/flamescans.d.ts.map +1 -1
  756. package/lib/typescript/module/src/providers/manga/index.d.ts +14 -17
  757. package/lib/typescript/module/src/providers/manga/index.d.ts.map +1 -1
  758. package/lib/typescript/module/src/providers/manga/mangadex.d.ts +5 -3
  759. package/lib/typescript/module/src/providers/manga/mangadex.d.ts.map +1 -1
  760. package/lib/typescript/module/src/providers/manga/mangahere.d.ts +5 -3
  761. package/lib/typescript/module/src/providers/manga/mangahere.d.ts.map +1 -1
  762. package/lib/typescript/module/src/providers/manga/mangahost.d.ts +5 -3
  763. package/lib/typescript/module/src/providers/manga/mangahost.d.ts.map +1 -1
  764. package/lib/typescript/module/src/providers/manga/mangakakalot.d.ts +5 -3
  765. package/lib/typescript/module/src/providers/manga/mangakakalot.d.ts.map +1 -1
  766. package/lib/typescript/module/src/providers/manga/mangapark.d.ts +5 -3
  767. package/lib/typescript/module/src/providers/manga/mangapark.d.ts.map +1 -1
  768. package/lib/typescript/module/src/providers/manga/mangapill.d.ts +5 -3
  769. package/lib/typescript/module/src/providers/manga/mangapill.d.ts.map +1 -1
  770. package/lib/typescript/module/src/providers/manga/mangareader.d.ts +5 -3
  771. package/lib/typescript/module/src/providers/manga/mangareader.d.ts.map +1 -1
  772. package/lib/typescript/module/src/providers/manga/mangasee123.d.ts +5 -3
  773. package/lib/typescript/module/src/providers/manga/mangasee123.d.ts.map +1 -1
  774. package/lib/typescript/module/src/providers/manga/readmanga.d.ts +11 -3
  775. package/lib/typescript/module/src/providers/manga/readmanga.d.ts.map +1 -1
  776. package/lib/typescript/module/src/providers/manga/vyvymanga.d.ts +5 -3
  777. package/lib/typescript/module/src/providers/manga/vyvymanga.d.ts.map +1 -1
  778. package/lib/typescript/module/src/providers/meta/anilist.d.ts +26 -9
  779. package/lib/typescript/module/src/providers/meta/anilist.d.ts.map +1 -1
  780. package/lib/typescript/module/src/providers/meta/index.d.ts +1 -0
  781. package/lib/typescript/module/src/providers/meta/index.d.ts.map +1 -1
  782. package/lib/typescript/module/src/providers/meta/mal.d.ts +9 -4
  783. package/lib/typescript/module/src/providers/meta/mal.d.ts.map +1 -1
  784. package/lib/typescript/module/src/providers/meta/tmdb-api-key.d.ts +7 -0
  785. package/lib/typescript/module/src/providers/meta/tmdb-api-key.d.ts.map +1 -0
  786. package/lib/typescript/module/src/providers/meta/tmdb.d.ts +18 -5
  787. package/lib/typescript/module/src/providers/meta/tmdb.d.ts.map +1 -1
  788. package/lib/typescript/module/src/providers/movies/himovies/himovies.d.ts +8 -3
  789. package/lib/typescript/module/src/providers/movies/himovies/himovies.d.ts.map +1 -1
  790. package/lib/typescript/module/src/providers/movies/index.d.ts +14 -10
  791. package/lib/typescript/module/src/providers/movies/index.d.ts.map +1 -1
  792. package/lib/typescript/module/src/providers/movies/multimovies/multimovies.d.ts +8 -3
  793. package/lib/typescript/module/src/providers/movies/multimovies/multimovies.d.ts.map +1 -1
  794. package/lib/typescript/module/src/providers/movies/multistream/index.d.ts +10 -3
  795. package/lib/typescript/module/src/providers/movies/multistream/index.d.ts.map +1 -1
  796. package/lib/typescript/module/src/providers/movies/multistream/utils.d.ts +7 -6
  797. package/lib/typescript/module/src/providers/movies/multistream/utils.d.ts.map +1 -1
  798. package/lib/typescript/module/src/providers/movies/netflixmirror/create-netflixmirror.d.ts +2 -6
  799. package/lib/typescript/module/src/providers/movies/netflixmirror/create-netflixmirror.d.ts.map +1 -1
  800. package/lib/typescript/module/src/providers/movies/netflixmirror/disneymirror.d.ts +12 -0
  801. package/lib/typescript/module/src/providers/movies/netflixmirror/disneymirror.d.ts.map +1 -0
  802. package/lib/typescript/module/src/providers/movies/netflixmirror/netflixmirror.d.ts +9 -17
  803. package/lib/typescript/module/src/providers/movies/netflixmirror/netflixmirror.d.ts.map +1 -1
  804. package/lib/typescript/module/src/providers/movies/netflixmirror/netmirror-parser.d.ts +21 -0
  805. package/lib/typescript/module/src/providers/movies/netflixmirror/netmirror-parser.d.ts.map +1 -0
  806. package/lib/typescript/module/src/providers/movies/netflixmirror/primemirror.d.ts +12 -0
  807. package/lib/typescript/module/src/providers/movies/netflixmirror/primemirror.d.ts.map +1 -0
  808. package/lib/typescript/module/src/providers/movies/vegamovies/create-vegamovies.d.ts.map +1 -1
  809. package/lib/typescript/module/src/providers/movies/vegamovies/vegamovies.d.ts +8 -5
  810. package/lib/typescript/module/src/providers/movies/vegamovies/vegamovies.d.ts.map +1 -1
  811. package/lib/typescript/module/src/providers/movies/yflix/yflix.d.ts +8 -3
  812. package/lib/typescript/module/src/providers/movies/yflix/yflix.d.ts.map +1 -1
  813. package/lib/typescript/module/src/providers/provider-args.d.ts +8 -0
  814. package/lib/typescript/module/src/providers/provider-args.d.ts.map +1 -0
  815. package/lib/typescript/module/src/registry-signing-keys.d.ts +18 -0
  816. package/lib/typescript/module/src/registry-signing-keys.d.ts.map +1 -0
  817. package/lib/typescript/module/src/utils/ExtractorManager.d.ts +33 -14
  818. package/lib/typescript/module/src/utils/ExtractorManager.d.ts.map +1 -1
  819. package/lib/typescript/module/src/utils/ProviderManager.d.ts +72 -19
  820. package/lib/typescript/module/src/utils/ProviderManager.d.ts.map +1 -1
  821. package/lib/typescript/module/src/utils/create-extractor-context.d.ts.map +1 -1
  822. package/lib/typescript/module/src/utils/create-provider-context.d.ts.map +1 -1
  823. package/lib/typescript/module/src/utils/extension-integrity.d.ts +40 -0
  824. package/lib/typescript/module/src/utils/extension-integrity.d.ts.map +1 -0
  825. package/lib/typescript/module/src/utils/extension-modules.d.ts +49 -0
  826. package/lib/typescript/module/src/utils/extension-modules.d.ts.map +1 -0
  827. package/lib/typescript/module/src/utils/extension-utils.d.ts +24 -46
  828. package/lib/typescript/module/src/utils/extension-utils.d.ts.map +1 -1
  829. package/lib/typescript/module/src/utils/fetch-with-timeout.d.ts +29 -0
  830. package/lib/typescript/module/src/utils/fetch-with-timeout.d.ts.map +1 -0
  831. package/lib/typescript/module/src/utils/index.d.ts +11 -4
  832. package/lib/typescript/module/src/utils/index.d.ts.map +1 -1
  833. package/lib/typescript/module/src/utils/meta-http.d.ts +16 -0
  834. package/lib/typescript/module/src/utils/meta-http.d.ts.map +1 -0
  835. package/lib/typescript/module/src/utils/provider-maps.d.ts +14 -7
  836. package/lib/typescript/module/src/utils/provider-maps.d.ts.map +1 -1
  837. package/lib/typescript/module/src/utils/queries.d.ts +17 -8
  838. package/lib/typescript/module/src/utils/queries.d.ts.map +1 -1
  839. package/lib/typescript/module/src/utils/registry-schema.d.ts +66 -0
  840. package/lib/typescript/module/src/utils/registry-schema.d.ts.map +1 -0
  841. package/lib/typescript/module/src/utils/registry-signature.d.ts +66 -0
  842. package/lib/typescript/module/src/utils/registry-signature.d.ts.map +1 -0
  843. package/lib/typescript/module/src/utils/url-polyfill.d.ts +20 -8
  844. package/lib/typescript/module/src/utils/url-polyfill.d.ts.map +1 -1
  845. package/lib/typescript/module/src/utils/utils.d.ts +0 -1
  846. package/lib/typescript/module/src/utils/utils.d.ts.map +1 -1
  847. package/package.json +36 -25
  848. package/src/NativeConsumet.ts +68 -2
  849. package/src/extension-registry.json +229 -61
  850. package/src/extension-registry.json.sig +1 -0
  851. package/src/extractors/asianload.ts +10 -7
  852. package/src/extractors/filemoon.ts +10 -7
  853. package/src/extractors/flixcloud.ts +0 -2
  854. package/src/extractors/gdflix.ts +0 -2
  855. package/src/extractors/gofile.ts +0 -2
  856. package/src/extractors/gogocdn.ts +12 -9
  857. package/src/extractors/hubcloud.ts +0 -2
  858. package/src/extractors/index.ts +24 -51
  859. package/src/extractors/kwik.ts +0 -2
  860. package/src/extractors/megaplay.ts +0 -2
  861. package/src/extractors/megaup.ts +2 -6
  862. package/src/extractors/mixdrop.ts +9 -5
  863. package/src/extractors/mp4player.ts +10 -6
  864. package/src/extractors/mp4upload.ts +9 -5
  865. package/src/extractors/rapidcloud.ts +15 -12
  866. package/src/extractors/streamhub.ts +10 -6
  867. package/src/extractors/streamlare.ts +10 -8
  868. package/src/extractors/streamsb.ts +10 -7
  869. package/src/extractors/streamtape.ts +9 -5
  870. package/src/extractors/vidhide.ts +3 -4
  871. package/src/extractors/vidmoly.ts +10 -6
  872. package/src/extractors/vizcloud.ts +10 -7
  873. package/src/extractors/voe.ts +10 -7
  874. package/src/index.tsx +109 -3
  875. package/src/models/base-provider.ts +6 -1
  876. package/src/models/extension-manifest.ts +35 -6
  877. package/src/models/extractor-context.ts +0 -2
  878. package/src/models/index.ts +13 -1
  879. package/src/models/meta-error.ts +33 -0
  880. package/src/models/provider-context.ts +21 -58
  881. package/src/models/types.ts +110 -3
  882. package/src/providers/anime/anikoto/anikoto.ts +14 -10
  883. package/src/providers/anime/anikoto/create-anikoto.ts +15 -7
  884. package/src/providers/anime/animekai/animekai.ts +14 -9
  885. package/src/providers/anime/animekai/create-animekai.ts +5 -5
  886. package/src/providers/anime/animepahe/animepahe.ts +14 -11
  887. package/src/providers/anime/animepahe/create-animepahe.ts +5 -14
  888. package/src/providers/anime/animeunity.ts +20 -10
  889. package/src/providers/anime/anineko/anineko.ts +18 -8
  890. package/src/providers/anime/anineko/create-anineko.ts +3 -2
  891. package/src/providers/anime/index.ts +13 -21
  892. package/src/providers/anime/reanime/create-reanime.ts +2 -4
  893. package/src/providers/anime/reanime/reanime.ts +13 -9
  894. package/src/providers/anime/zoro/create-zoro.ts +6 -7
  895. package/src/providers/anime/zoro/zoro.ts +14 -11
  896. package/src/providers/index.ts +4 -4
  897. package/src/providers/light-novels/index.ts +3 -3
  898. package/src/providers/light-novels/novelupdates.ts +33 -19
  899. package/src/providers/light-novels/readlightnovels.ts +12 -8
  900. package/src/providers/manga/asurascans.ts +13 -7
  901. package/src/providers/manga/brmangas.ts +11 -7
  902. package/src/providers/manga/comick.ts +17 -12
  903. package/src/providers/manga/flamescans.ts +11 -7
  904. package/src/providers/manga/index.ts +14 -16
  905. package/src/providers/manga/mangadex.ts +18 -14
  906. package/src/providers/manga/mangahere.ts +12 -8
  907. package/src/providers/manga/mangahost.ts +11 -7
  908. package/src/providers/manga/mangakakalot.ts +11 -7
  909. package/src/providers/manga/mangapark.ts +11 -7
  910. package/src/providers/manga/mangapill.ts +11 -7
  911. package/src/providers/manga/mangareader.ts +12 -8
  912. package/src/providers/manga/mangasee123.ts +11 -7
  913. package/src/providers/manga/readmanga.ts +36 -23
  914. package/src/providers/manga/vyvymanga.ts +12 -8
  915. package/src/providers/meta/anilist.ts +566 -1439
  916. package/src/providers/meta/index.ts +6 -1
  917. package/src/providers/meta/mal.ts +102 -139
  918. package/src/providers/meta/tmdb-api-key.ts +27 -0
  919. package/src/providers/meta/tmdb.ts +150 -141
  920. package/src/providers/movies/himovies/create-himovies.ts +3 -3
  921. package/src/providers/movies/himovies/himovies.ts +13 -11
  922. package/src/providers/movies/index.ts +14 -12
  923. package/src/providers/movies/multimovies/create-multimovies.ts +3 -3
  924. package/src/providers/movies/multimovies/multimovies.ts +13 -11
  925. package/src/providers/movies/multistream/index.ts +30 -18
  926. package/src/providers/movies/multistream/utils.ts +27 -15
  927. package/src/providers/movies/netflixmirror/create-netflixmirror.ts +567 -232
  928. package/src/providers/movies/netflixmirror/disneymirror.ts +16 -0
  929. package/src/providers/movies/netflixmirror/netflixmirror.ts +13 -43
  930. package/src/providers/movies/netflixmirror/netmirror-parser.ts +43 -0
  931. package/src/providers/movies/netflixmirror/primemirror.ts +16 -0
  932. package/src/providers/movies/vegamovies/create-vegamovies.ts +85 -60
  933. package/src/providers/movies/vegamovies/vegamovies.ts +13 -13
  934. package/src/providers/movies/yflix/create-yflix.ts +2 -2
  935. package/src/providers/movies/yflix/yflix.ts +13 -10
  936. package/src/providers/provider-args.ts +15 -0
  937. package/src/registry-signing-keys.ts +20 -0
  938. package/src/utils/ExtractorManager.ts +165 -258
  939. package/src/utils/ProviderManager.ts +236 -293
  940. package/src/utils/create-extractor-context.ts +0 -2
  941. package/src/utils/create-provider-context.ts +45 -29
  942. package/src/utils/extension-integrity.ts +82 -0
  943. package/src/utils/extension-modules.ts +123 -0
  944. package/src/utils/extension-utils.ts +45 -42
  945. package/src/utils/fetch-with-timeout.ts +76 -0
  946. package/src/utils/index.ts +31 -4
  947. package/src/utils/meta-http.ts +35 -0
  948. package/src/utils/provider-maps.ts +39 -19
  949. package/src/utils/queries.ts +30 -26
  950. package/src/utils/registry-schema.ts +273 -0
  951. package/src/utils/registry-signature.ts +215 -0
  952. package/src/utils/url-polyfill.ts +1146 -460
  953. package/src/utils/utils.ts +0 -26
  954. package/android/generated/jni/react/renderer/components/RNConsumetSpec/RNConsumetSpecJSI-generated.cpp +0 -75
  955. package/ios/generated/RNConsumetSpecJSI-generated.cpp +0 -75
  956. package/ios/generated/RNConsumetSpecJSI.h +0 -125
  957. package/lib/commonjs/extractors/StreamP2P.js +0 -69
  958. package/lib/commonjs/extractors/StreamP2P.js.map +0 -1
  959. package/lib/commonjs/extractors/kisskh/kkey.js +0 -98
  960. package/lib/commonjs/extractors/kisskh/kkey.js.map +0 -1
  961. package/lib/commonjs/extractors/kisskh/staticdata.js +0 -9
  962. package/lib/commonjs/extractors/kisskh/staticdata.js.map +0 -1
  963. package/lib/commonjs/providers/anime/anify.js +0 -195
  964. package/lib/commonjs/providers/anime/anify.js.map +0 -1
  965. package/lib/commonjs/providers/anime/animedrive.js +0 -228
  966. package/lib/commonjs/providers/anime/animedrive.js.map +0 -1
  967. package/lib/commonjs/providers/anime/animesuge/animesuge.js +0 -78
  968. package/lib/commonjs/providers/anime/animesuge/animesuge.js.map +0 -1
  969. package/lib/commonjs/providers/anime/animesuge/create-animesuge.js +0 -312
  970. package/lib/commonjs/providers/anime/animesuge/create-animesuge.js.map +0 -1
  971. package/lib/commonjs/providers/anime/kickassanime.js +0 -48
  972. package/lib/commonjs/providers/anime/kickassanime.js.map +0 -1
  973. package/lib/commonjs/providers/anime/marin.js +0 -282
  974. package/lib/commonjs/providers/anime/marin.js.map +0 -1
  975. package/lib/commonjs/providers/movies/dramacool.js +0 -397
  976. package/lib/commonjs/providers/movies/dramacool.js.map +0 -1
  977. package/lib/commonjs/providers/movies/yflix.js +0 -561
  978. package/lib/commonjs/providers/movies/yflix.js.map +0 -1
  979. package/lib/module/extractors/StreamP2P.js +0 -63
  980. package/lib/module/extractors/StreamP2P.js.map +0 -1
  981. package/lib/module/extractors/kisskh/kkey.js +0 -92
  982. package/lib/module/extractors/kisskh/kkey.js.map +0 -1
  983. package/lib/module/extractors/kisskh/staticdata.js +0 -5
  984. package/lib/module/extractors/kisskh/staticdata.js.map +0 -1
  985. package/lib/module/providers/anime/anify.js +0 -192
  986. package/lib/module/providers/anime/anify.js.map +0 -1
  987. package/lib/module/providers/anime/animedrive.js +0 -223
  988. package/lib/module/providers/anime/animedrive.js.map +0 -1
  989. package/lib/module/providers/anime/animesuge/animesuge.js +0 -73
  990. package/lib/module/providers/anime/animesuge/animesuge.js.map +0 -1
  991. package/lib/module/providers/anime/animesuge/create-animesuge.js +0 -309
  992. package/lib/module/providers/anime/animesuge/create-animesuge.js.map +0 -1
  993. package/lib/module/providers/anime/kickassanime.js +0 -45
  994. package/lib/module/providers/anime/kickassanime.js.map +0 -1
  995. package/lib/module/providers/anime/marin.js +0 -281
  996. package/lib/module/providers/anime/marin.js.map +0 -1
  997. package/lib/module/providers/movies/dramacool.js +0 -397
  998. package/lib/module/providers/movies/dramacool.js.map +0 -1
  999. package/lib/module/providers/movies/yflix.js +0 -561
  1000. package/lib/module/providers/movies/yflix.js.map +0 -1
  1001. package/lib/typescript/commonjs/src/extractors/StreamP2P.d.ts +0 -10
  1002. package/lib/typescript/commonjs/src/extractors/StreamP2P.d.ts.map +0 -1
  1003. package/lib/typescript/commonjs/src/extractors/kisskh/kkey.d.ts +0 -25
  1004. package/lib/typescript/commonjs/src/extractors/kisskh/kkey.d.ts.map +0 -1
  1005. package/lib/typescript/commonjs/src/extractors/kisskh/staticdata.d.ts +0 -3
  1006. package/lib/typescript/commonjs/src/extractors/kisskh/staticdata.d.ts.map +0 -1
  1007. package/lib/typescript/commonjs/src/providers/anime/anify.d.ts +0 -40
  1008. package/lib/typescript/commonjs/src/providers/anime/anify.d.ts.map +0 -1
  1009. package/lib/typescript/commonjs/src/providers/anime/animedrive.d.ts +0 -33
  1010. package/lib/typescript/commonjs/src/providers/anime/animedrive.d.ts.map +0 -1
  1011. package/lib/typescript/commonjs/src/providers/anime/animesuge/animesuge.d.ts +0 -34
  1012. package/lib/typescript/commonjs/src/providers/anime/animesuge/animesuge.d.ts.map +0 -1
  1013. package/lib/typescript/commonjs/src/providers/anime/animesuge/create-animesuge.d.ts +0 -14
  1014. package/lib/typescript/commonjs/src/providers/anime/animesuge/create-animesuge.d.ts.map +0 -1
  1015. package/lib/typescript/commonjs/src/providers/anime/kickassanime.d.ts +0 -30
  1016. package/lib/typescript/commonjs/src/providers/anime/kickassanime.d.ts.map +0 -1
  1017. package/lib/typescript/commonjs/src/providers/anime/marin.d.ts +0 -32
  1018. package/lib/typescript/commonjs/src/providers/anime/marin.d.ts.map +0 -1
  1019. package/lib/typescript/commonjs/src/providers/movies/dramacool.d.ts +0 -1
  1020. package/lib/typescript/commonjs/src/providers/movies/dramacool.d.ts.map +0 -1
  1021. package/lib/typescript/commonjs/src/providers/movies/yflix.d.ts +0 -1
  1022. package/lib/typescript/commonjs/src/providers/movies/yflix.d.ts.map +0 -1
  1023. package/lib/typescript/module/src/extractors/StreamP2P.d.ts +0 -10
  1024. package/lib/typescript/module/src/extractors/StreamP2P.d.ts.map +0 -1
  1025. package/lib/typescript/module/src/extractors/kisskh/kkey.d.ts +0 -25
  1026. package/lib/typescript/module/src/extractors/kisskh/kkey.d.ts.map +0 -1
  1027. package/lib/typescript/module/src/extractors/kisskh/staticdata.d.ts +0 -3
  1028. package/lib/typescript/module/src/extractors/kisskh/staticdata.d.ts.map +0 -1
  1029. package/lib/typescript/module/src/providers/anime/anify.d.ts +0 -40
  1030. package/lib/typescript/module/src/providers/anime/anify.d.ts.map +0 -1
  1031. package/lib/typescript/module/src/providers/anime/animedrive.d.ts +0 -33
  1032. package/lib/typescript/module/src/providers/anime/animedrive.d.ts.map +0 -1
  1033. package/lib/typescript/module/src/providers/anime/animesuge/animesuge.d.ts +0 -34
  1034. package/lib/typescript/module/src/providers/anime/animesuge/animesuge.d.ts.map +0 -1
  1035. package/lib/typescript/module/src/providers/anime/animesuge/create-animesuge.d.ts +0 -14
  1036. package/lib/typescript/module/src/providers/anime/animesuge/create-animesuge.d.ts.map +0 -1
  1037. package/lib/typescript/module/src/providers/anime/kickassanime.d.ts +0 -30
  1038. package/lib/typescript/module/src/providers/anime/kickassanime.d.ts.map +0 -1
  1039. package/lib/typescript/module/src/providers/anime/marin.d.ts +0 -32
  1040. package/lib/typescript/module/src/providers/anime/marin.d.ts.map +0 -1
  1041. package/lib/typescript/module/src/providers/movies/dramacool.d.ts +0 -1
  1042. package/lib/typescript/module/src/providers/movies/dramacool.d.ts.map +0 -1
  1043. package/lib/typescript/module/src/providers/movies/yflix.d.ts +0 -1
  1044. package/lib/typescript/module/src/providers/movies/yflix.d.ts.map +0 -1
  1045. package/src/extractors/StreamP2P.ts +0 -60
  1046. package/src/extractors/kisskh/kkey.ts +0 -161
  1047. package/src/extractors/kisskh/staticdata.ts +0 -144
  1048. package/src/providers/anime/anify.ts +0 -276
  1049. package/src/providers/anime/animedrive.ts +0 -245
  1050. package/src/providers/anime/animesuge/animesuge.ts +0 -77
  1051. package/src/providers/anime/animesuge/create-animesuge.ts +0 -327
  1052. package/src/providers/anime/kickassanime.ts +0 -51
  1053. package/src/providers/anime/marin.ts +0 -319
  1054. package/src/providers/movies/dramacool.ts +0 -395
  1055. package/src/providers/movies/yflix.ts +0 -559
@@ -4,211 +4,1039 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.URLSearchParams = exports.URL = exports.PolyURLSearchParams = exports.PolyURL = void 0;
7
- const isASCII = ch => ch.charCodeAt(0) < 128;
8
- function utf8Encode(str) {
9
- // encode JS string to UTF-8 bytes
10
- const encoder = typeof TextEncoder !== 'undefined' ? new TextEncoder() : null;
11
- if (encoder) return encoder.encode(str);
12
- // fallback
7
+ /**
8
+ * WHATWG URL and URLSearchParams for Hermes, whose global URL support is incomplete.
9
+ *
10
+ * Extensions get these as `ctx.PolyURL` / `ctx.PolyURLSearchParams`, so every provider and extractor
11
+ * inherits their behaviour. The parser follows the URL Standard (https://url.spec.whatwg.org/) state
12
+ * machine, and test/unit/url-polyfill.test.ts checks it against Node's URL. It never uses a global URL.
13
+ *
14
+ * Known gap: hosts are mapped with NFKC, lower-casing and punycode instead of the full UTS #46 table,
15
+ * so exotic internationalised domain names can differ from a browser.
16
+ */
17
+
18
+ const EOF = -1;
19
+
20
+ /* -----------------------------
21
+ Code points, UTF-8 and percent-encoding
22
+ ----------------------------- */
23
+
24
+ // The code points of a string, with lone surrogates replaced by U+FFFD (USVString conversion).
25
+ function toCodePoints(input) {
26
+ const out = [];
27
+ for (let i = 0; i < input.length; i++) {
28
+ const c = input.charCodeAt(i);
29
+ if (c >= 0xd800 && c <= 0xdbff && i + 1 < input.length) {
30
+ const d = input.charCodeAt(i + 1);
31
+ if (d >= 0xdc00 && d <= 0xdfff) {
32
+ out.push(0x10000 + (c - 0xd800 << 10) + (d - 0xdc00));
33
+ i++;
34
+ continue;
35
+ }
36
+ }
37
+ out.push(c >= 0xd800 && c <= 0xdfff ? 0xfffd : c);
38
+ }
39
+ return out;
40
+ }
41
+ function fromCodePoints(codePoints) {
42
+ let out = '';
43
+ for (const cp of codePoints) out += String.fromCodePoint(cp);
44
+ return out;
45
+ }
46
+ function utf8EncodeCodePoint(cp, bytes) {
47
+ if (cp < 0x80) {
48
+ bytes.push(cp);
49
+ } else if (cp < 0x800) {
50
+ bytes.push(0xc0 | cp >> 6, 0x80 | cp & 0x3f);
51
+ } else if (cp < 0x10000) {
52
+ bytes.push(0xe0 | cp >> 12, 0x80 | cp >> 6 & 0x3f, 0x80 | cp & 0x3f);
53
+ } else {
54
+ bytes.push(0xf0 | cp >> 18, 0x80 | cp >> 12 & 0x3f, 0x80 | cp >> 6 & 0x3f, 0x80 | cp & 0x3f);
55
+ }
56
+ }
57
+ function utf8Encode(input) {
13
58
  const bytes = [];
14
- for (let i = 0; i < str.length; i++) {
15
- let code = str.charCodeAt(i);
16
- if (code < 0x80) bytes.push(code);else if (code < 0x800) {
17
- bytes.push(0xc0 | code >> 6);
18
- bytes.push(0x80 | code & 0x3f);
19
- } else if (code < 0xd800 || code >= 0xe000) {
20
- bytes.push(0xe0 | code >> 12);
21
- bytes.push(0x80 | code >> 6 & 0x3f);
22
- bytes.push(0x80 | code & 0x3f);
23
- } else {
24
- // surrogate pair
25
- i++;
26
- const code2 = str.charCodeAt(i);
27
- const codePoint = 0x10000 + ((code & 0x3ff) << 10 | code2 & 0x3ff);
28
- bytes.push(0xf0 | codePoint >> 18);
29
- bytes.push(0x80 | codePoint >> 12 & 0x3f);
30
- bytes.push(0x80 | codePoint >> 6 & 0x3f);
31
- bytes.push(0x80 | codePoint & 0x3f);
59
+ for (const cp of toCodePoints(input)) utf8EncodeCodePoint(cp, bytes);
60
+ return bytes;
61
+ }
62
+
63
+ // UTF-8 decode without BOM, replacing invalid sequences with U+FFFD (WHATWG Encoding).
64
+ function utf8Decode(bytes) {
65
+ const out = [];
66
+ let codePoint = 0;
67
+ let bytesSeen = 0;
68
+ let bytesNeeded = 0;
69
+ let lower = 0x80;
70
+ let upper = 0xbf;
71
+ for (let i = 0; i < bytes.length; i++) {
72
+ const byte = bytes[i];
73
+ if (bytesNeeded === 0) {
74
+ if (byte <= 0x7f) {
75
+ out.push(byte);
76
+ } else if (byte >= 0xc2 && byte <= 0xdf) {
77
+ bytesNeeded = 1;
78
+ codePoint = byte & 0x1f;
79
+ } else if (byte >= 0xe0 && byte <= 0xef) {
80
+ if (byte === 0xe0) lower = 0xa0;
81
+ if (byte === 0xed) upper = 0x9f;
82
+ bytesNeeded = 2;
83
+ codePoint = byte & 0xf;
84
+ } else if (byte >= 0xf0 && byte <= 0xf4) {
85
+ if (byte === 0xf0) lower = 0x90;
86
+ if (byte === 0xf4) upper = 0x8f;
87
+ bytesNeeded = 3;
88
+ codePoint = byte & 0x7;
89
+ } else {
90
+ out.push(0xfffd);
91
+ }
92
+ continue;
93
+ }
94
+ if (byte < lower || byte > upper) {
95
+ codePoint = bytesNeeded = bytesSeen = 0;
96
+ lower = 0x80;
97
+ upper = 0xbf;
98
+ out.push(0xfffd);
99
+ i--; // reprocess this byte
100
+ continue;
101
+ }
102
+ lower = 0x80;
103
+ upper = 0xbf;
104
+ codePoint = codePoint << 6 | byte & 0x3f;
105
+ bytesSeen++;
106
+ if (bytesSeen === bytesNeeded) {
107
+ out.push(codePoint);
108
+ codePoint = bytesNeeded = bytesSeen = 0;
32
109
  }
33
110
  }
34
- return new Uint8Array(bytes);
111
+ if (bytesNeeded !== 0) out.push(0xfffd);
112
+ return fromCodePoints(out);
113
+ }
114
+ const isASCIIDigit = c => c >= 0x30 && c <= 0x39;
115
+ const isASCIIAlpha = c => c >= 0x41 && c <= 0x5a || c >= 0x61 && c <= 0x7a;
116
+ const isASCIIAlphanumeric = c => isASCIIDigit(c) || isASCIIAlpha(c);
117
+ const isASCIIHex = c => isASCIIDigit(c) || c >= 0x41 && c <= 0x46 || c >= 0x61 && c <= 0x66;
118
+ const lowerASCII = c => c >= 0x41 && c <= 0x5a ? c + 0x20 : c;
119
+ function isASCII(input) {
120
+ for (let i = 0; i < input.length; i++) if (input.charCodeAt(i) > 0x7f) return false;
121
+ return true;
35
122
  }
36
- function percentEncodeByte(byte) {
37
- return '%' + byte.toString(16).toUpperCase().padStart(2, '0');
123
+
124
+ // Remove leading and trailing C0 controls and spaces.
125
+ function trimC0ControlOrSpace(input) {
126
+ let start = 0;
127
+ let end = input.length;
128
+ while (start < end && input.charCodeAt(start) <= 0x20) start++;
129
+ while (end > start && input.charCodeAt(end - 1) <= 0x20) end--;
130
+ return input.slice(start, end);
131
+ }
132
+
133
+ // Percent-encode sets, as predicates on a code point. Each set extends another with ASCII characters.
134
+
135
+ function charTable(chars) {
136
+ const table = [];
137
+ for (let i = 0; i < chars.length; i++) table[chars.charCodeAt(i)] = true;
138
+ return table;
139
+ }
140
+ function extendSet(base, chars) {
141
+ const table = charTable(chars);
142
+ return c => base(c) || table[c] === true;
143
+ }
144
+ const inC0ControlSet = c => c <= 0x1f || c > 0x7e;
145
+ const inFragmentSet = extendSet(inC0ControlSet, ' "<>`');
146
+ const inQuerySet = extendSet(inC0ControlSet, ' "#<>');
147
+ const inSpecialQuerySet = extendSet(inQuerySet, "'");
148
+ const inPathSet = extendSet(inQuerySet, '?^`{}');
149
+ const inUserinfoSet = extendSet(inPathSet, '/:;=@[\\]|');
150
+ const inComponentSet = extendSet(inUserinfoSet, '$%&+,');
151
+ const inFormSet = extendSet(inComponentSet, "!'()~");
152
+ function percentEncodeCodePoint(cp, set) {
153
+ if (!set(cp)) return String.fromCodePoint(cp);
154
+ const bytes = [];
155
+ utf8EncodeCodePoint(cp, bytes);
156
+ let out = '';
157
+ for (const b of bytes) out += '%' + (b < 0x10 ? '0' : '') + b.toString(16).toUpperCase();
158
+ return out;
38
159
  }
39
- function encodeComponent(str, allow = /[A-Za-z0-9\-._~]/) {
40
- // encode like encodeURIComponent but allow customizing safe characters (RegExp)
160
+ function percentEncodeString(input, set, spaceAsPlus = false) {
41
161
  let out = '';
42
- const bytes = utf8Encode(str);
162
+ for (const cp of toCodePoints(input)) out += spaceAsPlus && cp === 0x20 ? '+' : percentEncodeCodePoint(cp, set);
163
+ return out;
164
+ }
165
+
166
+ // Percent-decode a string into bytes; a `%` not followed by two hex digits stays as is.
167
+ function percentDecode(input) {
168
+ const bytes = utf8Encode(input);
169
+ const out = [];
43
170
  for (let i = 0; i < bytes.length; i++) {
44
171
  const b = bytes[i];
45
- const ch = String.fromCharCode(b);
46
- if (allow.test(ch)) out += ch;else out += percentEncodeByte(b);
172
+ if (b === 0x25 && i + 2 < bytes.length && isASCIIHex(bytes[i + 1]) && isASCIIHex(bytes[i + 2])) {
173
+ out.push(parseInt(String.fromCharCode(bytes[i + 1], bytes[i + 2]), 16));
174
+ i += 2;
175
+ } else {
176
+ out.push(b);
177
+ }
47
178
  }
48
179
  return out;
49
180
  }
50
- function decodePercentEncoded(str) {
51
- // decode percent-encoded UTF-8 sequences
52
- try {
53
- // Replace + with %2B so decodeURIComponent doesn't convert + to space (we treat + literally)
54
- // but in query strings sometimes + is used for space; we keep literal + behavior.
55
- return decodeURIComponent(str);
56
- } catch (e) {
57
- // Be defensive: fallback to manual decode of %XX bytes into utf8 string
58
- const bytes = [];
59
- for (let i = 0; i < str.length;) {
60
- const ch = str[i];
61
- if (ch === '%' && i + 2 < str.length) {
62
- const hex = str.substr(i + 1, 2);
63
- const byte = parseInt(hex, 16);
64
- if (!Number.isNaN(byte)) {
65
- bytes.push(byte);
66
- i += 3;
67
- continue;
181
+
182
+ /* -----------------------------
183
+ application/x-www-form-urlencoded
184
+ ----------------------------- */
185
+
186
+ function parseFormUrlencoded(input) {
187
+ const decode = s => utf8Decode(percentDecode(s.replace(/\+/g, ' ')));
188
+ const out = [];
189
+ for (const sequence of input.split('&')) {
190
+ if (sequence === '') continue;
191
+ const eq = sequence.indexOf('=');
192
+ const name = eq === -1 ? sequence : sequence.slice(0, eq);
193
+ const value = eq === -1 ? '' : sequence.slice(eq + 1);
194
+ out.push([decode(name), decode(value)]);
195
+ }
196
+ return out;
197
+ }
198
+ function serializeFormUrlencoded(list) {
199
+ return list.map(([name, value]) => `${percentEncodeString(name, inFormSet, true)}=${percentEncodeString(value, inFormSet, true)}`).join('&');
200
+ }
201
+
202
+ /* -----------------------------
203
+ Hosts
204
+ ----------------------------- */
205
+
206
+ const FORBIDDEN_HOST_CODE_POINTS = charTable('\u0000\t\n\r #/:<>?@[\\]^|');
207
+ const isForbiddenHostCodePoint = c => FORBIDDEN_HOST_CODE_POINTS[c] === true;
208
+ const isForbiddenDomainCodePoint = c => isForbiddenHostCodePoint(c) || c <= 0x1f || c === 0x25 || c === 0x7f;
209
+ function parseIPv4Number(input) {
210
+ if (input === '') return null;
211
+ let radix = 10;
212
+ if (input.length >= 2 && input[0] === '0' && (input[1] === 'x' || input[1] === 'X')) {
213
+ input = input.slice(2);
214
+ radix = 16;
215
+ } else if (input.length >= 2 && input[0] === '0') {
216
+ input = input.slice(1);
217
+ radix = 8;
218
+ }
219
+ if (input === '') return 0;
220
+ const digits = radix === 10 ? /^[0-9]+$/ : radix === 16 ? /^[0-9A-Fa-f]+$/ : /^[0-7]+$/;
221
+ if (!digits.test(input)) return null;
222
+ return parseInt(input, radix);
223
+ }
224
+ function endsInANumber(input) {
225
+ const parts = input.split('.');
226
+ if (parts[parts.length - 1] === '') {
227
+ if (parts.length === 1) return false;
228
+ parts.pop();
229
+ }
230
+ const last = parts[parts.length - 1];
231
+ if (/^[0-9]+$/.test(last)) return true;
232
+ return parseIPv4Number(last) !== null;
233
+ }
234
+ function parseIPv4(input) {
235
+ const parts = input.split('.');
236
+ if (parts[parts.length - 1] === '' && parts.length > 1) parts.pop();
237
+ if (parts.length > 4) return null;
238
+ const numbers = [];
239
+ for (const part of parts) {
240
+ const n = parseIPv4Number(part);
241
+ if (n === null) return null;
242
+ numbers.push(n);
243
+ }
244
+ for (let i = 0; i < numbers.length - 1; i++) if (numbers[i] > 255) return null;
245
+ let ipv4 = numbers[numbers.length - 1];
246
+ if (ipv4 >= Math.pow(256, 5 - numbers.length)) return null;
247
+ for (let i = 0; i < numbers.length - 1; i++) ipv4 += numbers[i] * Math.pow(256, 3 - i);
248
+ let out = '';
249
+ for (let i = 0; i < 4; i++) {
250
+ out = String(ipv4 % 256) + (i === 0 ? '' : '.') + out;
251
+ ipv4 = Math.floor(ipv4 / 256);
252
+ }
253
+ return out;
254
+ }
255
+ function parseIPv6(input) {
256
+ const cps = toCodePoints(input);
257
+ const at = i => i < cps.length ? cps[i] : EOF;
258
+ const address = [0, 0, 0, 0, 0, 0, 0, 0];
259
+ let pieceIndex = 0;
260
+ let compress = null;
261
+ let pointer = 0;
262
+ if (at(pointer) === 0x3a) {
263
+ if (at(pointer + 1) !== 0x3a) return null;
264
+ pointer += 2;
265
+ compress = ++pieceIndex;
266
+ }
267
+ while (at(pointer) !== EOF) {
268
+ if (pieceIndex === 8) return null;
269
+ if (at(pointer) === 0x3a) {
270
+ if (compress !== null) return null;
271
+ pointer++;
272
+ compress = ++pieceIndex;
273
+ continue;
274
+ }
275
+ let value = 0;
276
+ let length = 0;
277
+ while (length < 4 && isASCIIHex(at(pointer))) {
278
+ value = value * 0x10 + parseInt(String.fromCharCode(at(pointer)), 16);
279
+ pointer++;
280
+ length++;
281
+ }
282
+ if (at(pointer) === 0x2e) {
283
+ // Embedded IPv4 address
284
+ if (length === 0) return null;
285
+ pointer -= length;
286
+ if (pieceIndex > 6) return null;
287
+ let numbersSeen = 0;
288
+ while (at(pointer) !== EOF) {
289
+ let ipv4Piece = null;
290
+ if (numbersSeen > 0) {
291
+ if (at(pointer) === 0x2e && numbersSeen < 4) pointer++;else return null;
292
+ }
293
+ if (!isASCIIDigit(at(pointer))) return null;
294
+ while (isASCIIDigit(at(pointer))) {
295
+ const n = at(pointer) - 0x30;
296
+ if (ipv4Piece === null) ipv4Piece = n;else if (ipv4Piece === 0) return null;else ipv4Piece = ipv4Piece * 10 + n;
297
+ if (ipv4Piece > 255) return null;
298
+ pointer++;
68
299
  }
300
+ address[pieceIndex] = address[pieceIndex] * 0x100 + ipv4Piece;
301
+ numbersSeen++;
302
+ if (numbersSeen === 2 || numbersSeen === 4) pieceIndex++;
69
303
  }
70
- bytes.push(str.charCodeAt(i));
71
- i++;
304
+ if (numbersSeen !== 4) return null;
305
+ break;
306
+ } else if (at(pointer) === 0x3a) {
307
+ pointer++;
308
+ if (at(pointer) === EOF) return null;
309
+ } else if (at(pointer) !== EOF) {
310
+ return null;
72
311
  }
73
- // decode UTF-8 bytes
74
- let res = '';
75
- for (let i = 0; i < bytes.length;) {
76
- const b = bytes[i];
77
- if (b < 0x80) {
78
- res += String.fromCharCode(b);
79
- i++;
80
- } else if (b >= 0xc0 && b < 0xe0) {
81
- const b2 = bytes[i + 1] ?? 0x80;
82
- const code = (b & 0x1f) << 6 | b2 & 0x3f;
83
- res += String.fromCharCode(code);
84
- i += 2;
85
- } else if (b >= 0xe0 && b < 0xf0) {
86
- const b2 = bytes[i + 1] ?? 0x80;
87
- const b3 = bytes[i + 2] ?? 0x80;
88
- const code = (b & 0x0f) << 12 | (b2 & 0x3f) << 6 | b3 & 0x3f;
89
- res += String.fromCharCode(code);
90
- i += 3;
91
- } else if (b >= 0xf0) {
92
- const b2 = bytes[i + 1] ?? 0x80,
93
- b3 = bytes[i + 2] ?? 0x80,
94
- b4 = bytes[i + 3] ?? 0x80;
95
- const codePoint = (b & 7) << 18 | (b2 & 0x3f) << 12 | (b3 & 0x3f) << 6 | b4 & 0x3f;
96
- const cp = codePoint - 0x10000;
97
- res += String.fromCharCode(0xd800 + (cp >> 10), 0xdc00 + (cp & 0x3ff));
98
- i += 4;
99
- } else {
100
- i++;
101
- }
312
+ address[pieceIndex] = value;
313
+ pieceIndex++;
314
+ }
315
+ if (compress !== null) {
316
+ let swaps = pieceIndex - compress;
317
+ pieceIndex = 7;
318
+ while (pieceIndex !== 0 && swaps > 0) {
319
+ const other = compress + swaps - 1;
320
+ const tmp = address[other];
321
+ address[other] = address[pieceIndex];
322
+ address[pieceIndex] = tmp;
323
+ pieceIndex--;
324
+ swaps--;
102
325
  }
103
- return res;
326
+ } else if (pieceIndex !== 8) {
327
+ return null;
104
328
  }
329
+ return address;
105
330
  }
106
- function isWindowsDrivePath(input) {
107
- return /^[a-zA-Z]:[\\/]/.test(input);
331
+ function serializeIPv6(address) {
332
+ // Compress the first longest run of two or more zero pieces.
333
+ let compress = null;
334
+ let longest = 1;
335
+ for (let i = 0; i < 8;) {
336
+ if (address[i] !== 0) {
337
+ i++;
338
+ continue;
339
+ }
340
+ let end = i;
341
+ while (end < 8 && address[end] === 0) end++;
342
+ if (end - i > longest) {
343
+ longest = end - i;
344
+ compress = i;
345
+ }
346
+ i = end;
347
+ }
348
+ let out = '';
349
+ let ignore0 = false;
350
+ for (let i = 0; i < 8; i++) {
351
+ if (ignore0 && address[i] === 0) continue;
352
+ ignore0 = false;
353
+ if (compress === i) {
354
+ out += i === 0 ? '::' : ':';
355
+ ignore0 = true;
356
+ continue;
357
+ }
358
+ out += address[i].toString(16);
359
+ if (i !== 7) out += ':';
360
+ }
361
+ return out;
108
362
  }
109
363
 
110
- // Path normalization utility
111
- function normalizePath(path) {
112
- if (!path || path === '/') return '/';
113
- const segments = path.split('/');
114
- const normalized = [];
115
- for (const segment of segments) {
116
- if (segment === '' || segment === '.') {
117
- continue; // skip empty and current directory
118
- } else if (segment === '..') {
119
- if (normalized.length > 0 && normalized[normalized.length - 1] !== '..') {
120
- normalized.pop(); // go up one directory
121
- } else if (!path.startsWith('/')) {
122
- normalized.push('..'); // relative path, keep ..
364
+ // Code points UTS #46 maps to nothing (soft hyphen, zero-width space and joiners, variation selectors, BOM).
365
+ const IGNORED_IN_DOMAINS = /[\u00AD\u034F\u180B-\u180F\u200B\u2060\u2064\uFE00-\uFE0F\uFEFF]/g;
366
+ function normalizeUnicode(input, form) {
367
+ try {
368
+ return typeof input.normalize === 'function' ? input.normalize(form) : input;
369
+ } catch {
370
+ return input;
371
+ }
372
+ }
373
+ function punycodeEncode(input) {
374
+ const base = 36;
375
+ const tMin = 1;
376
+ const tMax = 26;
377
+ const digit = d => String.fromCharCode(d < 26 ? 0x61 + d : 0x16 + d);
378
+ const adapt = (delta, numPoints, firstTime) => {
379
+ delta = firstTime ? Math.floor(delta / 700) : delta >> 1;
380
+ delta += Math.floor(delta / numPoints);
381
+ let k = 0;
382
+ while (delta > (base - tMin) * tMax >> 1) {
383
+ delta = Math.floor(delta / (base - tMin));
384
+ k += base;
385
+ }
386
+ return k + Math.floor((base - tMin + 1) * delta / (delta + 38));
387
+ };
388
+ let out = '';
389
+ for (const cp of input) if (cp < 0x80) out += String.fromCharCode(cp);
390
+ const basicLength = out.length;
391
+ let handled = basicLength;
392
+ if (basicLength > 0) out += '-';
393
+ let n = 0x80;
394
+ let delta = 0;
395
+ let bias = 72;
396
+ while (handled < input.length) {
397
+ let m = Infinity;
398
+ for (const cp of input) if (cp >= n && cp < m) m = cp;
399
+ delta += (m - n) * (handled + 1);
400
+ n = m;
401
+ for (const cp of input) {
402
+ if (cp < n) delta++;
403
+ if (cp === n) {
404
+ let q = delta;
405
+ for (let k = base;; k += base) {
406
+ const t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
407
+ if (q < t) break;
408
+ out += digit(t + (q - t) % (base - t));
409
+ q = Math.floor((q - t) / (base - t));
410
+ }
411
+ out += digit(q);
412
+ bias = adapt(delta, handled + 1, handled === basicLength);
413
+ delta = 0;
414
+ handled++;
123
415
  }
124
- } else {
125
- normalized.push(segment);
126
416
  }
417
+ delta++;
418
+ n++;
127
419
  }
128
- let result = normalized.join('/');
129
- if (path.startsWith('/')) result = '/' + result;
130
- if (path.endsWith('/') && result !== '/') result += '/';
131
- return result || '/';
420
+ return out;
132
421
  }
133
422
 
134
- // Default ports for common protocols
135
- const DEFAULT_PORTS = {
136
- 'http:': '80',
137
- 'https:': '443',
138
- 'ftp:': '21',
139
- 'ftps:': '990',
140
- 'ssh:': '22',
141
- 'ws:': '80',
142
- 'wss:': '443'
423
+ // Domain to ASCII. ASCII input is lower-cased; other input gets an approximation of UTS #46 mapping
424
+ // (ignored code points removed, NFKC, per-code-point lower case, NFC) and punycode per label.
425
+ function domainToASCII(domain) {
426
+ let result;
427
+ if (isASCII(domain)) {
428
+ result = domain.replace(/[A-Z]+/g, m => m.toLowerCase());
429
+ } else {
430
+ let mapped = normalizeUnicode(domain.replace(IGNORED_IN_DOMAINS, ''), 'NFKC');
431
+ mapped = normalizeUnicode(toCodePoints(mapped).map(toLowerCodePoint).join(''), 'NFC');
432
+ mapped = mapped.replace(/[\u3002\uFF0E\uFF61]/g, '.');
433
+ // U+FFFD comes from invalid percent-encoded UTF-8; C1 controls are disallowed too.
434
+ if (/[\u0080-\u009f\uFFFD]/.test(mapped)) return null;
435
+ result = mapped.split('.').map(label => isASCII(label) ? label : 'xn--' + punycodeEncode(toCodePoints(label))).join('.');
436
+ }
437
+ if (result === '') return null;
438
+ for (let i = 0; i < result.length; i++) if (isForbiddenDomainCodePoint(result.charCodeAt(i))) return null;
439
+ return result;
440
+ }
441
+ function toLowerCodePoint(cp) {
442
+ return String.fromCodePoint(cp).toLowerCase();
443
+ }
444
+
445
+ // Parse a host; returns the serialized host or null on failure.
446
+ function parseHost(input, isOpaque) {
447
+ if (input.startsWith('[')) {
448
+ if (!input.endsWith(']')) return null;
449
+ const address = parseIPv6(input.slice(1, -1));
450
+ return address ? `[${serializeIPv6(address)}]` : null;
451
+ }
452
+ if (isOpaque) {
453
+ for (const cp of toCodePoints(input)) if (isForbiddenHostCodePoint(cp)) return null;
454
+ return percentEncodeString(input, inC0ControlSet);
455
+ }
456
+ const asciiDomain = domainToASCII(utf8Decode(percentDecode(input)));
457
+ if (asciiDomain === null) return null;
458
+ if (endsInANumber(asciiDomain)) return parseIPv4(asciiDomain);
459
+ return asciiDomain;
460
+ }
461
+
462
+ /* -----------------------------
463
+ URL records and the basic URL parser
464
+ ----------------------------- */
465
+
466
+ // Special schemes and their default ports (file has none).
467
+ function specialSchemePort(scheme) {
468
+ switch (scheme) {
469
+ case 'ftp':
470
+ return 21;
471
+ case 'http':
472
+ case 'ws':
473
+ return 80;
474
+ case 'https':
475
+ case 'wss':
476
+ return 443;
477
+ case 'file':
478
+ return null;
479
+ default:
480
+ return undefined;
481
+ }
482
+ }
483
+ const isSpecialScheme = scheme => specialSchemePort(scheme) !== undefined;
484
+ const includesCredentials = url => url.username !== '' || url.password !== '';
485
+ const cannotHaveCredentialsOrPort = url => url.host === null || url.host === '' || url.scheme === 'file';
486
+ const isWindowsDriveLetter = s => /^[A-Za-z][:|]$/.test(s);
487
+ const isNormalizedWindowsDriveLetter = s => /^[A-Za-z]:$/.test(s);
488
+ const isSingleDotSegment = s => s === '.' || s.toLowerCase() === '%2e';
489
+ const isDoubleDotSegment = s => {
490
+ const lower = s.toLowerCase();
491
+ return lower === '..' || lower === '.%2e' || lower === '%2e.' || lower === '%2e%2e';
143
492
  };
493
+ function startsWithWindowsDriveLetter(cps, pointer) {
494
+ if (cps.length - pointer < 2) return false;
495
+ const first = cps[pointer];
496
+ const second = cps[pointer + 1];
497
+ if (!isASCIIAlpha(first) || second !== 0x3a && second !== 0x7c) return false;
498
+ if (cps.length - pointer === 2) return true;
499
+ const third = cps[pointer + 2];
500
+ return third === 0x2f || third === 0x5c || third === 0x3f || third === 0x23;
501
+ }
502
+ function pathList(url) {
503
+ if (typeof url.path === 'string') url.path = [];
504
+ return url.path;
505
+ }
506
+ function shortenPath(url) {
507
+ const path = pathList(url);
508
+ if (url.scheme === 'file' && path.length === 1 && isNormalizedWindowsDriveLetter(path[0])) return;
509
+ path.pop();
510
+ }
511
+
512
+ // Parser states
513
+ const SCHEME_START = 1;
514
+ const SCHEME = 2;
515
+ const NO_SCHEME = 3;
516
+ const SPECIAL_RELATIVE_OR_AUTHORITY = 4;
517
+ const PATH_OR_AUTHORITY = 5;
518
+ const RELATIVE = 6;
519
+ const RELATIVE_SLASH = 7;
520
+ const SPECIAL_AUTHORITY_SLASHES = 8;
521
+ const SPECIAL_AUTHORITY_IGNORE_SLASHES = 9;
522
+ const AUTHORITY = 10;
523
+ const HOST = 11;
524
+ const HOSTNAME = 12;
525
+ const PORT = 13;
526
+ const FILE = 14;
527
+ const FILE_SLASH = 15;
528
+ const FILE_HOST = 16;
529
+ const PATH_START = 17;
530
+ const PATH = 18;
531
+ const OPAQUE_PATH = 19;
532
+ const QUERY = 20;
533
+ const FRAGMENT = 21;
534
+
535
+ /**
536
+ * The URL Standard's basic URL parser. Returns the URL record, or null on failure. With `url` and
537
+ * `stateOverride` (used by the setters) it modifies `url` in place.
538
+ */
539
+ function basicURLParse(input, base, url, stateOverride) {
540
+ let record;
541
+ if (url) {
542
+ record = url;
543
+ } else {
544
+ record = {
545
+ scheme: '',
546
+ username: '',
547
+ password: '',
548
+ host: null,
549
+ port: null,
550
+ path: [],
551
+ query: null,
552
+ fragment: null
553
+ };
554
+ input = trimC0ControlOrSpace(input);
555
+ }
556
+ input = input.replace(/[\t\n\r]/g, '');
557
+ const cps = toCodePoints(input);
558
+ const special = () => isSpecialScheme(record.scheme);
559
+ let state = stateOverride || SCHEME_START;
560
+ let buffer = '';
561
+ let atSignSeen = false;
562
+ let insideBrackets = false;
563
+ let passwordTokenSeen = false;
564
+ for (let pointer = 0; pointer <= cps.length; pointer++) {
565
+ const c = pointer < cps.length ? cps[pointer] : EOF;
566
+ const next = pointer + 1 < cps.length ? cps[pointer + 1] : EOF;
567
+ switch (state) {
568
+ case SCHEME_START:
569
+ if (isASCIIAlpha(c)) {
570
+ buffer += String.fromCharCode(lowerASCII(c));
571
+ state = SCHEME;
572
+ } else if (!stateOverride) {
573
+ state = NO_SCHEME;
574
+ pointer--;
575
+ } else {
576
+ return null;
577
+ }
578
+ break;
579
+ case SCHEME:
580
+ if (isASCIIAlphanumeric(c) || c === 0x2b || c === 0x2d || c === 0x2e) {
581
+ buffer += String.fromCharCode(lowerASCII(c));
582
+ } else if (c === 0x3a) {
583
+ if (stateOverride) {
584
+ if (isSpecialScheme(record.scheme) !== isSpecialScheme(buffer)) return record;
585
+ if ((includesCredentials(record) || record.port !== null) && buffer === 'file') return record;
586
+ if (record.scheme === 'file' && record.host === '') return record;
587
+ }
588
+ record.scheme = buffer;
589
+ if (stateOverride) {
590
+ if (record.port === specialSchemePort(record.scheme)) record.port = null;
591
+ return record;
592
+ }
593
+ buffer = '';
594
+ if (record.scheme === 'file') {
595
+ state = FILE;
596
+ } else if (special() && base && base.scheme === record.scheme) {
597
+ state = SPECIAL_RELATIVE_OR_AUTHORITY;
598
+ } else if (special()) {
599
+ state = SPECIAL_AUTHORITY_SLASHES;
600
+ } else if (next === 0x2f) {
601
+ state = PATH_OR_AUTHORITY;
602
+ pointer++;
603
+ } else {
604
+ record.path = '';
605
+ state = OPAQUE_PATH;
606
+ }
607
+ } else if (!stateOverride) {
608
+ buffer = '';
609
+ state = NO_SCHEME;
610
+ pointer = -1; // start over
611
+ } else {
612
+ return null;
613
+ }
614
+ break;
615
+ case NO_SCHEME:
616
+ if (!base || typeof base.path === 'string' && c !== 0x23) {
617
+ return null;
618
+ } else if (typeof base.path === 'string' && c === 0x23) {
619
+ record.scheme = base.scheme;
620
+ record.path = base.path;
621
+ record.query = base.query;
622
+ record.fragment = '';
623
+ state = FRAGMENT;
624
+ } else if (base.scheme !== 'file') {
625
+ state = RELATIVE;
626
+ pointer--;
627
+ } else {
628
+ state = FILE;
629
+ pointer--;
630
+ }
631
+ break;
632
+ case SPECIAL_RELATIVE_OR_AUTHORITY:
633
+ if (c === 0x2f && next === 0x2f) {
634
+ state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
635
+ pointer++;
636
+ } else {
637
+ state = RELATIVE;
638
+ pointer--;
639
+ }
640
+ break;
641
+ case PATH_OR_AUTHORITY:
642
+ if (c === 0x2f) {
643
+ state = AUTHORITY;
644
+ } else {
645
+ state = PATH;
646
+ pointer--;
647
+ }
648
+ break;
649
+ case RELATIVE:
650
+ record.scheme = base.scheme;
651
+ if (c === 0x2f || special() && c === 0x5c) {
652
+ state = RELATIVE_SLASH;
653
+ } else {
654
+ record.username = base.username;
655
+ record.password = base.password;
656
+ record.host = base.host;
657
+ record.port = base.port;
658
+ record.path = typeof base.path === 'string' ? base.path : base.path.slice();
659
+ record.query = base.query;
660
+ if (c === 0x3f) {
661
+ record.query = '';
662
+ state = QUERY;
663
+ } else if (c === 0x23) {
664
+ record.fragment = '';
665
+ state = FRAGMENT;
666
+ } else if (c !== EOF) {
667
+ record.query = null;
668
+ shortenPath(record);
669
+ state = PATH;
670
+ pointer--;
671
+ }
672
+ }
673
+ break;
674
+ case RELATIVE_SLASH:
675
+ if (special() && (c === 0x2f || c === 0x5c)) {
676
+ state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
677
+ } else if (c === 0x2f) {
678
+ state = AUTHORITY;
679
+ } else {
680
+ record.username = base.username;
681
+ record.password = base.password;
682
+ record.host = base.host;
683
+ record.port = base.port;
684
+ state = PATH;
685
+ pointer--;
686
+ }
687
+ break;
688
+ case SPECIAL_AUTHORITY_SLASHES:
689
+ state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
690
+ if (c === 0x2f && next === 0x2f) pointer++;else pointer--;
691
+ break;
692
+ case SPECIAL_AUTHORITY_IGNORE_SLASHES:
693
+ if (c !== 0x2f && c !== 0x5c) {
694
+ state = AUTHORITY;
695
+ pointer--;
696
+ }
697
+ break;
698
+ case AUTHORITY:
699
+ if (c === 0x40) {
700
+ if (atSignSeen) buffer = '%40' + buffer;
701
+ atSignSeen = true;
702
+ for (const bc of toCodePoints(buffer)) {
703
+ if (bc === 0x3a && !passwordTokenSeen) {
704
+ passwordTokenSeen = true;
705
+ continue;
706
+ }
707
+ const encoded = percentEncodeCodePoint(bc, inUserinfoSet);
708
+ if (passwordTokenSeen) record.password += encoded;else record.username += encoded;
709
+ }
710
+ buffer = '';
711
+ } else if (c === EOF || c === 0x2f || c === 0x3f || c === 0x23 || special() && c === 0x5c) {
712
+ if (atSignSeen && buffer === '') return null;
713
+ pointer -= toCodePoints(buffer).length + 1;
714
+ buffer = '';
715
+ state = HOST;
716
+ } else {
717
+ buffer += String.fromCodePoint(c);
718
+ }
719
+ break;
720
+ case HOST:
721
+ case HOSTNAME:
722
+ if (stateOverride && record.scheme === 'file') {
723
+ pointer--;
724
+ state = FILE_HOST;
725
+ } else if (c === 0x3a && !insideBrackets) {
726
+ if (buffer === '') return null;
727
+ if (stateOverride === HOSTNAME) return null;
728
+ const host = parseHost(buffer, !special());
729
+ if (host === null) return null;
730
+ record.host = host;
731
+ buffer = '';
732
+ state = PORT;
733
+ } else if (c === EOF || c === 0x2f || c === 0x3f || c === 0x23 || special() && c === 0x5c) {
734
+ pointer--;
735
+ if (special() && buffer === '') return null;
736
+ if (stateOverride && buffer === '' && (includesCredentials(record) || record.port !== null)) return null;
737
+ const host = parseHost(buffer, !special());
738
+ if (host === null) return null;
739
+ record.host = host;
740
+ buffer = '';
741
+ state = PATH_START;
742
+ if (stateOverride) return record;
743
+ } else {
744
+ if (c === 0x5b) insideBrackets = true;
745
+ if (c === 0x5d) insideBrackets = false;
746
+ buffer += String.fromCodePoint(c);
747
+ }
748
+ break;
749
+ case PORT:
750
+ if (isASCIIDigit(c)) {
751
+ buffer += String.fromCharCode(c);
752
+ } else if (c === EOF || c === 0x2f || c === 0x3f || c === 0x23 || special() && c === 0x5c || stateOverride) {
753
+ if (buffer !== '') {
754
+ const port = parseInt(buffer, 10);
755
+ if (port > 65535) return null;
756
+ record.port = port === specialSchemePort(record.scheme) ? null : port;
757
+ buffer = '';
758
+ if (stateOverride) return record;
759
+ }
760
+ if (stateOverride) return null;
761
+ state = PATH_START;
762
+ pointer--;
763
+ } else {
764
+ return null;
765
+ }
766
+ break;
767
+ case FILE:
768
+ record.scheme = 'file';
769
+ record.host = '';
770
+ if (c === 0x2f || c === 0x5c) {
771
+ state = FILE_SLASH;
772
+ } else if (base && base.scheme === 'file') {
773
+ record.host = base.host;
774
+ record.path = typeof base.path === 'string' ? base.path : base.path.slice();
775
+ record.query = base.query;
776
+ if (c === 0x3f) {
777
+ record.query = '';
778
+ state = QUERY;
779
+ } else if (c === 0x23) {
780
+ record.fragment = '';
781
+ state = FRAGMENT;
782
+ } else if (c !== EOF) {
783
+ record.query = null;
784
+ if (!startsWithWindowsDriveLetter(cps, pointer)) shortenPath(record);else record.path = [];
785
+ state = PATH;
786
+ pointer--;
787
+ }
788
+ } else {
789
+ state = PATH;
790
+ pointer--;
791
+ }
792
+ break;
793
+ case FILE_SLASH:
794
+ if (c === 0x2f || c === 0x5c) {
795
+ state = FILE_HOST;
796
+ } else {
797
+ if (base && base.scheme === 'file') {
798
+ record.host = base.host;
799
+ const basePath = base.path;
800
+ if (!startsWithWindowsDriveLetter(cps, pointer) && typeof basePath !== 'string' && basePath.length > 0 && isNormalizedWindowsDriveLetter(basePath[0])) {
801
+ pathList(record).push(basePath[0]);
802
+ }
803
+ }
804
+ state = PATH;
805
+ pointer--;
806
+ }
807
+ break;
808
+ case FILE_HOST:
809
+ if (c === EOF || c === 0x2f || c === 0x5c || c === 0x3f || c === 0x23) {
810
+ pointer--;
811
+ if (!stateOverride && isWindowsDriveLetter(buffer)) {
812
+ state = PATH; // the buffer is kept and becomes the first path segment
813
+ } else if (buffer === '') {
814
+ record.host = '';
815
+ if (stateOverride) return record;
816
+ state = PATH_START;
817
+ } else {
818
+ let host = parseHost(buffer, !special());
819
+ if (host === null) return null;
820
+ if (host === 'localhost') host = '';
821
+ record.host = host;
822
+ if (stateOverride) return record;
823
+ buffer = '';
824
+ state = PATH_START;
825
+ }
826
+ } else {
827
+ buffer += String.fromCodePoint(c);
828
+ }
829
+ break;
830
+ case PATH_START:
831
+ if (special()) {
832
+ state = PATH;
833
+ if (c !== 0x2f && c !== 0x5c) pointer--;
834
+ } else if (!stateOverride && c === 0x3f) {
835
+ record.query = '';
836
+ state = QUERY;
837
+ } else if (!stateOverride && c === 0x23) {
838
+ record.fragment = '';
839
+ state = FRAGMENT;
840
+ } else if (c !== EOF) {
841
+ state = PATH;
842
+ if (c !== 0x2f) pointer--;
843
+ } else if (stateOverride && record.host === null) {
844
+ pathList(record).push('');
845
+ }
846
+ break;
847
+ case PATH:
848
+ if (c === EOF || c === 0x2f || special() && c === 0x5c || !stateOverride && (c === 0x3f || c === 0x23)) {
849
+ const slash = c === 0x2f || special() && c === 0x5c;
850
+ const path = pathList(record);
851
+ if (isDoubleDotSegment(buffer)) {
852
+ shortenPath(record);
853
+ if (!slash) path.push('');
854
+ } else if (isSingleDotSegment(buffer)) {
855
+ if (!slash) path.push('');
856
+ } else {
857
+ if (record.scheme === 'file' && path.length === 0 && isWindowsDriveLetter(buffer)) {
858
+ buffer = buffer[0] + ':';
859
+ }
860
+ path.push(buffer);
861
+ }
862
+ buffer = '';
863
+ if (c === 0x3f) {
864
+ record.query = '';
865
+ state = QUERY;
866
+ } else if (c === 0x23) {
867
+ record.fragment = '';
868
+ state = FRAGMENT;
869
+ }
870
+ } else {
871
+ buffer += percentEncodeCodePoint(c, inPathSet);
872
+ }
873
+ break;
874
+ case OPAQUE_PATH:
875
+ if (c === 0x3f) {
876
+ record.query = '';
877
+ state = QUERY;
878
+ } else if (c === 0x23) {
879
+ record.fragment = '';
880
+ state = FRAGMENT;
881
+ } else if (c === 0x20) {
882
+ record.path += next === 0x3f || next === 0x23 ? '%20' : ' ';
883
+ } else if (c !== EOF) {
884
+ record.path += percentEncodeCodePoint(c, inC0ControlSet);
885
+ }
886
+ break;
887
+ case QUERY:
888
+ if (!stateOverride && c === 0x23 || c === EOF) {
889
+ record.query = (record.query ?? '') + percentEncodeString(buffer, special() ? inSpecialQuerySet : inQuerySet);
890
+ buffer = '';
891
+ if (c === 0x23) {
892
+ record.fragment = '';
893
+ state = FRAGMENT;
894
+ }
895
+ } else {
896
+ buffer += String.fromCodePoint(c);
897
+ }
898
+ break;
899
+ case FRAGMENT:
900
+ if (c !== EOF) record.fragment = (record.fragment ?? '') + percentEncodeCodePoint(c, inFragmentSet);
901
+ break;
902
+ }
903
+ }
904
+ return record;
905
+ }
906
+ function serializePath(url) {
907
+ if (typeof url.path === 'string') return url.path;
908
+ let out = '';
909
+ for (const segment of url.path) out += '/' + segment;
910
+ return out;
911
+ }
912
+ function serializeURL(url) {
913
+ let out = url.scheme + ':';
914
+ if (url.host !== null) {
915
+ out += '//';
916
+ if (includesCredentials(url)) {
917
+ out += url.username;
918
+ if (url.password !== '') out += ':' + url.password;
919
+ out += '@';
920
+ }
921
+ out += url.host;
922
+ if (url.port !== null) out += ':' + url.port;
923
+ } else if (typeof url.path !== 'string' && url.path.length > 1 && url.path[0] === '') {
924
+ out += '/.';
925
+ }
926
+ out += serializePath(url);
927
+ if (url.query !== null) out += '?' + url.query;
928
+ if (url.fragment !== null) out += '#' + url.fragment;
929
+ return out;
930
+ }
931
+ function serializeOrigin(url) {
932
+ switch (url.scheme) {
933
+ case 'blob':
934
+ {
935
+ const inner = basicURLParse(serializePath(url), null);
936
+ return inner && (inner.scheme === 'http' || inner.scheme === 'https') ? serializeOrigin(inner) : 'null';
937
+ }
938
+ case 'ftp':
939
+ case 'http':
940
+ case 'https':
941
+ case 'ws':
942
+ case 'wss':
943
+ return `${url.scheme}://${url.host}${url.port !== null ? ':' + url.port : ''}`;
944
+ default:
945
+ return 'null';
946
+ }
947
+ }
144
948
 
145
949
  /* -----------------------------
146
950
  URLSearchParams Implementation
147
951
  ----------------------------- */
148
952
 
953
+ // What the owning URL needs to reach inside its URLSearchParams.
954
+
955
+ const internals = params => params;
149
956
  class URLSearchParams {
957
+ _list = [];
958
+ // The record of the URL whose `searchParams` this is; mutations rewrite its query.
959
+ _url = null;
150
960
  constructor(init) {
151
- this._map = new Map();
152
- if (!init) return;
153
- if (typeof init === 'string') {
154
- const s = init.startsWith('?') ? init.slice(1) : init;
155
- if (s.length === 0) return;
156
- s.split('&').forEach(pair => {
157
- if (pair.length === 0) return;
158
- const [k, ...rest] = pair.split('=');
159
- const key = decodePercentEncoded(k.replace(/\+/g, '%20'));
160
- const val = decodePercentEncoded((rest.join('=') || '').replace(/\+/g, '%20'));
161
- this.append(key, val);
162
- });
163
- } else if (Array.isArray(init)) {
164
- init.forEach(([k, v]) => this.append(String(k), String(v)));
165
- } else if (init instanceof URLSearchParams) {
166
- init.forEach((val, key) => this.append(key, val));
167
- } else if (typeof init === 'object') {
168
- Object.keys(init).forEach(k => this.set(k, init[k]));
961
+ if (init === undefined) return;
962
+ if (init !== null && (typeof init === 'object' || typeof init === 'function')) {
963
+ const iterable = init;
964
+ if (typeof iterable[Symbol.iterator] === 'function') {
965
+ for (const pair of iterable) {
966
+ const items = pair !== null && typeof pair === 'object' ? Array.from(pair) : null;
967
+ if (!items || items.length !== 2) {
968
+ throw new TypeError('Each query pair must be an iterable [name, value] tuple');
969
+ }
970
+ this._list.push([toUSVString(items[0]), toUSVString(items[1])]);
971
+ }
972
+ } else {
973
+ const record = init;
974
+ for (const key of Object.keys(record)) this._list.push([toUSVString(key), toUSVString(record[key])]);
975
+ }
976
+ return;
169
977
  }
978
+ const query = String(init);
979
+ this._list = parseFormUrlencoded(query.startsWith('?') ? query.slice(1) : query);
980
+ }
981
+ _update() {
982
+ if (!this._url) return;
983
+ const serialized = serializeFormUrlencoded(this._list);
984
+ this._url.query = serialized === '' ? null : serialized;
170
985
  }
171
986
  append(name, value) {
172
- const key = String(name);
173
- const val = String(value);
174
- const arr = this._map.get(key) || [];
175
- arr.push(val);
176
- this._map.set(key, arr);
987
+ this._list.push([toUSVString(name), toUSVString(value)]);
988
+ this._update();
177
989
  }
178
990
  set(name, value) {
179
- this._map.set(String(name), [String(value)]);
991
+ const key = toUSVString(name);
992
+ const val = toUSVString(value);
993
+ const index = this._list.findIndex(([k]) => k === key);
994
+ if (index === -1) {
995
+ this._list.push([key, val]);
996
+ } else {
997
+ this._list[index] = [key, val];
998
+ this._list = this._list.filter(([k], i) => i <= index || k !== key);
999
+ }
1000
+ this._update();
180
1001
  }
181
1002
  get(name) {
182
- const arr = this._map.get(String(name));
183
- return arr ? arr[0] : null;
1003
+ const key = toUSVString(name);
1004
+ const pair = this._list.find(([k]) => k === key);
1005
+ return pair ? pair[1] : null;
184
1006
  }
185
1007
  getAll(name) {
186
- return (this._map.get(String(name)) || []).slice();
1008
+ const key = toUSVString(name);
1009
+ return this._list.filter(([k]) => k === key).map(([, v]) => v);
187
1010
  }
188
- has(name) {
189
- return this._map.has(String(name));
1011
+ has(name, value) {
1012
+ const key = toUSVString(name);
1013
+ const val = value === undefined ? undefined : toUSVString(value);
1014
+ return this._list.some(([k, v]) => k === key && (val === undefined || v === val));
190
1015
  }
191
- delete(name) {
192
- this._map.delete(String(name));
1016
+ delete(name, value) {
1017
+ const key = toUSVString(name);
1018
+ const val = value === undefined ? undefined : toUSVString(value);
1019
+ this._list = this._list.filter(([k, v]) => !(k === key && (val === undefined || v === val)));
1020
+ this._update();
193
1021
  }
194
1022
  forEach(cb, thisArg) {
195
- for (const [k, vals] of this._map) {
196
- for (const v of vals) cb.call(thisArg, v, k, this);
1023
+ for (let i = 0; i < this._list.length; i++) {
1024
+ const [k, v] = this._list[i];
1025
+ cb.call(thisArg, v, k, this);
197
1026
  }
198
1027
  }
199
1028
  toString() {
200
- const out = [];
201
- for (const [k, vals] of this._map) {
202
- for (const v of vals) {
203
- out.push(`${encodeComponent(k)}=${encodeComponent(v)}`);
204
- }
205
- }
206
- return out.join('&');
1029
+ return serializeFormUrlencoded(this._list);
207
1030
  }
208
1031
  sort() {
209
- // Stable sort by key (and preserve values order per key)
210
- const entries = Array.from(this._map.entries()).sort((a, b) => a[0] < b[0] ? -1 : a[0] > b[0] ? 1 : 0);
211
- this._map = new Map(entries);
1032
+ // Stable sort by name, comparing code units.
1033
+ this._list = this._list.map((pair, index) => ({
1034
+ pair,
1035
+ index
1036
+ })).sort((a, b) => a.pair[0] < b.pair[0] ? -1 : a.pair[0] > b.pair[0] ? 1 : a.index - b.index).map(({
1037
+ pair
1038
+ }) => pair);
1039
+ this._update();
212
1040
  }
213
1041
  toJSON() {
214
1042
  return this.toString();
@@ -219,354 +1047,175 @@ class URLSearchParams {
219
1047
 
220
1048
  // Additional utility methods
221
1049
  get size() {
222
- let count = 0;
223
- for (const [, vals] of this._map) {
224
- count += vals.length;
225
- }
226
- return count;
1050
+ return this._list.length;
227
1051
  }
228
1052
  clear() {
229
- this._map.clear();
1053
+ this._list = [];
1054
+ this._update();
230
1055
  }
231
1056
  *entries() {
232
- for (const [k, vals] of this._map) for (const v of vals) yield [k, v];
1057
+ for (let i = 0; i < this._list.length; i++) {
1058
+ const [k, v] = this._list[i];
1059
+ yield [k, v];
1060
+ }
233
1061
  }
234
1062
  *keys() {
235
- for (const [k] of this._map) yield k;
1063
+ for (let i = 0; i < this._list.length; i++) yield this._list[i][0];
236
1064
  }
237
1065
  *values() {
238
- for (const [, vals] of this._map) for (const v of vals) yield v;
1066
+ for (let i = 0; i < this._list.length; i++) yield this._list[i][1];
239
1067
  }
240
1068
  [Symbol.iterator]() {
241
1069
  return this.entries();
242
1070
  }
243
1071
  }
1072
+ exports.PolyURLSearchParams = exports.URLSearchParams = URLSearchParams;
1073
+ function toUSVString(value) {
1074
+ const s = String(value);
1075
+ return /[\ud800-\udfff]/.test(s) ? fromCodePoints(toCodePoints(s)) : s;
1076
+ }
244
1077
 
245
1078
  /* -----------------------------
246
1079
  URL Implementation
247
1080
  ----------------------------- */
248
- exports.PolyURLSearchParams = exports.URLSearchParams = URLSearchParams;
249
- const SCHEME_RE = /^([A-Za-z][A-Za-z0-9+.-]*):/;
250
- function splitBeforeFirst(haystack, needle) {
251
- const idx = haystack.indexOf(needle);
252
- if (idx === -1) return [haystack, ''];
253
- return [haystack.slice(0, idx), haystack.slice(idx + needle.length)];
254
- }
255
- function parseURLString(input, base) {
256
- let url = input.trim();
257
1081
 
258
- // Handle data URLs and other special schemes
259
- if (url.match(/^(data|mailto|tel|sms):/i)) {
260
- const [scheme, rest] = splitBeforeFirst(url, ':');
261
- return {
262
- protocol: scheme.toLowerCase() + ':',
263
- username: '',
264
- password: '',
265
- host: '',
266
- hostname: '',
267
- port: '',
268
- pathname: rest || '',
269
- search: '',
270
- hash: '',
271
- origin: 'null'
272
- };
273
- }
274
-
275
- // If base is provided and url is relative, resolve
276
- if (base) {
277
- // handle scheme-relative: //host/path
278
- if (url.startsWith('//')) {
279
- url = base.protocol + url;
280
- } else if (!SCHEME_RE.test(url)) {
281
- // relative path
282
- // join base.pathname directory with url
283
- const basePath = base.pathname;
284
- let dir = basePath.slice(0, basePath.lastIndexOf('/') + 1);
285
- if (!dir.endsWith('/')) dir += '/';
286
- url = `${base.protocol}//${base.host}${dir}${url}`;
287
- }
288
- }
289
- const protocolMatch = url.match(SCHEME_RE);
290
- const protocol = protocolMatch ? protocolMatch[1].toLowerCase() + ':' : '';
291
- let rest = protocol ? url.slice(protocol.length) : url;
292
-
293
- // If protocol present, remove single leading slashes
294
- if (protocol) {
295
- if (rest.startsWith('///')) {
296
- // weird but handle
297
- rest = '//' + rest.slice(3);
298
- }
299
- }
300
-
301
- // Extract hash
302
- let [withoutHash, hash] = splitBeforeFirst(rest, '#');
303
- if (hash) hash = '#' + hash;
304
-
305
- // Extract search
306
- let [beforeSearch, search] = splitBeforeFirst(withoutHash, '?');
307
- if (search) search = '?' + search;
308
-
309
- // authority and path
310
- let authority = '';
311
- let pathname = '';
312
- if (beforeSearch.startsWith('//')) {
313
- const afterSlashes = beforeSearch.slice(2);
314
- const idx = afterSlashes.indexOf('/');
315
- if (idx === -1) {
316
- authority = afterSlashes;
317
- pathname = '/';
318
- } else {
319
- authority = afterSlashes.slice(0, idx);
320
- pathname = afterSlashes.slice(idx) || '/';
321
- }
322
- } else {
323
- pathname = beforeSearch || '';
324
- }
325
-
326
- // parse username/password and host/port
327
- let username = '';
328
- let password = '';
329
- let host = '';
330
- let hostname = '';
331
- let port = '';
332
- if (authority) {
333
- // userinfo@host:port
334
- const atIdx = authority.lastIndexOf('@');
335
- let hostport = authority;
336
- if (atIdx !== -1) {
337
- const userinfo = authority.slice(0, atIdx);
338
- hostport = authority.slice(atIdx + 1);
339
- const [u, p] = splitBeforeFirst(userinfo, ':');
340
- username = decodePercentEncoded(u);
341
- password = p ? decodePercentEncoded(p) : '';
342
- }
343
- // IPv6 in [..]:port
344
- if (hostport.startsWith('[')) {
345
- const closeIdx = hostport.indexOf(']');
346
- if (closeIdx !== -1) {
347
- hostname = hostport.slice(0, closeIdx + 1);
348
- port = hostport.slice(closeIdx + 1);
349
- if (port.startsWith(':')) port = port.slice(1);
350
- } else {
351
- hostname = hostport; // malformed, but take as hostname
352
- }
353
- } else {
354
- const colonIdx = hostport.lastIndexOf(':');
355
- if (colonIdx > hostport.indexOf(']')) {
356
- // normal
357
- }
358
- if (colonIdx !== -1 && hostport.indexOf(':') === colonIdx) {
359
- hostname = hostport.slice(0, colonIdx);
360
- port = hostport.slice(colonIdx + 1);
361
- } else {
362
- hostname = hostport;
363
- }
364
- }
365
- hostname = hostname || '';
366
- host = port ? `${hostname}:${port}` : hostname;
367
- host = host.trim();
368
- }
369
-
370
- // Normalization
371
- if (!pathname) pathname = '/';
372
- pathname = normalizePath(decodePercentEncoded(pathname));
373
-
374
- // If hostname present but protocol empty (like relative), try to use base
375
- let origin = '';
376
- if (protocol && host) {
377
- origin = protocol + '//' + host;
378
- } else if (base && !protocol) {
379
- origin = base.origin;
380
- } else if (protocol && !host) {
381
- origin = protocol + '//';
382
- }
383
- return {
384
- protocol: protocol,
385
- username,
386
- password,
387
- host,
388
- hostname,
389
- port,
390
- pathname,
391
- search: search || '',
392
- hash: hash || '',
393
- origin
394
- };
395
- }
396
1082
  class URL {
1083
+ /** @throws {TypeError} if `input` (resolved against `base`) or `base` is not a valid URL. */
397
1084
  constructor(input, base) {
398
- let baseParsed;
399
- if (base instanceof URL) baseParsed = base._p;else if (typeof base === 'string' && base.length > 0) baseParsed = parseURLString(base);
400
- this._p = parseURLString(String(input), baseParsed);
401
- this.searchParams = new URLSearchParams(this._p.search || '');
402
-
403
- // Bind searchParams changes to update the URL's search property
404
- this._bindSearchParamsUpdates();
1085
+ let baseRecord = null;
1086
+ if (base !== undefined) {
1087
+ baseRecord = base instanceof URL ? base._r : basicURLParse(String(base), null);
1088
+ if (baseRecord === null) throw new TypeError(`Invalid base URL: ${String(base)}`);
1089
+ }
1090
+ const record = basicURLParse(String(input), baseRecord);
1091
+ if (record === null) throw new TypeError(`Invalid URL: ${String(input)}`);
1092
+ this._r = record;
1093
+ this.searchParams = new URLSearchParams();
1094
+ internals(this.searchParams)._url = record;
1095
+ this._resetSearchParams();
405
1096
  }
406
- _bindSearchParamsUpdates() {
407
- const origToString = this.searchParams.toString.bind(this.searchParams);
408
- const self = this;
409
1097
 
410
- // Override methods that change params to update search string
411
- const mutators = ['append', 'set', 'delete', 'sort', 'clear'];
412
- for (const m of mutators) {
413
- const fn = this.searchParams[m];
414
- if (typeof fn === 'function') {
415
- this.searchParams[m] = function (...args) {
416
- const res = fn.apply(this, args);
417
- const newSearch = origToString();
418
- self._p.search = newSearch ? '?' + newSearch : '';
419
- return res;
420
- };
421
- }
422
- }
1098
+ // Refill searchParams from the query, keeping the same object (as the standard requires).
1099
+ _resetSearchParams() {
1100
+ internals(this.searchParams)._list = this._r.query !== null ? parseFormUrlencoded(this._r.query) : [];
423
1101
  }
424
1102
 
425
1103
  // Static helper methods
426
1104
  static canParse(url, base) {
427
- try {
428
- new URL(url, base);
429
- return true;
430
- } catch {
431
- return false;
1105
+ let baseRecord = null;
1106
+ if (base !== undefined) {
1107
+ baseRecord = base instanceof URL ? base._r : basicURLParse(String(base), null);
1108
+ if (baseRecord === null) return false;
432
1109
  }
1110
+ return basicURLParse(String(url), baseRecord) !== null;
433
1111
  }
434
1112
  static parse(url, base) {
435
- try {
436
- return new URL(url, base);
437
- } catch {
438
- return null;
439
- }
1113
+ return URL.canParse(url, base) ? new URL(url, base) : null;
440
1114
  }
441
1115
  get href() {
442
- return this.toString();
1116
+ return serializeURL(this._r);
443
1117
  }
444
1118
  set href(val) {
445
- const parsed = parseURLString(String(val));
446
- this._p = parsed;
447
- this.searchParams = new URLSearchParams(this._p.search || '');
448
- this._bindSearchParamsUpdates();
1119
+ const parsed = basicURLParse(String(val), null);
1120
+ if (parsed === null) throw new TypeError(`Invalid URL: ${String(val)}`);
1121
+ // Update in place: searchParams holds a reference to this record.
1122
+ Object.assign(this._r, parsed);
1123
+ this._resetSearchParams();
449
1124
  }
450
1125
  get protocol() {
451
- return this._p.protocol;
1126
+ return this._r.scheme + ':';
452
1127
  }
453
1128
  set protocol(val) {
454
- const m = String(val).replace(/:$/, '');
455
- this._p.protocol = m + ':';
456
- this._updateOrigin();
1129
+ basicURLParse(String(val) + ':', null, this._r, SCHEME_START);
457
1130
  }
458
1131
  get username() {
459
- return this._p.username;
1132
+ return this._r.username;
460
1133
  }
461
1134
  set username(v) {
462
- this._p.username = String(v);
1135
+ if (cannotHaveCredentialsOrPort(this._r)) return;
1136
+ this._r.username = percentEncodeString(String(v), inUserinfoSet);
463
1137
  }
464
1138
  get password() {
465
- return this._p.password;
1139
+ return this._r.password;
466
1140
  }
467
1141
  set password(v) {
468
- this._p.password = String(v);
1142
+ if (cannotHaveCredentialsOrPort(this._r)) return;
1143
+ this._r.password = percentEncodeString(String(v), inUserinfoSet);
469
1144
  }
470
1145
  get host() {
471
- return this._p.host;
1146
+ const {
1147
+ host,
1148
+ port
1149
+ } = this._r;
1150
+ if (host === null) return '';
1151
+ return port === null ? host : `${host}:${port}`;
472
1152
  }
473
1153
  set host(v) {
474
- const [hostname, port] = splitBeforeFirst(String(v), ':');
475
- this._p.hostname = hostname;
476
- this._p.port = port;
477
- this._p.host = port ? `${hostname}:${port}` : hostname;
478
- this._updateOrigin();
1154
+ if (typeof this._r.path === 'string') return;
1155
+ basicURLParse(String(v), null, this._r, HOST);
479
1156
  }
480
1157
  get hostname() {
481
- return this._p.hostname;
1158
+ return this._r.host ?? '';
482
1159
  }
483
1160
  set hostname(v) {
484
- this._p.hostname = String(v);
485
- this._p.host = this._p.port ? `${this._p.hostname}:${this._p.port}` : this._p.hostname;
486
- this._updateOrigin();
1161
+ if (typeof this._r.path === 'string') return;
1162
+ basicURLParse(String(v), null, this._r, HOSTNAME);
487
1163
  }
488
1164
  get port() {
489
- return this._p.port;
1165
+ return this._r.port === null ? '' : String(this._r.port);
490
1166
  }
491
1167
  set port(v) {
492
- const portStr = String(v);
493
- // Remove default ports to match browser behavior
494
- if (DEFAULT_PORTS[this._p.protocol] === portStr) {
495
- this._p.port = '';
496
- } else {
497
- this._p.port = portStr;
498
- }
499
- this._p.host = this._p.port ? `${this._p.hostname}:${this._p.port}` : this._p.hostname;
500
- this._updateOrigin();
1168
+ if (cannotHaveCredentialsOrPort(this._r)) return;
1169
+ const port = String(v);
1170
+ if (port === '') this._r.port = null;else basicURLParse(port, null, this._r, PORT);
501
1171
  }
502
1172
  get pathname() {
503
- return this._p.pathname;
1173
+ return serializePath(this._r);
504
1174
  }
505
1175
  set pathname(v) {
506
- let path = String(v);
507
- if (!path.startsWith('/')) path = '/' + path;
508
- this._p.pathname = normalizePath(path);
1176
+ if (typeof this._r.path === 'string') return;
1177
+ this._r.path = [];
1178
+ basicURLParse(String(v), null, this._r, PATH_START);
509
1179
  }
510
1180
  get search() {
511
- return this._p.search;
1181
+ return this._r.query ? '?' + this._r.query : '';
512
1182
  }
513
1183
  set search(v) {
514
- let search = String(v);
515
- if (search && !search.startsWith('?')) search = '?' + search;
516
- this._p.search = search;
517
- this.searchParams = new URLSearchParams(search || '');
518
- this._bindSearchParamsUpdates();
1184
+ const value = String(v);
1185
+ if (value === '') {
1186
+ this._r.query = null;
1187
+ internals(this.searchParams)._list = [];
1188
+ return;
1189
+ }
1190
+ const input = value.startsWith('?') ? value.slice(1) : value;
1191
+ this._r.query = '';
1192
+ basicURLParse(input, null, this._r, QUERY);
1193
+ // Like Node, read the list back from the stored query (tabs and newlines already removed).
1194
+ this._resetSearchParams();
519
1195
  }
520
1196
  get hash() {
521
- return this._p.hash;
1197
+ return this._r.fragment ? '#' + this._r.fragment : '';
522
1198
  }
523
1199
  set hash(v) {
524
- let hash = String(v);
525
- if (hash && !hash.startsWith('#')) hash = '#' + hash;
526
- this._p.hash = hash;
1200
+ const value = String(v);
1201
+ if (value === '') {
1202
+ this._r.fragment = null;
1203
+ return;
1204
+ }
1205
+ this._r.fragment = '';
1206
+ basicURLParse(value.startsWith('#') ? value.slice(1) : value, null, this._r, FRAGMENT);
527
1207
  }
528
1208
  get origin() {
529
- return this._p.origin;
530
- }
531
- _updateOrigin() {
532
- if (this._p.protocol && this._p.hostname) {
533
- this._p.origin = this._p.protocol + '//' + this._p.host;
534
- }
1209
+ return serializeOrigin(this._r);
535
1210
  }
536
1211
  toString() {
537
- const p = this._p;
538
- let auth = '';
539
- if (p.username || p.password) {
540
- auth = encodeComponent(p.username) + (p.password ? ':' + encodeComponent(p.password) : '') + '@';
541
- }
542
- const hostPart = p.host || '';
543
- const path = p.pathname ? encodeComponentPath(p.pathname) : '/';
544
- const search = p.search || (this.searchParams ? this.searchParams.toString() ? '?' + this.searchParams.toString() : '' : '');
545
- const hash = p.hash || '';
546
- const proto = p.protocol || '';
547
-
548
- // Handle special schemes
549
- if (proto.match(/^(data|mailto|tel|sms):/i)) {
550
- return proto + path + search + hash;
551
- }
552
-
553
- // If protocol uses scheme with no host (like mailto), handle simply
554
- if (!hostPart && proto && (path === '/' || path === '')) {
555
- return proto + path + search + hash;
556
- }
557
- return proto + '//' + auth + hostPart + path + search + hash;
1212
+ return this.href;
558
1213
  }
559
1214
  toJSON() {
560
- return this.toString();
1215
+ return this.href;
561
1216
  }
562
1217
  }
563
1218
 
564
- /* Helper: escape path preserving slashes */
565
- exports.PolyURL = exports.URL = URL;
566
- function encodeComponentPath(path) {
567
- // Split on / and encode segments, preserving empty segments for proper // handling
568
- return path.split('/').map(seg => encodeComponent(seg)).join('/');
569
- }
570
-
571
1219
  // Export for Node.js environments that might not have these globals
1220
+ exports.PolyURL = exports.URL = URL;
572
1221
  //# sourceMappingURL=url-polyfill.js.map