nuxt-og-image 4.0.2 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (401) hide show
  1. package/LICENSE.md +9 -9
  2. package/README.md +75 -75
  3. package/dist/client/200.html +218 -217
  4. package/dist/client/404.html +218 -217
  5. package/dist/client/_nuxt/3kbuJQcV.js +1 -0
  6. package/dist/client/_nuxt/3xVqZejG.js +1 -0
  7. package/dist/client/_nuxt/4XBoJZZ4.js +3834 -0
  8. package/dist/client/_nuxt/{CrOfvjVs.js → 5LuOXUq_.js} +1 -1
  9. package/dist/client/_nuxt/727ZlQH0.js +1 -0
  10. package/dist/client/_nuxt/7O62HKoU.js +1 -0
  11. package/dist/client/_nuxt/9C6ErRqt.js +1 -0
  12. package/dist/client/_nuxt/B-DoSBHF.js +1 -0
  13. package/dist/client/_nuxt/{I3KQ5pkt.js → B-MI_7-y.js} +1 -1
  14. package/dist/client/_nuxt/B-k3dvlD.js +1 -0
  15. package/dist/client/_nuxt/B0XVJmRM.js +1 -0
  16. package/dist/client/_nuxt/B14Poo8t.js +1 -0
  17. package/dist/client/_nuxt/B1SYOhNW.js +1 -0
  18. package/dist/client/_nuxt/B1bQXN8T.js +1 -0
  19. package/dist/client/_nuxt/B2vK47Ag.js +1 -0
  20. package/dist/client/_nuxt/B3ZDOciz.js +1 -0
  21. package/dist/client/_nuxt/B430Bg39.js +1 -0
  22. package/dist/client/_nuxt/B48N-Iqd.js +1 -0
  23. package/dist/client/_nuxt/B5auBHZD.js +1 -0
  24. package/dist/client/_nuxt/B5lbUyaz.js +1 -0
  25. package/dist/client/_nuxt/B6W0miNI.js +1 -0
  26. package/dist/client/_nuxt/B7mTdjB0.js +1 -0
  27. package/dist/client/_nuxt/B9wLZaAG.js +1 -0
  28. package/dist/client/_nuxt/BAng5TT0.js +1 -0
  29. package/dist/client/_nuxt/{BzaEo2Du.js → BC5c_5Pe.js} +1 -1
  30. package/dist/client/_nuxt/BE9QQhgF.js +1 -0
  31. package/dist/client/_nuxt/BEhvmC7f.js +1 -0
  32. package/dist/client/_nuxt/{C8pgRvQH.js → BFOHcciG.js} +1 -1
  33. package/dist/client/_nuxt/BHOwM8T6.js +1 -0
  34. package/dist/client/_nuxt/BIEUsx6d.js +1 -0
  35. package/dist/client/_nuxt/BILxekzW.js +1 -0
  36. package/dist/client/_nuxt/BJ4Li9vH.js +1 -0
  37. package/dist/client/_nuxt/BJGe-b2p.js +1 -0
  38. package/dist/client/_nuxt/{C0hdQUNN.js → BMR_PYu6.js} +1 -1
  39. package/dist/client/_nuxt/{dwbxrGt_.js → BMYPR7BL.js} +1 -1
  40. package/dist/client/_nuxt/BMj5Y0dO.js +1 -0
  41. package/dist/client/_nuxt/{BTbGKmhu.js → BNHBcdi1.js} +1 -1
  42. package/dist/client/_nuxt/BNioltXt.js +1 -0
  43. package/dist/client/_nuxt/BPT9niGB.js +1 -0
  44. package/dist/client/_nuxt/BPhBrDlE.js +1 -0
  45. package/dist/client/_nuxt/{DWmkr0yC.js → BQoSv7ci.js} +1 -1
  46. package/dist/client/_nuxt/BQwtg7Y-.js +1 -0
  47. package/dist/client/_nuxt/BUEGK8hf.js +1 -0
  48. package/dist/client/_nuxt/BVUVsWT6.js +1 -0
  49. package/dist/client/_nuxt/BVr_1_27.js +1 -0
  50. package/dist/client/_nuxt/{D44NvAEk.js → BVz_zdnA.js} +1 -1
  51. package/dist/client/_nuxt/{CMz7PuSU.js → BX77sIaO.js} +1 -1
  52. package/dist/client/_nuxt/BXW1EomU.js +1 -0
  53. package/dist/client/_nuxt/{BD9UVO-6.js → BXWLJovA.js} +1 -1
  54. package/dist/client/_nuxt/BY-TUvya.js +1 -0
  55. package/dist/client/_nuxt/B_49xXYf.js +1 -0
  56. package/dist/client/_nuxt/BbSNqyBO.js +1 -0
  57. package/dist/client/_nuxt/BdxkyMLR.js +1 -0
  58. package/dist/client/_nuxt/Be6lgOlo.js +1 -0
  59. package/dist/client/_nuxt/BeQkCIfX.js +1 -0
  60. package/dist/client/_nuxt/BfCpw3nA.js +1 -0
  61. package/dist/client/_nuxt/{CpRrwcwt.js → BfivnA6A.js} +1 -1
  62. package/dist/client/_nuxt/Bg-kzb6g.js +1 -0
  63. package/dist/client/_nuxt/BgYniUM_.js +1 -0
  64. package/dist/client/_nuxt/{i5HCB2tm.js → BiFfXF7O.js} +1 -1
  65. package/dist/client/_nuxt/Bid6LQhH.js +1 -0
  66. package/dist/client/_nuxt/BjQB5zDj.js +1 -0
  67. package/dist/client/_nuxt/{D-RymO5g.js → BknIz3MU.js} +1 -1
  68. package/dist/client/_nuxt/{eACALr6E.js → Bl1h29GH.js} +1 -1
  69. package/dist/client/_nuxt/{CKfqYE_r.js → BlxRB_8X.js} +1 -1
  70. package/dist/client/_nuxt/BoXegm-a.js +1 -0
  71. package/dist/client/_nuxt/BpWG_bgh.js +1 -0
  72. package/dist/client/_nuxt/BsOYHjMa.js +1 -0
  73. package/dist/client/_nuxt/Bu5BbsvL.js +1 -0
  74. package/dist/client/_nuxt/{DNDvMORL.js → Bvotw-X0.js} +1 -1
  75. package/dist/client/_nuxt/Bw0wYZmb.js +1 -0
  76. package/dist/client/_nuxt/{DDUKAZWS.js → BwXTMy5W.js} +1 -1
  77. package/dist/client/_nuxt/C-nORZOA.js +1 -0
  78. package/dist/client/_nuxt/C-wny61x.js +1 -0
  79. package/dist/client/_nuxt/C0nbwVuJ.js +1 -0
  80. package/dist/client/_nuxt/C1XDQQGZ.js +1 -0
  81. package/dist/client/_nuxt/C1tVc3UG.js +1 -0
  82. package/dist/client/_nuxt/{DymQr0nX.js → C1w2a3ep.js} +1 -1
  83. package/dist/client/_nuxt/C30yJ1fx.js +1 -0
  84. package/dist/client/_nuxt/C39BiMTA.js +1 -0
  85. package/dist/client/_nuxt/C3FkfJm5.js +1 -0
  86. package/dist/client/_nuxt/C3mMm8J8.js +1 -0
  87. package/dist/client/_nuxt/C3t2pwGQ.js +1 -0
  88. package/dist/client/_nuxt/C5Y8tDhP.js +1 -0
  89. package/dist/client/_nuxt/C5wWYbrZ.js +1 -0
  90. package/dist/client/_nuxt/{sH2JAGjN.js → C6j12Q_x.js} +1 -1
  91. package/dist/client/_nuxt/C7L56vO4.js +1 -0
  92. package/dist/client/_nuxt/C7gG9l05.js +1 -0
  93. package/dist/client/_nuxt/CAQ2eGtk.js +1 -0
  94. package/dist/client/_nuxt/{CSoQzgif.js → CB0Krxn9.js} +1 -1
  95. package/dist/client/_nuxt/{Dwo6uFCY.js → CB2ApiWb.js} +1 -1
  96. package/dist/client/_nuxt/{B6E6ObS_.js → CG55hV0U.js} +2 -2
  97. package/dist/client/_nuxt/{CyEc264g.js → CGVVOGHx.js} +1 -1
  98. package/dist/client/_nuxt/CJaU5se_.js +1 -0
  99. package/dist/client/_nuxt/CKg9tqCS.js +1 -0
  100. package/dist/client/_nuxt/{CmWLV2bY.js → CM8KxXT1.js} +1 -1
  101. package/dist/client/_nuxt/CMt9yHYq.js +1 -0
  102. package/dist/client/_nuxt/COJ4H7py.js +1 -0
  103. package/dist/client/_nuxt/COK4E0Yg.js +1 -0
  104. package/dist/client/_nuxt/{CbUnruJU.js → COyJrUc7.js} +1 -1
  105. package/dist/client/_nuxt/CQ0soPOq.js +1 -0
  106. package/dist/client/_nuxt/CSHBycmS.js +1 -0
  107. package/dist/client/_nuxt/CSp6iqVD.js +1 -0
  108. package/dist/client/_nuxt/CUnW07Te.js +1 -0
  109. package/dist/client/_nuxt/{CIiI48o2.js → CVw76BM1.js} +1 -1
  110. package/dist/client/_nuxt/CYFUjXW1.js +1 -0
  111. package/dist/client/_nuxt/CZe0XNBd.js +1 -0
  112. package/dist/client/_nuxt/Cc5clBb7.js +1 -0
  113. package/dist/client/_nuxt/CcHjYXgz.js +1 -0
  114. package/dist/client/_nuxt/{Bv-mwDEg.js → CdO5JTpU.js} +1 -1
  115. package/dist/client/_nuxt/{j_FrBdja.js → Cf8iN4DR.js} +1 -1
  116. package/dist/client/_nuxt/{zchoCBdH.js → CfQXZHmo.js} +1 -1
  117. package/dist/client/_nuxt/Ci6OQyBP.js +1 -0
  118. package/dist/client/_nuxt/{RXHOmnpW.js → CkXjmgJE.js} +1 -1
  119. package/dist/client/_nuxt/{yA8e6OR-.js → ClGRhx96.js} +1 -1
  120. package/dist/client/_nuxt/CsSk9TLD.js +1 -0
  121. package/dist/client/_nuxt/{Cqv5JV-q.js → CwjWoCRV.js} +1 -1
  122. package/dist/client/_nuxt/{s1PdnzAn.js → CyIGOvEh.js} +1 -1
  123. package/dist/client/_nuxt/{CodIOJDM.js → Cz8P-rqG.js} +1 -1
  124. package/dist/client/_nuxt/Cza_XSSt.js +1 -0
  125. package/dist/client/_nuxt/CzouJOBO.js +1 -0
  126. package/dist/client/_nuxt/{ZJvK9Z2N.js → D4Tzg5kh.js} +1 -1
  127. package/dist/client/_nuxt/{CQWsIgnU.js → D4h5O-jR.js} +1 -1
  128. package/dist/client/_nuxt/D5pd2Owo.js +1 -0
  129. package/dist/client/_nuxt/D8mZ0lfy.js +1 -0
  130. package/dist/client/_nuxt/D9-PGadD.js +1 -0
  131. package/dist/client/_nuxt/D9R-vmeu.js +1 -0
  132. package/dist/client/_nuxt/DB_GagMm.js +1 -0
  133. package/dist/client/_nuxt/DCE3LsBG.js +1 -0
  134. package/dist/client/_nuxt/DDtJtuOZ.js +1 -0
  135. package/dist/client/_nuxt/DHo0CJ0O.js +1 -0
  136. package/dist/client/_nuxt/{Dzwn3p-3.js → DJlmqQ1C.js} +1 -1
  137. package/dist/client/_nuxt/DKOGybHv.js +1 -0
  138. package/dist/client/_nuxt/DKXYxT9g.js +1 -0
  139. package/dist/client/_nuxt/DKykz6zU.js +1 -0
  140. package/dist/client/_nuxt/DLVR-baX.js +1 -0
  141. package/dist/client/_nuxt/{CEjiMJLT.js → DNquZEk8.js} +1 -1
  142. package/dist/client/_nuxt/DPvbFsQx.js +1 -0
  143. package/dist/client/_nuxt/{NUI3YrRW.js → DQ1-QYvQ.js} +1 -1
  144. package/dist/client/_nuxt/{NKd-Y1zG.js → DREVFZK8.js} +1 -1
  145. package/dist/client/_nuxt/{IqKf4WGj.js → DRNBmV_Q.js} +1 -1
  146. package/dist/client/_nuxt/DRhBOlRY.js +1 -0
  147. package/dist/client/_nuxt/{DoiKbUTj.js → DWJ3fJO_.js} +1 -1
  148. package/dist/client/_nuxt/{2aygx1xg.js → DWedfzmr.js} +1 -1
  149. package/dist/client/_nuxt/{CmY0Y6Yh.js → DXbdFlpD.js} +1 -1
  150. package/dist/client/_nuxt/DYoNaHQp.js +1 -0
  151. package/dist/client/_nuxt/DYvnoCeB.js +1 -0
  152. package/dist/client/_nuxt/D_z4Izcz.js +1 -0
  153. package/dist/client/_nuxt/{CNRQ974Q.js → Dayu4EKP.js} +1 -1
  154. package/dist/client/_nuxt/Dbxjm_CC.js +1 -0
  155. package/dist/client/_nuxt/{B6NdQBKR.js → Deuh7S70.js} +1 -1
  156. package/dist/client/_nuxt/DfxzS6Rs.js +1 -0
  157. package/dist/client/_nuxt/DhUJRlN_.js +1 -0
  158. package/dist/client/_nuxt/Dhn9LcZ4.js +1 -0
  159. package/dist/client/_nuxt/Dj6nwHGl.js +1 -0
  160. package/dist/client/_nuxt/{ClV7KpCc.js → DjHMNizO.js} +1 -1
  161. package/dist/client/_nuxt/DkBy-JyN.js +1 -0
  162. package/dist/client/_nuxt/DkLiglaE.js +1 -0
  163. package/dist/client/_nuxt/Dmy2k9nq.js +1 -0
  164. package/dist/client/_nuxt/Drsz93k2.js +1 -0
  165. package/dist/client/_nuxt/DsBKuouk.js +1 -0
  166. package/dist/client/_nuxt/{DFW6HATB.js → DsWjAdsX.js} +1 -1
  167. package/dist/client/_nuxt/{BCzYJAay.js → Dsg_Bt_b.js} +1 -1
  168. package/dist/client/_nuxt/DtFQj3wx.js +1 -0
  169. package/dist/client/_nuxt/Du268qiB.js +1 -0
  170. package/dist/client/_nuxt/Du5NY7AG.js +1 -0
  171. package/dist/client/_nuxt/DxSadP1t.js +1 -0
  172. package/dist/client/_nuxt/HNqc6WRo.js +1 -0
  173. package/dist/client/_nuxt/HnGAYVZD.js +1 -0
  174. package/dist/client/_nuxt/HzYwdGDm.js +1 -0
  175. package/dist/client/_nuxt/{Dtn98rcr.js → IuBKFhSY.js} +1 -1
  176. package/dist/client/_nuxt/{DZQMDcrx.js → L9t79GZl.js} +1 -1
  177. package/dist/client/_nuxt/{DlYXzDlu.js → P4WzXJd0.js} +1 -1
  178. package/dist/client/_nuxt/{BGct0Hx7.js → QhoSD0DR.js} +1 -1
  179. package/dist/client/_nuxt/R900dpIa.js +1 -0
  180. package/dist/client/_nuxt/{BSHf-0eb.js → SKMF96pI.js} +1 -1
  181. package/dist/client/_nuxt/SPD3sf1n.js +1 -0
  182. package/dist/client/_nuxt/{D9Bn7OQI.js → T-Tgc4AT.js} +1 -1
  183. package/dist/client/_nuxt/{B8E-_56i.js → TU54ms6u.js} +1 -1
  184. package/dist/client/_nuxt/Tz6hzZYG.js +1 -0
  185. package/dist/client/_nuxt/UIAJJxZW.js +1 -0
  186. package/dist/client/_nuxt/UL5zprDm.js +1 -0
  187. package/dist/client/_nuxt/XBlWyCtg.js +1 -0
  188. package/dist/client/_nuxt/{L9-HYnaW.js → YJb9dmdj.js} +1 -1
  189. package/dist/client/_nuxt/{D2TqM893.js → Ye_uPAM8.js} +1 -1
  190. package/dist/client/_nuxt/{Bnbw1zOw.js → ahYVQIuB.js} +1 -1
  191. package/dist/client/_nuxt/{DJEtsjbi.js → ajMbGru0.js} +1 -1
  192. package/dist/client/_nuxt/atvbtKCR.js +1 -0
  193. package/dist/client/_nuxt/{dZn0vQkf.js → bCA53EVm.js} +1 -1
  194. package/dist/client/_nuxt/bN70gL4F.js +1 -0
  195. package/dist/client/_nuxt/builds/latest.json +1 -1
  196. package/dist/client/_nuxt/builds/meta/b9d6b3a8-8e55-4600-8c54-953432a44665.json +1 -0
  197. package/dist/client/_nuxt/{CkqQx3Va.js → cPjAOO0u.js} +1 -1
  198. package/dist/client/_nuxt/din0uRiO.js +1 -0
  199. package/dist/client/_nuxt/{FMvz1E70.js → e4jU7D2d.js} +1 -1
  200. package/dist/client/_nuxt/{BINKOAKH.js → eg146-Ew.js} +1 -1
  201. package/dist/client/_nuxt/{entry.CpT28PgB.css → entry.0k2jyAbH.css} +1 -1
  202. package/dist/client/_nuxt/error-404.CeB15F3i.css +1 -0
  203. package/dist/client/_nuxt/error-500.kWwbyTjN.css +1 -0
  204. package/dist/client/_nuxt/fje9CFhw.js +1 -0
  205. package/dist/client/_nuxt/ifBTmRxC.js +1 -0
  206. package/dist/client/_nuxt/{DfpIq38s.js → m2LEI-9-.js} +1 -1
  207. package/dist/client/_nuxt/m4gc_qpA.js +1 -0
  208. package/dist/client/_nuxt/m4uW47V2.js +1 -0
  209. package/dist/client/_nuxt/mebxcVVE.js +1 -0
  210. package/dist/client/_nuxt/nyqBNV6O.js +1 -0
  211. package/dist/client/_nuxt/qmhIZ77x.js +1 -0
  212. package/dist/client/_nuxt/{CY2R9RuK.js → qpfuy3xp.js} +1 -1
  213. package/dist/client/_nuxt/sacFqUAJ.js +1 -0
  214. package/dist/client/_nuxt/{Bcw97oti.js → sdHcTMYB.js} +1 -1
  215. package/dist/client/_nuxt/shcSOmrb.js +1 -0
  216. package/dist/client/_nuxt/{CQzXS8_C.js → w-ucz2PV.js} +1 -1
  217. package/dist/client/_nuxt/{BDjtpMT8.js → w8dY5SsB.js} +1 -1
  218. package/dist/client/_nuxt/wI6OXr6j.js +1 -0
  219. package/dist/client/_nuxt/xI-RfyKK.js +1 -0
  220. package/dist/client/_nuxt/{CpWBKVjh.js → xW4inM5L.js} +1 -1
  221. package/dist/client/_nuxt/ySlJ1b_l.js +1 -0
  222. package/dist/client/_nuxt/{hdsyEllQ.js → zocC4JxJ.js} +1 -1
  223. package/dist/client/index.html +218 -217
  224. package/dist/content.cjs +20 -0
  225. package/dist/content.d.cts +35 -0
  226. package/dist/content.d.mts +35 -0
  227. package/dist/content.d.ts +35 -0
  228. package/dist/content.mjs +17 -0
  229. package/dist/module.cjs +944 -4
  230. package/dist/module.d.cts +108 -0
  231. package/dist/module.d.mts +1 -1
  232. package/dist/module.d.ts +1 -1
  233. package/dist/module.json +1 -1
  234. package/dist/module.mjs +37 -18
  235. package/dist/runtime/app/components/Templates/Community/BrandedLogo.vue +29 -29
  236. package/dist/runtime/app/components/Templates/Community/Frame.vue +64 -64
  237. package/dist/runtime/app/components/Templates/Community/Nuxt.vue +185 -185
  238. package/dist/runtime/app/components/Templates/Community/NuxtSeo.vue +137 -137
  239. package/dist/runtime/app/components/Templates/Community/Pergel.vue +103 -103
  240. package/dist/runtime/app/components/Templates/Community/SimpleBlog.vue +35 -35
  241. package/dist/runtime/app/components/Templates/Community/UnJs.vue +108 -108
  242. package/dist/runtime/app/components/Templates/Community/Wave.vue +34 -34
  243. package/dist/runtime/app/components/Templates/Community/WithEmoji.vue +28 -28
  244. package/dist/runtime/logger.d.ts +1 -1
  245. package/dist/runtime/pure.js +15 -4
  246. package/dist/runtime/server/og-image/satori/plugins/imageSrc.js +5 -2
  247. package/dist/runtime/server/og-image/satori/renderer.d.ts +1 -1
  248. package/dist/runtime/server/og-image/satori/renderer.js +10 -3
  249. package/dist/runtime/server/og-image/templates/html.js +3 -3
  250. package/dist/runtime/server/tsconfig.json +3 -3
  251. package/dist/runtime/server/util/logger.d.ts +1 -1
  252. package/dist/runtime/types.d.ts +2 -3
  253. package/package.json +31 -33
  254. package/virtual.d.ts +71 -71
  255. package/dist/client/_nuxt/-ALZ4IvE.js +0 -1
  256. package/dist/client/_nuxt/2pWuV6-S.js +0 -1
  257. package/dist/client/_nuxt/5Vw9JATd.js +0 -1
  258. package/dist/client/_nuxt/6RUVFG9U.js +0 -1
  259. package/dist/client/_nuxt/8Uu6eIa-.js +0 -1
  260. package/dist/client/_nuxt/B1rsb5QC.js +0 -1
  261. package/dist/client/_nuxt/B2bjgU-v.js +0 -1
  262. package/dist/client/_nuxt/B2uSYIFn.js +0 -1
  263. package/dist/client/_nuxt/B3Z_eaxm.js +0 -1
  264. package/dist/client/_nuxt/B4_rEpOs.js +0 -1
  265. package/dist/client/_nuxt/B5L7zzq-.js +0 -1
  266. package/dist/client/_nuxt/B74Y8nHz.js +0 -1
  267. package/dist/client/_nuxt/B9Vj0mJK.js +0 -1
  268. package/dist/client/_nuxt/BA1ndEPy.js +0 -1
  269. package/dist/client/_nuxt/BCawSwWi.js +0 -1
  270. package/dist/client/_nuxt/BIguuW30.js +0 -1
  271. package/dist/client/_nuxt/BJGgnGWZ.js +0 -1
  272. package/dist/client/_nuxt/BJNXdUBN.js +0 -1
  273. package/dist/client/_nuxt/BKbjiiqg.js +0 -1
  274. package/dist/client/_nuxt/BMwgFBEQ.js +0 -1
  275. package/dist/client/_nuxt/BN40hmum.js +0 -1
  276. package/dist/client/_nuxt/BNxDCkIA.js +0 -1
  277. package/dist/client/_nuxt/BSPpinrx.js +0 -1
  278. package/dist/client/_nuxt/BWkuYGGO.js +0 -1
  279. package/dist/client/_nuxt/BWslPs4p.js +0 -1
  280. package/dist/client/_nuxt/BYqZ7etr.js +0 -1
  281. package/dist/client/_nuxt/BZ3P6AVf.js +0 -1
  282. package/dist/client/_nuxt/BZRbnyjI.js +0 -1
  283. package/dist/client/_nuxt/B_R80ZlN.js +0 -1
  284. package/dist/client/_nuxt/BaLI2h1d.js +0 -1
  285. package/dist/client/_nuxt/BbalPOsb.js +0 -1
  286. package/dist/client/_nuxt/BbccZ3y2.js +0 -1
  287. package/dist/client/_nuxt/Bdprqoiu.js +0 -1
  288. package/dist/client/_nuxt/BgqZeg96.js +0 -1
  289. package/dist/client/_nuxt/BhC5s0V7.js +0 -1
  290. package/dist/client/_nuxt/BhsLqr-4.js +0 -1
  291. package/dist/client/_nuxt/BjXeLqNd.js +0 -1
  292. package/dist/client/_nuxt/Bjs2cL5p.js +0 -1
  293. package/dist/client/_nuxt/BkG9CdHo.js +0 -1
  294. package/dist/client/_nuxt/Bmb0A568.js +0 -1
  295. package/dist/client/_nuxt/BnfnAR_u.js +0 -1
  296. package/dist/client/_nuxt/BoZcIFWd.js +0 -1
  297. package/dist/client/_nuxt/BqtQrzRp.js +0 -1
  298. package/dist/client/_nuxt/BrbOHqWv.js +0 -1
  299. package/dist/client/_nuxt/Bv_sPlCv.js +0 -1
  300. package/dist/client/_nuxt/BwpQXVS2.js +0 -1
  301. package/dist/client/_nuxt/ByY1Guvr.js +0 -1
  302. package/dist/client/_nuxt/BzAMEn9Z.js +0 -1
  303. package/dist/client/_nuxt/BzwtH5UL.js +0 -1
  304. package/dist/client/_nuxt/C30t_gpS.js +0 -1
  305. package/dist/client/_nuxt/C4Ro8ZjH.js +0 -1
  306. package/dist/client/_nuxt/C5-9kuJc.js +0 -1
  307. package/dist/client/_nuxt/CBzZD_Xh.js +0 -1
  308. package/dist/client/_nuxt/CGXjegLJ.js +0 -1
  309. package/dist/client/_nuxt/CI15r38m.js +0 -1
  310. package/dist/client/_nuxt/CIxipgmy.js +0 -1
  311. package/dist/client/_nuxt/CJxt7p29.js +0 -1
  312. package/dist/client/_nuxt/CK56Z9cH.js +0 -1
  313. package/dist/client/_nuxt/CK7S-5jS.js +0 -1
  314. package/dist/client/_nuxt/CLmbwNS9.js +0 -1
  315. package/dist/client/_nuxt/CM4fc1WH.js +0 -1
  316. package/dist/client/_nuxt/CMOi41r9.js +0 -1
  317. package/dist/client/_nuxt/CMnybHwx.js +0 -1
  318. package/dist/client/_nuxt/CNXuF1yM.js +0 -1
  319. package/dist/client/_nuxt/CQO4gZEw.js +0 -1
  320. package/dist/client/_nuxt/CVESyXxo.js +0 -1
  321. package/dist/client/_nuxt/CWJejSyX.js +0 -1
  322. package/dist/client/_nuxt/CXmV_HiI.js +0 -1
  323. package/dist/client/_nuxt/C_wU0A-3.js +0 -3834
  324. package/dist/client/_nuxt/CcPoRNJz.js +0 -1
  325. package/dist/client/_nuxt/CcSEeikT.js +0 -1
  326. package/dist/client/_nuxt/CeZwWGti.js +0 -1
  327. package/dist/client/_nuxt/ChDww4um.js +0 -1
  328. package/dist/client/_nuxt/Ci-La1BS.js +0 -1
  329. package/dist/client/_nuxt/CnsmiicP.js +0 -1
  330. package/dist/client/_nuxt/CuIYtGag.js +0 -1
  331. package/dist/client/_nuxt/Cv3cJnDV.js +0 -1
  332. package/dist/client/_nuxt/CwIbMU3B.js +0 -1
  333. package/dist/client/_nuxt/Cztwc-HH.js +0 -1
  334. package/dist/client/_nuxt/D2O4HAMr.js +0 -1
  335. package/dist/client/_nuxt/D7v6OrNy.js +0 -1
  336. package/dist/client/_nuxt/D8nBeWSR.js +0 -1
  337. package/dist/client/_nuxt/DA0ESIWO.js +0 -1
  338. package/dist/client/_nuxt/DCcCncrU.js +0 -1
  339. package/dist/client/_nuxt/DES0gjzB.js +0 -1
  340. package/dist/client/_nuxt/DFIOpqzz.js +0 -1
  341. package/dist/client/_nuxt/DFQ4Xr-4.js +0 -1
  342. package/dist/client/_nuxt/DH4N8IuU.js +0 -1
  343. package/dist/client/_nuxt/DIt9OTko.js +0 -1
  344. package/dist/client/_nuxt/DL4Dju3v.js +0 -1
  345. package/dist/client/_nuxt/DNgb01dh.js +0 -1
  346. package/dist/client/_nuxt/DOAn35dn.js +0 -1
  347. package/dist/client/_nuxt/DPTZissz.js +0 -1
  348. package/dist/client/_nuxt/DQxx3LPD.js +0 -1
  349. package/dist/client/_nuxt/DRhUEtVu.js +0 -1
  350. package/dist/client/_nuxt/DUdzsfxe.js +0 -1
  351. package/dist/client/_nuxt/DVWcdiGS.js +0 -1
  352. package/dist/client/_nuxt/DWMP3yrW.js +0 -1
  353. package/dist/client/_nuxt/DZ4hUExO.js +0 -1
  354. package/dist/client/_nuxt/Db-JQHi3.js +0 -1
  355. package/dist/client/_nuxt/DdAYiE08.js +0 -1
  356. package/dist/client/_nuxt/DepYB8Ml.js +0 -1
  357. package/dist/client/_nuxt/DhG9BCpW.js +0 -1
  358. package/dist/client/_nuxt/DhRVplvY.js +0 -1
  359. package/dist/client/_nuxt/DhqJCFIX.js +0 -1
  360. package/dist/client/_nuxt/Dk1rBueR.js +0 -1
  361. package/dist/client/_nuxt/DkpUthgY.js +0 -1
  362. package/dist/client/_nuxt/DmF4-xLG.js +0 -1
  363. package/dist/client/_nuxt/DmZ-uG0V.js +0 -1
  364. package/dist/client/_nuxt/Dnfm4U7b.js +0 -1
  365. package/dist/client/_nuxt/DnyWjya5.js +0 -1
  366. package/dist/client/_nuxt/DqpEK-75.js +0 -1
  367. package/dist/client/_nuxt/DsCg8CPl.js +0 -1
  368. package/dist/client/_nuxt/DvA-6Bhw.js +0 -1
  369. package/dist/client/_nuxt/DvQyZZSe.js +0 -1
  370. package/dist/client/_nuxt/DwU8c_yx.js +0 -1
  371. package/dist/client/_nuxt/DzaHHFTY.js +0 -1
  372. package/dist/client/_nuxt/EZUUsui8.js +0 -1
  373. package/dist/client/_nuxt/F89DG-fP.js +0 -1
  374. package/dist/client/_nuxt/HNM5thJl.js +0 -1
  375. package/dist/client/_nuxt/IBB5Tl9j.js +0 -1
  376. package/dist/client/_nuxt/KUYRHWK4.js +0 -1
  377. package/dist/client/_nuxt/Kxp7UmFj.js +0 -1
  378. package/dist/client/_nuxt/Lp17StYA.js +0 -1
  379. package/dist/client/_nuxt/NgWrSVUg.js +0 -1
  380. package/dist/client/_nuxt/W2lx4xae.js +0 -1
  381. package/dist/client/_nuxt/XF954dHc.js +0 -1
  382. package/dist/client/_nuxt/YurBl9Qv.js +0 -1
  383. package/dist/client/_nuxt/aeT0-ak7.js +0 -1
  384. package/dist/client/_nuxt/bGS5FTDY.js +0 -1
  385. package/dist/client/_nuxt/builds/meta/a938c56b-6345-454a-9e52-026adcc92670.json +0 -1
  386. package/dist/client/_nuxt/error-404.DNn2eSPw.css +0 -1
  387. package/dist/client/_nuxt/error-500.B_Aslu6N.css +0 -1
  388. package/dist/client/_nuxt/gOa3Yz9U.js +0 -1
  389. package/dist/client/_nuxt/i22b9gbM.js +0 -1
  390. package/dist/client/_nuxt/mLcCfA0-.js +0 -1
  391. package/dist/client/_nuxt/plSVBvJQ.js +0 -1
  392. package/dist/client/_nuxt/rf8nNrOk.js +0 -1
  393. package/dist/client/_nuxt/u4bm_LMz.js +0 -1
  394. package/dist/client/_nuxt/vocl-2a6.js +0 -1
  395. package/dist/client/_nuxt/w1el_4yc.js +0 -1
  396. package/dist/client/_nuxt/xfgw03QH.js +0 -1
  397. package/dist/client/_nuxt/yLioyJ2E.js +0 -1
  398. /package/dist/runtime/assets/{Inter-400.ttf.base64 → Inter-normal-400.ttf.base64} +0 -0
  399. /package/dist/runtime/assets/{Inter-700.ttf.base64 → Inter-normal-700.ttf.base64} +0 -0
  400. /package/dist/runtime/server/plugins/{nuxt-content.d.ts → nuxt-content-v2.d.ts} +0 -0
  401. /package/dist/runtime/server/plugins/{nuxt-content.js → nuxt-content-v2.js} +0 -0
