resuxjs 0.4.0-beta.2 → 0.4.0-beta.3

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 (339) hide show
  1. package/dist/bin.d.ts +1 -1
  2. package/dist/bin.js +3 -2
  3. package/dist/bin.js.map +1 -1
  4. package/dist/build/index.d.ts +9 -8
  5. package/dist/build/index.js +2 -2
  6. package/dist/build/index.js.map +1 -1
  7. package/dist/cli.d.ts +5 -4
  8. package/dist/cli.js +115 -127
  9. package/dist/cli.js.map +1 -1
  10. package/dist/compiler/adapter.d.ts +6 -5
  11. package/dist/compiler/adapter.js +2 -1
  12. package/dist/compiler/adapter.js.map +1 -1
  13. package/dist/compiler/dev-warnings.d.ts +6 -5
  14. package/dist/compiler/dev-warnings.js +7 -6
  15. package/dist/compiler/dev-warnings.js.map +1 -1
  16. package/dist/compiler/directives.d.ts +4 -3
  17. package/dist/compiler/directives.js +2 -1
  18. package/dist/compiler/directives.js.map +1 -1
  19. package/dist/compiler/implementation.d.ts +21 -19
  20. package/dist/compiler/implementation.js +124 -133
  21. package/dist/compiler/index.d.ts +6 -5
  22. package/dist/compiler/index.js +2 -1
  23. package/dist/compiler/index.js.map +1 -1
  24. package/dist/core/config.d.ts +7 -5
  25. package/dist/core/config.js +1 -1
  26. package/dist/core/config.js.map +1 -1
  27. package/dist/core/hooks.d.ts +7 -6
  28. package/dist/core/hooks.js +1 -1
  29. package/dist/core/hooks.js.map +1 -1
  30. package/dist/core/index.js +2 -1
  31. package/dist/core/module-container.d.ts +22 -20
  32. package/dist/core/module-container.js +3 -3
  33. package/dist/core/module-container.js.map +1 -1
  34. package/dist/core/resux.d.ts +5 -3
  35. package/dist/core/resux.js +2 -1
  36. package/dist/core/resux.js.map +1 -1
  37. package/dist/create-bin.d.ts +1 -1
  38. package/dist/create-bin.js +3 -2
  39. package/dist/create-bin.js.map +1 -1
  40. package/dist/create.d.ts +3 -2
  41. package/dist/create.js +7 -10
  42. package/dist/create.js.map +1 -1
  43. package/dist/deploy/cloudflare.d.ts +3 -1
  44. package/dist/deploy/cloudflare.js +2 -1
  45. package/dist/deploy/cloudflare.js.map +1 -1
  46. package/dist/deploy/common.d.ts +13 -11
  47. package/dist/deploy/common.js +2 -1
  48. package/dist/deploy/common.js.map +1 -1
  49. package/dist/deploy/framework-runtime.d.ts +2 -1
  50. package/dist/deploy/framework-runtime.js +2 -1
  51. package/dist/deploy/framework-runtime.js.map +1 -1
  52. package/dist/deploy/index.d.ts +4 -2
  53. package/dist/deploy/index.js +4 -6
  54. package/dist/deploy/index.js.map +1 -1
  55. package/dist/deploy/netlify.d.ts +3 -1
  56. package/dist/deploy/netlify.js +2 -1
  57. package/dist/deploy/netlify.js.map +1 -1
  58. package/dist/deploy/node.d.ts +3 -1
  59. package/dist/deploy/node.js +3 -3
  60. package/dist/deploy/node.js.map +1 -1
  61. package/dist/deploy/production-report.d.ts +2 -1
  62. package/dist/deploy/production-report.js +2 -1
  63. package/dist/deploy/production-report.js.map +1 -1
  64. package/dist/deploy/runtime-dependencies.d.ts +5 -4
  65. package/dist/deploy/runtime-dependencies.js +3 -3
  66. package/dist/deploy/runtime-dependencies.js.map +1 -1
  67. package/dist/deploy/static.d.ts +3 -1
  68. package/dist/deploy/static.js +2 -1
  69. package/dist/deploy/static.js.map +1 -1
  70. package/dist/deploy/types.d.ts +8 -7
  71. package/dist/deploy/types.js +1 -1
  72. package/dist/deploy/vercel.d.ts +4 -2
  73. package/dist/deploy/vercel.js +2 -1
  74. package/dist/deploy/vercel.js.map +1 -1
  75. package/dist/fonts/index.d.ts +5 -4
  76. package/dist/fonts/index.js +3 -2
  77. package/dist/fonts/index.js.map +1 -1
  78. package/dist/globals.d.ts +2 -2
  79. package/dist/globals.js +1 -1
  80. package/dist/halal-core/ai/classifyProject.d.ts +5 -3
  81. package/dist/halal-core/ai/classifyProject.js +2 -1
  82. package/dist/halal-core/ai/classifyProject.js.map +1 -1
  83. package/dist/halal-core/ai/classifyRuntimeContent.d.ts +3 -1
  84. package/dist/halal-core/ai/classifyRuntimeContent.js +2 -1
  85. package/dist/halal-core/ai/classifyRuntimeContent.js.map +1 -1
  86. package/dist/halal-core/ai/createProjectSummary.d.ts +2 -1
  87. package/dist/halal-core/ai/createProjectSummary.js +2 -1
  88. package/dist/halal-core/ai/createProjectSummary.js.map +1 -1
  89. package/dist/halal-core/ai/halalClassifierPrompt.d.ts +2 -1
  90. package/dist/halal-core/ai/halalClassifierPrompt.js +1 -1
  91. package/dist/halal-core/ai/redactSensitiveData.d.ts +2 -1
  92. package/dist/halal-core/ai/redactSensitiveData.js +1 -1
  93. package/dist/halal-core/ai/redactSensitiveData.js.map +1 -1
  94. package/dist/halal-core/ai/validateAiResponse.d.ts +3 -1
  95. package/dist/halal-core/ai/validateAiResponse.js +3 -3
  96. package/dist/halal-core/ai/validateAiResponse.js.map +1 -1
  97. package/dist/halal-core/cli/check.d.ts +2 -1
  98. package/dist/halal-core/cli/check.js +3 -3
  99. package/dist/halal-core/cli/check.js.map +1 -1
  100. package/dist/halal-core/cli/explain.d.ts +2 -1
  101. package/dist/halal-core/cli/explain.js +3 -3
  102. package/dist/halal-core/cli/explain.js.map +1 -1
  103. package/dist/halal-core/cli/report.d.ts +2 -1
  104. package/dist/halal-core/cli/report.js +3 -3
  105. package/dist/halal-core/cli/report.js.map +1 -1
  106. package/dist/halal-core/cli/submitReview.d.ts +2 -1
  107. package/dist/halal-core/cli/submitReview.js +3 -3
  108. package/dist/halal-core/cli/submitReview.js.map +1 -1
  109. package/dist/halal-core/cli/verifyReview.d.ts +2 -1
  110. package/dist/halal-core/cli/verifyReview.js +3 -4
  111. package/dist/halal-core/cli/verifyReview.js.map +1 -1
  112. package/dist/halal-core/config.d.ts +9 -8
  113. package/dist/halal-core/config.js +2 -1
  114. package/dist/halal-core/config.js.map +1 -1
  115. package/dist/halal-core/crypto/integrity.d.ts +6 -5
  116. package/dist/halal-core/crypto/integrity.js +2 -1
  117. package/dist/halal-core/crypto/integrity.js.map +1 -1
  118. package/dist/halal-core/enforce.d.ts +6 -5
  119. package/dist/halal-core/enforce.js +13 -15
  120. package/dist/halal-core/enforce.js.map +1 -1
  121. package/dist/halal-core/index.js +2 -1
  122. package/dist/halal-core/lifecycle.d.ts +2 -1
  123. package/dist/halal-core/lifecycle.js +2 -1
  124. package/dist/halal-core/lifecycle.js.map +1 -1
  125. package/dist/halal-core/policy.d.ts +3 -1
  126. package/dist/halal-core/policy.js +2 -1
  127. package/dist/halal-core/policy.js.map +1 -1
  128. package/dist/halal-core/report/formatBrowserOverlay.d.ts +3 -1
  129. package/dist/halal-core/report/formatBrowserOverlay.js +1 -1
  130. package/dist/halal-core/report/formatBrowserOverlay.js.map +1 -1
  131. package/dist/halal-core/report/formatTerminalReport.d.ts +3 -1
  132. package/dist/halal-core/report/formatTerminalReport.js +1 -1
  133. package/dist/halal-core/report/formatTerminalReport.js.map +1 -1
  134. package/dist/halal-core/report/generateHalalReport.d.ts +4 -2
  135. package/dist/halal-core/report/generateHalalReport.js +5 -7
  136. package/dist/halal-core/report/generateHalalReport.js.map +1 -1
  137. package/dist/halal-core/report/signReport.d.ts +4 -2
  138. package/dist/halal-core/report/signReport.js +2 -1
  139. package/dist/halal-core/report/signReport.js.map +1 -1
  140. package/dist/halal-core/report/verifyReport.d.ts +5 -3
  141. package/dist/halal-core/report/verifyReport.js +4 -3
  142. package/dist/halal-core/report/verifyReport.js.map +1 -1
  143. package/dist/halal-core/review/createReviewRequest.d.ts +3 -1
  144. package/dist/halal-core/review/createReviewRequest.js +3 -3
  145. package/dist/halal-core/review/createReviewRequest.js.map +1 -1
  146. package/dist/halal-core/review/reviewPolicy.d.ts +4 -3
  147. package/dist/halal-core/review/reviewPolicy.js +1 -1
  148. package/dist/halal-core/review/reviewPolicy.js.map +1 -1
  149. package/dist/halal-core/review/signedReviewFile.d.ts +6 -4
  150. package/dist/halal-core/review/signedReviewFile.js +2 -1
  151. package/dist/halal-core/review/signedReviewFile.js.map +1 -1
  152. package/dist/halal-core/review/verifyReviewApproval.d.ts +3 -2
  153. package/dist/halal-core/review/verifyReviewApproval.js +2 -1
  154. package/dist/halal-core/review/verifyReviewApproval.js.map +1 -1
  155. package/dist/halal-core/rules/adultContentRules.d.ts +3 -2
  156. package/dist/halal-core/rules/adultContentRules.js +1 -1
  157. package/dist/halal-core/rules/adultContentRules.js.map +1 -1
  158. package/dist/halal-core/rules/alcoholDrugVapeRules.d.ts +3 -2
  159. package/dist/halal-core/rules/alcoholDrugVapeRules.js +1 -1
  160. package/dist/halal-core/rules/alcoholDrugVapeRules.js.map +1 -1
  161. package/dist/halal-core/rules/childSafetyRules.d.ts +3 -2
  162. package/dist/halal-core/rules/childSafetyRules.js +1 -1
  163. package/dist/halal-core/rules/childSafetyRules.js.map +1 -1
  164. package/dist/halal-core/rules/coreCategories.d.ts +3 -2
  165. package/dist/halal-core/rules/coreCategories.js +1 -1
  166. package/dist/halal-core/rules/coreCategories.js.map +1 -1
  167. package/dist/halal-core/rules/cyberAbuseRules.d.ts +3 -2
  168. package/dist/halal-core/rules/cyberAbuseRules.js +1 -1
  169. package/dist/halal-core/rules/cyberAbuseRules.js.map +1 -1
  170. package/dist/halal-core/rules/defaultBlockedRules.d.ts +3 -1
  171. package/dist/halal-core/rules/defaultBlockedRules.js +9 -11
  172. package/dist/halal-core/rules/defaultBlockedRules.js.map +1 -1
  173. package/dist/halal-core/rules/dependencyRules.d.ts +3 -2
  174. package/dist/halal-core/rules/dependencyRules.js +1 -1
  175. package/dist/halal-core/rules/dependencyRules.js.map +1 -1
  176. package/dist/halal-core/rules/endpointRules.d.ts +3 -2
  177. package/dist/halal-core/rules/endpointRules.js +1 -1
  178. package/dist/halal-core/rules/endpointRules.js.map +1 -1
  179. package/dist/halal-core/rules/environmentalHarmRules.d.ts +3 -2
  180. package/dist/halal-core/rules/environmentalHarmRules.js +1 -1
  181. package/dist/halal-core/rules/environmentalHarmRules.js.map +1 -1
  182. package/dist/halal-core/rules/financeRibaRules.d.ts +3 -2
  183. package/dist/halal-core/rules/financeRibaRules.js +1 -1
  184. package/dist/halal-core/rules/financeRibaRules.js.map +1 -1
  185. package/dist/halal-core/rules/gamblingRules.d.ts +3 -2
  186. package/dist/halal-core/rules/gamblingRules.js +1 -1
  187. package/dist/halal-core/rules/gamblingRules.js.map +1 -1
  188. package/dist/halal-core/rules/generalHarmRules.d.ts +3 -2
  189. package/dist/halal-core/rules/generalHarmRules.js +1 -1
  190. package/dist/halal-core/rules/generalHarmRules.js.map +1 -1
  191. package/dist/halal-core/rules/healthHarmRules.d.ts +3 -2
  192. package/dist/halal-core/rules/healthHarmRules.js +1 -1
  193. package/dist/halal-core/rules/healthHarmRules.js.map +1 -1
  194. package/dist/halal-core/rules/keywordRules.d.ts +2 -1
  195. package/dist/halal-core/rules/keywordRules.js +1 -1
  196. package/dist/halal-core/rules/keywordRules.js.map +1 -1
  197. package/dist/halal-core/rules/privacyAbuseRules.d.ts +3 -2
  198. package/dist/halal-core/rules/privacyAbuseRules.js +1 -1
  199. package/dist/halal-core/rules/privacyAbuseRules.js.map +1 -1
  200. package/dist/halal-core/rules/scamFraudRules.d.ts +3 -2
  201. package/dist/halal-core/rules/scamFraudRules.js +1 -1
  202. package/dist/halal-core/rules/scamFraudRules.js.map +1 -1
  203. package/dist/halal-core/rules/selfHarmRules.d.ts +3 -2
  204. package/dist/halal-core/rules/selfHarmRules.js +1 -1
  205. package/dist/halal-core/rules/selfHarmRules.js.map +1 -1
  206. package/dist/halal-core/rules/violenceExtremismRules.d.ts +3 -2
  207. package/dist/halal-core/rules/violenceExtremismRules.js +1 -1
  208. package/dist/halal-core/rules/violenceExtremismRules.js.map +1 -1
  209. package/dist/halal-core/runtime/guard.d.ts +5 -3
  210. package/dist/halal-core/runtime/guard.js +2 -1
  211. package/dist/halal-core/runtime/guard.js.map +1 -1
  212. package/dist/halal-core/runtime/index.js +2 -1
  213. package/dist/halal-core/runtime/reviewedMemory.d.ts +6 -4
  214. package/dist/halal-core/runtime/reviewedMemory.js +3 -2
  215. package/dist/halal-core/runtime/reviewedMemory.js.map +1 -1
  216. package/dist/halal-core/runtime/serializeRuntimeContent.d.ts +7 -5
  217. package/dist/halal-core/runtime/serializeRuntimeContent.js +4 -3
  218. package/dist/halal-core/runtime/serializeRuntimeContent.js.map +1 -1
  219. package/dist/halal-core/runtime/types.d.ts +11 -9
  220. package/dist/halal-core/runtime/types.js +1 -1
  221. package/dist/halal-core/scanner/scanApiRoutes.d.ts +2 -1
  222. package/dist/halal-core/scanner/scanApiRoutes.js +2 -1
  223. package/dist/halal-core/scanner/scanApiRoutes.js.map +1 -1
  224. package/dist/halal-core/scanner/scanComponents.d.ts +2 -1
  225. package/dist/halal-core/scanner/scanComponents.js +2 -1
  226. package/dist/halal-core/scanner/scanComponents.js.map +1 -1
  227. package/dist/halal-core/scanner/scanContent.d.ts +3 -2
  228. package/dist/halal-core/scanner/scanContent.js +4 -3
  229. package/dist/halal-core/scanner/scanContent.js.map +1 -1
  230. package/dist/halal-core/scanner/scanDependencies.d.ts +2 -1
  231. package/dist/halal-core/scanner/scanDependencies.js +2 -1
  232. package/dist/halal-core/scanner/scanDependencies.js.map +1 -1
  233. package/dist/halal-core/scanner/scanDomains.d.ts +2 -1
  234. package/dist/halal-core/scanner/scanDomains.js +1 -1
  235. package/dist/halal-core/scanner/scanDomains.js.map +1 -1
  236. package/dist/halal-core/scanner/scanEnvNames.d.ts +2 -1
  237. package/dist/halal-core/scanner/scanEnvNames.js +2 -1
  238. package/dist/halal-core/scanner/scanEnvNames.js.map +1 -1
  239. package/dist/halal-core/scanner/scanMetadata.d.ts +3 -2
  240. package/dist/halal-core/scanner/scanMetadata.js +2 -1
  241. package/dist/halal-core/scanner/scanMetadata.js.map +1 -1
  242. package/dist/halal-core/scanner/scanPages.d.ts +2 -1
  243. package/dist/halal-core/scanner/scanPages.js +2 -1
  244. package/dist/halal-core/scanner/scanPages.js.map +1 -1
  245. package/dist/halal-core/scanner/scanProject.d.ts +4 -2
  246. package/dist/halal-core/scanner/scanProject.js +2 -1
  247. package/dist/halal-core/scanner/scanProject.js.map +1 -1
  248. package/dist/halal-core/scanner/scanRoutes.d.ts +2 -1
  249. package/dist/halal-core/scanner/scanRoutes.js +2 -1
  250. package/dist/halal-core/scanner/scanRoutes.js.map +1 -1
  251. package/dist/halal-core/scanner/scanTranslations.d.ts +2 -1
  252. package/dist/halal-core/scanner/scanTranslations.js +2 -1
  253. package/dist/halal-core/scanner/scanTranslations.js.map +1 -1
  254. package/dist/halal-core/status.d.ts +3 -2
  255. package/dist/halal-core/status.js +1 -1
  256. package/dist/halal-core/tamper/verifyCoreIntegrity.d.ts +2 -1
  257. package/dist/halal-core/tamper/verifyCoreIntegrity.js +2 -1
  258. package/dist/halal-core/tamper/verifyCoreIntegrity.js.map +1 -1
  259. package/dist/halal-core/tamper/verifyLifecycleHooks.d.ts +2 -1
  260. package/dist/halal-core/tamper/verifyLifecycleHooks.js +1 -1
  261. package/dist/halal-core/tamper/verifyLifecycleHooks.js.map +1 -1
  262. package/dist/halal-core/tamper/verifyReportSignature.d.ts +3 -1
  263. package/dist/halal-core/tamper/verifyReportSignature.js +3 -3
  264. package/dist/halal-core/tamper/verifyReportSignature.js.map +1 -1
  265. package/dist/halal.js +2 -1
  266. package/dist/i18n/index.d.ts +12 -11
  267. package/dist/i18n/index.js +5 -6
  268. package/dist/i18n/index.js.map +1 -1
  269. package/dist/i18n/shared.d.ts +15 -14
  270. package/dist/i18n/shared.js +4 -4
  271. package/dist/i18n/shared.js.map +1 -1
  272. package/dist/icons/index.d.ts +20 -18
  273. package/dist/icons/index.js +5 -4
  274. package/dist/icons/index.js.map +1 -1
  275. package/dist/index.d.ts +1 -1
  276. package/dist/index.js +2 -1
  277. package/dist/kit/index.d.ts +23 -21
  278. package/dist/kit/index.js +2 -1
  279. package/dist/kit/index.js.map +1 -1
  280. package/dist/nitro-server/index.d.ts +3 -2
  281. package/dist/nitro-server/index.js +1 -1
  282. package/dist/nitro-server/index.js.map +1 -1
  283. package/dist/node.d.ts +4 -2
  284. package/dist/node.js +7 -6
  285. package/dist/node.js.map +1 -1
  286. package/dist/reactivity/computed.d.ts +5 -3
  287. package/dist/reactivity/computed.js +3 -3
  288. package/dist/reactivity/computed.js.map +1 -1
  289. package/dist/reactivity/effect.d.ts +15 -13
  290. package/dist/reactivity/effect.js +9 -10
  291. package/dist/reactivity/effect.js.map +1 -1
  292. package/dist/reactivity/index.js +2 -1
  293. package/dist/reactivity/reactive.d.ts +6 -5
  294. package/dist/reactivity/reactive.js +5 -4
  295. package/dist/reactivity/reactive.js.map +1 -1
  296. package/dist/reactivity/readonly.js +2 -1
  297. package/dist/reactivity/ref.d.ts +9 -7
  298. package/dist/reactivity/ref.js +2 -4
  299. package/dist/reactivity/ref.js.map +1 -1
  300. package/dist/reactivity/scheduler.d.ts +5 -4
  301. package/dist/reactivity/scheduler.js +1 -1
  302. package/dist/reactivity/scheduler.js.map +1 -1
  303. package/dist/reactivity/types.d.ts +12 -11
  304. package/dist/reactivity/types.js +1 -1
  305. package/dist/reactivity/utils.d.ts +10 -9
  306. package/dist/reactivity/utils.js +1 -1
  307. package/dist/reactivity/utils.js.map +1 -1
  308. package/dist/reactivity/watch.d.ts +4 -2
  309. package/dist/reactivity/watch.js +4 -5
  310. package/dist/reactivity/watch.js.map +1 -1
  311. package/dist/runtime/core.d.ts +5 -4
  312. package/dist/runtime/core.js +9 -10
  313. package/dist/runtime/core.js.map +1 -1
  314. package/dist/runtime/index.d.ts +123 -122
  315. package/dist/runtime/index.js +45 -58
  316. package/dist/runtime/index.js.map +1 -1
  317. package/dist/runtime/reactivity.js +2 -1
  318. package/dist/runtime/resume.d.ts +15 -14
  319. package/dist/runtime/resume.js +3 -3
  320. package/dist/runtime/resume.js.map +1 -1
  321. package/dist/runtime/router.d.ts +5 -4
  322. package/dist/runtime/router.js +1 -1
  323. package/dist/runtime/router.js.map +1 -1
  324. package/dist/runtime/streaming.d.ts +7 -6
  325. package/dist/runtime/streaming.js +3 -3
  326. package/dist/runtime/streaming.js.map +1 -1
  327. package/dist/security/media-fetch.d.ts +11 -10
  328. package/dist/security/media-fetch.js +5 -4
  329. package/dist/security/media-fetch.js.map +1 -1
  330. package/dist/security/path-boundary.d.ts +5 -4
  331. package/dist/security/path-boundary.js +2 -1
  332. package/dist/security/path-boundary.js.map +1 -1
  333. package/dist/ui/index.d.ts +195 -193
  334. package/dist/ui/index.js +7 -8
  335. package/dist/ui/index.js.map +1 -1
  336. package/dist/vite-builder/index.d.ts +3 -2
  337. package/dist/vite-builder/index.js +1 -1
  338. package/dist/vite-builder/index.js.map +1 -1
  339. package/package.json +2 -2
@@ -1,27 +1,29 @@
1
1
  import { ResuxModuleDefinition } from "../kit/index.js";
2
+ import * as vue0 from "vue";
3
+
2
4
  //#region src/icons/index.d.ts
3
- export interface ResuxIconsModuleOptions {
5
+ interface ResuxIconsModuleOptions {
4
6
  collections?: string[];
5
7
  component?: string;
6
8
  mode?: "css" | "svg";
7
9
  apiProvider?: string;
8
10
  lazy?: boolean;
9
11
  }
10
- export declare function defineIconCollections(collections: string[]): ResuxIconsModuleOptions;
11
- export interface IconPathData {
12
+ declare function defineIconCollections(collections: string[]): ResuxIconsModuleOptions;
13
+ interface IconPathData {
12
14
  d: string;
13
15
  opacity?: string;
14
16
  }
15
- export interface IconData {
17
+ interface IconData {
16
18
  path?: string;
17
19
  paths?: IconPathData[];
18
20
  opacity?: string;
19
21
  viewBox?: string;
20
22
  }
21
- export declare const iconRegistry: Record<string, IconData>;
22
- export declare function normalizeIconApiProvider(value: unknown): string;
23
- export declare function fetchIconifyIcon(name: string, apiProvider?: string): Promise<IconData | null>;
24
- export declare const Icon: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
23
+ declare const iconRegistry: Record<string, IconData>;
24
+ declare function normalizeIconApiProvider(value: unknown): string;
25
+ declare function fetchIconifyIcon(name: string, apiProvider?: string): Promise<IconData | null>;
26
+ declare const Icon: vue0.DefineComponent<vue0.ExtractPropTypes<{
25
27
  name: {
26
28
  type: StringConstructor;
27
29
  required: true;
@@ -50,9 +52,9 @@ export declare const Icon: import("vue").DefineComponent<import("vue").ExtractPr
50
52
  type: StringConstructor;
51
53
  default: string;
52
54
  };
53
- }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
55
+ }>, () => vue0.VNode<vue0.RendererNode, vue0.RendererElement, {
54
56
  [key: string]: any;
55
- }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
57
+ }>, {}, {}, {}, vue0.ComponentOptionsMixin, vue0.ComponentOptionsMixin, {}, string, vue0.PublicProps, Readonly<vue0.ExtractPropTypes<{
56
58
  name: {
57
59
  type: StringConstructor;
58
60
  required: true;
@@ -82,14 +84,14 @@ export declare const Icon: import("vue").DefineComponent<import("vue").ExtractPr
82
84
  default: string;
83
85
  };
84
86
  }>> & Readonly<{}>, {
87
+ lazy: boolean;
85
88
  size: string | number;
86
89
  mode: string;
87
- lazy: boolean;
88
90
  loading: string;
89
91
  apiProvider: string;
90
92
  class: string;
91
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
92
- export declare const ResuxIcon: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
93
+ }, {}, {}, {}, string, vue0.ComponentProvideOptions, true, {}, any>;
94
+ declare const ResuxIcon: vue0.DefineComponent<vue0.ExtractPropTypes<{
93
95
  name: {
94
96
  type: StringConstructor;
95
97
  required: true;
@@ -118,9 +120,9 @@ export declare const ResuxIcon: import("vue").DefineComponent<import("vue").Extr
118
120
  type: StringConstructor;
119
121
  default: string;
120
122
  };
121
- }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
123
+ }>, () => vue0.VNode<vue0.RendererNode, vue0.RendererElement, {
122
124
  [key: string]: any;
123
- }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
125
+ }>, {}, {}, {}, vue0.ComponentOptionsMixin, vue0.ComponentOptionsMixin, {}, string, vue0.PublicProps, Readonly<vue0.ExtractPropTypes<{
124
126
  name: {
125
127
  type: StringConstructor;
126
128
  required: true;
@@ -150,14 +152,14 @@ export declare const ResuxIcon: import("vue").DefineComponent<import("vue").Extr
150
152
  default: string;
151
153
  };
152
154
  }>> & Readonly<{}>, {
155
+ lazy: boolean;
153
156
  size: string | number;
154
157
  mode: string;
155
- lazy: boolean;
156
158
  loading: string;
157
159
  apiProvider: string;
158
160
  class: string;
159
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
161
+ }, {}, {}, {}, string, vue0.ComponentProvideOptions, true, {}, any>;
160
162
  declare const _default: ResuxModuleDefinition<ResuxIconsModuleOptions>;
161
163
  //#endregion
162
- export { _default as default };
164
+ export { Icon, IconData, IconPathData, ResuxIcon, ResuxIconsModuleOptions, _default as default, defineIconCollections, fetchIconifyIcon, iconRegistry, normalizeIconApiProvider };
163
165
  //# sourceMappingURL=index.d.ts.map
@@ -1,6 +1,7 @@
1
1
  import { useRuntimeConfig } from "../runtime/index.js";
2
2
  import { defineResuxModule } from "../kit/index.js";
3
3
  import { computed, defineComponent, h, onMounted, onUnmounted, ref, watch } from "vue";
4
+
4
5
  //#region src/icons/index.ts
5
6
  function defineIconCollections(collections) {
6
7
  return { collections };
@@ -57,7 +58,7 @@ const iconRegistry = {
57
58
  if (typeof globalThis !== "undefined") globalThis.__RESUX_ICON_REGISTRY__ = iconRegistry;
58
59
  const DEFAULT_ICON_API_PROVIDER = "https://api.iconify.design";
59
60
  const ICON_FETCH_TIMEOUT_MS = 1e4;
60
- const ICON_FETCH_MAX_BYTES = 262144;
61
+ const ICON_FETCH_MAX_BYTES = 256 * 1024;
61
62
  const ICON_FETCH_CACHE_MAX_ENTRIES = 256;
62
63
  const ICON_FETCH_MAX_IN_FLIGHT = 32;
63
64
  const ICON_FETCH_QUEUE_MAX_ENTRIES = 512;
@@ -88,8 +89,8 @@ async function readBoundedIconSvg(response) {
88
89
  if (Number.isFinite(contentLength) && contentLength > ICON_FETCH_MAX_BYTES) return null;
89
90
  }
90
91
  if (!response.body?.getReader) {
91
- const text = await response.text();
92
- return new TextEncoder().encode(text).byteLength <= ICON_FETCH_MAX_BYTES ? text : null;
92
+ const text$1 = await response.text();
93
+ return new TextEncoder().encode(text$1).byteLength <= ICON_FETCH_MAX_BYTES ? text$1 : null;
93
94
  }
94
95
  const reader = response.body.getReader();
95
96
  const decoder = new TextDecoder();
@@ -329,7 +330,7 @@ var icons_default = defineResuxModule({
329
330
  } } });
330
331
  }
331
332
  });
333
+
332
334
  //#endregion
333
335
  export { Icon, ResuxIcon, icons_default as default, defineIconCollections, fetchIconifyIcon, iconRegistry, normalizeIconApiProvider };