package/dist/module.cjs CHANGED
@@ -1,5 +1,945 @@
1
- module.exports = function(...args) {
2
- return import('./module.mjs').then(m => m.default.call(this, ...args))
1
+ 'use strict';
2
+
3
+ const fs = require('node:fs');
4
+ const promises = require('node:fs/promises');
5
+ const kit = require('@nuxt/kit');
6
+ const defu = require('defu');
7
+ const kit$1 = require('nuxt-site-config/kit');
8
+ const ohash = require('ohash');
9
+ const pathe = require('pathe');
10
+ const pkgTypes = require('pkg-types');
11
+ const stdEnv = require('std-env');
12
+ const ufo = require('ufo');
13
+ const unstorage = require('unstorage');
14
+ const fsDriver = require('unstorage/drivers/fs');
15
+ const node_crypto = require('node:crypto');
16
+ const nypm = require('nypm');
17
+ const node_path = require('node:path');
18
+ const devtoolsKit = require('@nuxt/devtools-kit');
19
+ const node_url = require('node:url');
20
+ const MagicString = require('magic-string');
21
+ const stripLiteral = require('strip-literal');
22
+ const unplugin = require('unplugin');
23
+ const logger_js = require('../dist/runtime/logger.js');
24
+ const chromeLauncher = require('chrome-launcher');
25
+ const ofetch = require('ofetch');
26
+
27
+ var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
28
+ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
29
+
30
+ function _interopNamespaceCompat(e) {
31
+ if (e && typeof e === 'object' && 'default' in e) return e;
32
+ const n = Object.create(null);
33
+ if (e) {
34
+ for (const k in e) {
35
+ n[k] = e[k];
36
+ }
37
+ }
38
+ n.default = e;
39
+ return n;
3
40
  }
4
- const _meta = module.exports.meta = require('./module.json')
5
- module.exports.getMeta = () => Promise.resolve(_meta)
41
+
42
+ const fs__namespace = /*#__PURE__*/_interopNamespaceCompat(fs);
43
+ const fsDriver__default = /*#__PURE__*/_interopDefaultCompat(fsDriver);
44
+ const MagicString__default = /*#__PURE__*/_interopDefaultCompat(MagicString);
45
+
46
+ const autodetectableProviders = {
47
+ azure_static: "azure",
48
+ cloudflare_pages: "cloudflare-pages",
49
+ netlify: "netlify",
50
+ stormkit: "stormkit",
51
+ vercel: "vercel",
52
+ cleavr: "cleavr",
53
+ stackblitz: "stackblitz"
54
+ };
55
+ const autodetectableStaticProviders = {
56
+ netlify: "netlify-static",
57
+ vercel: "vercel-static"
58
+ };
59
+ const NodeRuntime = {
60
+ // node-server runtime
61
+ "chromium": "on-demand",
62
+ // this gets changed build start
63
+ "css-inline": "node",
64
+ "resvg": "node",
65
+ "satori": "node",
66
+ "sharp": "node"
67
+ // will be disabled if they're missing the dependency
68
+ };
69
+ const cloudflare = {
70
+ "chromium": false,
71
+ "css-inline": false,
72
+ "resvg": "wasm",
73
+ "satori": "node",
74
+ "sharp": false,
75
+ "wasm": {
76
+ esmImport: true,
77
+ lazy: true
78
+ }
79
+ };
80
+ const awsLambda = {
81
+ "chromium": false,
82
+ "css-inline": "wasm",
83
+ "resvg": "node",
84
+ "satori": "node",
85
+ "sharp": false
86
+ // 0.33.x has issues
87
+ };
88
+ const WebContainer = {
89
+ "chromium": false,
90
+ "css-inline": "wasm-fs",
91
+ "resvg": "wasm-fs",
92
+ "satori": "wasm-fs",
93
+ "sharp": false
94
+ };
95
+ const RuntimeCompatibility = {
96
+ "nitro-dev": NodeRuntime,
97
+ "nitro-prerender": NodeRuntime,
98
+ "node-server": NodeRuntime,
99
+ "stackblitz": WebContainer,
100
+ "codesandbox": WebContainer,
101
+ "aws-lambda": awsLambda,
102
+ "netlify": awsLambda,
103
+ "netlify-edge": {
104
+ "chromium": false,
105
+ "css-inline": "wasm",
106
+ "resvg": "wasm",
107
+ "satori": "node",
108
+ "sharp": false,
109
+ "wasm": {
110
+ rollup: {
111
+ targetEnv: "auto-inline",
112
+ sync: ["@resvg/resvg-wasm/index_bg.wasm"]
113
+ }
114
+ }
115
+ },
116
+ "firebase": awsLambda,
117
+ "vercel": awsLambda,
118
+ "vercel-edge": {
119
+ "chromium": false,
120
+ "css-inline": false,
121
+ // size constraint (2mb is max)
122
+ "resvg": "wasm",
123
+ "satori": "node",
124
+ "sharp": false,
125
+ "wasm": {
126
+ // lowers workers kb size
127
+ esmImport: true,
128
+ lazy: true
129
+ }
130
+ },
131
+ "cloudflare-pages": cloudflare,
132
+ "cloudflare": cloudflare,
133
+ "cloudflare-module": cloudflare
134
+ };
135
+ function detectTarget(options = {}) {
136
+ return options?.static ? autodetectableStaticProviders[stdEnv.provider] : autodetectableProviders[stdEnv.provider];
137
+ }
138
+ function resolveNitroPreset(nitroConfig) {
139
+ if (stdEnv.provider === "stackblitz" || stdEnv.provider === "codesandbox")
140
+ return stdEnv.provider;
141
+ const nuxt = kit.useNuxt();
142
+ if (nuxt.options.dev)
143
+ return "nitro-dev";
144
+ if (nuxt.options._generate)
145
+ return "nitro-prerender";
146
+ let preset;
147
+ if (nitroConfig && nitroConfig?.preset)
148
+ preset = nitroConfig.preset;
149
+ if (!preset)
150
+ preset = stdEnv.env.NITRO_PRESET || stdEnv.env.SERVER_PRESET || detectTarget() || "node-server";
151
+ return preset.replace("_", "-");
152
+ }
153
+ function getPresetNitroPresetCompatibility(target) {
154
+ let compatibility = RuntimeCompatibility[target];
155
+ if (!compatibility)
156
+ compatibility = RuntimeCompatibility["nitro-dev"];
157
+ return compatibility;
158
+ }
159
+ async function applyNitroPresetCompatibility(nitroConfig, options) {
160
+ const target = resolveNitroPreset(nitroConfig);
161
+ const compatibility = getPresetNitroPresetCompatibility(target);
162
+ const hasCssInlineNode = !!await kit.tryResolveModule("@css-inline/css-inline");
163
+ const hasCssInlineWasm = !!await kit.tryResolveModule("@css-inline/css-inline-wasm");
164
+ const { resolve } = options;
165
+ const satoriEnabled = typeof options.compatibility?.satori !== "undefined" ? !!options.compatibility.satori : !!compatibility.satori;
166
+ const chromiumEnabled = typeof options.compatibility?.chromium !== "undefined" ? !!options.compatibility.chromium : !!compatibility.chromium;
167
+ nitroConfig.alias["#og-image/renderers/satori"] = satoriEnabled ? resolve("./runtime/server/og-image/satori/renderer") : "unenv/runtime/mock/empty";
168
+ nitroConfig.alias["#og-image/renderers/chromium"] = chromiumEnabled ? resolve("./runtime/server/og-image/chromium/renderer") : "unenv/runtime/mock/empty";
169
+ const resolvedCompatibility = {};
170
+ function applyBinding(key) {
171
+ let binding = options.compatibility?.[key];
172
+ if (typeof binding === "undefined")
173
+ binding = compatibility[key];
174
+ if (key === "chromium" && binding === "node")
175
+ binding = "playwright";
176
+ if (key === "css-inline" && typeof binding === "string") {
177
+ if (binding === "node" && !hasCssInlineNode || ["wasm", "wasm-fs"].includes(binding) && !hasCssInlineWasm) {
178
+ binding = false;
179
+ }
180
+ }
181
+ resolvedCompatibility[key] = binding;
182
+ return {
183
+ [`#og-image/bindings/${key}`]: binding === false ? "unenv/runtime/mock/empty" : resolve(`./runtime/server/og-image/bindings/${key}/${binding}`)
184
+ };
185
+ }
186
+ nitroConfig.alias = defu.defu(
187
+ applyBinding("chromium"),
188
+ applyBinding("satori"),
189
+ applyBinding("resvg"),
190
+ applyBinding("sharp"),
191
+ applyBinding("css-inline"),
192
+ nitroConfig.alias || {}
193
+ );
194
+ if (Object.values(compatibility).includes("wasm")) {
195
+ nitroConfig.experimental = nitroConfig.experimental || {};
196
+ nitroConfig.experimental.wasm = true;
197
+ }
198
+ nitroConfig.rollupConfig = nitroConfig.rollupConfig || {};
199
+ nitroConfig.wasm = defu.defu(compatibility.wasm, nitroConfig.wasm);
200
+ nitroConfig.virtual["#og-image/compatibility"] = () => `export default ${JSON.stringify(resolvedCompatibility)}`;
201
+ kit.addTemplate({
202
+ filename: "nuxt-og-image/compatibility.mjs",
203
+ getContents() {
204
+ return `export default ${JSON.stringify(resolvedCompatibility)}`;
205
+ },
206
+ options: { mode: "server" }
207
+ });
208
+ return resolvedCompatibility;
209
+ }
210
+ function ensureDependencies(dep, nuxt = kit.useNuxt()) {
211
+ return Promise.all(dep.map((d) => {
212
+ return nypm.ensureDependencyInstalled(d, {
213
+ cwd: nuxt.options.rootDir,
214
+ dev: true
215
+ });
216
+ }));
217
+ }
218
+
219
+ async function setupBuildHandler(config, resolve, nuxt = kit.useNuxt()) {
220
+ nuxt.options.nitro.storage = nuxt.options.nitro.storage || {};
221
+ if (typeof config.runtimeCacheStorage === "object")
222
+ nuxt.options.nitro.storage["og-image"] = config.runtimeCacheStorage;
223
+ nuxt.hooks.hook("nitro:config", async (nitroConfig) => {
224
+ await applyNitroPresetCompatibility(nitroConfig, { compatibility: config.compatibility?.runtime, resolve });
225
+ nitroConfig.alias.electron = "unenv/runtime/mock/proxy-cjs";
226
+ nitroConfig.alias.bufferutil = "unenv/runtime/mock/proxy-cjs";
227
+ nitroConfig.alias["utf-8-validate"] = "unenv/runtime/mock/proxy-cjs";
228
+ nitroConfig.alias.queue = "unenv/runtime/mock/proxy-cjs";
229
+ nitroConfig.alias["chromium-bidi"] = "unenv/runtime/mock/proxy-cjs";
230
+ });
231
+ nuxt.hooks.hook("nitro:init", async (nitro) => {
232
+ const target = resolveNitroPreset(nitro.options);
233
+ const isCloudflarePagesOrModule = target === "cloudflare-pages" || target === "cloudflare-module";
234
+ if (isCloudflarePagesOrModule) {
235
+ nitro.options.cloudflare = nitro.options.cloudflare || {};
236
+ nitro.options.cloudflare.pages = nitro.options.cloudflare.pages || {};
237
+ nitro.options.cloudflare.pages.routes = nitro.options.cloudflare.pages.routes || { exclude: [] };
238
+ nitro.options.cloudflare.pages.routes.exclude = nitro.options.cloudflare.pages.routes.exclude || [];
239
+ nitro.options.cloudflare.pages.routes.exclude.push("/__og-image__/static/*");
240
+ }
241
+ nitro.hooks.hook("compiled", async (_nitro) => {
242
+ const compatibility = getPresetNitroPresetCompatibility(target);
243
+ if (compatibility.wasm?.esmImport !== true)
244
+ return;
245
+ const configuredEntry = nitro.options.rollupConfig?.output.entryFileNames;
246
+ const serverEntry = resolve(_nitro.options.output.serverDir, typeof configuredEntry === "string" ? configuredEntry : "index.mjs");
247
+ const wasmEntries = [serverEntry];
248
+ if (isCloudflarePagesOrModule) {
249
+ wasmEntries.push(resolve(pathe.dirname(serverEntry), "./chunks/wasm.mjs"));
250
+ wasmEntries.push(resolve(pathe.dirname(serverEntry), "./chunks/_/wasm.mjs"));
251
+ wasmEntries.push(resolve(pathe.dirname(serverEntry), "./chunks/index_bg.mjs"));
252
+ }
253
+ const resvgHash = await resolveFilePathSha1("@resvg/resvg-wasm/index_bg.wasm");
254
+ const yogaHash = await resolveFilePathSha1("yoga-wasm-web/dist/yoga.wasm");
255
+ const cssInlineHash = await resolveFilePathSha1("@css-inline/css-inline-wasm/index_bg.wasm");
256
+ for (const entry of wasmEntries) {
257
+ if (!fs.existsSync(entry))
258
+ continue;
259
+ const contents = await promises.readFile(serverEntry, "utf-8");
260
+ const postfix = target === "vercel-edge" ? "?module" : "";
261
+ const path = isCloudflarePagesOrModule ? `../wasm/` : `./wasm/`;
262
+ await promises.writeFile(serverEntry, contents.replaceAll('"@resvg/resvg-wasm/index_bg.wasm?module"', `"${path}index_bg-${resvgHash}.wasm${postfix}"`).replaceAll('"@css-inline/css-inline-wasm/index_bg.wasm?module"', `"${path}index_bg-${cssInlineHash}.wasm${postfix}"`).replaceAll('"yoga-wasm-web/dist/yoga.wasm?module"', `"${path}yoga-${yogaHash}.wasm${postfix}"`), { encoding: "utf-8" });
263
+ }
264
+ });
265
+ });
266
+ }
267
+ async function resolveFilePathSha1(path) {
268
+ const _path = await kit.resolvePath(path);
269
+ return sha1(fs.existsSync(_path) ? await promises.readFile(_path) : path);
270
+ }
271
+ function sha1(source) {
272
+ return node_crypto.createHash("sha1").update(source).digest("hex").slice(0, 16);
273
+ }
274
+
275
+ function setupDevHandler(options, resolve, nuxt = kit.useNuxt()) {
276
+ nuxt.hooks.hook("nitro:config", async (nitroConfig) => {
277
+ await applyNitroPresetCompatibility(nitroConfig, { compatibility: options.compatibility?.dev, resolve });
278
+ });
279
+ }
280
+
281
+ const DEVTOOLS_UI_ROUTE = "/__nuxt-og-image";
282
+ const DEVTOOLS_UI_LOCAL_PORT = 3030;
283
+ function setupDevToolsUI(options, resolve, nuxt = kit.useNuxt()) {
284
+ const clientPath = resolve("./client");
285
+ const isProductionBuild = fs.existsSync(clientPath);
286
+ if (isProductionBuild) {
287
+ nuxt.hook("vite:serverCreated", async (server) => {
288
+ const sirv = await import('sirv').then((r) => r.default || r);
289
+ server.middlewares.use(
290
+ DEVTOOLS_UI_ROUTE,
291
+ sirv(clientPath, { dev: true, single: true })
292
+ );
293
+ });
294
+ } else {
295
+ nuxt.hook("vite:extendConfig", (config) => {
296
+ config.server = config.server || {};
297
+ config.server.proxy = config.server.proxy || {};
298
+ config.server.proxy[DEVTOOLS_UI_ROUTE] = {
299
+ target: `http://localhost:${DEVTOOLS_UI_LOCAL_PORT}${DEVTOOLS_UI_ROUTE}`,
300
+ changeOrigin: true,
301
+ followRedirects: true,
302
+ rewrite: (path) => path.replace(DEVTOOLS_UI_ROUTE, "")
303
+ };
304
+ });
305
+ }
306
+ devtoolsKit.onDevToolsInitialized(async () => {
307
+ const rpc = devtoolsKit.extendServerRpc("nuxt-og-image", {});
308
+ nuxt.hook("builder:watch", (e, path) => {
309
+ path = node_path.relative(nuxt.options.srcDir, resolve(nuxt.options.srcDir, path));
310
+ if ((e === "change" || e.includes("link")) && (path.startsWith("pages") || path.startsWith("content"))) {
311
+ rpc.broadcast.refreshRouteData(path).catch(() => {
312
+ });
313
+ }
314
+ if (options.componentDirs.some((dir) => path.includes(dir))) {
315
+ if (e === "change") {
316
+ rpc.broadcast.refresh().catch(() => {
317
+ });
318
+ } else {
319
+ rpc.broadcast.refreshGlobalData().catch(() => {
320
+ });
321
+ }
322
+ }
323
+ });
324
+ });
325
+ nuxt.hook("devtools:customTabs", (tabs) => {
326
+ tabs.push({
327
+ // unique identifier
328
+ name: "nuxt-og-image",
329
+ // title to display in the tab
330
+ title: "OG Image",
331
+ // any icon from Iconify, or a URL to an image
332
+ icon: "carbon:image-search",
333
+ // iframe view
334
+ view: {
335
+ type: "iframe",
336
+ src: DEVTOOLS_UI_ROUTE
337
+ }
338
+ });
339
+ });
340
+ }
341
+
342
+ function setupGenerateHandler(options, resolve, nuxt = kit.useNuxt()) {
343
+ nuxt.hooks.hook("nitro:config", async (nitroConfig) => {
344
+ await applyNitroPresetCompatibility(nitroConfig, {
345
+ compatibility: {
346
+ "chromium": false,
347
+ "satori": false,
348
+ "css-inline": false,
349
+ "resvg": false,
350
+ "sharp": false
351
+ },
352
+ resolve
353
+ });
354
+ });
355
+ }
356
+
357
+ function setupPrerenderHandler(options, resolve, nuxt = kit.useNuxt()) {
358
+ nuxt.hooks.hook("nitro:init", async (nitro) => {
359
+ nitro.hooks.hook("prerender:config", async (nitroConfig) => {
360
+ await applyNitroPresetCompatibility(nitroConfig, { compatibility: options.compatibility?.prerender, resolve });
361
+ nitroConfig.wasm = nitroConfig.wasm || {};
362
+ nitroConfig.wasm.esmImport = false;
363
+ });
364
+ });
365
+ }
366
+
367
+ function isVue(id, opts = {}) {
368
+ const { search } = ufo.parseURL(decodeURIComponent(node_url.pathToFileURL(id).href));
369
+ if (id.endsWith(".vue") && !search) {
370
+ return true;
371
+ }
372
+ if (!search) {
373
+ return false;
374
+ }
375
+ const query = ufo.parseQuery(search);
376
+ if (query.nuxt_component) {
377
+ return false;
378
+ }
379
+ if (query.macro && (search === "?macro=true" || !opts.type || opts.type.includes("script"))) {
380
+ return true;
381
+ }
382
+ const type = "setup" in query ? "script" : query.type;
383
+ if (!("vue" in query) || opts.type && !opts.type.includes(type)) {
384
+ return false;
385
+ }
386
+ return true;
387
+ }
388
+ const JS_RE = /\.(?:[cm]?j|t)sx?$/;
389
+ function isJS(id) {
390
+ const { pathname } = ufo.parseURL(decodeURIComponent(node_url.pathToFileURL(id).href));
391
+ return JS_RE.test(pathname);
392
+ }
393
+ const TreeShakeComposablesPlugin = unplugin.createUnplugin(() => {
394
+ const composableNames = [
395
+ "defineOgImage",
396
+ "defineOgImageComponent",
397
+ "defineOgImageScreenshot"
398
+ ];
399
+ const regexp = `(^\\s*)(${composableNames.join("|")})(?=\\((?!\\) \\{))`;
400
+ const COMPOSABLE_RE = new RegExp(regexp, "m");
401
+ const COMPOSABLE_RE_GLOBAL = new RegExp(regexp, "gm");
402
+ return {
403
+ name: "nuxt-og-image:zero-runtime:transform",
404
+ enforce: "pre",
405
+ transformInclude(id) {
406
+ return isVue(id, { type: ["script"] }) || isJS(id);
407
+ },
408
+ transform(code, id) {
409
+ const s = new MagicString__default(code);
410
+ if (id.endsWith("components.islands.mjs")) ; else {
411
+ const strippedCode = stripLiteral.stripLiteral(code);
412
+ if (!COMPOSABLE_RE.test(code)) {
413
+ return;
414
+ }
415
+ for (const match of strippedCode.matchAll(COMPOSABLE_RE_GLOBAL)) {
416
+ s.overwrite(match.index, match.index + match[0].length, `${match[1]} import.meta.prerender && ${match[2]}`);
417
+ }
418
+ }
419
+ if (s.hasChanged()) {
420
+ return {
421
+ code: s.toString(),
422
+ map: s.generateMap({ hires: true })
423
+ };
424
+ }
425
+ }
426
+ };
427
+ });
428
+
429
+ async function getNuxtModuleOptions(module, nuxt = kit.useNuxt()) {
430
+ const moduleMeta = (typeof module === "string" ? { name: module } : await module.getMeta?.()) || {};
431
+ const { nuxtModule } = await kit.loadNuxtModuleInstance(module, nuxt);
432
+ let moduleEntry;
433
+ for (const m of nuxt.options.modules) {
434
+ if (Array.isArray(m) && m.length >= 2) {
435
+ const _module = m[0];
436
+ const _moduleEntryName = typeof _module === "string" ? _module : (await _module.getMeta?.())?.name || "";
437
+ if (_moduleEntryName === moduleMeta.name)
438
+ moduleEntry = m;
439
+ }
440
+ }
441
+ let inlineOptions = {};
442
+ if (moduleEntry)
443
+ inlineOptions = moduleEntry[1];
444
+ if (nuxtModule.getOptions)
445
+ return nuxtModule.getOptions(inlineOptions, nuxt);
446
+ return inlineOptions;
447
+ }
448
+ function extendTypes(module, template) {
449
+ const nuxt = kit.useNuxt();
450
+ const { resolve } = kit.createResolver((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('module.cjs', document.baseURI).href)));
451
+ kit.addTemplate({
452
+ filename: `module/${module}.d.ts`,
453
+ getContents: async () => {
454
+ const typesPath = pathe.relative(resolve(nuxt.options.rootDir, nuxt.options.buildDir, "module"), resolve("runtime/types"));
455
+ const s = await template({ typesPath });
456
+ return `// Generated by ${module}
457
+ ${s}
458
+ export {}
459
+ `;
460
+ }
461
+ });
462
+ nuxt.hooks.hook("prepare:types", ({ references }) => {
463
+ references.push({ path: resolve(nuxt.options.buildDir, `module/${module}.d.ts`) });
464
+ });
465
+ nuxt.hooks.hook("nitro:config", (config) => {
466
+ config.typescript = config.typescript || {};
467
+ config.typescript.tsConfig = config.typescript.tsConfig || {};
468
+ config.typescript.tsConfig.include = config.typescript.tsConfig.include || [];
469
+ config.typescript.tsConfig.include.push(`./module/${module}.d.ts`);
470
+ });
471
+ }
472
+ function isNuxtGenerate(nuxt = kit.useNuxt()) {
473
+ return nuxt.options._generate || nuxt.options.nitro.static || nuxt.options.nitro.preset === "static";
474
+ }
475
+
476
+ function normaliseFontInput(fonts) {
477
+ return fonts.map((f) => {
478
+ if (typeof f === "string") {
479
+ const vals = f.split(":");
480
+ const includesStyle = vals.length === 3;
481
+ let name, weight, style;
482
+ if (includesStyle) {
483
+ name = vals[0];
484
+ style = vals[1];
485
+ weight = vals[2];
486
+ } else {
487
+ name = vals[0];
488
+ weight = vals[1];
489
+ }
490
+ return {
491
+ cacheKey: f,
492
+ name,
493
+ weight: weight || 400,
494
+ style: style || "normal",
495
+ path: void 0
496
+ };
497
+ }
498
+ return {
499
+ cacheKey: f.key || `${f.name}:${f.style}:${f.weight}`,
500
+ style: "normal",
501
+ weight: 400,
502
+ ...f
503
+ };
504
+ });
505
+ }
506
+
507
+ const isUndefinedOrTruthy = (v) => typeof v === "undefined" || v !== false;
508
+ function checkLocalChrome() {
509
+ if (stdEnv.isCI)
510
+ return false;
511
+ let hasChromeLocally = false;
512
+ try {
513
+ hasChromeLocally = !!chromeLauncher.Launcher.getFirstInstallation();
514
+ } catch {
515
+ }
516
+ return hasChromeLocally;
517
+ }
518
+ async function checkPlaywrightDependency() {
519
+ return !!await kit.tryResolveModule("playwright");
520
+ }
521
+ async function downloadFont(font, storage, mirror) {
522
+ const { name, weight, style } = font;
523
+ const key = `${name}-${style}-${weight}.ttf.base64`;
524
+ if (await storage.hasItem(key))
525
+ return true;
526
+ const host = typeof mirror === "undefined" ? "fonts.googleapis.com" : mirror === true ? "fonts.font.im" : mirror;
527
+ const css = await ofetch.$fetch(`https://${host}/css2?family=${name}:${style === "ital" ? `ital,wght@1,${weight}` : `wght@${weight}`}`, {
528
+ timeout: 10 * 1e3,
529
+ // 10 second timeout
530
+ headers: {
531
+ // Make sure it returns TTF.
532
+ "User-Agent": "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_8; de-at) AppleWebKit/533.21.1 (KHTML, like Gecko) Version/5.0.5 Safari/533.21.1"
533
+ }
534
+ }).catch(() => {
535
+ return false;
536
+ });
537
+ if (!css)
538
+ return false;
539
+ const ttfResource = css.match(/src: url\((.+)\) format\('(opentype|truetype)'\)/);
540
+ if (ttfResource?.[1]) {
541
+ const buf = await ofetch.$fetch(ttfResource[1], { baseURL: host, responseType: "arrayBuffer" });
542
+ const base64Font = Buffer.from(buf).toString("base64");
543
+ await storage.setItem(key, base64Font);
544
+ return true;
545
+ }
546
+ return false;
547
+ }
548
+
549
+ const module$1 = kit.defineNuxtModule({
550
+ meta: {
551
+ name: "nuxt-og-image",
552
+ compatibility: {
553
+ nuxt: ">=3.10.3",
554
+ bridge: false
555
+ },
556
+ configKey: "ogImage"
557
+ },
558
+ defaults() {
559
+ return {
560
+ enabled: true,
561
+ defaults: {
562
+ emojis: "noto",
563
+ renderer: "satori",
564
+ component: "NuxtSeo",
565
+ extension: "png",
566
+ width: 1200,
567
+ height: 600,
568
+ // default is to cache the image for 3 day (72 hours)
569
+ cacheMaxAgeSeconds: 60 * 60 * 24 * 3
570
+ },
571
+ componentDirs: ["OgImage", "OgImageTemplate"],
572
+ fonts: [],
573
+ runtimeCacheStorage: true,
574
+ debug: stdEnv.isDevelopment
575
+ };
576
+ },
577
+ async setup(config, nuxt) {
578
+ const { resolve } = kit.createResolver((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('module.cjs', document.baseURI).href)));
579
+ const { version } = await pkgTypes.readPackageJSON(resolve("../package.json"));
580
+ logger_js.logger.level = config.debug || nuxt.options.debug ? 4 : 3;
581
+ if (config.enabled === false) {
582
+ logger_js.logger.debug("The module is disabled, skipping setup.");
583
+ ["defineOgImage", "defineOgImageComponent", "defineOgImageScreenshot"].forEach((name) => {
584
+ kit.addImports({ name, from: resolve(`./runtime/app/composables/mock`) });
585
+ });
586
+ return;
587
+ }
588
+ if (config.enabled && !nuxt.options.ssr) {
589
+ logger_js.logger.warn("Nuxt OG Image is enabled but SSR is disabled.\n\nYou should enable SSR (`ssr: true`) or disable the module (`ogImage: { enabled: false }`).");
590
+ return;
591
+ }
592
+ nuxt.options.alias["#og-image"] = resolve("./runtime");
593
+ nuxt.options.alias["#og-image-cache"] = resolve("./runtime/server/og-image/cache/lru");
594
+ nuxt.options.alias["#nuxt-og-image-utils"] = resolve("./runtime/shared");
595
+ const preset = resolveNitroPreset(nuxt.options.nitro);
596
+ const targetCompatibility = getPresetNitroPresetCompatibility(preset);
597
+ if (config.zeroRuntime) {
598
+ config.compatibility = defu.defu(config.compatibility, {
599
+ runtime: {
600
+ chromium: false,
601
+ // should already be false
602
+ satori: false
603
+ }
604
+ });
605
+ if (!nuxt.options.dev) {
606
+ kit.addBuildPlugin(TreeShakeComposablesPlugin, { server: true, client: true, build: true });
607
+ nuxt.options.alias["#og-image-cache"] = resolve("./runtime/server/og-image/cache/mock");
608
+ }
609
+ }
610
+ let isUsingSharp = false;
611
+ const userConfiguredExtension = config.defaults.extension;
612
+ const hasConfiguredJpegs = userConfiguredExtension && ["jpeg", "jpg"].includes(userConfiguredExtension);
613
+ if (!!config.sharpOptions || hasConfiguredJpegs && config.defaults.renderer !== "chromium") {
614
+ isUsingSharp = true;
615
+ const hasSharpDependency = !!await kit.tryResolveModule("sharp");
616
+ if (hasSharpDependency && !targetCompatibility.sharp) {
617
+ logger_js.logger.warn(`Rendering JPEGs requires sharp which does not work with ${preset}. Images will be rendered as PNG at runtime.`);
618
+ config.compatibility = defu.defu(config.compatibility, {
619
+ runtime: { sharp: false }
620
+ });
621
+ } else if (!hasSharpDependency) {
622
+ logger_js.logger.warn("You have enabled `JPEG` images. These require the `sharp` dependency which is missing, installing it for you.");
623
+ await ensureDependencies(["sharp"]);
624
+ logger_js.logger.warn("Support for `sharp` is limited so check the compatibility guide.");
625
+ }
626
+ }
627
+ if (!isUsingSharp) {
628
+ config.compatibility = defu.defu(config.compatibility, {
629
+ runtime: { sharp: false },
630
+ dev: { sharp: false },
631
+ prerender: { sharp: false }
632
+ });
633
+ }
634
+ const hasChromeLocally = checkLocalChrome();
635
+ const hasPlaywrightDependency = await checkPlaywrightDependency();
636
+ const chromeCompatibilityFlags = {
637
+ prerender: config.compatibility?.prerender?.chromium,
638
+ dev: config.compatibility?.dev?.chromium,
639
+ runtime: config.compatibility?.runtime?.chromium
640
+ };
641
+ const chromiumBinding = {
642
+ dev: null,
643
+ prerender: null,
644
+ runtime: null
645
+ };
646
+ if (nuxt.options.dev) {
647
+ if (isUndefinedOrTruthy(chromeCompatibilityFlags.dev))
648
+ chromiumBinding.dev = hasChromeLocally ? "chrome-launcher" : hasPlaywrightDependency ? "playwright" : "on-demand";
649
+ } else {
650
+ if (isUndefinedOrTruthy(chromeCompatibilityFlags.prerender))
651
+ chromiumBinding.prerender = hasChromeLocally ? "chrome-launcher" : hasPlaywrightDependency ? "playwright" : "on-demand";
652
+ if (isUndefinedOrTruthy(chromeCompatibilityFlags.runtime))
653
+ chromiumBinding.runtime = hasPlaywrightDependency ? "playwright" : null;
654
+ }
655
+ config.compatibility = defu.defu(config.compatibility, {
656
+ runtime: { chromium: chromiumBinding.runtime },
657
+ dev: { chromium: chromiumBinding.dev },
658
+ prerender: { chromium: chromiumBinding.prerender }
659
+ });
660
+ await import('@resvg/resvg-js').catch(() => {
661
+ logger_js.logger.warn("ReSVG is missing dependencies for environment. Falling back to WASM version, this may slow down PNG rendering.");
662
+ config.compatibility = defu.defu(config.compatibility, {
663
+ dev: { resvg: "wasm-fs" },
664
+ prerender: { resvg: "wasm-fs" }
665
+ });
666
+ if (targetCompatibility.resvg === "node") {
667
+ config.compatibility = defu.defu(config.compatibility, {
668
+ runtime: { resvg: "wasm" }
669
+ });
670
+ }
671
+ });
672
+ await kit$1.installNuxtSiteConfig();
673
+ const usingNuxtContent = kit.hasNuxtModule("@nuxt/content");
674
+ const isNuxtContentV3 = usingNuxtContent && await kit.hasNuxtModuleCompatibility("@nuxt/content", "^3");
675
+ const isNuxtContentV2 = usingNuxtContent && await kit.hasNuxtModuleCompatibility("@nuxt/content", "^2");
676
+ if (isNuxtContentV3) {
677
+ if (typeof config.strictNuxtContentPaths !== "undefined") {
678
+ logger_js.logger.warn("The `strictNuxtContentPaths` option is deprecated and has no effect in Nuxt Content v3.");
679
+ }
680
+ } else if (isNuxtContentV2) {
681
+ kit.addServerPlugin(resolve("./runtime/server/plugins/nuxt-content"));
682
+ }
683
+ if (!config.fonts.length) {
684
+ config.fonts = [
685
+ { name: "Inter", weight: 400, path: resolve("./runtime/assets/Inter-normal-400.ttf.base64"), absolutePath: true },
686
+ { name: "Inter", weight: 700, path: resolve("./runtime/assets/Inter-normal-700.ttf.base64"), absolutePath: true }
687
+ ];
688
+ }
689
+ let publicDirAbs = nuxt.options.dir.public;
690
+ if (!pathe.isAbsolute(publicDirAbs)) {
691
+ publicDirAbs = publicDirAbs in nuxt.options.alias ? nuxt.options.alias[publicDirAbs] : resolve(nuxt.options.rootDir, publicDirAbs);
692
+ }
693
+ const serverFontsDir = resolve(nuxt.options.buildDir, "cache", `nuxt-og-image@${version}`, "_fonts");
694
+ const fontStorage = unstorage.createStorage({
695
+ driver: fsDriver__default({
696
+ base: serverFontsDir
697
+ })
698
+ });
699
+ config.fonts = (await Promise.all(normaliseFontInput(config.fonts).map(async (f) => {
700
+ const fontKey = `${f.name}:${f.style}:${f.weight}`;
701
+ const fontFileBase = fontKey.replaceAll(":", "-");
702
+ if (!f.key && !f.path) {
703
+ if (preset === "stackblitz") {
704
+ logger_js.logger.warn(`The ${fontKey} font was skipped because remote fonts are not available in StackBlitz, please use a local font.`);
705
+ return false;
706
+ }
707
+ if (await downloadFont(f, fontStorage, config.googleFontMirror)) {
708
+ f.key = `nuxt-og-image:fonts:${fontFileBase}.ttf.base64`;
709
+ } else {
710
+ logger_js.logger.warn(`Failed to download font ${fontKey}. You may be offline or behind a firewall blocking Google. Consider setting \`googleFontMirror: true\`.`);
711
+ return false;
712
+ }
713
+ } else if (f.path) {
714
+ const extension = pathe.basename(f.path.replace(".base64", "")).split(".").pop();
715
+ if (!["woff", "ttf", "otf"].includes(extension)) {
716
+ logger_js.logger.warn(`The ${fontKey} font was skipped because the file extension ${extension} is not supported. Only woff, ttf and otf are supported.`);
717
+ return false;
718
+ }
719
+ if (!f.absolutePath)
720
+ f.path = resolve(publicDirAbs, ufo.withoutLeadingSlash(f.path));
721
+ if (!fs.existsSync(f.path)) {
722
+ logger_js.logger.warn(`The ${fontKey} font was skipped because the file does not exist at path ${f.path}.`);
723
+ return false;
724
+ }
725
+ const fontData = await promises.readFile(f.path, f.path.endsWith(".base64") ? "utf-8" : "base64");
726
+ f.key = `nuxt-og-image:fonts:${fontFileBase}.${extension}.base64`;
727
+ await fontStorage.setItem(`${fontFileBase}.${extension}.base64`, fontData);
728
+ delete f.path;
729
+ delete f.absolutePath;
730
+ }
731
+ return f;
732
+ }))).filter(Boolean);
733
+ const fontKeys = config.fonts.map((f) => f.key?.split(":").pop());
734
+ const fontStorageKeys = await fontStorage.getKeys();
735
+ await Promise.all(fontStorageKeys.filter((key) => !fontKeys.includes(key)).map(async (key) => {
736
+ logger_js.logger.info(`Nuxt OG Image removing outdated cached font file \`${key}\``);
737
+ await fontStorage.removeItem(key);
738
+ }));
739
+ if (!config.zeroRuntime) {
740
+ nuxt.options.nitro.serverAssets = nuxt.options.nitro.serverAssets || [];
741
+ nuxt.options.nitro.serverAssets.push({ baseName: "nuxt-og-image:fonts", dir: serverFontsDir });
742
+ }
743
+ nuxt.options.experimental.componentIslands ||= true;
744
+ const basePath = config.zeroRuntime ? "./runtime/server/routes/__zero-runtime" : "./runtime/server/routes";
745
+ kit.addServerHandler({
746
+ lazy: true,
747
+ route: "/__og-image__/font/**",
748
+ handler: resolve(`${basePath}/font`)
749
+ });
750
+ if (config.debug || nuxt.options.dev) {
751
+ kit.addServerHandler({
752
+ lazy: true,
753
+ route: "/__og-image__/debug.json",
754
+ handler: resolve("./runtime/server/routes/debug.json")
755
+ });
756
+ }
757
+ kit.addServerHandler({
758
+ lazy: true,
759
+ route: "/__og-image__/image/**",
760
+ handler: resolve(`${basePath}/image`)
761
+ });
762
+ kit.addServerHandler({
763
+ lazy: true,
764
+ route: "/__og-image__/static/**",
765
+ handler: resolve(`${basePath}/image`)
766
+ });
767
+ if (!nuxt.options.dev) {
768
+ nuxt.options.optimization.treeShake.composables.client["nuxt-og-image"] = [];
769
+ }
770
+ ["defineOgImage", "defineOgImageComponent", "defineOgImageScreenshot"].forEach((name) => {
771
+ kit.addImports({
772
+ name,
773
+ from: resolve(`./runtime/app/composables/${name}`)
774
+ });
775
+ if (!nuxt.options.dev) {
776
+ nuxt.options.optimization.treeShake.composables.client["nuxt-og-image"].push(name);
777
+ }
778
+ });
779
+ if (!config.zeroRuntime || nuxt.options.dev) {
780
+ await kit.addComponentsDir({
781
+ path: resolve("./runtime/app/components/Templates/Community"),
782
+ island: true
783
+ // watch: true,
784
+ });
785
+ }
786
+ [
787
+ // new
788
+ "OgImage",
789
+ "OgImageScreenshot"
790
+ ].forEach((name) => {
791
+ kit.addComponent({
792
+ name,
793
+ filePath: resolve(`./runtime/app/components/OgImage/${name}`),
794
+ ...config.componentOptions
795
+ });
796
+ });
797
+ const basePluginPath = `./runtime/app/plugins${config.zeroRuntime ? "/__zero-runtime" : ""}`;
798
+ kit.addPlugin({ mode: "server", src: resolve(`${basePluginPath}/route-rule-og-image.server`) });
799
+ kit.addPlugin({ mode: "server", src: resolve(`${basePluginPath}/og-image-canonical-urls.server`) });
800
+ const ogImageComponentCtx = { components: [] };
801
+ nuxt.hook("components:extend", (components) => {
802
+ ogImageComponentCtx.components = [];
803
+ components.forEach((component) => {
804
+ let valid = false;
805
+ config.componentDirs.forEach((dir) => {
806
+ if (component.pascalName.startsWith(dir) || component.kebabName.startsWith(dir) || component.shortPath.includes(`/${dir}/`)) {
807
+ valid = true;
808
+ }
809
+ });
810
+ if (component.filePath.includes(resolve("./runtime/app/components/Templates")))
811
+ valid = true;
812
+ if (valid && fs__namespace.existsSync(component.filePath)) {
813
+ component.island = true;
814
+ component.mode = "server";
815
+ let category = "app";
816
+ if (component.filePath.includes(resolve("./runtime/app/components/Templates/Community")))
817
+ category = "community";
818
+ const componentFile = fs__namespace.readFileSync(component.filePath, "utf-8");
819
+ const credits = componentFile.split("\n").find((line) => line.startsWith(" * @credits"))?.replace("* @credits", "").trim();
820
+ ogImageComponentCtx.components.push({
821
+ // purge cache when component changes
822
+ hash: ohash.hash(componentFile),
823
+ pascalName: component.pascalName,
824
+ kebabName: component.kebabName,
825
+ path: nuxt.options.dev ? component.filePath : void 0,
826
+ category,
827
+ credits
828
+ });
829
+ }
830
+ });
831
+ nuxt.hooks.hook("nuxt-og-image:components", ogImageComponentCtx);
832
+ });
833
+ kit.addTemplate({
834
+ filename: "nuxt-og-image/components.mjs",
835
+ getContents() {
836
+ return `export const componentNames = ${JSON.stringify(ogImageComponentCtx.components)}`;
837
+ },
838
+ options: { mode: "server" }
839
+ });
840
+ nuxt.options.nitro.virtual = nuxt.options.nitro.virtual || {};
841
+ nuxt.options.nitro.virtual["#og-image-virtual/component-names.mjs"] = () => {
842
+ return `export const componentNames = ${JSON.stringify(ogImageComponentCtx.components)}`;
843
+ };
844
+ let unoCssConfig = {};
845
+ nuxt.hook("tailwindcss:config", (tailwindConfig) => {
846
+ unoCssConfig = defu.defu(tailwindConfig.theme?.extend, { ...tailwindConfig.theme, extend: void 0 });
847
+ });
848
+ nuxt.hook("unocss:config", (_unoCssConfig) => {
849
+ unoCssConfig = { ..._unoCssConfig.theme };
850
+ });
851
+ nuxt.options.nitro.virtual["#og-image-virtual/unocss-config.mjs"] = () => {
852
+ return `export const theme = ${JSON.stringify(unoCssConfig)}`;
853
+ };
854
+ extendTypes("nuxt-og-image", ({ typesPath }) => {
855
+ const componentImports = ogImageComponentCtx.components.map((component) => {
856
+ const relativeComponentPath = pathe.relative(resolve(nuxt.options.rootDir, nuxt.options.buildDir, "module"), component.path);
857
+ const name = config.componentDirs.sort((a, b) => b.length - a.length).reduce((name2, dir) => {
858
+ return name2.replace(new RegExp(`^${dir}`), "");
859
+ }, component.pascalName);
860
+ return ` '${name}': typeof import('${relativeComponentPath}')['default']`;
861
+ }).join("\n");
862
+ return `
863
+ declare module 'nitropack' {
864
+ interface NitroRouteRules {
865
+ ogImage?: false | import('${typesPath}').OgImageOptions & Record<string, any>
866
+ }
867
+ interface NitroRouteConfig {
868
+ ogImage?: false | import('${typesPath}').OgImageOptions & Record<string, any>
869
+ }
870
+ interface NitroRuntimeHooks {
871
+ 'nuxt-og-image:context': (ctx: import('${typesPath}').OgImageRenderEventContext) => void | Promise<void>
872
+ 'nuxt-og-image:satori:vnodes': (vnodes: import('${typesPath}').VNode, ctx: import('${typesPath}').OgImageRenderEventContext) => void | Promise<void>
873
+ }
874
+ }
875
+
876
+ declare module '#og-image/components' {
877
+ export interface OgImageComponents {
878
+ ${componentImports}
879
+ }
880
+ }
881
+ declare module '#og-image/unocss-config' {
882
+ export type theme = any
883
+ }
884
+ `;
885
+ });
886
+ const cacheEnabled = typeof config.runtimeCacheStorage !== "undefined" && config.runtimeCacheStorage !== false;
887
+ const runtimeCacheStorage = typeof config.runtimeCacheStorage === "boolean" ? "default" : config.runtimeCacheStorage.driver;
888
+ let baseCacheKey = runtimeCacheStorage === "default" ? `/cache/nuxt-og-image/${version}` : `/nuxt-og-image/${version}`;
889
+ if (!cacheEnabled)
890
+ baseCacheKey = false;
891
+ if (!nuxt.options.dev && config.runtimeCacheStorage && typeof config.runtimeCacheStorage === "object") {
892
+ nuxt.options.nitro.storage = nuxt.options.nitro.storage || {};
893
+ nuxt.options.nitro.storage["nuxt-og-image"] = config.runtimeCacheStorage;
894
+ }
895
+ nuxt.hooks.hook("modules:done", async () => {
896
+ const normalisedFonts = normaliseFontInput(config.fonts);
897
+ if (!isNuxtGenerate() && nuxt.options.build) {
898
+ nuxt.options.nitro = nuxt.options.nitro || {};
899
+ nuxt.options.nitro.prerender = nuxt.options.nitro.prerender || {};
900
+ nuxt.options.nitro.prerender.routes = nuxt.options.nitro.prerender.routes || [];
901
+ }
902
+ const hasColorModeModule = kit.hasNuxtModule("@nuxtjs/color-mode");
903
+ const colorModeOptions = hasColorModeModule ? await getNuxtModuleOptions("@nuxtjs/color-mode") : {};
904
+ let colorPreference = colorModeOptions.preference;
905
+ if (!colorPreference || colorPreference === "system")
906
+ colorPreference = colorModeOptions.fallback;
907
+ if (!colorPreference || colorPreference === "system")
908
+ colorPreference = "light";
909
+ const runtimeConfig = {
910
+ version,
911
+ // binding options
912
+ satoriOptions: config.satoriOptions || {},
913
+ resvgOptions: config.resvgOptions || {},
914
+ sharpOptions: config.sharpOptions === true ? {} : config.sharpOptions || {},
915
+ publicStoragePath: `root${publicDirAbs.replace(nuxt.options.rootDir, "").replaceAll("/", ":")}`,
916
+ defaults: config.defaults,
917
+ debug: config.debug,
918
+ // avoid adding credentials
919
+ baseCacheKey,
920
+ // convert the fonts to uniform type to fix ts issue
921
+ fonts: normalisedFonts,
922
+ hasNuxtIcon: kit.hasNuxtModule("nuxt-icon") || kit.hasNuxtModule("@nuxt/icon"),
923
+ colorPreference,
924
+ strictNuxtContentPaths: config.strictNuxtContentPaths,
925
+ // @ts-expect-error runtime type
926
+ isNuxtContentDocumentDriven: config.strictNuxtContentPaths || !!nuxt.options.content?.documentDriven
927
+ };
928
+ nuxt.hooks.callHook("nuxt-og-image:runtime-config", runtimeConfig);
929
+ nuxt.options.runtimeConfig["nuxt-og-image"] = runtimeConfig;
930
+ });
931
+ if (nuxt.options.dev) {
932
+ setupDevHandler(config, resolve);
933
+ setupDevToolsUI(config, resolve);
934
+ } else if (isNuxtGenerate()) {
935
+ setupGenerateHandler(config, resolve);
936
+ } else if (nuxt.options.build) {
937
+ await setupBuildHandler(config, resolve);
938
+ }
939
+ if (nuxt.options.build)
940
+ kit.addServerPlugin(resolve("./runtime/server/plugins/prerender"));
941
+ setupPrerenderHandler(config, resolve);
942
+ }
943
+ });
944
+
945
+ module.exports = module$1;