334
-
335
336
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/icons/index.ts"],"sourcesContent":["import { defineComponent, h, computed, ref, onMounted, onUnmounted, watch } from \"vue\";\nimport { defineResuxModule } from \"../kit/index.js\";\nimport { useRuntimeConfig } from \"../runtime/index.js\";\n\nexport interface ResuxIconsModuleOptions {\n collections?: string[];\n component?: string;\n mode?: \"css\" | \"svg\";\n apiProvider?: string;\n lazy?: boolean;\n}\n\nexport function defineIconCollections(collections: string[]): ResuxIconsModuleOptions {\n return { collections };\n}\n\nexport interface IconPathData {\n d: string;\n opacity?: string;\n}\n\nexport interface IconData {\n path?: string;\n paths?: IconPathData[];\n opacity?: string;\n viewBox?: string;\n}\n\nexport const iconRegistry: Record<string, IconData> = {\n \"material-symbols:call\": { path: \"M6.62 10.79a15.15 15.15 0 0 0 6.59 6.59l2.2-2.2a1 1 0 0 1 1.11-.27c1.12.37 2.33.57 3.57.57a1 1 0 0 1 1 1V20a1 1 0 0 1-1 1A17 17 0 0 1 3 4a1 1 0 0 1 1-1h3.5a1 1 0 0 1 1 1c0 1.25.2 2.45.57 3.57a1 1 0 0 1-.26 1.02l-2.2 2.2z\" },\n \"call\": { path: \"M6.62 10.79a15.15 15.15 0 0 0 6.59 6.59l2.2-2.2a1 1 0 0 1 1.11-.27c1.12.37 2.33.57 3.57.57a1 1 0 0 1 1 1V20a1 1 0 0 1-1 1A17 17 0 0 1 3 4a1 1 0 0 1 1-1h3.5a1 1 0 0 1 1 1c0 1.25.2 2.45.57 3.57a1 1 0 0 1-.26 1.02l-2.2 2.2z\" },\n \"material-symbols:mail\": { path: \"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5l-8-5V6l8 5l8-5v2z\" },\n \"material-symbols-light:mail-outline-sharp\": { path: \"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5l-8-5V6l8 5l8-5v2z\" },\n \"material-symbols:mail-outline\": { path: \"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5l-8-5V6l8 5l8-5v2z\" },\n \"mail\": { path: \"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5l-8-5V6l8 5l8-5v2z\" },\n \"material-symbols:location-on-outline-rounded\": { path: \"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5s-1.12 2.5-2.5 2.5z\" },\n \"location\": { path: \"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5s-1.12 2.5-2.5 2.5z\" },\n \"material-symbols:warning\": { path: \"M1 21h22L12 2L1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z\" },\n \"warning\": { path: \"M1 21h22L12 2L1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z\" },\n \"material-symbols:error\": { path: \"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10s10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z\" },\n \"error\": { path: \"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10s10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z\" },\n \"material-symbols:close\": { path: \"M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12z\" },\n \"close\": { path: \"M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12z\" },\n \"material-symbols:add\": { path: \"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z\" },\n \"add\": { path: \"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z\" },\n \"material-symbols:keyboard-arrow-down\": { path: \"m12 15.4l-6-6L7.4 8l4.6 4.6L16.6 8L18 9.4z\" },\n \"arrow-down\": { path: \"m12 15.4l-6-6L7.4 8l4.6 4.6L16.6 8L18 9.4z\" },\n \"mdi:facebook\": { path: \"M12 2.04C6.5 2.04 2 6.53 2 12.06C2 17.06 5.66 21.21 10.44 21.96V14.96H7.9V12.06H10.44V9.85C10.44 7.34 11.93 5.96 14.22 5.96C15.31 5.96 16.45 6.15 16.45 6.15V8.62H15.19C13.95 8.62 13.56 9.39 13.56 10.18V12.06H16.34L15.89 14.96H13.56V21.96A10 10 0 0 0 22 12.06C22 6.53 17.5 2.04 12 2.04Z\" },\n \"mdi:facebook-box\": { path: \"M19 3a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14m-.5 15.5v-5.3h-1.8v-2.2h1.8V9.3c0-1.8 1.1-2.8 2.7-2.8c.8 0 1.5.1 1.7.1v2h-1.2c-.9 0-1 .4-1 1v1.3h2.2l-.3 2.2h-1.9v5.3h-2.2z\" },\n \"facebook\": { path: \"M19 3a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14m-.5 15.5v-5.3h-1.8v-2.2h1.8V9.3c0-1.8 1.1-2.8 2.7-2.8c.8 0 1.5.1 1.7.1v2h-1.2c-.9 0-1 .4-1 1v1.3h2.2l-.3 2.2h-1.9v5.3h-2.2z\" },\n \"mingcute:instagram-fill\": { path: \"M16 3a5 5 0 0 1 5 5v8a5 5 0 0 1-5 5H8a5 5 0 0 1-5-5V8a5 5 0 0 1 5-5zm-4 5a4 4 0 1 0 0 8a4 4 0 0 0 0-8m0 2a2 2 0 1 1 0 4a2 2 0 0 1 0-4m4.5-3.5a1 1 0 1 0 0 2a1 1 0 0 0 0-2\" },\n \"instagram\": { path: \"M16 3a5 5 0 0 1 5 5v8a5 5 0 0 1-5 5H8a5 5 0 0 1-5-5V8a5 5 0 0 1 5-5zm-4 5a4 4 0 1 0 0 8a4 4 0 0 0 0-8m0 2a2 2 0 1 1 0 4a2 2 0 0 1 0-4m4.5-3.5a1 1 0 1 0 0 2a1 1 0 0 0 0-2\" },\n \"cib:linkedin\": { path: \"M27.26 27.271h-4.733v-7.427c0-1.771-.037-4.047-2.475-4.047c-2.468 0-2.844 1.921-2.844 3.916v7.557h-4.739V11.999h4.552v2.083h.061c.636-1.203 2.183-2.468 4.491-2.468c4.801 0 5.692 3.161 5.692 7.271v8.385zM7.115 9.912a2.75 2.75 0 0 1-2.751-2.756a2.753 2.753 0 1 1 2.751 2.756m2.374 17.359H4.74V12h4.749zM29.636 0H2.36C1.057 0 0 1.031 0 2.307v27.387c0 1.276 1.057 2.307 2.36 2.307h27.271c1.301 0 2.369-1.031 2.369-2.307V2.307C32 1.031 30.932 0 29.636 0z\" },\n \"lineicons:linkedin\": { path: \"M27.26 27.271h-4.733v-7.427c0-1.771-.037-4.047-2.475-4.047c-2.468 0-2.844 1.921-2.844 3.916v7.557h-4.739V11.999h4.552v2.083h.061c.636-1.203 2.183-2.468 4.491-2.468c4.801 0 5.692 3.161 5.692 7.271v8.385zM7.115 9.912a2.75 2.75 0 0 1-2.751-2.756a2.753 2.753 0 1 1 2.751 2.756m2.374 17.359H4.74V12h4.749zM29.636 0H2.36C1.057 0 0 1.031 0 2.307v27.387c0 1.276 1.057 2.307 2.36 2.307h27.271c1.301 0 2.369-1.031 2.369-2.307V2.307C32 1.031 30.932 0 29.636 0z\" },\n \"linkedin\": { path: \"M27.26 27.271h-4.733v-7.427c0-1.771-.037-4.047-2.475-4.047c-2.468 0-2.844 1.921-2.844 3.916v7.557h-4.739V11.999h4.552v2.083h.061c.636-1.203 2.183-2.468 4.491-2.468c4.801 0 5.692 3.161 5.692 7.271v8.385zM7.115 9.912a2.75 2.75 0 0 1-2.751-2.756a2.753 2.753 0 1 1 2.751 2.756m2.374 17.359H4.74V12h4.749zM29.636 0H2.36C1.057 0 0 1.031 0 2.307v27.387c0 1.276 1.057 2.307 2.36 2.307h27.271c1.301 0 2.369-1.031 2.369-2.307V2.307C32 1.031 30.932 0 29.636 0z\" },\n \"uil:youtube\": { path: \"M23 9.71a8.5 8.5 0 0 0-.91-4.13a2.92 2.92 0 0 0-1.72-1A78 78 0 0 0 12 4.27a79 79 0 0 0-8.34.3a2.87 2.87 0 0 0-1.46.74c-.9.83-1 2.25-1.1 3.45a48 48 0 0 0 0 6.48a9.6 9.6 0 0 0 .3 2a3.14 3.14 0 0 0 .71 1.36a2.86 2.86 0 0 0 1.49.78a45 45 0 0 0 6.5.33c3.5.05 6.57 0 10.2-.28a2.9 2.9 0 0 0 1.53-.78a2.5 2.5 0 0 0 .61-1a10.6 10.6 0 0 0 .52-3.4c.04-.56.04-3.94.04-4.54M9.74 14.85V8.66l5.92 3.11c-1.66.92-3.85 1.96-5.92 3.08\" },\n \"youtube\": { path: \"M23 9.71a8.5 8.5 0 0 0-.91-4.13a2.92 2.92 0 0 0-1.72-1A78 78 0 0 0 12 4.27a79 79 0 0 0-8.34.3a2.87 2.87 0 0 0-1.46.74c-.9.83-1 2.25-1.1 3.45a48 48 0 0 0 0 6.48a9.6 9.6 0 0 0 .3 2a3.14 3.14 0 0 0 .71 1.36a2.86 2.86 0 0 0 1.49.78a45 45 0 0 0 6.5.33c3.5.05 6.57 0 10.2-.28a2.9 2.9 0 0 0 1.53-.78a2.5 2.5 0 0 0 .61-1a10.6 10.6 0 0 0 .52-3.4c.04-.56.04-3.94.04-4.54M9.74 14.85V8.66l5.92 3.11c-1.66.92-3.85 1.96-5.92 3.08\" },\n \"line-md:twitter-x\": { path: \"M18.244 2.25h3.308l-7.227 8.26l8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z\" },\n \"twitter\": { path: \"M18.244 2.25h3.308l-7.227 8.26l8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z\" },\n \"ic:baseline-whatsapp\": { path: \"M12.04 2c-5.46 0-9.91 4.45-9.91 9.91c0 1.75.46 3.45 1.32 4.95L2.05 22l5.25-1.38c1.45.79 3.08 1.21 4.74 1.21c5.46 0 9.91-4.45 9.91-9.91c0-2.65-1.03-5.14-2.9-7.01A9.816 9.816 0 0 0 12.04 2zm.01 1.67c4.55 0 8.25 3.7 8.25 8.25c0 4.55-3.7 8.25-8.25 8.25c-1.47 0-2.88-.39-4.12-1.12l-.3-.18l-3.07.81l.82-2.99l-.19-.31A8.204 8.204 0 0 1 3.8 11.92c0-4.55 3.7-8.25 8.25-8.25z\" },\n \"streamline:interface-validation-check-circle-checkmark-addition-circle-success-check-validation-add-form\": { path: \"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10s10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5l1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z\" },\n \"ph:check-circle-thin\": { path: \"M12 2a10 10 0 1 0 10 10A10.011 10.011 0 0 0 12 2zm0 19a9 9 0 1 1 9-9a9.01 9.01 0 0 1-9 9zm4.53-11.47a.5.5 0 0 1 0 .71l-5 5a.5.5 0 0 1-.71 0l-2.5-2.5a.5.5 0 1 1 .71-.71L11.17 14.4l4.65-4.65a.5.5 0 0 1 .71 0z\" },\n \"solar:check-circle-linear\": { path: \"M12 2a10 10 0 1 0 10 10A10.011 10.011 0 0 0 12 2zm0 19a9 9 0 1 1 9-9a9.01 9.01 0 0 1-9 9zm4.53-11.47a.5.5 0 0 1 0 .71l-5 5a.5.5 0 0 1-.71 0l-2.5-2.5a.5.5 0 1 1 .71-.71L11.17 14.4l4.65-4.65a.5.5 0 0 1 .71 0z\" },\n \"lucide-lab:flower-lotus\": { path: \"M12 21c-4.418 0-8-3.582-8-8c0-3.5 3.5-7 8-11c4.5 4 8 7.5 8 11c0 4.418-3.582 8-8 8z\" },\n \"solar:leaf-outline\": { path: \"M12 21c-4.418 0-8-3.582-8-8c0-3.5 3.5-7 8-11c4.5 4 8 7.5 8 11c0 4.418-3.582 8-8 8z\" },\n \"solar:command-linear\": { path: \"M8.5 5A3.5 3.5 0 0 0 5 8.5v.5A3.5 3.5 0 0 0 8.5 12.5H9v-1h-.5A2.5 2.5 0 0 1 6 9v-.5A2.5 2.5 0 0 1 8.5 6H9V5h-.5zm7 0H15v1h.5a2.5 2.5 0 0 1 2.5 2.5v.5a2.5 2.5 0 0 1-2.5 2.5H15v1h.5a3.5 3.5 0 0 0 3.5-3.5v-.5A3.5 3.5 0 0 0 15.5 5z\" },\n \"gg:mouse\": { path: \"M12 5a1 1 0 0 0-1 1v4a1 1 0 1 0 2 0V6a1 1 0 0 0-1-1M4 8a8 8 0 1 1 16 0v8a8 8 0 1 1-16 0zm14 0v8a6 6 0 0 1-12 0V8a6 6 0 1 1 12 0\" },\n \"mouse\": { path: \"M12 5a1 1 0 0 0-1 1v4a1 1 0 1 0 2 0V6a1 1 0 0 0-1-1M4 8a8 8 0 1 1 16 0v8a8 8 0 1 1-16 0zm14 0v8a6 6 0 0 1-12 0V8a6 6 0 1 1 12 0\" },\n \"iconoir:flash\": { path: \"M13 10V3L5 14h6v7l8-11z\" },\n \"flash\": { path: \"M13 10V3L5 14h6v7l8-11z\" },\n \"hugeicons:search-01\": { path: \"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5A6.5 6.5 0 1 0 9.5 16a6.471 6.471 0 0 0 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5S14 7.01 14 9.5S11.99 14 9.5 14z\" },\n \"search\": { path: \"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5A6.5 6.5 0 1 0 9.5 16a6.471 6.471 0 0 0 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5S14 7.01 14 9.5S11.99 14 9.5 14z\" },\n \"solar:info-circle-outline\": { path: \"M12 17.75a.75.75 0 0 0 .75-.75v-6a.75.75 0 0 0-1.5 0v6c0 .414.336.75.75.75M12 7a1 1 0 1 1 0 2a1 1 0 0 1 0-2M1.25 12C1.25 6.063 6.063 1.25 12 1.25S22.75 6.063 22.75 12S17.937 22.75 12 22.75S1.25 17.937 1.25 12M12 2.75a9.25 9.25 0 1 0 0 18.5a9.25 9.25 0 0 0 0-18.5\" },\n \"ic:sharp-tag-faces\": { path: \"M12.01 2C6.49 2 2.02 6.48 2.02 12s4.47 10 9.99 10c5.53 0 10.01-4.48 10.01-10S17.54 2 12.01 2m.01 18c-4.42 0-8-3.58-8-8s3.58-8 8-8s8 3.58 8 8s-3.58 8-8 8m3.5-9c.83 0 1.5-.67 1.5-1.5S16.35 8 15.52 8s-1.5.67-1.5 1.5s.67 1.5 1.5 1.5m-7 0c.83 0 1.5-.67 1.5-1.5S9.35 8 8.52 8s-1.5.67-1.5 1.5s.67 1.5 1.5 1.5m3.5 6.5c2.33 0 4.31-1.46 5.11-3.5H6.91c.8 2.04 2.78 3.5 5.11 3.5\" },\n \"hamburger\": { path: \"M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z\" },\n \"svg-spinners:ring-resize\": { path: \"M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2zm0 18a8 8 0 1 1 8-8 8 8 0 0 1-8 8z\" }\n};\n\nif (typeof globalThis !== \"undefined\") {\n (globalThis as any).__RESUX_ICON_REGISTRY__ = iconRegistry;\n}\n\nconst DEFAULT_ICON_API_PROVIDER = \"https://api.iconify.design\";\nconst ICON_FETCH_TIMEOUT_MS = 10_000;\nconst ICON_FETCH_MAX_BYTES = 256 * 1024;\nconst ICON_FETCH_CACHE_MAX_ENTRIES = 256;\nconst ICON_FETCH_MAX_IN_FLIGHT = 32;\nconst ICON_FETCH_QUEUE_MAX_ENTRIES = 512;\nconst pendingFetches = new Map<string, Promise<IconData | null>>();\nconst fetchedIconCache = new Map<string, IconData>();\nconst iconFetchQueue: Array<() => void> = [];\nlet activeIconFetches = 0;\n\nfunction stripTrailingSlashes(value: string): string {\n let end = value.length;\n while (end > 0 && value.charCodeAt(end - 1) === 47) {\n end -= 1;\n }\n return value.slice(0, end);\n}\n\nexport function normalizeIconApiProvider(value: unknown): string {\n const raw = typeof value === \"string\" ? stripTrailingSlashes(value.trim()) : \"\";\n if (!raw) {\n return DEFAULT_ICON_API_PROVIDER;\n }\n if (raw.startsWith(\"//\")) {\n return DEFAULT_ICON_API_PROVIDER;\n }\n if (raw.startsWith(\"/\")) {\n return raw;\n }\n try {\n const url = new URL(raw);\n if (url.protocol === \"https:\" || url.protocol === \"http:\") {\n return stripTrailingSlashes(url.toString());\n }\n } catch {\n // Fall back to the public provider for malformed values.\n }\n return DEFAULT_ICON_API_PROVIDER;\n}\n\nasync function readBoundedIconSvg(response: Response): Promise<string | null> {\n const rawLength = response.headers?.get?.(\"content-length\");\n if (rawLength) {\n const contentLength = Number(rawLength);\n if (Number.isFinite(contentLength) && contentLength > ICON_FETCH_MAX_BYTES) {\n return null;\n }\n }\n\n if (!response.body?.getReader) {\n const text = await response.text();\n return new TextEncoder().encode(text).byteLength <= ICON_FETCH_MAX_BYTES ? text : null;\n }\n\n const reader = response.body.getReader();\n const decoder = new TextDecoder();\n let totalBytes = 0;\n let text = \"\";\n try {\n while (true) {\n const { done, value } = await reader.read();\n if (done) break;\n totalBytes += value.byteLength;\n if (totalBytes > ICON_FETCH_MAX_BYTES) {\n await reader.cancel().catch(() => undefined);\n return null;\n }\n text += decoder.decode(value, { stream: true });\n }\n text += decoder.decode();\n return text;\n } finally {\n reader.releaseLock();\n }\n}\n\nfunction readFetchedIcon(cacheKey: string): IconData | undefined {\n const cached = fetchedIconCache.get(cacheKey);\n if (!cached) return undefined;\n fetchedIconCache.delete(cacheKey);\n fetchedIconCache.set(cacheKey, cached);\n return cached;\n}\n\nfunction rememberFetchedIcon(cacheKey: string, data: IconData): void {\n fetchedIconCache.delete(cacheKey);\n fetchedIconCache.set(cacheKey, data);\n while (fetchedIconCache.size > ICON_FETCH_CACHE_MAX_ENTRIES) {\n const oldestKey = fetchedIconCache.keys().next().value;\n if (oldestKey === undefined) break;\n fetchedIconCache.delete(oldestKey);\n }\n}\n\nfunction runWithIconFetchSlot(\n task: () => Promise<IconData | null>,\n): Promise<IconData | null> {\n if (activeIconFetches >= ICON_FETCH_MAX_IN_FLIGHT\n && iconFetchQueue.length >= ICON_FETCH_QUEUE_MAX_ENTRIES) {\n return Promise.resolve(null);\n }\n\n return new Promise((resolve) => {\n const run = () => {\n activeIconFetches += 1;\n void task()\n .then(resolve, () => resolve(null))\n .finally(() => {\n activeIconFetches = Math.max(0, activeIconFetches - 1);\n iconFetchQueue.shift()?.();\n });\n };\n if (activeIconFetches < ICON_FETCH_MAX_IN_FLIGHT) {\n run();\n } else {\n iconFetchQueue.push(run);\n }\n });\n}\n\nexport function fetchIconifyIcon(\n name: string,\n apiProvider: string = DEFAULT_ICON_API_PROVIDER,\n): Promise<IconData | null> {\n const normalized = String(name || \"\").trim().toLowerCase();\n if (!normalized || normalized.length > 256) return Promise.resolve(null);\n if (iconRegistry[normalized]) {\n return Promise.resolve(iconRegistry[normalized]);\n }\n\n const parts = normalized.split(\":\");\n if (parts.length !== 2 || !parts[0] || !parts[1]) {\n return Promise.resolve(null);\n }\n\n const provider = normalizeIconApiProvider(apiProvider);\n const cacheKey = provider + \"::\" + normalized;\n const cached = readFetchedIcon(cacheKey);\n if (cached) {\n return Promise.resolve(cached);\n }\n const pending = pendingFetches.get(cacheKey);\n if (pending) {\n return pending;\n }\n const prefix = parts[0];\n const iconName = parts[1];\n const url = provider + \"/\" + encodeURIComponent(prefix) + \"/\" + encodeURIComponent(iconName) + \".svg\";\n\n const fetchPromise = runWithIconFetchSlot(async () => {\n const controller = typeof AbortController === \"function\" ? new AbortController() : null;\n const timeout = setTimeout(() => controller?.abort(), ICON_FETCH_TIMEOUT_MS);\n try {\n const response = await fetch(url, controller ? { signal: controller.signal } : undefined);\n if (!response.ok) return null;\n const svgText = await readBoundedIconSvg(response);\n if (!svgText) return null;\n const viewBox = readSvgAttribute(svgText, \"viewBox\") || \"0 0 24 24\";\n const paths = [...svgText.matchAll(/<path\\b[^>]*>/gi)]\n .slice(0, 128)\n .map((match) => ({\n d: readSvgAttribute(match[0], \"d\").slice(0, 65_536),\n opacity: readSvgAttribute(match[0], \"opacity\") || undefined,\n }))\n .filter((entry) => Boolean(entry.d));\n if (!paths.length) {\n return null;\n }\n const data: IconData = {\n path: paths[0].d,\n paths,\n viewBox,\n };\n rememberFetchedIcon(cacheKey, data);\n return data;\n } catch {\n return null;\n } finally {\n clearTimeout(timeout);\n }\n }).finally(() => {\n pendingFetches.delete(cacheKey);\n });\n\n pendingFetches.set(cacheKey, fetchPromise);\n return fetchPromise;\n}\n\nfunction readSvgAttribute(source: string, name: string): string {\n const escapedName = name.replace(/[.*+?^${}()|[\\]\\\\]/g, String.raw`\\$&`);\n const match = new RegExp(\n String.raw`\\b${escapedName}\\s*=\\s*(?:\"([^\"]*)\"|'([^']*)')`,\n \"i\",\n ).exec(source);\n return (match?.[1] ?? match?.[2] ?? \"\").trim();\n}\n\nexport const Icon = defineComponent({\n name: \"ResuxIcon\",\n props: {\n name: { type: String, required: true },\n size: { type: [String, Number], default: \"1.25rem\" },\n mode: { type: String, default: \"svg\" },\n lazy: { type: Boolean, default: false },\n loading: { type: String, default: \"eager\" },\n apiProvider: { type: String, default: \"\" },\n class: { type: String, default: \"\" }\n },\n setup(props, { attrs }) {\n const iconRef = ref<HTMLElement | null>(null);\n const isVisible = ref(false);\n const iconName = computed(() => String(props.name || \"\").trim().toLowerCase());\n const runtimeConfig = useRuntimeConfig();\n const configuredProvider = (runtimeConfig.public?.icons as { apiProvider?: unknown } | undefined)?.apiProvider;\n const apiProvider = computed(() => normalizeIconApiProvider(props.apiProvider || configuredProvider));\n const dynamicData = ref<IconData | null>(null);\n\n const isLazy = computed(() => props.lazy || props.loading === \"lazy\");\n\n const iconData = computed<IconData>(() => {\n if (iconRegistry[iconName.value]) {\n return iconRegistry[iconName.value];\n }\n if (dynamicData.value) {\n return dynamicData.value;\n }\n return {\n path: \"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2S2 6.477 2 12s4.477 10 10 10zm0-2a8 8 0 1 1 0-16 8 8 0 0 1 0 16z\",\n opacity: \".35\",\n viewBox: \"0 0 24 24\"\n };\n });\n\n let requestRevision = 0;\n const loadDynamicIcon = () => {\n const requestedName = iconName.value;\n const requestedProvider = apiProvider.value;\n const revision = ++requestRevision;\n if (iconRegistry[requestedName]) {\n return;\n }\n fetchIconifyIcon(requestedName, requestedProvider).then((result) => {\n if (\n result\n && revision === requestRevision\n && requestedName === iconName.value\n && requestedProvider === apiProvider.value\n ) {\n dynamicData.value = result;\n }\n });\n };\n\n let observer: IntersectionObserver | null = null;\n\n onMounted(() => {\n if (isLazy.value && typeof window !== \"undefined\" && \"IntersectionObserver\" in window) {\n observer = new IntersectionObserver(\n (entries) => {\n if (entries.some((entry) => entry.isIntersecting)) {\n isVisible.value = true;\n loadDynamicIcon();\n if (observer && iconRef.value) {\n observer.unobserve(iconRef.value);\n }\n }\n },\n { rootMargin: \"100px\" }\n );\n if (iconRef.value) {\n observer.observe(iconRef.value);\n }\n } else {\n isVisible.value = true;\n loadDynamicIcon();\n }\n });\n\n onUnmounted(() => {\n requestRevision += 1;\n if (observer) {\n observer.disconnect();\n }\n });\n\n watch([iconName, apiProvider], () => {\n dynamicData.value = null;\n if (!isLazy.value || isVisible.value) {\n loadDynamicIcon();\n }\n });\n\n const sizeValue = computed(() =>\n typeof props.size === \"number\" ? `${props.size}px` : (String(props.size || \"\").trim() || \"1.25rem\")\n );\n\n return () => {\n const data = iconData.value;\n return h(\n \"svg\",\n {\n ref: iconRef,\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: data.viewBox || \"0 0 24 24\",\n width: sizeValue.value,\n height: sizeValue.value,\n fill: \"currentColor\",\n class: [\"inline-block shrink-0 align-middle\", props.class].filter(Boolean).join(\" \"),\n style: { width: sizeValue.value, height: sizeValue.value },\n \"aria-hidden\": \"true\",\n \"data-icon-name\": props.name,\n \"data-icon-lazy\": isLazy.value ? \"true\" : \"false\",\n ...attrs\n },\n (data.paths?.length ? data.paths : [{ d: data.path || \"\", opacity: data.opacity }])\n .map((entry, index) => h(\"path\", {\n key: index,\n d: entry.d,\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n opacity: entry.opacity || \"1\"\n }))\n );\n };\n }\n});\n\nexport const ResuxIcon = Icon;\n\nexport default defineResuxModule<ResuxIconsModuleOptions>({\n defaults: {\n collections: [],\n component: \"Icon\",\n mode: \"svg\",\n apiProvider: DEFAULT_ICON_API_PROVIDER,\n lazy: false\n },\n setup(options, resux) {\n const collections = Array.isArray(options.collections)\n ? [...new Set(options.collections.map((entry) => String(entry).trim()).filter(Boolean))]\n : [];\n resux.extendRuntimeConfig({\n public: {\n icons: {\n component: typeof options.component === \"string\" ? options.component : \"Icon\",\n collections,\n mode: options.mode || \"svg\",\n apiProvider: normalizeIconApiProvider(options.apiProvider),\n lazy: options.lazy === true\n }\n }\n });\n }\n});\n"],"mappings":";;;;AAYA,SAAgB,sBAAsB,aAAgD;CACpF,OAAO,EAAE,YAAY;AACvB;AAcA,MAAa,eAAyC;CACpD,yBAAyB,EAAE,MAAM,+NAA+N;CAChQ,QAAQ,EAAE,MAAM,+NAA+N;CAC/O,yBAAyB,EAAE,MAAM,iHAAiH;CAClJ,6CAA6C,EAAE,MAAM,iHAAiH;CACtK,iCAAiC,EAAE,MAAM,iHAAiH;CAC1J,QAAQ,EAAE,MAAM,iHAAiH;CACjI,gDAAgD,EAAE,MAAM,8JAA8J;CACtN,YAAY,EAAE,MAAM,8JAA8J;CAClL,4BAA4B,EAAE,MAAM,qDAAqD;CACzF,WAAW,EAAE,MAAM,qDAAqD;CACxE,0BAA0B,EAAE,MAAM,mGAAmG;CACrI,SAAS,EAAE,MAAM,mGAAmG;CACpH,0BAA0B,EAAE,MAAM,wGAAwG;CAC1I,SAAS,EAAE,MAAM,wGAAwG;CACzH,wBAAwB,EAAE,MAAM,sCAAsC;CACtE,OAAO,EAAE,MAAM,sCAAsC;CACrD,wCAAwC,EAAE,MAAM,6CAA6C;CAC7F,cAAc,EAAE,MAAM,6CAA6C;CACnE,gBAAgB,EAAE,MAAM,gSAAgS;CACxT,oBAAoB,EAAE,MAAM,sMAAsM;CAClO,YAAY,EAAE,MAAM,sMAAsM;CAC1N,2BAA2B,EAAE,MAAM,4KAA4K;CAC/M,aAAa,EAAE,MAAM,4KA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AAK,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;IACnF,OAAO;KAAE,OAAO,UAAU;KAAO,QAAQ,UAAU;IAAM;IACzD,eAAe;IACf,kBAAkB,MAAM;IACxB,kBAAkB,OAAO,QAAQ,SAAS;IAC1C,GAAG;GACL,IACC,KAAK,OAAO,SAAS,KAAK,QAAQ,CAAC;IAAE,GAAG,KAAK,QAAQ;IAAI,SAAS,KAAK;GAAQ,CAAC,EAAA,CAC9E,KAAK,OAAO,UAAU,EAAE,QAAQ;IAC/B,KAAK;IACL,GAAG,MAAM;IACT,UAAU;IACV,UAAU;IACV,SAAS,MAAM,WAAW;GAC5B,CAAC,CAAC,CACN;EACF;CACF;AACF,CAAC;AAED,MAAa,YAAY;AAEzB,IAAA,gBAAe,kBAA2C;CACxD,UAAU;EACR,aAAa,CAAC;EACd,WAAW;EACX,MAAM;EACN,aAAa;EACb,MAAM;CACR;CACA,MAAM,SAAS,OAAO;EACpB,MAAM,cAAc,MAAM,QAAQ,QAAQ,WAAW,IACjD,CAAC,GAAG,IAAI,IAAI,QAAQ,YAAY,KAAK,UAAU,OAAO,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,IACrF,CAAC;EACL,MAAM,oBAAoB,EACxB,QAAQ,EACN,OAAO;GACL,WAAW,OAAO,QAAQ,cAAc,WAAW,QAAQ,YAAY;GACvE;GACA,MAAM,QAAQ,QAAQ;GACtB,aAAa,yBAAyB,QAAQ,WAAW;GACzD,MAAM,QAAQ,SAAS;EACzB,EACF,EACF,CAAC;CACH;AACF,CAAC"}
1
+ {"version":3,"file":"index.js","names":["text"],"sources":["../../src/icons/index.ts"],"sourcesContent":["import { defineComponent, h, computed, ref, onMounted, onUnmounted, watch } from \"vue\";\nimport { defineResuxModule } from \"../kit/index.js\";\nimport { useRuntimeConfig } from \"../runtime/index.js\";\n\nexport interface ResuxIconsModuleOptions {\n collections?: string[];\n component?: string;\n mode?: \"css\" | \"svg\";\n apiProvider?: string;\n lazy?: boolean;\n}\n\nexport function defineIconCollections(collections: string[]): ResuxIconsModuleOptions {\n return { collections };\n}\n\nexport interface IconPathData {\n d: string;\n opacity?: string;\n}\n\nexport interface IconData {\n path?: string;\n paths?: IconPathData[];\n opacity?: string;\n viewBox?: string;\n}\n\nexport const iconRegistry: Record<string, IconData> = {\n \"material-symbols:call\": { path: \"M6.62 10.79a15.15 15.15 0 0 0 6.59 6.59l2.2-2.2a1 1 0 0 1 1.11-.27c1.12.37 2.33.57 3.57.57a1 1 0 0 1 1 1V20a1 1 0 0 1-1 1A17 17 0 0 1 3 4a1 1 0 0 1 1-1h3.5a1 1 0 0 1 1 1c0 1.25.2 2.45.57 3.57a1 1 0 0 1-.26 1.02l-2.2 2.2z\" },\n \"call\": { path: \"M6.62 10.79a15.15 15.15 0 0 0 6.59 6.59l2.2-2.2a1 1 0 0 1 1.11-.27c1.12.37 2.33.57 3.57.57a1 1 0 0 1 1 1V20a1 1 0 0 1-1 1A17 17 0 0 1 3 4a1 1 0 0 1 1-1h3.5a1 1 0 0 1 1 1c0 1.25.2 2.45.57 3.57a1 1 0 0 1-.26 1.02l-2.2 2.2z\" },\n \"material-symbols:mail\": { path: \"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5l-8-5V6l8 5l8-5v2z\" },\n \"material-symbols-light:mail-outline-sharp\": { path: \"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5l-8-5V6l8 5l8-5v2z\" },\n \"material-symbols:mail-outline\": { path: \"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5l-8-5V6l8 5l8-5v2z\" },\n \"mail\": { path: \"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5l-8-5V6l8 5l8-5v2z\" },\n \"material-symbols:location-on-outline-rounded\": { path: \"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5s-1.12 2.5-2.5 2.5z\" },\n \"location\": { path: \"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5s2.5 1.12 2.5 2.5s-1.12 2.5-2.5 2.5z\" },\n \"material-symbols:warning\": { path: \"M1 21h22L12 2L1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z\" },\n \"warning\": { path: \"M1 21h22L12 2L1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z\" },\n \"material-symbols:error\": { path: \"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10s10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z\" },\n \"error\": { path: \"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10s10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z\" },\n \"material-symbols:close\": { path: \"M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12z\" },\n \"close\": { path: \"M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12z\" },\n \"material-symbols:add\": { path: \"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z\" },\n \"add\": { path: \"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z\" },\n \"material-symbols:keyboard-arrow-down\": { path: \"m12 15.4l-6-6L7.4 8l4.6 4.6L16.6 8L18 9.4z\" },\n \"arrow-down\": { path: \"m12 15.4l-6-6L7.4 8l4.6 4.6L16.6 8L18 9.4z\" },\n \"mdi:facebook\": { path: \"M12 2.04C6.5 2.04 2 6.53 2 12.06C2 17.06 5.66 21.21 10.44 21.96V14.96H7.9V12.06H10.44V9.85C10.44 7.34 11.93 5.96 14.22 5.96C15.31 5.96 16.45 6.15 16.45 6.15V8.62H15.19C13.95 8.62 13.56 9.39 13.56 10.18V12.06H16.34L15.89 14.96H13.56V21.96A10 10 0 0 0 22 12.06C22 6.53 17.5 2.04 12 2.04Z\" },\n \"mdi:facebook-box\": { path: \"M19 3a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14m-.5 15.5v-5.3h-1.8v-2.2h1.8V9.3c0-1.8 1.1-2.8 2.7-2.8c.8 0 1.5.1 1.7.1v2h-1.2c-.9 0-1 .4-1 1v1.3h2.2l-.3 2.2h-1.9v5.3h-2.2z\" },\n \"facebook\": { path: \"M19 3a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14m-.5 15.5v-5.3h-1.8v-2.2h1.8V9.3c0-1.8 1.1-2.8 2.7-2.8c.8 0 1.5.1 1.7.1v2h-1.2c-.9 0-1 .4-1 1v1.3h2.2l-.3 2.2h-1.9v5.3h-2.2z\" },\n \"mingcute:instagram-fill\": { path: \"M16 3a5 5 0 0 1 5 5v8a5 5 0 0 1-5 5H8a5 5 0 0 1-5-5V8a5 5 0 0 1 5-5zm-4 5a4 4 0 1 0 0 8a4 4 0 0 0 0-8m0 2a2 2 0 1 1 0 4a2 2 0 0 1 0-4m4.5-3.5a1 1 0 1 0 0 2a1 1 0 0 0 0-2\" },\n \"instagram\": { path: \"M16 3a5 5 0 0 1 5 5v8a5 5 0 0 1-5 5H8a5 5 0 0 1-5-5V8a5 5 0 0 1 5-5zm-4 5a4 4 0 1 0 0 8a4 4 0 0 0 0-8m0 2a2 2 0 1 1 0 4a2 2 0 0 1 0-4m4.5-3.5a1 1 0 1 0 0 2a1 1 0 0 0 0-2\" },\n \"cib:linkedin\": { path: \"M27.26 27.271h-4.733v-7.427c0-1.771-.037-4.047-2.475-4.047c-2.468 0-2.844 1.921-2.844 3.916v7.557h-4.739V11.999h4.552v2.083h.061c.636-1.203 2.183-2.468 4.491-2.468c4.801 0 5.692 3.161 5.692 7.271v8.385zM7.115 9.912a2.75 2.75 0 0 1-2.751-2.756a2.753 2.753 0 1 1 2.751 2.756m2.374 17.359H4.74V12h4.749zM29.636 0H2.36C1.057 0 0 1.031 0 2.307v27.387c0 1.276 1.057 2.307 2.36 2.307h27.271c1.301 0 2.369-1.031 2.369-2.307V2.307C32 1.031 30.932 0 29.636 0z\" },\n \"lineicons:linkedin\": { path: \"M27.26 27.271h-4.733v-7.427c0-1.771-.037-4.047-2.475-4.047c-2.468 0-2.844 1.921-2.844 3.916v7.557h-4.739V11.999h4.552v2.083h.061c.636-1.203 2.183-2.468 4.491-2.468c4.801 0 5.692 3.161 5.692 7.271v8.385zM7.115 9.912a2.75 2.75 0 0 1-2.751-2.756a2.753 2.753 0 1 1 2.751 2.756m2.374 17.359H4.74V12h4.749zM29.636 0H2.36C1.057 0 0 1.031 0 2.307v27.387c0 1.276 1.057 2.307 2.36 2.307h27.271c1.301 0 2.369-1.031 2.369-2.307V2.307C32 1.031 30.932 0 29.636 0z\" },\n \"linkedin\": { path: \"M27.26 27.271h-4.733v-7.427c0-1.771-.037-4.047-2.475-4.047c-2.468 0-2.844 1.921-2.844 3.916v7.557h-4.739V11.999h4.552v2.083h.061c.636-1.203 2.183-2.468 4.491-2.468c4.801 0 5.692 3.161 5.692 7.271v8.385zM7.115 9.912a2.75 2.75 0 0 1-2.751-2.756a2.753 2.753 0 1 1 2.751 2.756m2.374 17.359H4.74V12h4.749zM29.636 0H2.36C1.057 0 0 1.031 0 2.307v27.387c0 1.276 1.057 2.307 2.36 2.307h27.271c1.301 0 2.369-1.031 2.369-2.307V2.307C32 1.031 30.932 0 29.636 0z\" },\n \"uil:youtube\": { path: \"M23 9.71a8.5 8.5 0 0 0-.91-4.13a2.92 2.92 0 0 0-1.72-1A78 78 0 0 0 12 4.27a79 79 0 0 0-8.34.3a2.87 2.87 0 0 0-1.46.74c-.9.83-1 2.25-1.1 3.45a48 48 0 0 0 0 6.48a9.6 9.6 0 0 0 .3 2a3.14 3.14 0 0 0 .71 1.36a2.86 2.86 0 0 0 1.49.78a45 45 0 0 0 6.5.33c3.5.05 6.57 0 10.2-.28a2.9 2.9 0 0 0 1.53-.78a2.5 2.5 0 0 0 .61-1a10.6 10.6 0 0 0 .52-3.4c.04-.56.04-3.94.04-4.54M9.74 14.85V8.66l5.92 3.11c-1.66.92-3.85 1.96-5.92 3.08\" },\n \"youtube\": { path: \"M23 9.71a8.5 8.5 0 0 0-.91-4.13a2.92 2.92 0 0 0-1.72-1A78 78 0 0 0 12 4.27a79 79 0 0 0-8.34.3a2.87 2.87 0 0 0-1.46.74c-.9.83-1 2.25-1.1 3.45a48 48 0 0 0 0 6.48a9.6 9.6 0 0 0 .3 2a3.14 3.14 0 0 0 .71 1.36a2.86 2.86 0 0 0 1.49.78a45 45 0 0 0 6.5.33c3.5.05 6.57 0 10.2-.28a2.9 2.9 0 0 0 1.53-.78a2.5 2.5 0 0 0 .61-1a10.6 10.6 0 0 0 .52-3.4c.04-.56.04-3.94.04-4.54M9.74 14.85V8.66l5.92 3.11c-1.66.92-3.85 1.96-5.92 3.08\" },\n \"line-md:twitter-x\": { path: \"M18.244 2.25h3.308l-7.227 8.26l8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z\" },\n \"twitter\": { path: \"M18.244 2.25h3.308l-7.227 8.26l8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z\" },\n \"ic:baseline-whatsapp\": { path: \"M12.04 2c-5.46 0-9.91 4.45-9.91 9.91c0 1.75.46 3.45 1.32 4.95L2.05 22l5.25-1.38c1.45.79 3.08 1.21 4.74 1.21c5.46 0 9.91-4.45 9.91-9.91c0-2.65-1.03-5.14-2.9-7.01A9.816 9.816 0 0 0 12.04 2zm.01 1.67c4.55 0 8.25 3.7 8.25 8.25c0 4.55-3.7 8.25-8.25 8.25c-1.47 0-2.88-.39-4.12-1.12l-.3-.18l-3.07.81l.82-2.99l-.19-.31A8.204 8.204 0 0 1 3.8 11.92c0-4.55 3.7-8.25 8.25-8.25z\" },\n \"streamline:interface-validation-check-circle-checkmark-addition-circle-success-check-validation-add-form\": { path: \"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10s10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5l1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z\" },\n \"ph:check-circle-thin\": { path: \"M12 2a10 10 0 1 0 10 10A10.011 10.011 0 0 0 12 2zm0 19a9 9 0 1 1 9-9a9.01 9.01 0 0 1-9 9zm4.53-11.47a.5.5 0 0 1 0 .71l-5 5a.5.5 0 0 1-.71 0l-2.5-2.5a.5.5 0 1 1 .71-.71L11.17 14.4l4.65-4.65a.5.5 0 0 1 .71 0z\" },\n \"solar:check-circle-linear\": { path: \"M12 2a10 10 0 1 0 10 10A10.011 10.011 0 0 0 12 2zm0 19a9 9 0 1 1 9-9a9.01 9.01 0 0 1-9 9zm4.53-11.47a.5.5 0 0 1 0 .71l-5 5a.5.5 0 0 1-.71 0l-2.5-2.5a.5.5 0 1 1 .71-.71L11.17 14.4l4.65-4.65a.5.5 0 0 1 .71 0z\" },\n \"lucide-lab:flower-lotus\": { path: \"M12 21c-4.418 0-8-3.582-8-8c0-3.5 3.5-7 8-11c4.5 4 8 7.5 8 11c0 4.418-3.582 8-8 8z\" },\n \"solar:leaf-outline\": { path: \"M12 21c-4.418 0-8-3.582-8-8c0-3.5 3.5-7 8-11c4.5 4 8 7.5 8 11c0 4.418-3.582 8-8 8z\" },\n \"solar:command-linear\": { path: \"M8.5 5A3.5 3.5 0 0 0 5 8.5v.5A3.5 3.5 0 0 0 8.5 12.5H9v-1h-.5A2.5 2.5 0 0 1 6 9v-.5A2.5 2.5 0 0 1 8.5 6H9V5h-.5zm7 0H15v1h.5a2.5 2.5 0 0 1 2.5 2.5v.5a2.5 2.5 0 0 1-2.5 2.5H15v1h.5a3.5 3.5 0 0 0 3.5-3.5v-.5A3.5 3.5 0 0 0 15.5 5z\" },\n \"gg:mouse\": { path: \"M12 5a1 1 0 0 0-1 1v4a1 1 0 1 0 2 0V6a1 1 0 0 0-1-1M4 8a8 8 0 1 1 16 0v8a8 8 0 1 1-16 0zm14 0v8a6 6 0 0 1-12 0V8a6 6 0 1 1 12 0\" },\n \"mouse\": { path: \"M12 5a1 1 0 0 0-1 1v4a1 1 0 1 0 2 0V6a1 1 0 0 0-1-1M4 8a8 8 0 1 1 16 0v8a8 8 0 1 1-16 0zm14 0v8a6 6 0 0 1-12 0V8a6 6 0 1 1 12 0\" },\n \"iconoir:flash\": { path: \"M13 10V3L5 14h6v7l8-11z\" },\n \"flash\": { path: \"M13 10V3L5 14h6v7l8-11z\" },\n \"hugeicons:search-01\": { path: \"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5A6.5 6.5 0 1 0 9.5 16a6.471 6.471 0 0 0 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5S14 7.01 14 9.5S11.99 14 9.5 14z\" },\n \"search\": { path: \"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5A6.5 6.5 0 1 0 9.5 16a6.471 6.471 0 0 0 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5S14 7.01 14 9.5S11.99 14 9.5 14z\" },\n \"solar:info-circle-outline\": { path: \"M12 17.75a.75.75 0 0 0 .75-.75v-6a.75.75 0 0 0-1.5 0v6c0 .414.336.75.75.75M12 7a1 1 0 1 1 0 2a1 1 0 0 1 0-2M1.25 12C1.25 6.063 6.063 1.25 12 1.25S22.75 6.063 22.75 12S17.937 22.75 12 22.75S1.25 17.937 1.25 12M12 2.75a9.25 9.25 0 1 0 0 18.5a9.25 9.25 0 0 0 0-18.5\" },\n \"ic:sharp-tag-faces\": { path: \"M12.01 2C6.49 2 2.02 6.48 2.02 12s4.47 10 9.99 10c5.53 0 10.01-4.48 10.01-10S17.54 2 12.01 2m.01 18c-4.42 0-8-3.58-8-8s3.58-8 8-8s8 3.58 8 8s-3.58 8-8 8m3.5-9c.83 0 1.5-.67 1.5-1.5S16.35 8 15.52 8s-1.5.67-1.5 1.5s.67 1.5 1.5 1.5m-7 0c.83 0 1.5-.67 1.5-1.5S9.35 8 8.52 8s-1.5.67-1.5 1.5s.67 1.5 1.5 1.5m3.5 6.5c2.33 0 4.31-1.46 5.11-3.5H6.91c.8 2.04 2.78 3.5 5.11 3.5\" },\n \"hamburger\": { path: \"M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z\" },\n \"svg-spinners:ring-resize\": { path: \"M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2zm0 18a8 8 0 1 1 8-8 8 8 0 0 1-8 8z\" }\n};\n\nif (typeof globalThis !== \"undefined\") {\n (globalThis as any).__RESUX_ICON_REGISTRY__ = iconRegistry;\n}\n\nconst DEFAULT_ICON_API_PROVIDER = \"https://api.iconify.design\";\nconst ICON_FETCH_TIMEOUT_MS = 10_000;\nconst ICON_FETCH_MAX_BYTES = 256 * 1024;\nconst ICON_FETCH_CACHE_MAX_ENTRIES = 256;\nconst ICON_FETCH_MAX_IN_FLIGHT = 32;\nconst ICON_FETCH_QUEUE_MAX_ENTRIES = 512;\nconst pendingFetches = new Map<string, Promise<IconData | null>>();\nconst fetchedIconCache = new Map<string, IconData>();\nconst iconFetchQueue: Array<() => void> = [];\nlet activeIconFetches = 0;\n\nfunction stripTrailingSlashes(value: string): string {\n let end = value.length;\n while (end > 0 && value.charCodeAt(end - 1) === 47) {\n end -= 1;\n }\n return value.slice(0, end);\n}\n\nexport function normalizeIconApiProvider(value: unknown): string {\n const raw = typeof value === \"string\" ? stripTrailingSlashes(value.trim()) : \"\";\n if (!raw) {\n return DEFAULT_ICON_API_PROVIDER;\n }\n if (raw.startsWith(\"//\")) {\n return DEFAULT_ICON_API_PROVIDER;\n }\n if (raw.startsWith(\"/\")) {\n return raw;\n }\n try {\n const url = new URL(raw);\n if (url.protocol === \"https:\" || url.protocol === \"http:\") {\n return stripTrailingSlashes(url.toString());\n }\n } catch {\n // Fall back to the public provider for malformed values.\n }\n return DEFAULT_ICON_API_PROVIDER;\n}\n\nasync function readBoundedIconSvg(response: Response): Promise<string | null> {\n const rawLength = response.headers?.get?.(\"content-length\");\n if (rawLength) {\n const contentLength = Number(rawLength);\n if (Number.isFinite(contentLength) && contentLength > ICON_FETCH_MAX_BYTES) {\n return null;\n }\n }\n\n if (!response.body?.getReader) {\n const text = await response.text();\n return new TextEncoder().encode(text).byteLength <= ICON_FETCH_MAX_BYTES ? text : null;\n }\n\n const reader = response.body.getReader();\n const decoder = new TextDecoder();\n let totalBytes = 0;\n let text = \"\";\n try {\n while (true) {\n const { done, value } = await reader.read();\n if (done) break;\n totalBytes += value.byteLength;\n if (totalBytes > ICON_FETCH_MAX_BYTES) {\n await reader.cancel().catch(() => undefined);\n return null;\n }\n text += decoder.decode(value, { stream: true });\n }\n text += decoder.decode();\n return text;\n } finally {\n reader.releaseLock();\n }\n}\n\nfunction readFetchedIcon(cacheKey: string): IconData | undefined {\n const cached = fetchedIconCache.get(cacheKey);\n if (!cached) return undefined;\n fetchedIconCache.delete(cacheKey);\n fetchedIconCache.set(cacheKey, cached);\n return cached;\n}\n\nfunction rememberFetchedIcon(cacheKey: string, data: IconData): void {\n fetchedIconCache.delete(cacheKey);\n fetchedIconCache.set(cacheKey, data);\n while (fetchedIconCache.size > ICON_FETCH_CACHE_MAX_ENTRIES) {\n const oldestKey = fetchedIconCache.keys().next().value;\n if (oldestKey === undefined) break;\n fetchedIconCache.delete(oldestKey);\n }\n}\n\nfunction runWithIconFetchSlot(\n task: () => Promise<IconData | null>,\n): Promise<IconData | null> {\n if (activeIconFetches >= ICON_FETCH_MAX_IN_FLIGHT\n && iconFetchQueue.length >= ICON_FETCH_QUEUE_MAX_ENTRIES) {\n return Promise.resolve(null);\n }\n\n return new Promise((resolve) => {\n const run = () => {\n activeIconFetches += 1;\n void task()\n .then(resolve, () => resolve(null))\n .finally(() => {\n activeIconFetches = Math.max(0, activeIconFetches - 1);\n iconFetchQueue.shift()?.();\n });\n };\n if (activeIconFetches < ICON_FETCH_MAX_IN_FLIGHT) {\n run();\n } else {\n iconFetchQueue.push(run);\n }\n });\n}\n\nexport function fetchIconifyIcon(\n name: string,\n apiProvider: string = DEFAULT_ICON_API_PROVIDER,\n): Promise<IconData | null> {\n const normalized = String(name || \"\").trim().toLowerCase();\n if (!normalized || normalized.length > 256) return Promise.resolve(null);\n if (iconRegistry[normalized]) {\n return Promise.resolve(iconRegistry[normalized]);\n }\n\n const parts = normalized.split(\":\");\n if (parts.length !== 2 || !parts[0] || !parts[1]) {\n return Promise.resolve(null);\n }\n\n const provider = normalizeIconApiProvider(apiProvider);\n const cacheKey = provider + \"::\" + normalized;\n const cached = readFetchedIcon(cacheKey);\n if (cached) {\n return Promise.resolve(cached);\n }\n const pending = pendingFetches.get(cacheKey);\n if (pending) {\n return pending;\n }\n const prefix = parts[0];\n const iconName = parts[1];\n const url = provider + \"/\" + encodeURIComponent(prefix) + \"/\" + encodeURIComponent(iconName) + \".svg\";\n\n const fetchPromise = runWithIconFetchSlot(async () => {\n const controller = typeof AbortController === \"function\" ? new AbortController() : null;\n const timeout = setTimeout(() => controller?.abort(), ICON_FETCH_TIMEOUT_MS);\n try {\n const response = await fetch(url, controller ? { signal: controller.signal } : undefined);\n if (!response.ok) return null;\n const svgText = await readBoundedIconSvg(response);\n if (!svgText) return null;\n const viewBox = readSvgAttribute(svgText, \"viewBox\") || \"0 0 24 24\";\n const paths = [...svgText.matchAll(/<path\\b[^>]*>/gi)]\n .slice(0, 128)\n .map((match) => ({\n d: readSvgAttribute(match[0], \"d\").slice(0, 65_536),\n opacity: readSvgAttribute(match[0], \"opacity\") || undefined,\n }))\n .filter((entry) => Boolean(entry.d));\n if (!paths.length) {\n return null;\n }\n const data: IconData = {\n path: paths[0].d,\n paths,\n viewBox,\n };\n rememberFetchedIcon(cacheKey, data);\n return data;\n } catch {\n return null;\n } finally {\n clearTimeout(timeout);\n }\n }).finally(() => {\n pendingFetches.delete(cacheKey);\n });\n\n pendingFetches.set(cacheKey, fetchPromise);\n return fetchPromise;\n}\n\nfunction readSvgAttribute(source: string, name: string): string {\n const escapedName = name.replace(/[.*+?^${}()|[\\]\\\\]/g, String.raw`\\$&`);\n const match = new RegExp(\n String.raw`\\b${escapedName}\\s*=\\s*(?:\"([^\"]*)\"|'([^']*)')`,\n \"i\",\n ).exec(source);\n return (match?.[1] ?? match?.[2] ?? \"\").trim();\n}\n\nexport const Icon = defineComponent({\n name: \"ResuxIcon\",\n props: {\n name: { type: String, required: true },\n size: { type: [String, Number], default: \"1.25rem\" },\n mode: { type: String, default: \"svg\" },\n lazy: { type: Boolean, default: false },\n loading: { type: String, default: \"eager\" },\n apiProvider: { type: String, default: \"\" },\n class: { type: String, default: \"\" }\n },\n setup(props, { attrs }) {\n const iconRef = ref<HTMLElement | null>(null);\n const isVisible = ref(false);\n const iconName = computed(() => String(props.name || \"\").trim().toLowerCase());\n const runtimeConfig = useRuntimeConfig();\n const configuredProvider = (runtimeConfig.public?.icons as { apiProvider?: unknown } | undefined)?.apiProvider;\n const apiProvider = computed(() => normalizeIconApiProvider(props.apiProvider || configuredProvider));\n const dynamicData = ref<IconData | null>(null);\n\n const isLazy = computed(() => props.lazy || props.loading === \"lazy\");\n\n const iconData = computed<IconData>(() => {\n if (iconRegistry[iconName.value]) {\n return iconRegistry[iconName.value];\n }\n if (dynamicData.value) {\n return dynamicData.value;\n }\n return {\n path: \"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2S2 6.477 2 12s4.477 10 10 10zm0-2a8 8 0 1 1 0-16 8 8 0 0 1 0 16z\",\n opacity: \".35\",\n viewBox: \"0 0 24 24\"\n };\n });\n\n let requestRevision = 0;\n const loadDynamicIcon = () => {\n const requestedName = iconName.value;\n const requestedProvider = apiProvider.value;\n const revision = ++requestRevision;\n if (iconRegistry[requestedName]) {\n return;\n }\n fetchIconifyIcon(requestedName, requestedProvider).then((result) => {\n if (\n result\n && revision === requestRevision\n && requestedName === iconName.value\n && requestedProvider === apiProvider.value\n ) {\n dynamicData.value = result;\n }\n });\n };\n\n let observer: IntersectionObserver | null = null;\n\n onMounted(() => {\n if (isLazy.value && typeof window !== \"undefined\" && \"IntersectionObserver\" in window) {\n observer = new IntersectionObserver(\n (entries) => {\n if (entries.some((entry) => entry.isIntersecting)) {\n isVisible.value = true;\n loadDynamicIcon();\n if (observer && iconRef.value) {\n observer.unobserve(iconRef.value);\n }\n }\n },\n { rootMargin: \"100px\" }\n );\n if (iconRef.value) {\n observer.observe(iconRef.value);\n }\n } else {\n isVisible.value = true;\n loadDynamicIcon();\n }\n });\n\n onUnmounted(() => {\n requestRevision += 1;\n if (observer) {\n observer.disconnect();\n }\n });\n\n watch([iconName, apiProvider], () => {\n dynamicData.value = null;\n if (!isLazy.value || isVisible.value) {\n loadDynamicIcon();\n }\n });\n\n const sizeValue = computed(() =>\n typeof props.size === \"number\" ? `${props.size}px` : (String(props.size || \"\").trim() || \"1.25rem\")\n );\n\n return () => {\n const data = iconData.value;\n return h(\n \"svg\",\n {\n ref: iconRef,\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: data.viewBox || \"0 0 24 24\",\n width: sizeValue.value,\n height: sizeValue.value,\n fill: \"currentColor\",\n class: [\"inline-block shrink-0 align-middle\", props.class].filter(Boolean).join(\" \"),\n style: { width: sizeValue.value, height: sizeValue.value },\n \"aria-hidden\": \"true\",\n \"data-icon-name\": props.name,\n \"data-icon-lazy\": isLazy.value ? \"true\" : \"false\",\n ...attrs\n },\n (data.paths?.length ? data.paths : [{ d: data.path || \"\", opacity: data.opacity }])\n .map((entry, index) => h(\"path\", {\n key: index,\n d: entry.d,\n fillRule: \"evenodd\",\n clipRule: \"evenodd\",\n opacity: entry.opacity || \"1\"\n }))\n );\n };\n }\n});\n\nexport const ResuxIcon = Icon;\n\nexport default defineResuxModule<ResuxIconsModuleOptions>({\n defaults: {\n collections: [],\n component: \"Icon\",\n mode: \"svg\",\n apiProvider: DEFAULT_ICON_API_PROVIDER,\n lazy: false\n },\n setup(options, resux) {\n const collections = Array.isArray(options.collections)\n ? [...new Set(options.collections.map((entry) => String(entry).trim()).filter(Boolean))]\n : [];\n resux.extendRuntimeConfig({\n public: {\n icons: {\n component: typeof options.component === \"string\" ? options.component : \"Icon\",\n collections,\n mode: options.mode || \"svg\",\n apiProvider: normalizeIconApiProvider(options.apiProvider),\n lazy: options.lazy === true\n }\n }\n });\n }\n});\n"],"mappings":";;;;;AAYA,SAAgB,sBAAsB,aAAgD;AACpF,QAAO,EAAE,aAAa;;AAexB,MAAa,eAAyC;CACpD,yBAAyB,EAAE,MAAM,gOAAgO;CACjQ,QAAQ,EAAE,MAAM,gOAAgO;CAChP,yBAAyB,EAAE,MAAM,kHAAkH;CACnJ,6CAA6C,EAAE,MAAM,kHAAkH;CACvK,iCAAiC,EAAE,MAAM,kHAAkH;CAC3J,QAAQ,EAAE,MAAM,kHAAkH;CAClI,gDAAgD,EAAE,MAAM,+JAA+J;CACvN,YAAY,EAAE,MAAM,+JAA+J;CACnL,4BAA4B,EAAE,MAAM,sDAAsD;CAC1F,WAAW,EAAE,MAAM,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AAO,EACL,OACA;IACE,KAAK;IACL,OAAO;IACP,SAAS,KAAK,WAAW;IACzB,OAAO,UAAU;IACjB,QAAQ,UAAU;IAClB,MAAM;IACN,OAAO,CAAC,sCAAsC,MAAM,MAAM,CAAC,OAAO,QAAQ,CAAC,KAAK,IAAI;IACpF,OAAO;KAAE,OAAO,UAAU;KAAO,QAAQ,UAAU;KAAO;IAC1D,eAAe;IACf,kBAAkB,MAAM;IACxB,kBAAkB,OAAO,QAAQ,SAAS;IAC1C,GAAG;IACJ,GACA,KAAK,OAAO,SAAS,KAAK,QAAQ,CAAC;IAAE,GAAG,KAAK,QAAQ;IAAI,SAAS,KAAK;IAAS,CAAC,EAC/E,KAAK,OAAO,UAAU,EAAE,QAAQ;IAC/B,KAAK;IACL,GAAG,MAAM;IACT,UAAU;IACV,UAAU;IACV,SAAS,MAAM,WAAW;IAC3B,CAAC,CAAC,CACN;;;CAGN,CAAC;AAEF,MAAa,YAAY;AAEzB,oBAAe,kBAA2C;CACxD,UAAU;EACR,aAAa,EAAE;EACf,WAAW;EACX,MAAM;EACN,aAAa;EACb,MAAM;EACP;CACD,MAAM,SAAS,OAAO;EACpB,MAAM,cAAc,MAAM,QAAQ,QAAQ,YAAY,GAClD,CAAC,GAAG,IAAI,IAAI,QAAQ,YAAY,KAAK,UAAU,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,QAAQ,CAAC,CAAC,GACtF,EAAE;AACN,QAAM,oBAAoB,EACxB,QAAQ,EACN,OAAO;GACL,WAAW,OAAO,QAAQ,cAAc,WAAW,QAAQ,YAAY;GACvE;GACA,MAAM,QAAQ,QAAQ;GACtB,aAAa,yBAAyB,QAAQ,YAAY;GAC1D,MAAM,QAAQ,SAAS;GACxB,EACF,EACF,CAAC;;CAEL,CAAC"}
package/dist/index.d.ts CHANGED
@@ -5,4 +5,4 @@ import { computed } from "./reactivity/computed.js";
5
5
  import { watch, watchEffect } from "./reactivity/watch.js";
6
6
  import { nextTick } from "./reactivity/scheduler.js";
7
7
  import { AsyncDataError, AsyncDataHandlerContext, AsyncDataResource, AsyncResuxRenderer, AwaitedAsyncDataResource, ClientEnhancementContext, ClientEnhancementSetup, ClientEnhancementTrigger, ClientPluginManifestRecord, ClientRouteMiddlewareManifestRecord, ClientRuntimeSourceOptions, ComponentDefinition, ComponentStyle, DeviceInfo, ElementTemplateNode, EventHandler, EventHandlerEvent, ForDirective, HeadEntry, HtmlDirective, IfDirective, InterpolationTemplateNode, JsonValue, PackageAdapterContext, PackageAdapterDefinition, PageMeta, RenderAppOptions, RenderDocumentOptions, RenderResult, ResuxAppInjections, ResuxAppLike, ResuxAppProvides, ResuxClientBootMode, ResuxClientBootPlan, ResuxClientPackageImportRegistry, ResuxConfigInput, ResuxDeployOptions, ResuxDeployTarget, ResuxError, ResuxImageBuilder, ResuxImageCacheInput, ResuxImageConfig, ResuxImageFit, ResuxImageModifiers, ResuxImageProviderConfig, ResuxLazyPackageLoader, ResuxLazyPackageOptions, ResuxModule, ResuxModuleContext, ResuxPackageCssMap, ResuxPackageMode, ResuxPackageModeMap, ResuxPackagesConfig, ResuxPayload, ResuxPlugin, ResuxRouteMiddleware, ResuxRouter, ResuxSupportMode, RouteContext, RouteMiddlewareResult, RouteRecord, RuntimeConfig, SeoMetaInput, SeoMetaValue, SerializedAsyncData, SerializedScope, ServerMiddleware, ServerMiddlewareResult, SetupContext, TemplateAttribute, TemplateEvent, TemplateNode, TextTemplateNode, UseClientEnhancementOptions, UseResuxImageOptions, abortNavigation, clearError, createError, createServerSetupContext, defineClientEnhancement, defineClientOnlyPackage, defineComponent, defineEventHandler, defineLazyPackage, definePackageAdapter, defineResuxConfig, defineResuxModule, defineResuxPlugin, defineResuxRouteMiddleware, defineServerMiddleware, disposeClientEnhancements, evaluateExpression, eventHandler, getClientEnhancement, getClientRuntimeBootPlan, getClientRuntimeSource, getQuery, hasClientEnhancement, navigateTo, parseUserAgent, readBody, renderApp, renderAppAsync, renderClientPatches, renderDocument, renderTemplateNodesAsync, scanClientEnhancements, setHeader, shouldLoadClientRuntime, showError, useClientEnhancement, useClientPackage, useDevice, useError, useLazyPackage, usePackageReady, useResuxApp, useResuxImage, useRoute, useRouter, useRuntimeConfig } from "./runtime/index.js";
8
- export { AsyncDataError, AsyncDataHandlerContext, AsyncDataResource, AsyncResuxRenderer, AwaitedAsyncDataResource, ClientEnhancementContext, ClientEnhancementSetup, ClientEnhancementTrigger, ClientPluginManifestRecord, ClientRouteMiddlewareManifestRecord, ClientRuntimeSourceOptions, ComponentDefinition, ComponentStyle, type ComputedRef, DeviceInfo, ElementTemplateNode, EventHandler, EventHandlerEvent, ForDirective, HeadEntry, HtmlDirective, IfDirective, InterpolationTemplateNode, JsonValue, type MaybeRef, type MaybeRefOrGetter, PackageAdapterContext, PackageAdapterDefinition, PageMeta, type ReactiveEffectOptions, type ReactiveEffectRunner, type Ref, RenderAppOptions, RenderDocumentOptions, RenderResult, ResuxAppInjections, ResuxAppLike, ResuxAppProvides, ResuxClientBootMode, ResuxClientBootPlan, ResuxClientPackageImportRegistry, ResuxConfigInput, ResuxDeployOptions, ResuxDeployTarget, ResuxError, ResuxImageBuilder, ResuxImageCacheInput, ResuxImageConfig, ResuxImageFit, ResuxImageModifiers, ResuxImageProviderConfig, ResuxLazyPackageLoader, ResuxLazyPackageOptions, ResuxModule, ResuxModuleContext, ResuxPackageCssMap, ResuxPackageMode, ResuxPackageModeMap, ResuxPackagesConfig, ResuxPayload, ResuxPlugin, ResuxRouteMiddleware, ResuxRouter, ResuxSupportMode, RouteContext, RouteMiddlewareResult, RouteRecord, RuntimeConfig, SeoMetaInput, SeoMetaValue, SerializedAsyncData, SerializedScope, ServerMiddleware, ServerMiddlewareResult, SetupContext, TemplateAttribute, TemplateEvent, TemplateNode, TextTemplateNode, UseClientEnhancementOptions, UseResuxImageOptions, type WatchCallback, type WatchOptions, type WatchSource, type WatchStopHandle, abortNavigation, clearError, computed, createError, createServerSetupContext, defineClientEnhancement, defineClientOnlyPackage, defineComponent, defineEventHandler, defineLazyPackage, definePackageAdapter, defineResuxConfig, defineResuxModule, defineResuxPlugin, defineResuxRouteMiddleware, defineServerMiddleware, disposeClientEnhancements, evaluateExpression, eventHandler, getClientEnhancement, getClientRuntimeBootPlan, getClientRuntimeSource, getQuery, hasClientEnhancement, isReactive, isReadonly, isRef, navigateTo, nextTick, parseUserAgent, reactive, readBody, readonly, ref, renderApp, renderAppAsync, renderClientPatches, renderDocument, renderTemplateNodesAsync, scanClientEnhancements, setHeader, shouldLoadClientRuntime, showError, toRef, toRefs, unref, useClientEnhancement, useClientPackage, useDevice, useError, useLazyPackage, usePackageReady, useResuxApp, useResuxImage, useRoute, useRouter, useRuntimeConfig, watch, watchEffect };
8
+ export { AsyncDataError, AsyncDataHandlerContext, AsyncDataResource, AsyncResuxRenderer, AwaitedAsyncDataResource, ClientEnhancementContext, ClientEnhancementSetup, ClientEnhancementTrigger, ClientPluginManifestRecord, ClientRouteMiddlewareManifestRecord, ClientRuntimeSourceOptions, ComponentDefinition, ComponentStyle, ComputedRef, DeviceInfo, ElementTemplateNode, EventHandler, EventHandlerEvent, ForDirective, HeadEntry, HtmlDirective, IfDirective, InterpolationTemplateNode, JsonValue, MaybeRef, MaybeRefOrGetter, PackageAdapterContext, PackageAdapterDefinition, PageMeta, ReactiveEffectOptions, ReactiveEffectRunner, Ref, RenderAppOptions, RenderDocumentOptions, RenderResult, ResuxAppInjections, ResuxAppLike, ResuxAppProvides, ResuxClientBootMode, ResuxClientBootPlan, ResuxClientPackageImportRegistry, ResuxConfigInput, ResuxDeployOptions, ResuxDeployTarget, ResuxError, ResuxImageBuilder, ResuxImageCacheInput, ResuxImageConfig, ResuxImageFit, ResuxImageModifiers, ResuxImageProviderConfig, ResuxLazyPackageLoader, ResuxLazyPackageOptions, ResuxModule, ResuxModuleContext, ResuxPackageCssMap, ResuxPackageMode, ResuxPackageModeMap, ResuxPackagesConfig, ResuxPayload, ResuxPlugin, ResuxRouteMiddleware, ResuxRouter, ResuxSupportMode, RouteContext, RouteMiddlewareResult, RouteRecord, RuntimeConfig, SeoMetaInput, SeoMetaValue, SerializedAsyncData, SerializedScope, ServerMiddleware, ServerMiddlewareResult, SetupContext, TemplateAttribute, TemplateEvent, TemplateNode, TextTemplateNode, UseClientEnhancementOptions, UseResuxImageOptions, WatchCallback, WatchOptions, WatchSource, WatchStopHandle, abortNavigation, clearError, computed, createError, createServerSetupContext, defineClientEnhancement, defineClientOnlyPackage, defineComponent, defineEventHandler, defineLazyPackage, definePackageAdapter, defineResuxConfig, defineResuxModule, defineResuxPlugin, defineResuxRouteMiddleware, defineServerMiddleware, disposeClientEnhancements, evaluateExpression, eventHandler, getClientEnhancement, getClientRuntimeBootPlan, getClientRuntimeSource, getQuery, hasClientEnhancement, isReactive, isReadonly, isRef, navigateTo, nextTick, parseUserAgent, reactive, readBody, readonly, ref, renderApp, renderAppAsync, renderClientPatches, renderDocument, renderTemplateNodesAsync, scanClientEnhancements, setHeader, shouldLoadClientRuntime, showError, toRef, toRefs, unref, useClientEnhancement, useClientPackage, useDevice, useError, useLazyPackage, usePackageReady, useResuxApp, useResuxImage, useRoute, useRouter, useRuntimeConfig, watch, watchEffect };
package/dist/index.js CHANGED
@@ -4,4 +4,5 @@ import { computed } from "./reactivity/computed.js";
4
4
  import { nextTick } from "./reactivity/scheduler.js";
5
5
  import { watch, watchEffect } from "./reactivity/watch.js";
6
6
  import { AsyncResuxRenderer, abortNavigation, clearError, createError, createServerSetupContext, defineClientEnhancement, defineClientOnlyPackage, defineComponent, defineEventHandler, defineLazyPackage, definePackageAdapter, defineResuxConfig, defineResuxModule, defineResuxPlugin, defineResuxRouteMiddleware, defineServerMiddleware, disposeClientEnhancements, evaluateExpression, eventHandler, getClientEnhancement, getClientRuntimeBootPlan, getClientRuntimeSource, getQuery, hasClientEnhancement, navigateTo, parseUserAgent, readBody, renderApp, renderAppAsync, renderClientPatches, renderDocument, renderTemplateNodesAsync, scanClientEnhancements, setHeader, shouldLoadClientRuntime, showError, useClientEnhancement, useClientPackage, useDevice, useError, useLazyPackage, usePackageReady, useResuxApp, useResuxImage, useRoute, useRouter, useRuntimeConfig } from "./runtime/index.js";
7
- export { AsyncResuxRenderer, abortNavigation, clearError, computed, createError, createServerSetupContext, defineClientEnhancement, defineClientOnlyPackage, defineComponent, defineEventHandler, defineLazyPackage, definePackageAdapter, defineResuxConfig, defineResuxModule, defineResuxPlugin, defineResuxRouteMiddleware, defineServerMiddleware, disposeClientEnhancements, evaluateExpression, eventHandler, getClientEnhancement, getClientRuntimeBootPlan, getClientRuntimeSource, getQuery, hasClientEnhancement, isReactive, isReadonly, isRef, navigateTo, nextTick, parseUserAgent, reactive, readBody, readonly, ref, renderApp, renderAppAsync, renderClientPatches, renderDocument, renderTemplateNodesAsync, scanClientEnhancements, setHeader, shouldLoadClientRuntime, showError, toRef, toRefs, unref, useClientEnhancement, useClientPackage, useDevice, useError, useLazyPackage, usePackageReady, useResuxApp, useResuxImage, useRoute, useRouter, useRuntimeConfig, watch, watchEffect };
7
+
8
+ export { AsyncResuxRenderer, abortNavigation, clearError, computed, createError, createServerSetupContext, defineClientEnhancement, defineClientOnlyPackage, defineComponent, defineEventHandler, defineLazyPackage, definePackageAdapter, defineResuxConfig, defineResuxModule, defineResuxPlugin, defineResuxRouteMiddleware, defineServerMiddleware, disposeClientEnhancements, evaluateExpression, eventHandler, getClientEnhancement, getClientRuntimeBootPlan, getClientRuntimeSource, getQuery, hasClientEnhancement, isReactive, isReadonly, isRef, navigateTo, nextTick, parseUserAgent, reactive, readBody, readonly, ref, renderApp, renderAppAsync, renderClientPatches, renderDocument, renderTemplateNodesAsync, scanClientEnhancements, setHeader, shouldLoadClientRuntime, showError, toRef, toRefs, unref, useClientEnhancement, useClientPackage, useDevice, useError, useLazyPackage, usePackageReady, useResuxApp, useResuxImage, useRoute, useRouter, useRuntimeConfig, watch, watchEffect };
@@ -1,32 +1,34 @@
1
1
  import { NitroConfigExtender, PagesExtender, ResuxComponentInput, ResuxComponentsDirInput, ResuxImportInput, ResuxModuleContext, ResuxPluginInput, ResuxRouteMiddlewareInput, ResuxServerHandlerInput, ResuxTemplateInput, ResuxTypeTemplateInput, ViteConfigExtender } from "../core/module-container.js";
2
+
2
3
  //#region src/kit/index.d.ts
3
- export interface ResuxModuleMeta {
4
+ interface ResuxModuleMeta {
4
5
  name?: string;
5
6
  configKey?: string;
6
7
  }
7
- export interface ResuxModuleDefinition<TOptions = Record<string, unknown>> {
8
+ interface ResuxModuleDefinition<TOptions = Record<string, unknown>> {
8
9
  meta?: ResuxModuleMeta;
9
10
  defaults?: TOptions;
10
11
  setup: (options: TOptions, resux: ResuxModuleContext) => void | Promise<void>;
11
12
  }
12
- export declare function withResuxKitContext<T>(context: ResuxModuleContext, run: () => Promise<T> | T): Promise<T> | T;
13
- export declare function defineResuxModule<TOptions = Record<string, unknown>>(module: ResuxModuleDefinition<TOptions>): ResuxModuleDefinition<TOptions>;
14
- export declare function addComponent(component: ResuxComponentInput | string): void;
15
- export declare function addComponentsDir(dir: ResuxComponentsDirInput | string): void;
16
- export declare function addImports(imports: ResuxImportInput | ResuxImportInput[]): void;
17
- export declare function addImportsDir(dir: string): void;
18
- export declare function addPlugin(plugin: ResuxPluginInput | string): void;
19
- export declare function addRouteMiddleware(middleware: ResuxRouteMiddlewareInput): void;
20
- export declare function addServerHandler(handler: ResuxServerHandlerInput): void;
21
- export declare function addServerPlugin(plugin: string): void;
22
- export declare function addTemplate(template: ResuxTemplateInput): void;
23
- export declare function addTypeTemplate(template: ResuxTypeTemplateInput): void;
24
- export declare function extendPages(extender: PagesExtender): void;
25
- export declare function extendRuntimeConfig(config: Record<string, unknown>): void;
26
- export declare function extendViteConfig(extender: ViteConfigExtender): void;
27
- export declare function extendNitroConfig(extender: NitroConfigExtender): void;
28
- export declare function addVitePlugin(plugin: unknown): void;
29
- export declare function addRouteRule(path: string, rule: Record<string, unknown>): void;
30
- export declare function addPrerenderRoutes(route: string | string[]): void;
13
+ declare function withResuxKitContext<T>(context: ResuxModuleContext, run: () => Promise<T> | T): Promise<T> | T;
14
+ declare function defineResuxModule<TOptions = Record<string, unknown>>(module: ResuxModuleDefinition<TOptions>): ResuxModuleDefinition<TOptions>;
15
+ declare function addComponent(component: ResuxComponentInput | string): void;
16
+ declare function addComponentsDir(dir: ResuxComponentsDirInput | string): void;
17
+ declare function addImports(imports: ResuxImportInput | ResuxImportInput[]): void;
18
+ declare function addImportsDir(dir: string): void;
19
+ declare function addPlugin(plugin: ResuxPluginInput | string): void;
20
+ declare function addRouteMiddleware(middleware: ResuxRouteMiddlewareInput): void;
21
+ declare function addServerHandler(handler: ResuxServerHandlerInput): void;
22
+ declare function addServerPlugin(plugin: string): void;
23
+ declare function addTemplate(template: ResuxTemplateInput): void;
24
+ declare function addTypeTemplate(template: ResuxTypeTemplateInput): void;
25
+ declare function extendPages(extender: PagesExtender): void;
26
+ declare function extendRuntimeConfig(config: Record<string, unknown>): void;
27
+ declare function extendViteConfig(extender: ViteConfigExtender): void;
28
+ declare function extendNitroConfig(extender: NitroConfigExtender): void;
29
+ declare function addVitePlugin(plugin: unknown): void;
30
+ declare function addRouteRule(path: string, rule: Record<string, unknown>): void;
31
+ declare function addPrerenderRoutes(route: string | string[]): void;
31
32
  //#endregion
33
+ export { ResuxModuleDefinition, ResuxModuleMeta, addComponent, addComponentsDir, addImports, addImportsDir, addPlugin, addPrerenderRoutes, addRouteMiddleware, addRouteRule, addServerHandler, addServerPlugin, addTemplate, addTypeTemplate, addVitePlugin, defineResuxModule, extendNitroConfig, extendPages, extendRuntimeConfig, extendViteConfig, withResuxKitContext };
32
34
  //# sourceMappingURL=index.d.ts.map
package/dist/kit/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { AsyncLocalStorage } from "node:async_hooks";
2
+
2
3
  //#region src/kit/index.ts
3
4
  const kitContextStorage = new AsyncLocalStorage();
4
5
  function withResuxKitContext(context, run) {
@@ -63,7 +64,7 @@ function useContext(api) {
63
64
  if (!context) throw new Error(`Resux Kit "${api}" was called outside of a module setup context.`);
64
65
  return context;
65
66
  }
67
+
66
68
  //#endregion
67
69
  export { addComponent, addComponentsDir, addImports, addImportsDir, addPlugin, addPrerenderRoutes, addRouteMiddleware, addRouteRule, addServerHandler, addServerPlugin, addTemplate, addTypeTemplate, addVitePlugin, defineResuxModule, extendNitroConfig, extendPages, extendRuntimeConfig, extendViteConfig, withResuxKitContext };
68
-
69
70
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/kit/index.ts"],"sourcesContent":["import { AsyncLocalStorage } from \"node:async_hooks\";\nimport type {\n PagesExtender,\n ResuxComponentInput,\n ResuxComponentsDirInput,\n ResuxImportInput,\n ResuxModuleContext,\n ResuxPluginInput,\n ResuxRouteMiddlewareInput,\n ResuxServerHandlerInput,\n ResuxTemplateInput,\n ResuxTypeTemplateInput,\n ViteConfigExtender,\n NitroConfigExtender\n} from \"../core/module-container.js\";\n\nexport interface ResuxModuleMeta {\n name?: string;\n configKey?: string;\n}\n\nexport interface ResuxModuleDefinition<TOptions = Record<string, unknown>> {\n meta?: ResuxModuleMeta;\n defaults?: TOptions;\n setup: (options: TOptions, resux: ResuxModuleContext) => void | Promise<void>;\n}\n\nconst kitContextStorage = new AsyncLocalStorage<ResuxModuleContext>();\n\nexport function withResuxKitContext<T>(context: ResuxModuleContext, run: () => Promise<T> | T): Promise<T> | T {\n return kitContextStorage.run(context, run);\n}\n\nexport function defineResuxModule<TOptions = Record<string, unknown>>(module: ResuxModuleDefinition<TOptions>): ResuxModuleDefinition<TOptions> {\n return module;\n}\n\nexport function addComponent(component: ResuxComponentInput | string): void {\n useContext(\"addComponent\").addComponent(component);\n}\n\nexport function addComponentsDir(dir: ResuxComponentsDirInput | string): void {\n useContext(\"addComponentsDir\").addComponentsDir(dir);\n}\n\nexport function addImports(imports: ResuxImportInput | ResuxImportInput[]): void {\n useContext(\"addImports\").addImports(imports);\n}\n\nexport function addImportsDir(dir: string): void {\n useContext(\"addImportsDir\").addImportsDir(dir);\n}\n\nexport function addPlugin(plugin: ResuxPluginInput | string): void {\n useContext(\"addPlugin\").addPlugin(plugin);\n}\n\nexport function addRouteMiddleware(middleware: ResuxRouteMiddlewareInput): void {\n useContext(\"addRouteMiddleware\").addRouteMiddleware(middleware);\n}\n\nexport function addServerHandler(handler: ResuxServerHandlerInput): void {\n useContext(\"addServerHandler\").addServerHandler(handler);\n}\n\nexport function addServerPlugin(plugin: string): void {\n useContext(\"addServerPlugin\").addServerPlugin(plugin);\n}\n\nexport function addTemplate(template: ResuxTemplateInput): void {\n useContext(\"addTemplate\").addTemplate(template);\n}\n\nexport function addTypeTemplate(template: ResuxTypeTemplateInput): void {\n useContext(\"addTypeTemplate\").addTypeTemplate(template);\n}\n\nexport function extendPages(extender: PagesExtender): void {\n useContext(\"extendPages\").extendPages(extender);\n}\n\nexport function extendRuntimeConfig(config: Record<string, unknown>): void {\n useContext(\"extendRuntimeConfig\").extendRuntimeConfig(config);\n}\n\nexport function extendViteConfig(extender: ViteConfigExtender): void {\n useContext(\"extendViteConfig\").extendViteConfig(extender);\n}\n\nexport function extendNitroConfig(extender: NitroConfigExtender): void {\n useContext(\"extendNitroConfig\").extendNitroConfig(extender);\n}\n\nexport function addVitePlugin(plugin: unknown): void {\n useContext(\"addVitePlugin\").addVitePlugin(plugin);\n}\n\nexport function addRouteRule(path: string, rule: Record<string, unknown>): void {\n useContext(\"addRouteRule\").addRouteRule(path, rule);\n}\n\nexport function addPrerenderRoutes(route: string | string[]): void {\n useContext(\"addPrerenderRoutes\").addPrerenderRoutes(route);\n}\n\nfunction useContext(api: string): ResuxModuleContext {\n const context = kitContextStorage.getStore();\n if (!context) {\n throw new Error(`Resux Kit \"${api}\" was called outside of a module setup context.`);\n }\n return context;\n}\n"],"mappings":";;AA2BA,MAAM,oBAAoB,IAAI,kBAAsC;AAEpE,SAAgB,oBAAuB,SAA6B,KAA2C;CAC7G,OAAO,kBAAkB,IAAI,SAAS,GAAG;AAC3C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,MAAM;AAClD;AAEA,SAAgB,aAAa,MAAc,MAAqC;CAC9E,WAAW,cAAc,CAAC,CAAC,aAAa,MAAM,IAAI;AACpD;AAEA,SAAgB,mBAAmB,OAAgC;CACjE,WAAW,oBAAoB,CAAC,CAAC,mBAAmB,KAAK;AAC3D;AAEA,SAAS,WAAW,KAAiC;CACnD,MAAM,UAAU,kBAAkB,SAAS;CAC3C,IAAI,CAAC,SACH,MAAM,IAAI,MAAM,cAAc,IAAI,gDAAgD;CAEpF,OAAO;AACT"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/kit/index.ts"],"sourcesContent":["import { AsyncLocalStorage } from \"node:async_hooks\";\nimport type {\n PagesExtender,\n ResuxComponentInput,\n ResuxComponentsDirInput,\n ResuxImportInput,\n ResuxModuleContext,\n ResuxPluginInput,\n ResuxRouteMiddlewareInput,\n ResuxServerHandlerInput,\n ResuxTemplateInput,\n ResuxTypeTemplateInput,\n ViteConfigExtender,\n NitroConfigExtender\n} from \"../core/module-container.js\";\n\nexport interface ResuxModuleMeta {\n name?: string;\n configKey?: string;\n}\n\nexport interface ResuxModuleDefinition<TOptions = Record<string, unknown>> {\n meta?: ResuxModuleMeta;\n defaults?: TOptions;\n setup: (options: TOptions, resux: ResuxModuleContext) => void | Promise<void>;\n}\n\nconst kitContextStorage = new AsyncLocalStorage<ResuxModuleContext>();\n\nexport function withResuxKitContext<T>(context: ResuxModuleContext, run: () => Promise<T> | T): Promise<T> | T {\n return kitContextStorage.run(context, run);\n}\n\nexport function defineResuxModule<TOptions = Record<string, unknown>>(module: ResuxModuleDefinition<TOptions>): ResuxModuleDefinition<TOptions> {\n return module;\n}\n\nexport function addComponent(component: ResuxComponentInput | string): void {\n useContext(\"addComponent\").addComponent(component);\n}\n\nexport function addComponentsDir(dir: ResuxComponentsDirInput | string): void {\n useContext(\"addComponentsDir\").addComponentsDir(dir);\n}\n\nexport function addImports(imports: ResuxImportInput | ResuxImportInput[]): void {\n useContext(\"addImports\").addImports(imports);\n}\n\nexport function addImportsDir(dir: string): void {\n useContext(\"addImportsDir\").addImportsDir(dir);\n}\n\nexport function addPlugin(plugin: ResuxPluginInput | string): void {\n useContext(\"addPlugin\").addPlugin(plugin);\n}\n\nexport function addRouteMiddleware(middleware: ResuxRouteMiddlewareInput): void {\n useContext(\"addRouteMiddleware\").addRouteMiddleware(middleware);\n}\n\nexport function addServerHandler(handler: ResuxServerHandlerInput): void {\n useContext(\"addServerHandler\").addServerHandler(handler);\n}\n\nexport function addServerPlugin(plugin: string): void {\n useContext(\"addServerPlugin\").addServerPlugin(plugin);\n}\n\nexport function addTemplate(template: ResuxTemplateInput): void {\n useContext(\"addTemplate\").addTemplate(template);\n}\n\nexport function addTypeTemplate(template: ResuxTypeTemplateInput): void {\n useContext(\"addTypeTemplate\").addTypeTemplate(template);\n}\n\nexport function extendPages(extender: PagesExtender): void {\n useContext(\"extendPages\").extendPages(extender);\n}\n\nexport function extendRuntimeConfig(config: Record<string, unknown>): void {\n useContext(\"extendRuntimeConfig\").extendRuntimeConfig(config);\n}\n\nexport function extendViteConfig(extender: ViteConfigExtender): void {\n useContext(\"extendViteConfig\").extendViteConfig(extender);\n}\n\nexport function extendNitroConfig(extender: NitroConfigExtender): void {\n useContext(\"extendNitroConfig\").extendNitroConfig(extender);\n}\n\nexport function addVitePlugin(plugin: unknown): void {\n useContext(\"addVitePlugin\").addVitePlugin(plugin);\n}\n\nexport function addRouteRule(path: string, rule: Record<string, unknown>): void {\n useContext(\"addRouteRule\").addRouteRule(path, rule);\n}\n\nexport function addPrerenderRoutes(route: string | string[]): void {\n useContext(\"addPrerenderRoutes\").addPrerenderRoutes(route);\n}\n\nfunction useContext(api: string): ResuxModuleContext {\n const context = kitContextStorage.getStore();\n if (!context) {\n throw new Error(`Resux Kit \"${api}\" was called outside of a module setup context.`);\n }\n return context;\n}\n"],"mappings":";;;AA2BA,MAAM,oBAAoB,IAAI,mBAAuC;AAErE,SAAgB,oBAAuB,SAA6B,KAA2C;AAC7G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;AACjE,YAAW,qBAAqB,CAAC,mBAAmB,MAAM;;AAG5D,SAAS,WAAW,KAAiC;CACnD,MAAM,UAAU,kBAAkB,UAAU;AAC5C,KAAI,CAAC,QACH,OAAM,IAAI,MAAM,cAAc,IAAI,iDAAiD;AAErF,QAAO"}
@@ -1,10 +1,11 @@
1
1
  //#region src/nitro-server/index.d.ts
2
- export interface ResuxNitroServerOptions {
2
+ interface ResuxNitroServerOptions {
3
3
  appRoot: string;
4
4
  outDir: string;
5
5
  preset?: string;
6
6
  compatibilityDate?: string;
7
7
  }
8
- export declare function createNitroServerOptions(options: ResuxNitroServerOptions): ResuxNitroServerOptions;
8
+ declare function createNitroServerOptions(options: ResuxNitroServerOptions): ResuxNitroServerOptions;
9
9
  //#endregion
10
+ export { ResuxNitroServerOptions, createNitroServerOptions };
10
11
  //# sourceMappingURL=index.d.ts.map
@@ -2,7 +2,7 @@
2
2
  function createNitroServerOptions(options) {
3
3
  return options;
4
4
  }
5
+
5
6
  //#endregion
6
7
  export { createNitroServerOptions };
7
-
8
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../src/nitro-server/index.ts"],"sourcesContent":["export interface ResuxNitroServerOptions {\n appRoot: string;\n outDir: string;\n preset?: string;\n compatibilityDate?: string;\n}\n\nexport function createNitroServerOptions(options: ResuxNitroServerOptions): ResuxNitroServerOptions {\n return options;\n}\n"],"mappings":";AAOA,SAAgB,yBAAyB,SAA2D;CAClG,OAAO;AACT"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/nitro-server/index.ts"],"sourcesContent":["export interface ResuxNitroServerOptions {\n appRoot: string;\n outDir: string;\n preset?: string;\n compatibilityDate?: string;\n}\n\nexport function createNitroServerOptions(options: ResuxNitroServerOptions): ResuxNitroServerOptions {\n return options;\n}\n"],"mappings":";AAOA,SAAgB,yBAAyB,SAA2D;AAClG,QAAO"}
package/dist/node.d.ts CHANGED
@@ -1,7 +1,9 @@
1
1
  import { ResuxNodeHandlerOptions } from "./cli.js";
2
2
  import { ServerResponse } from "node:http";
3
+ import * as http0 from "http";
4
+
3
5
  //#region src/node.d.ts
4
- export declare function createResuxNodeHandler(options?: ResuxNodeHandlerOptions): (request: import("http").IncomingMessage, response: ServerResponse) => void;
6
+ declare function createResuxNodeHandler(options?: ResuxNodeHandlerOptions): (request: http0.IncomingMessage, response: ServerResponse) => void;
5
7
  //#endregion
6
- export type { ResuxNodeHandlerOptions };
8
+ export { type ResuxNodeHandlerOptions, createResuxNodeHandler };
7
9
  //# sourceMappingURL=node.d.ts.map
package/dist/node.js CHANGED
@@ -1,16 +1,17 @@
1
1
  import { createResuxNodeHandler as createResuxNodeHandler$1 } from "./cli.js";
2
+
2
3
  //#region src/node.ts
3
4
  const GENERATED_IMAGE_PREFIX = "/_resux/generated/images/";
4
5
  const GENERATED_VIDEO_PREFIX = "/_resux/generated/videos/";
5
6
  const STATELESS_IMAGE_PATH = "/__resux/image";
6
7
  const STATELESS_VIDEO_PATH = "/__resux/video";
7
- const CACHE_BOOLEAN_TRUE = /* @__PURE__ */ new Set([
8
+ const CACHE_BOOLEAN_TRUE = new Set([
8
9
  "true",
9
10
  "1",
10
11
  "yes",
11
12
  "on"
12
13
  ]);
13
- const CACHE_BOOLEAN_FALSE = /* @__PURE__ */ new Set([
14
+ const CACHE_BOOLEAN_FALSE = new Set([
14
15
  "false",
15
16
  "0",
16
17
  "off",
@@ -20,8 +21,8 @@ const CACHE_UNIT_SECONDS = {
20
21
  s: 1,
21
22
  m: 60,
22
23
  h: 3600,
23
- d: 86400,
24
- w: 604800
24
+ d: 1440 * 60,
25
+ w: 10080 * 60
25
26
  };
26
27
  function positiveRoundedSeconds(value) {
27
28
  return Number.isFinite(value) && value > 0 ? Math.max(1, Math.round(value)) : void 0;
@@ -29,7 +30,7 @@ function positiveRoundedSeconds(value) {
29
30
  function parseCacheMaxAgeSeconds(value) {
30
31
  const normalized = value?.trim().toLowerCase();
31
32
  if (!normalized || CACHE_BOOLEAN_FALSE.has(normalized)) return;
32
- if (CACHE_BOOLEAN_TRUE.has(normalized)) return 86400;
33
+ if (CACHE_BOOLEAN_TRUE.has(normalized)) return 1440 * 60;
33
34
  const numericSeconds = positiveRoundedSeconds(Number(normalized));
34
35
  if (numericSeconds) return numericSeconds;
35
36
  const duration = /^(\d+)\s*([smhdw])$/.exec(normalized);
@@ -100,7 +101,7 @@ function createResuxNodeHandler(options = {}) {
100
101
  handler(request, response);
101
102
  };
102
103
  }
104
+
103
105
  //#endregion
104
106
  export { createResuxNodeHandler };
105
-
106
107
  //# sourceMappingURL=node.js.map
package/dist/node.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"node.js","names":["createCliResuxNodeHandler"],"sources":["../src/node.ts"],"sourcesContent":["import type { OutgoingHttpHeaders, ServerResponse } from \"node:http\";\nimport {\n createResuxNodeHandler as createCliResuxNodeHandler,\n type ResuxNodeHandlerOptions,\n} from \"./cli.js\";\n\nexport type { ResuxNodeHandlerOptions } from \"./cli.js\";\n\nconst GENERATED_IMAGE_PREFIX = \"/_resux/generated/images/\";\nconst GENERATED_VIDEO_PREFIX = \"/_resux/generated/videos/\";\nconst STATELESS_IMAGE_PATH = \"/__resux/image\";\nconst STATELESS_VIDEO_PATH = \"/__resux/video\";\nconst CACHE_BOOLEAN_TRUE = new Set([\"true\", \"1\", \"yes\", \"on\"]);\nconst CACHE_BOOLEAN_FALSE = new Set([\"false\", \"0\", \"off\", \"no\"]);\nconst CACHE_UNIT_SECONDS: Record<string, number> = {\n s: 1,\n m: 60,\n h: 60 * 60,\n d: 24 * 60 * 60,\n w: 7 * 24 * 60 * 60,\n};\n\nfunction positiveRoundedSeconds(value: number): number | undefined {\n return Number.isFinite(value) && value > 0\n ? Math.max(1, Math.round(value))\n : undefined;\n}\n\nfunction parseCacheMaxAgeSeconds(value: string | null): number | undefined {\n const normalized = value?.trim().toLowerCase();\n if (!normalized || CACHE_BOOLEAN_FALSE.has(normalized)) {\n return undefined;\n }\n if (CACHE_BOOLEAN_TRUE.has(normalized)) {\n return 24 * 60 * 60;\n }\n\n const numericSeconds = positiveRoundedSeconds(Number(normalized));\n if (numericSeconds) {\n return numericSeconds;\n }\n\n const duration = /^(\\d+)\\s*([smhdw])$/.exec(normalized);\n if (!duration) {\n return undefined;\n }\n\n const amount = Number(duration[1]);\n const unitSeconds = CACHE_UNIT_SECONDS[duration[2] ?? \"\"];\n return unitSeconds ? positiveRoundedSeconds(amount * unitSeconds) : undefined;\n}\n\nfunction isStatelessDeploymentRuntime(): boolean {\n return Boolean(\n process.env.VERCEL\n || process.env.VERCEL_ENV\n || process.env.AWS_LAMBDA_FUNCTION_NAME\n || process.env.LAMBDA_TASK_ROOT\n || process.env.NETLIFY,\n );\n}\n\nfunction resolveStatelessGeneratedMediaRequest(rawUrl: string | undefined): {\n url: string;\n maxAgeSeconds: number;\n} | null {\n if (!rawUrl) {\n return null;\n }\n\n let requestUrl: URL;\n try {\n requestUrl = new URL(rawUrl, \"https://resux.invalid\");\n } catch {\n return null;\n }\n\n const cacheValue = requestUrl.searchParams.get(\"cache\") ?? requestUrl.searchParams.get(\"c\");\n const maxAgeSeconds = parseCacheMaxAgeSeconds(cacheValue);\n if (!maxAgeSeconds) {\n return null;\n }\n\n const hasSource = Boolean(\n requestUrl.searchParams.get(\"src\")\n || requestUrl.searchParams.get(\"url\")\n || requestUrl.searchParams.get(\"original\"),\n );\n if (!hasSource) {\n return null;\n }\n\n if (requestUrl.pathname.startsWith(GENERATED_IMAGE_PREFIX)) {\n requestUrl.pathname = STATELESS_IMAGE_PATH;\n } else if (requestUrl.pathname.startsWith(GENERATED_VIDEO_PREFIX)) {\n requestUrl.pathname = STATELESS_VIDEO_PATH;\n } else {\n return null;\n }\n\n return {\n url: `${requestUrl.pathname}${requestUrl.search}`,\n maxAgeSeconds,\n };\n}\n\nfunction withGeneratedMediaCacheHeaders(\n response: ServerResponse,\n maxAgeSeconds: number,\n): void {\n const originalWriteHead = response.writeHead.bind(response) as (...args: any[]) => ServerResponse;\n const cacheControl = `public, max-age=${maxAgeSeconds}, s-maxage=${maxAgeSeconds}`;\n const cdnCacheControl = `public, max-age=${maxAgeSeconds}`;\n const overrides: OutgoingHttpHeaders = {\n \"cache-control\": cacheControl,\n \"cdn-cache-control\": cdnCacheControl,\n \"vercel-cdn-cache-control\": cdnCacheControl,\n \"x-resux-cache\": \"stateless\",\n };\n\n response.writeHead = ((statusCode: number, ...args: any[]) => {\n if (statusCode >= 200 && statusCode < 300) {\n if (typeof args[0] === \"string\") {\n if (args[1] && typeof args[1] === \"object\" && !Array.isArray(args[1])) {\n args[1] = { ...args[1], ...overrides };\n } else if (!args[1]) {\n args[1] = { ...overrides };\n }\n } else if (args[0] && typeof args[0] === \"object\" && !Array.isArray(args[0])) {\n args[0] = { ...args[0], ...overrides };\n } else if (!args[0]) {\n args[0] = { ...overrides };\n } else {\n for (const [name, value] of Object.entries(overrides)) {\n if (value !== undefined) {\n response.setHeader(name, value as string | number | readonly string[]);\n }\n }\n }\n }\n\n return originalWriteHead(statusCode, ...args);\n }) as ServerResponse[\"writeHead\"];\n}\n\nexport function createResuxNodeHandler(options: ResuxNodeHandlerOptions = {}) {\n const handler = createCliResuxNodeHandler(options);\n\n if (!isStatelessDeploymentRuntime()) {\n return handler;\n }\n\n return (request: Parameters<typeof handler>[0], response: Parameters<typeof handler>[1]): void => {\n const rewritten = resolveStatelessGeneratedMediaRequest(request.url);\n if (rewritten) {\n request.url = rewritten.url;\n withGeneratedMediaCacheHeaders(response, rewritten.maxAgeSeconds);\n }\n handler(request, response);\n };\n}\n"],"mappings":";;AAQA,MAAM,yBAAyB;AAC/B,MAAM,yBAAyB;AAC/B,MAAM,uBAAuB;AAC7B,MAAM,uBAAuB;AAC7B,MAAM,qCAAqB,IAAI,IAAI;CAAC;CAAQ;CAAK;CAAO;AAAI,CAAC;AAC7D,MAAM,sCAAsB,IAAI,IAAI;CAAC;CAAS;CAAK;CAAO;AAAI,CAAC;AAC/D,MA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W;GACb,QAAQ,MAAM,UAAU;GACxB,+BAA+B,UAAU,UAAU,aAAa;EAClE;EACA,QAAQ,SAAS,QAAQ;CAC3B;AACF"}
1
+ {"version":3,"file":"node.js","names":["createCliResuxNodeHandler"],"sources":["../src/node.ts"],"sourcesContent":["import type { OutgoingHttpHeaders, ServerResponse } from \"node:http\";\nimport {\n createResuxNodeHandler as createCliResuxNodeHandler,\n type ResuxNodeHandlerOptions,\n} from \"./cli.js\";\n\nexport type { ResuxNodeHandlerOptions } from \"./cli.js\";\n\nconst GENERATED_IMAGE_PREFIX = \"/_resux/generated/images/\";\nconst GENERATED_VIDEO_PREFIX = \"/_resux/generated/videos/\";\nconst STATELESS_IMAGE_PATH = \"/__resux/image\";\nconst STATELESS_VIDEO_PATH = \"/__resux/video\";\nconst CACHE_BOOLEAN_TRUE = new Set([\"true\", \"1\", \"yes\", \"on\"]);\nconst CACHE_BOOLEAN_FALSE = new Set([\"false\", \"0\", \"off\", \"no\"]);\nconst CACHE_UNIT_SECONDS: Record<string, number> = {\n s: 1,\n m: 60,\n h: 60 * 60,\n d: 24 * 60 * 60,\n w: 7 * 24 * 60 * 60,\n};\n\nfunction positiveRoundedSeconds(value: number): number | undefined {\n return Number.isFinite(value) && value > 0\n ? Math.max(1, Math.round(value))\n : undefined;\n}\n\nfunction parseCacheMaxAgeSeconds(value: string | null): number | undefined {\n const normalized = value?.trim().toLowerCase();\n if (!normalized || CACHE_BOOLEAN_FALSE.has(normalized)) {\n return undefined;\n }\n if (CACHE_BOOLEAN_TRUE.has(normalized)) {\n return 24 * 60 * 60;\n }\n\n const numericSeconds = positiveRoundedSeconds(Number(normalized));\n if (numericSeconds) {\n return numericSeconds;\n }\n\n const duration = /^(\\d+)\\s*([smhdw])$/.exec(normalized);\n if (!duration) {\n return undefined;\n }\n\n const amount = Number(duration[1]);\n const unitSeconds = CACHE_UNIT_SECONDS[duration[2] ?? \"\"];\n return unitSeconds ? positiveRoundedSeconds(amount * unitSeconds) : undefined;\n}\n\nfunction isStatelessDeploymentRuntime(): boolean {\n return Boolean(\n process.env.VERCEL\n || process.env.VERCEL_ENV\n || process.env.AWS_LAMBDA_FUNCTION_NAME\n || process.env.LAMBDA_TASK_ROOT\n || process.env.NETLIFY,\n );\n}\n\nfunction resolveStatelessGeneratedMediaRequest(rawUrl: string | undefined): {\n url: string;\n maxAgeSeconds: number;\n} | null {\n if (!rawUrl) {\n return null;\n }\n\n let requestUrl: URL;\n try {\n requestUrl = new URL(rawUrl, \"https://resux.invalid\");\n } catch {\n return null;\n }\n\n const cacheValue = requestUrl.searchParams.get(\"cache\") ?? requestUrl.searchParams.get(\"c\");\n const maxAgeSeconds = parseCacheMaxAgeSeconds(cacheValue);\n if (!maxAgeSeconds) {\n return null;\n }\n\n const hasSource = Boolean(\n requestUrl.searchParams.get(\"src\")\n || requestUrl.searchParams.get(\"url\")\n || requestUrl.searchParams.get(\"original\"),\n );\n if (!hasSource) {\n return null;\n }\n\n if (requestUrl.pathname.startsWith(GENERATED_IMAGE_PREFIX)) {\n requestUrl.pathname = STATELESS_IMAGE_PATH;\n } else if (requestUrl.pathname.startsWith(GENERATED_VIDEO_PREFIX)) {\n requestUrl.pathname = STATELESS_VIDEO_PATH;\n } else {\n return null;\n }\n\n return {\n url: `${requestUrl.pathname}${requestUrl.search}`,\n maxAgeSeconds,\n };\n}\n\nfunction withGeneratedMediaCacheHeaders(\n response: ServerResponse,\n maxAgeSeconds: number,\n): void {\n const originalWriteHead = response.writeHead.bind(response) as (...args: any[]) => ServerResponse;\n const cacheControl = `public, max-age=${maxAgeSeconds}, s-maxage=${maxAgeSeconds}`;\n const cdnCacheControl = `public, max-age=${maxAgeSeconds}`;\n const overrides: OutgoingHttpHeaders = {\n \"cache-control\": cacheControl,\n \"cdn-cache-control\": cdnCacheControl,\n \"vercel-cdn-cache-control\": cdnCacheControl,\n \"x-resux-cache\": \"stateless\",\n };\n\n response.writeHead = ((statusCode: number, ...args: any[]) => {\n if (statusCode >= 200 && statusCode < 300) {\n if (typeof args[0] === \"string\") {\n if (args[1] && typeof args[1] === \"object\" && !Array.isArray(args[1])) {\n args[1] = { ...args[1], ...overrides };\n } else if (!args[1]) {\n args[1] = { ...overrides };\n }\n } else if (args[0] && typeof args[0] === \"object\" && !Array.isArray(args[0])) {\n args[0] = { ...args[0], ...overrides };\n } else if (!args[0]) {\n args[0] = { ...overrides };\n } else {\n for (const [name, value] of Object.entries(overrides)) {\n if (value !== undefined) {\n response.setHeader(name, value as string | number | readonly string[]);\n }\n }\n }\n }\n\n return originalWriteHead(statusCode, ...args);\n }) as ServerResponse[\"writeHead\"];\n}\n\nexport function createResuxNodeHandler(options: ResuxNodeHandlerOptions = {}) {\n const handler = createCliResuxNodeHandler(options);\n\n if (!isStatelessDeploymentRuntime()) {\n return handler;\n }\n\n return (request: Parameters<typeof handler>[0], response: Parameters<typeof handler>[1]): void => {\n const rewritten = resolveStatelessGeneratedMediaRequest(request.url);\n if (rewritten) {\n request.url = rewritten.url;\n withGeneratedMediaCacheHeaders(response, rewritten.maxAgeSeconds);\n }\n handler(request, response);\n };\n}\n"],"mappings":";;;AAQA,MAAM,yBAAyB;AAC/B,MAAM,yBAAyB;AAC/B,MAAM,uBAAuB;AAC7B,MAAM,uBAAuB;AAC7B,MAAM,qBAAqB,IAAI,IAAI;CAAC;CAAQ;CAAK;CAAO;CAAK,CAAC;AAC9D,MAAM,sBAAsB,IAAI,IAAI;CAAC;CAAS;CAAK;CAAO;CAAK,CAAC;AAChE,MAAM,qBAA6C;CACjD,GAAG;CACH,GAAG;CACH,GAAG;CACH,GAAG,OAAU;CACb,GAAG,QAAc;CAClB;AAED,SAAS,uBAAuB,OAAmC;AACjE,QAAO,OAAO,SAAS,MAAM,IAAI,QAAQ,IACrC,KAAK,IAAI,GAAG,KAAK,MAAM,MAAM,CAAC,GAC9B;;AAGN,SAAS,wBAAwB,OAA0C;CACzE,MAAM,aAAa,OAAO,MAAM,CAAC,aAAa;AAC9C,KAAI,CAAC,cAAc,oBA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5B,iBAAiB;EAClB;AAED,UAAS,cAAc,YAAoB,GAAG,SAAgB;AAC5D,MAAI,cAAc,OAAO,aAAa,KACpC;OAAI,OAAO,KAAK,OAAO,UACrB;QAAI,KAAK,MAAM,OAAO,KAAK,OAAO,YAAY,CAAC,MAAM,QAAQ,KAAK,GAAG,CACnE,MAAK,KAAK;KAAE,GAAG,KAAK;KAAI,GAAG;KAAW;aAC7B,CAAC,KAAK,GACf,MAAK,KAAK,EAAE,GAAG,WAAW;cAEnB,KAAK,MAAM,OAAO,KAAK,OAAO,YAAY,CAAC,MAAM,QAAQ,KAAK,GAAG,CAC1E,MAAK,KAAK;IAAE,GAAG,KAAK;IAAI,GAAG;IAAW;YAC7B,CAAC,KAAK,GACf,MAAK,KAAK,EAAE,GAAG,WAAW;OAE1B,MAAK,MAAM,CAAC,MAAM,UAAU,OAAO,QAAQ,UAAU,CACnD,KAAI,UAAU,OACZ,UAAS,UAAU,MAAM,MAA6C;;AAM9E,SAAO,kBAAkB,YAAY,GAAG,KAAK;;;AAIjD,SAAgB,uBAAuB,UAAmC,EAAE,EAAE;CAC5E,MAAM,UAAUA,yBAA0B,QAAQ;AAElD,KAAI,CAAC,8BAA8B,CACjC,QAAO;AAGT,SAAQ,SAAwC,aAAkD;EAChG,MAAM,YAAY,sCAAsC,QAAQ,IAAI;AACpE,MAAI,WAAW;AACb,WAAQ,MAAM,UAAU;AACxB,kCAA+B,UAAU,UAAU,cAAc;;AAEnE,UAAQ,SAAS,SAAS"}
@@ -1,10 +1,12 @@
1
1
  import { ComputedRef } from "./types.js";
2
+
2
3
  //#region src/reactivity/computed.d.ts
3
- export declare function computed<T>(getter: () => T): ComputedRef<T>;
4
- export declare function computed<T>(options: {
4
+ declare function computed<T>(getter: () => T): ComputedRef<T>;
5
+ declare function computed<T>(options: {
5
6
  get: () => T;
6
7
  set?: (value: T) => void;
7
8
  }): ComputedRef<T>;
8
- export declare function isComputed(value: unknown): boolean;
9
+ declare function isComputed(value: unknown): boolean;
9
10
  //#endregion
11
+ export { computed, isComputed };
10
12
  //# sourceMappingURL=computed.d.ts.map
@@ -1,5 +1,6 @@
1
1
  import { effect, isTracking, trackEffects, triggerEffects } from "./effect.js";
2
2
  import { ReactiveFlags } from "./utils.js";
3
+
3
4
  //#region src/reactivity/computed.ts
4
5
  var ComputedRefImpl = class {
5
6
  __v_isRef = true;
@@ -24,8 +25,7 @@ var ComputedRefImpl = class {
24
25
  get value() {
25
26
  if (isTracking()) trackEffects(this._dep());
26
27
  if (this.dirty) {
27
- const value = this.runner();
28
- this._value = value;
28
+ this._value = this.runner();
29
29
  this.dirty = false;
30
30
  }
31
31
  return this._value;
@@ -45,7 +45,7 @@ function computed(getterOrOptions) {
45
45
  function isComputed(value) {
46
46
  return Boolean(value && typeof value === "object" && value[ReactiveFlags.IS_REF] === true && value[ReactiveFlags.IS_READONLY] === true);
47
47
  }
48
+
48
49
  //#endregion
49
50
  export { computed, isComputed };
50
-
51
51
  //# sourceMappingURL=computed.js.map