shopify 4.3.0 → 4.5.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 (337) hide show
  1. package/dist/analytics-DMUNCDGT.js +1 -0
  2. package/dist/analytics-GAPN4I6R.js +1 -0
  3. package/dist/assets/hydrogen/routes/locale-check.ts +3 -3
  4. package/dist/assets/hydrogen/starter/CHANGELOG.md +106 -0
  5. package/dist/assets/hydrogen/starter/app/components/Aside.tsx +4 -2
  6. package/dist/assets/hydrogen/starter/app/components/CartMain.tsx +8 -5
  7. package/dist/assets/hydrogen/starter/app/components/CartSummary.tsx +117 -23
  8. package/dist/assets/hydrogen/starter/app/components/Header.tsx +3 -3
  9. package/dist/assets/hydrogen/starter/app/components/PaginatedResourceSection.tsx +24 -4
  10. package/dist/assets/hydrogen/starter/app/components/ProductPrice.tsx +1 -1
  11. package/dist/assets/hydrogen/starter/app/lib/context.ts +5 -0
  12. package/dist/assets/hydrogen/starter/app/routes/[robots.txt].tsx +14 -53
  13. package/dist/assets/hydrogen/starter/app/routes/_index.tsx +11 -4
  14. package/dist/assets/hydrogen/starter/app/routes/account.$.tsx +1 -1
  15. package/dist/assets/hydrogen/starter/app/routes/account.addresses.tsx +2 -2
  16. package/dist/assets/hydrogen/starter/app/routes/account.profile.tsx +1 -1
  17. package/dist/assets/hydrogen/starter/package.json +9 -10
  18. package/dist/assets/hydrogen/starter/storefrontapi.generated.d.ts +0 -11
  19. package/dist/assets/hydrogen/starter/vite.config.ts +10 -4
  20. package/dist/assets/hydrogen/vite/package.json +1 -2
  21. package/dist/assets/hydrogen/vite/vite.config.js +4 -3
  22. package/dist/bootstrap.js +1 -1
  23. package/dist/{chunk-3YDYZ232.js → chunk-235JVI2J.js} +8 -8
  24. package/dist/{chunk-2K7FGAT6.js → chunk-24RF5KN3.js} +1 -1
  25. package/dist/{chunk-GWHV62YT.js → chunk-2IPVQRMI.js} +1 -1
  26. package/dist/{chunk-QDVJJKLB.js → chunk-2MDFREEW.js} +1 -1
  27. package/dist/{chunk-JSOGPMWB.js → chunk-2MZACB7V.js} +1 -1
  28. package/dist/{chunk-LCZDC6EE.js → chunk-2ROG5NK3.js} +1 -1
  29. package/dist/{chunk-WVRGCNBZ.js → chunk-2VUG6LRN.js} +1 -1
  30. package/dist/{chunk-S22NCNAJ.js → chunk-32KQKGSY.js} +1 -1
  31. package/dist/chunk-3EQY5B4S.js +836 -0
  32. package/dist/{chunk-VRJTLVG3.js → chunk-3JAC5SI7.js} +1 -1
  33. package/dist/{chunk-G3JJLXPH.js → chunk-3JZKWK2V.js} +1 -1
  34. package/dist/chunk-3NMVMCOM.js +3 -0
  35. package/dist/chunk-3OE5HXHO.js +1 -0
  36. package/dist/{chunk-2RBIR3NM.js → chunk-4EYTWWYF.js} +1 -1
  37. package/dist/{chunk-G2OHWAY2.js → chunk-4LML2QWN.js} +1 -1
  38. package/dist/{chunk-UYSF234H.js → chunk-4Q54UDO3.js} +1 -1
  39. package/dist/{chunk-7572RLUP.js → chunk-4U3NC3UU.js} +1 -1
  40. package/dist/chunk-52H2R2FU.js +1 -0
  41. package/dist/{chunk-PMS4MNHB.js → chunk-57IRHKV3.js} +1 -1
  42. package/dist/{chunk-3AOQKI4B.js → chunk-5A7EMVAP.js} +1 -1
  43. package/dist/{chunk-T3ERXB7F.js → chunk-5EVFLUUA.js} +1 -1
  44. package/dist/{chunk-DYNH5SKT.js → chunk-5O7PY44R.js} +1 -1
  45. package/dist/chunk-63NFEXJR.js +275 -0
  46. package/dist/{chunk-PXHY753L.js → chunk-663TS34D.js} +1 -1
  47. package/dist/{chunk-JAWKLBOB.js → chunk-6I3FNLT3.js} +1 -1
  48. package/dist/{chunk-WA3YC5W4.js → chunk-6LTJMYUD.js} +2 -2
  49. package/dist/{chunk-5BKCIDMS.js → chunk-6V37CHBZ.js} +1 -1
  50. package/dist/{chunk-HOSFU6UP.js → chunk-74IG3ZE3.js} +3 -3
  51. package/dist/{chunk-4J32OHLY.js → chunk-7BVXGS44.js} +1 -1
  52. package/dist/{chunk-MRS6LAY7.js → chunk-7DYZVU7H.js} +1 -1
  53. package/dist/{chunk-YSIBRY6C.js → chunk-7EOQVQND.js} +1 -1
  54. package/dist/{chunk-3SPDFV5D.js → chunk-7HZG7FBK.js} +1 -1
  55. package/dist/{chunk-MIDYZPO4.js → chunk-7KHYEIA7.js} +1 -1
  56. package/dist/{chunk-5XDQ76DQ.js → chunk-7ZIO3X22.js} +1 -1
  57. package/dist/{chunk-6JKGUQRD.js → chunk-A2O3MBPH.js} +1 -1
  58. package/dist/{chunk-Q77MM2N2.js → chunk-ABCU552E.js} +1 -1
  59. package/dist/{chunk-N3CNWCC2.js → chunk-AP6FNGTA.js} +1 -1
  60. package/dist/chunk-AUZCENYI.js +1 -0
  61. package/dist/chunk-AYKRKE6O.js +2 -0
  62. package/dist/{chunk-PFGYC53K.js → chunk-AYSS2ERL.js} +1 -1
  63. package/dist/chunk-B367FOQA.js +7 -0
  64. package/dist/{chunk-PCCK4YTE.js → chunk-BBATKR3B.js} +1 -1
  65. package/dist/chunk-BCEWCYZD.js +1 -0
  66. package/dist/{chunk-2GU7OY3H.js → chunk-BH34ZLZ4.js} +1 -1
  67. package/dist/{chunk-ZM75DSIW.js → chunk-BLI7DUNV.js} +1 -1
  68. package/dist/{chunk-E7DHELFH.js → chunk-BNX4MZMV.js} +1 -1
  69. package/dist/{chunk-N5LVGFDS.js → chunk-BU7R7NFL.js} +1 -1
  70. package/dist/{chunk-NILXAUUT.js → chunk-BVHBMOIB.js} +1 -1
  71. package/dist/{chunk-7FQFEB33.js → chunk-BXDZX3BS.js} +34 -34
  72. package/dist/{chunk-MMIHHCMW.js → chunk-CVRAATZ5.js} +1 -1
  73. package/dist/{chunk-G3RWLAOG.js → chunk-DBBU6OVN.js} +1 -1
  74. package/dist/{chunk-G2LVUM7N.js → chunk-DKVU7LYY.js} +1 -1
  75. package/dist/{chunk-L2PC4MUV.js → chunk-DLZPP33V.js} +1 -1
  76. package/dist/{chunk-JEZ3PGVC.js → chunk-DQOS54HN.js} +1 -1
  77. package/dist/{chunk-OZBY45KT.js → chunk-E4GW6OXT.js} +1 -1
  78. package/dist/chunk-E64BQS4D.js +1 -0
  79. package/dist/chunk-F447QKVX.js +1 -0
  80. package/dist/{chunk-57PPQKJT.js → chunk-FA25RL4G.js} +1 -1
  81. package/dist/{chunk-TRYWVIVJ.js → chunk-FJOEHMXM.js} +1 -1
  82. package/dist/{chunk-NWXDOCL5.js → chunk-G6YOP2SJ.js} +1 -1
  83. package/dist/{chunk-YIRFEW5M.js → chunk-GOAKZ2IL.js} +1 -1
  84. package/dist/{chunk-AU5EZQW7.js → chunk-H2JU5BGK.js} +1 -1
  85. package/dist/{chunk-VJ6KDRZI.js → chunk-H3V6Y5JO.js} +1 -1
  86. package/dist/{chunk-GJXINXSU.js → chunk-HHA322FT.js} +46 -46
  87. package/dist/{chunk-HCTZN7L4.js → chunk-HP3NDE7S.js} +1 -1
  88. package/dist/{chunk-ANBOLDON.js → chunk-HX3TALXV.js} +1 -1
  89. package/dist/{chunk-OU3M32A2.js → chunk-I3Y6XTKN.js} +1 -1
  90. package/dist/{chunk-DCLUZFT7.js → chunk-ICHNVDFU.js} +1 -1
  91. package/dist/{chunk-RSRYC5ZF.js → chunk-ICXHUPP5.js} +1 -1
  92. package/dist/chunk-IE4SSSXU.js +593 -0
  93. package/dist/{chunk-5FVB7JHP.js → chunk-IFVYCKX5.js} +1 -1
  94. package/dist/{chunk-JUYJZUYU.js → chunk-J2ZES5K5.js} +1 -1
  95. package/dist/{chunk-JCIN73BE.js → chunk-J5U2FUIX.js} +1 -1
  96. package/dist/chunk-JC3PRJJS.js +1 -0
  97. package/dist/chunk-JGN7YG5X.js +3 -0
  98. package/dist/{chunk-ZGJ3DFTQ.js → chunk-JZVNNQWE.js} +1 -1
  99. package/dist/{chunk-CV5EQGES.js → chunk-K2CIMJJW.js} +1 -1
  100. package/dist/{chunk-T4NS63K4.js → chunk-K7I5BGFC.js} +1 -1
  101. package/dist/{chunk-33OHQUHZ.js → chunk-KESQOMEW.js} +1 -1
  102. package/dist/{chunk-4QTEPWEJ.js → chunk-KJQAJUDU.js} +4 -4
  103. package/dist/{chunk-TP7E54WN.js → chunk-KNEF6NAG.js} +1 -1
  104. package/dist/{chunk-S6B2ADVR.js → chunk-KUKYAIOR.js} +1 -1
  105. package/dist/{chunk-MEIEEENL.js → chunk-KZDI2BXR.js} +1 -1
  106. package/dist/chunk-LKZ7ARYS.js +18 -0
  107. package/dist/{chunk-W7DDV2EY.js → chunk-LMPD55L6.js} +1 -1
  108. package/dist/{chunk-YVQXEPHY.js → chunk-LXZM6Z4F.js} +1 -1
  109. package/dist/{chunk-S5IFJ737.js → chunk-MGPLKG23.js} +1 -1
  110. package/dist/chunk-MSJDZLZT.js +1 -0
  111. package/dist/{chunk-N3NE4MVN.js → chunk-N4LCWB56.js} +1 -1
  112. package/dist/{chunk-VI34CKV6.js → chunk-N5U5Q2MG.js} +1 -1
  113. package/dist/{chunk-JK3NIHTX.js → chunk-N5YIZJ4S.js} +1 -1
  114. package/dist/{chunk-CEHXOWA6.js → chunk-N625VE5T.js} +1 -1
  115. package/dist/{chunk-A5HKAMAC.js → chunk-NJLSZS27.js} +1 -1
  116. package/dist/{chunk-WHNWE7P2.js → chunk-O7OQK2OC.js} +1 -1
  117. package/dist/{chunk-5O43334U.js → chunk-P375IGKT.js} +1 -1
  118. package/dist/chunk-P3RGC53U.js +5 -0
  119. package/dist/{chunk-4FFPTEKD.js → chunk-P4243GCY.js} +1 -1
  120. package/dist/{chunk-FIYAECXH.js → chunk-PFEC2NUB.js} +1 -1
  121. package/dist/{chunk-JJ6RM54S.js → chunk-PH7F4BMG.js} +1 -1
  122. package/dist/chunk-PK6NOLT5.js +2 -0
  123. package/dist/chunk-PLHJQQVZ.js +1 -0
  124. package/dist/{chunk-AO3RFGNV.js → chunk-PVD544NN.js} +1 -1
  125. package/dist/chunk-Q3WOWDUU.js +1 -0
  126. package/dist/chunk-Q7BOSHWX.js +7 -0
  127. package/dist/{chunk-2XZBQZ5R.js → chunk-QAM7VCLV.js} +1 -1
  128. package/dist/{chunk-FOFJBRSL.js → chunk-QCBAFI6Z.js} +1 -1
  129. package/dist/{chunk-SSCYLDSX.js → chunk-QHWF3S7U.js} +1 -1
  130. package/dist/{chunk-EVZA2TCI.js → chunk-QJL3SXYA.js} +1 -1
  131. package/dist/{chunk-UB26DGTR.js → chunk-QRETBFXI.js} +1 -1
  132. package/dist/chunk-RBOYWA2D.js +1 -0
  133. package/dist/{chunk-N3YTDGFY.js → chunk-ROQXPIEZ.js} +1 -1
  134. package/dist/{chunk-ATSMK66C.js → chunk-RUKK4KXX.js} +1 -1
  135. package/dist/{chunk-PNP5OKNZ.js → chunk-RY2ESY3P.js} +1 -1
  136. package/dist/{chunk-HIQHYPLU.js → chunk-RY5CY3ZW.js} +1 -1
  137. package/dist/{chunk-Q73GEVSJ.js → chunk-S442LGHR.js} +1 -1
  138. package/dist/{chunk-OXJBYKMX.js → chunk-S5JJL3BP.js} +1 -1
  139. package/dist/{chunk-UU5P2IYU.js → chunk-SF53RKMO.js} +1 -1
  140. package/dist/{chunk-JAWOP4HJ.js → chunk-SY2AH7C2.js} +1 -1
  141. package/dist/{chunk-J5BRKYGE.js → chunk-TC3JOEMA.js} +1 -1
  142. package/dist/{chunk-M7YFD4EV.js → chunk-TEXYUUTD.js} +5 -5
  143. package/dist/chunk-TGM7L6RV.js +1 -0
  144. package/dist/{chunk-5H3VTG77.js → chunk-TKW3Z7XL.js} +1 -1
  145. package/dist/{chunk-HDC5V7RY.js → chunk-TM534QSE.js} +1 -1
  146. package/dist/{chunk-5FFHQTRC.js → chunk-U44HRKSU.js} +1 -1
  147. package/dist/{chunk-UTO4Z6P6.js → chunk-UEC23KAO.js} +1 -1
  148. package/dist/{chunk-RKDZGK5K.js → chunk-UFGDNIYX.js} +1 -1
  149. package/dist/{chunk-Q7C44DX5.js → chunk-UGGFSV7N.js} +1 -1
  150. package/dist/{chunk-USLYL5AC.js → chunk-UJVYIWUI.js} +1 -1
  151. package/dist/{chunk-OU4SKQTC.js → chunk-UP7H24B3.js} +2 -2
  152. package/dist/{chunk-YPBCSDFQ.js → chunk-UQZ7HZ47.js} +1 -1
  153. package/dist/{chunk-2EHBJWC6.js → chunk-UTLRP527.js} +1 -1
  154. package/dist/chunk-UTPJAU5S.js +1 -0
  155. package/dist/{chunk-DNXYKGV2.js → chunk-V66IHWQO.js} +1 -1
  156. package/dist/{chunk-YL3TYQGT.js → chunk-V774I3FW.js} +1 -1
  157. package/dist/{chunk-6KETAPWL.js → chunk-VKFDDZD3.js} +1 -1
  158. package/dist/{chunk-ZUKLGZOU.js → chunk-VNYKNAT5.js} +1 -1
  159. package/dist/{chunk-AERKD4TO.js → chunk-VUACOGOX.js} +1 -1
  160. package/dist/{chunk-KRQGLK2Q.js → chunk-WFB3FHKV.js} +1 -1
  161. package/dist/chunk-WPITBIL5.js +21 -0
  162. package/dist/{chunk-J3HX6ZGD.js → chunk-WTYH2O47.js} +1 -1
  163. package/dist/chunk-WU6GIY22.js +4 -0
  164. package/dist/{chunk-UC7KMA6W.js → chunk-XA5JA7DK.js} +1 -1
  165. package/dist/{chunk-2TMQG2UT.js → chunk-XSXX75VV.js} +1 -1
  166. package/dist/{chunk-7D45IAMQ.js → chunk-XXUWTD7A.js} +1 -1
  167. package/dist/chunk-XZWAX4FI.js +46 -0
  168. package/dist/{chunk-FQ5ZZX2G.js → chunk-YF4HKJB5.js} +1 -1
  169. package/dist/chunk-YJAX22JK.js +7 -0
  170. package/dist/{chunk-BL46CZ2M.js → chunk-YT3NPMWK.js} +1 -1
  171. package/dist/{chunk-NTRAWIEJ.js → chunk-YYLEWVO6.js} +3 -3
  172. package/dist/chunk-Z2Y6G2QF.js +1 -0
  173. package/dist/{chunk-M2YINBHF.js → chunk-Z66NZ2HC.js} +1 -1
  174. package/dist/{chunk-6LWOWDF4.js → chunk-ZFOWAMFK.js} +1 -1
  175. package/dist/{chunk-25HJX3L2.js → chunk-ZKBWEHIY.js} +1 -1
  176. package/dist/{chunk-2GAFKG64.js → chunk-ZZ3SMI2A.js} +1 -1
  177. package/dist/{chunk-TY6BZTG3.js → chunk-ZZWSMRKT.js} +1 -1
  178. package/dist/cli/commands/app/app-logs/sources.js +1 -1
  179. package/dist/cli/commands/app/build.js +1 -1
  180. package/dist/cli/commands/app/bulk/cancel.js +1 -1
  181. package/dist/cli/commands/app/bulk/execute.js +1 -1
  182. package/dist/cli/commands/app/bulk/status.js +1 -1
  183. package/dist/cli/commands/app/config/link.js +1 -1
  184. package/dist/cli/commands/app/config/pull.js +1 -1
  185. package/dist/cli/commands/app/config/use.js +1 -1
  186. package/dist/cli/commands/app/config/validate.js +1 -1
  187. package/dist/cli/commands/app/demo/watcher.js +1 -1
  188. package/dist/cli/commands/app/deploy.js +1 -1
  189. package/dist/cli/commands/app/dev/clean.js +1 -1
  190. package/dist/cli/commands/app/dev.js +1 -1
  191. package/dist/cli/commands/app/env/pull.js +1 -1
  192. package/dist/cli/commands/app/env/show.js +1 -1
  193. package/dist/cli/commands/app/execute.js +1 -1
  194. package/dist/cli/commands/app/function/build.js +1 -1
  195. package/dist/cli/commands/app/function/info.js +1 -1
  196. package/dist/cli/commands/app/function/replay.js +1 -1
  197. package/dist/cli/commands/app/function/run.js +1 -1
  198. package/dist/cli/commands/app/function/schema.js +1 -1
  199. package/dist/cli/commands/app/function/typegen.js +1 -1
  200. package/dist/cli/commands/app/generate/extension.js +1 -1
  201. package/dist/cli/commands/app/graphiql.js +1 -0
  202. package/dist/cli/commands/app/import-custom-data-definitions.js +1 -1
  203. package/dist/cli/commands/app/import-extensions.js +1 -1
  204. package/dist/cli/commands/app/info.js +1 -1
  205. package/dist/cli/commands/app/init.js +1 -1
  206. package/dist/cli/commands/app/logs.js +1 -1
  207. package/dist/cli/commands/app/release.js +1 -1
  208. package/dist/cli/commands/app/versions/list.js +1 -1
  209. package/dist/cli/commands/app/webhook/trigger.js +1 -1
  210. package/dist/cli/commands/auth/login.js +1 -1
  211. package/dist/cli/commands/auth/logout.js +1 -1
  212. package/dist/cli/commands/cache/clear.js +1 -1
  213. package/dist/cli/commands/config/autoupgrade/off.js +1 -1
  214. package/dist/cli/commands/config/autoupgrade/on.js +1 -1
  215. package/dist/cli/commands/config/autoupgrade/status.js +1 -1
  216. package/dist/cli/commands/debug/command-flags.js +1 -1
  217. package/dist/cli/commands/doc/fetch.js +1 -1
  218. package/dist/cli/commands/doc/search.js +1 -1
  219. package/dist/cli/commands/docs/generate.js +1 -1
  220. package/dist/cli/commands/doctor-release/doctor-release.js +1 -1
  221. package/dist/cli/commands/doctor-release/theme/index.js +1 -1
  222. package/dist/cli/commands/help.js +1 -1
  223. package/dist/cli/commands/kitchen-sink/async.js +1 -1
  224. package/dist/cli/commands/kitchen-sink/index.js +1 -1
  225. package/dist/cli/commands/kitchen-sink/prompts.js +1 -1
  226. package/dist/cli/commands/kitchen-sink/static.js +1 -1
  227. package/dist/cli/commands/notifications/generate.js +1 -1
  228. package/dist/cli/commands/notifications/list.js +1 -1
  229. package/dist/cli/commands/organization/list.js +1 -1
  230. package/dist/cli/commands/search.js +1 -1
  231. package/dist/cli/commands/theme/check.js +1 -1
  232. package/dist/cli/commands/theme/console.js +1 -1
  233. package/dist/cli/commands/theme/delete.js +1 -1
  234. package/dist/cli/commands/theme/dev.js +1 -1
  235. package/dist/cli/commands/theme/duplicate.js +1 -1
  236. package/dist/cli/commands/theme/info.js +1 -1
  237. package/dist/cli/commands/theme/init.js +1 -1
  238. package/dist/cli/commands/theme/language-server.js +1 -1
  239. package/dist/cli/commands/theme/list.js +1 -1
  240. package/dist/cli/commands/theme/metafields/pull.js +1 -1
  241. package/dist/cli/commands/theme/open.js +1 -1
  242. package/dist/cli/commands/theme/package.js +1 -1
  243. package/dist/cli/commands/theme/preview.js +1 -1
  244. package/dist/cli/commands/theme/profile.js +1 -1
  245. package/dist/cli/commands/theme/publish.js +1 -1
  246. package/dist/cli/commands/theme/pull.js +1 -1
  247. package/dist/cli/commands/theme/push.js +1 -1
  248. package/dist/cli/commands/theme/rename.js +1 -1
  249. package/dist/cli/commands/theme/share.js +1 -1
  250. package/dist/cli/commands/upgrade.js +1 -1
  251. package/dist/cli/commands/version.js +1 -1
  252. package/dist/cli/help.d.ts +38 -0
  253. package/dist/cli/help.js +2 -0
  254. package/dist/command-registry.js +1 -1
  255. package/dist/{conf-store-UY3MDGGA.js → conf-store-V6ILVUUO.js} +1 -1
  256. package/dist/{deprecations-KNUMDRIU.js → deprecations-MOEFN6OW.js} +1 -1
  257. package/dist/dist-2BL5GGMG.js +1 -0
  258. package/dist/dist-E6QKEULH.js +1 -0
  259. package/dist/environments-5KA3OBIZ.js +1 -0
  260. package/dist/error-NYYI6HVX.js +1 -0
  261. package/dist/error-handler-BOESDKZA.js +1 -0
  262. package/dist/{fs-LJWVNO4H.js → fs-XE6SBVBF.js} +1 -1
  263. package/dist/hooks/app-init.js +1 -1
  264. package/dist/hooks/did-you-mean.js +1 -1
  265. package/dist/hooks/hydrogen-init.js +1 -1
  266. package/dist/hooks/plugin-plugins.js +1 -1
  267. package/dist/hooks/postrun.js +1 -1
  268. package/dist/hooks/prerun.js +1 -1
  269. package/dist/hooks/public-metadata.js +1 -1
  270. package/dist/hooks/sensitive-metadata.js +1 -1
  271. package/dist/hooks/tunnel-provider.js +1 -1
  272. package/dist/hooks/tunnel-start.js +1 -1
  273. package/dist/index.js +23 -10
  274. package/dist/{is-global-W6ALVC5L.js → is-global-JOHCPSKZ.js} +1 -1
  275. package/dist/lib-NOROGV6N.js +1 -0
  276. package/dist/lib-UCG2DNMS.js +1 -0
  277. package/dist/{local-GKEWZAIV.js → local-BTQDUX72.js} +1 -1
  278. package/dist/local-storage-WUSIVDTQ.js +1 -0
  279. package/dist/{metadata-UEUN64TK.js → metadata-APVOKTBV.js} +1 -1
  280. package/dist/{morph-CGOZEPPZ.js → morph-CG6HEMCQ.js} +4 -4
  281. package/dist/{node-package-manager-4ASQQIIF.js → node-package-manager-AC34ZJZD.js} +1 -1
  282. package/dist/notifications-system-4ODOESG2.js +1 -0
  283. package/dist/{output-S6E37GJQ.js → output-EAPQ7OWD.js} +1 -1
  284. package/dist/{prettier-EGVCP5CY.js → prettier-6ZMB2MMO.js} +1 -1
  285. package/dist/system-D7CH26HU.js +1 -0
  286. package/dist/tsconfig.tsbuildinfo +1 -1
  287. package/dist/ui-AXZBGWIQ.js +1 -0
  288. package/dist/upgrade-SLPJF6LD.js +1 -0
  289. package/dist/version-3IYH4V5U.js +1 -0
  290. package/dist/version-FAU37PQN.js +1 -0
  291. package/dist/{workerd-QOTT6UCO.js → workerd-XXPWKQOM.js} +1 -1
  292. package/oclif.manifest.json +712 -124
  293. package/package.json +15 -8
  294. package/dist/analytics-JH64XI2J.js +0 -1
  295. package/dist/analytics-MEGKKFGF.js +0 -1
  296. package/dist/assets/hydrogen/starter/app/routes/api.$version.[graphql.json].tsx +0 -14
  297. package/dist/chunk-762JWOWJ.js +0 -5
  298. package/dist/chunk-7LV55VWE.js +0 -1
  299. package/dist/chunk-A27NZMWB.js +0 -1
  300. package/dist/chunk-AVD3INWF.js +0 -1
  301. package/dist/chunk-AWEB5AQM.js +0 -1
  302. package/dist/chunk-AXNAGI32.js +0 -1
  303. package/dist/chunk-BQWK3C47.js +0 -278
  304. package/dist/chunk-CFOXXOO2.js +0 -1
  305. package/dist/chunk-DTIWUT2T.js +0 -18
  306. package/dist/chunk-DZQYG32N.js +0 -2
  307. package/dist/chunk-EH7ZTFS4.js +0 -613
  308. package/dist/chunk-EKVTNWHM.js +0 -1
  309. package/dist/chunk-G4OQABDT.js +0 -836
  310. package/dist/chunk-I22ZTRKK.js +0 -3
  311. package/dist/chunk-I4R7TML2.js +0 -7
  312. package/dist/chunk-J3H4LPN6.js +0 -18
  313. package/dist/chunk-JLE4NBMT.js +0 -1
  314. package/dist/chunk-LXVORHCQ.js +0 -1
  315. package/dist/chunk-MINZGZ4N.js +0 -1
  316. package/dist/chunk-S7F5KFQP.js +0 -1
  317. package/dist/chunk-T4IV643Z.js +0 -9
  318. package/dist/chunk-TPCG6DCA.js +0 -1
  319. package/dist/chunk-TUNUEOHO.js +0 -3
  320. package/dist/chunk-VPPWSKOY.js +0 -1
  321. package/dist/chunk-XVUHUA36.js +0 -1
  322. package/dist/chunk-YMAWEIUR.js +0 -1
  323. package/dist/dist-C5IV2YDQ.js +0 -1
  324. package/dist/dist-VL4KZWV2.js +0 -1
  325. package/dist/environments-YPRVO2CF.js +0 -1
  326. package/dist/error-XRBQTNFM.js +0 -1
  327. package/dist/error-handler-NI7D6GSY.js +0 -1
  328. package/dist/lib-AIKYSHWL.js +0 -1
  329. package/dist/lib-Q4PWEMFD.js +0 -1
  330. package/dist/local-storage-ZOZMA22B.js +0 -1
  331. package/dist/notifications-system-HLXJCAMG.js +0 -1
  332. package/dist/system-YQZNGSWB.js +0 -1
  333. package/dist/ui-D2FFWRK7.js +0 -1
  334. package/dist/upgrade-TVTCFMXM.js +0 -1
  335. package/dist/version-J6MDN7BZ.js +0 -1
  336. package/dist/version-RIRW5EXQ.js +0 -1
  337. /package/dist/{chunk-YLQ3LNNY.js → chunk-VDN6MEYI.js} +0 -0
@@ -1 +0,0 @@
1
- import{F as f,fa as v,ga as A,h as d,k as w,s as m}from"./chunk-G4OQABDT.js";import{b as l}from"./chunk-HDC5V7RY.js";import{d as p,g as F}from"./chunk-TPCG6DCA.js";import{Fb as g,Hb as h}from"./chunk-7FQFEB33.js";import{j as q}from"./chunk-NNOSZ447.js";import{g as c}from"./chunk-VKWPEFWQ.js";c();c();var V={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"publicApiVersions"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"publicApiVersions"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"handle"}},{kind:"Field",name:{kind:"Name",value:"supported"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};var S=new Map;async function W(t,r,e){let o="Admin",a=await b(r),n=r.storeFqdn,s=$(r);l()==="local"&&(s["x-forwarded-host"]=n,n=new m().host("app"));let i=x(n,a,r);return v({query:t,api:o,addedHeaders:s,url:i,token:r.token,variables:e})}async function E(t){let{query:r,session:e,variables:o,version:a,responseOptions:n,preferredBehaviour:s}=t,i=a??S.get(e.storeFqdn);i??(i=await b(e,s));let u=e.storeFqdn,k=$(e);l()==="local"&&(k["x-forwarded-host"]=u,u=new m().host("app"));let D={url:x(u,i,e),api:"Admin",token:e.token,addedHeaders:k},y;return"refresh"in e&&(y={type:"token_refresh",handler:e.refresh}),A({...D,query:r,variables:o,responseOptions:n,unauthorizedHandler:y,preferredBehaviour:s})}function $(t){return f(t)?{"X-Shopify-Shop":t.storeFqdn,"X-Shopify-Access-Token":t.token}:{}}async function b(t,r){let o=(await N(t,r)).reverse()[0];return S.set(t.storeFqdn,o),o}async function N(t,r){return(await R(t,r)).filter(o=>o.supported).map(o=>o.handle).sort()}async function R(t,r){try{return(await E({query:V,session:t,variables:{},version:"unstable",responseOptions:{handleErrors:!1},preferredBehaviour:r})).publicApiVersions}catch(e){if(e instanceof d&&e.response.status===403){let o=t.storeFqdn.replace(".myshopify.com","");throw new p(h`Looks like you don't have access to this dev store: (${g.link(o,`https://${t.storeFqdn}`)})`,h`If you're not the owner, create a dev store staff account for yourself`)}throw e instanceof d&&(e.response.status===401||e.response.status===404)?new p(`Error connecting to your store ${t.storeFqdn}: ${e.message} ${e.response.status} ${e.response.data}`):w(e)?new p(`Network error connecting to your store ${t.storeFqdn}: ${e instanceof Error?e.message:String(e)}`,"Check your internet connection and try again."):new F(`Unknown error connecting to your store ${t.storeFqdn}: ${e instanceof Error?e.message:String(e)}`)}}function x(t,r,e){let o=r??"unstable";return e&&f(e)?`https://${q}/cli/admin/api/${o}/graphql.json`:`https://${t}/admin/api/${o}/graphql.json`}export{W as a,E as b,N as c,R as d,x as e};
@@ -1,18 +0,0 @@
1
- import{k as we,t as ge}from"./chunk-5XDQ76DQ.js";import{M as fe,O as de,o as L,va as y,xa as C}from"./chunk-G4OQABDT.js";import{a as ue}from"./chunk-VPPWSKOY.js";import{P as pe,x as le,y as he}from"./chunk-NTRAWIEJ.js";import{d as R}from"./chunk-TPCG6DCA.js";import{Fb as F,Hb as ye,Pb as h}from"./chunk-7FQFEB33.js";import{u as me}from"./chunk-S5IFJ737.js";import{g as l}from"./chunk-VKWPEFWQ.js";l();l();function _e(e){let t=new URLSearchParams;for(let[r,n]of Object.entries(e.replaceTemplates??[]))t.append(`replace_templates[${r}]`,n);for(let[r,n]of Object.entries(e.replaceExtensionTemplates??[])){let o=r.split("/")[0];t.append(`replace_extension_templates[${o}][${r}]`,n)}return t.append("_method",e.method),t}function S(){return{"User-Agent":`Shopify CLI; v=${ue}`}}function W(e){return delete e.cookie,delete e.authorization,e}l();function T(e){let t={};return e.split(";").forEach(r=>{let n=r.match(/(.*?)=(.*)$/)??[],o=n[1]?.trim(),s=n[2]?.trim()??"";o&&(t[o]=s)}),t}function I(e){return Object.entries(e).map(([t,r])=>`${t}=${r}`).join("; ")}var k=class extends R{};async function $r(e){return ge(e)}async function jr(e,t){let r=Ce(t),n=new URLSearchParams;n.append("form_type","storefront_password"),n.append("utf8","\u2713"),n.append("password",e??""),C("theme-service:storefront-session:check-storefront-password");let o=await L(`${r}/password`,{headers:{"cache-control":"no-cache","content-type":"application/x-www-form-urlencoded"},body:n.toString(),method:"POST",redirect:"manual"});if(o.status===429)throw y(new R(`Too many incorrect password attempts. Please try again after ${o.headers.get("retry-after")} seconds.`));return Ee(o,r)}async function Re(e,t,r,n,o={}){let s={},a=await be(e,r,o),c=Ce(t);if(s._shopify_essential=a,C(`theme-service:storefront-session:is-password-protected:${!!n}`),!n)return s;let i=await rt(a,e,c,n,o);return{...s,...i}}async function be(e,t,r,n=1){let o=new URLSearchParams({preview_theme_id:t,_fd:"0",pb:"0"}),s=`${e}?${o}`;C("theme-service:storefront-session:get-session-essential-cookie");let a=await L(s,{method:"HEAD",redirect:"manual",headers:{...r,...S()}}),c=a.headers.raw()["set-cookie"]??[],i=z(c,"_shopify_essential");if(!i){if(h(`Failed to obtain _shopify_essential cookie.
2
-
3
- -Request ID: ${a.headers.get("x-request-id")??"unknown"}
4
-
5
- -Body: ${await a.text()}
6
-
7
- -Status: ${a.status}
8
- `),n>3)throw y(new k('Your development session could not be created because the "_shopify_essential" could not be defined. Please, check your internet connection.'));return h("Retrying to obtain the _shopify_essential cookie..."),await pe(n),be(e,t,r,n+1)}return i}async function rt(e,t,r,n,o){let s=new URLSearchParams({password:n}),a=await L(`${t}/password`,{method:"POST",redirect:"manual",body:s,headers:{...o,...S(),Cookie:I({_shopify_essential:e})}});if(!Ee(a,r))throw y(new R("Your development session could not be created because the store password is invalid. Please, retry with a different password."));let c=a.headers.raw()["set-cookie"]??[],i=z(c,"storefront_digest"),u=z(c,"_shopify_essential"),f={};return i&&(f.storefront_digest=i),u&&(f._shopify_essential=u),f}function Ee(e,t){let r=e.headers.get("location")??"",n;try{n=new URL(r,t)}catch(s){if(s instanceof TypeError)return!1;throw s}let o=new URL(t).origin;return e.status===302&&n.origin===o}function z(e,t){let r=e.find(o=>T(o)[t]);return r?T(r)[t]:void 0}function Ce(e){return`https://${e}`}l();l();l();l();var Br=String.fromCharCode;var Ae=/\+/g;var nt=/%2f/gi;function H(e=""){try{return decodeURIComponent(""+e)}catch{return""+e}}function G(e){return H(e.replace(nt,"%252F"))}function ot(e){return H(e.replace(Ae," "))}function st(e){return H(e.replace(Ae," "))}function at(e=""){let t=Object.create(null);e[0]==="?"&&(e=e.slice(1));for(let r of e.split("&")){let n=r.match(/([^=]+)=?(.*)/)||[];if(n.length<2)continue;let o=ot(n[1]);if(o==="__proto__"||o==="constructor")continue;let s=st(n[2]||"");t[o]===void 0?t[o]=s:Array.isArray(t[o])?t[o].push(s):t[o]=[t[o],s]}return t}var it=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,ct=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,ut=/^([/\\]\s*){2,}[^/\\]/;var ft=/\/$|\/\?|\/#/,dt=/^\.?\//;function lt(e,t={}){return typeof t=="boolean"&&(t={acceptRelative:t}),t.strict?it.test(e):ct.test(e)||(t.acceptRelative?ut.test(e):!1)}function V(e="",t){return t?ft.test(e):e.endsWith("/")}function J(e="",t){if(!t)return(V(e)?e.slice(0,-1):e)||"/";if(!V(e,!0))return e||"/";let r=e,n="",o=e.indexOf("#");o!==-1&&(r=e.slice(0,o),n=e.slice(o));let[s,...a]=r.split("?");return((s.endsWith("/")?s.slice(0,-1):s)||"/")+(a.length>0?`?${a.join("?")}`:"")+n}function ht(e="",t){if(!t)return e.endsWith("/")?e:e+"/";if(V(e,!0))return e||"/";let r=e,n="",o=e.indexOf("#");if(o!==-1&&(r=e.slice(0,o),n=e.slice(o),!r))return n;let[s,...a]=r.split("?");return s+"/"+(a.length>0?`?${a.join("?")}`:"")+n}function pt(e=""){return e.startsWith("/")}function Q(e=""){return pt(e)?e:"/"+e}function xe(e){return at(P(e).search)}function mt(e){return e&&e!=="/"}function Te(e,...t){let r=e||"";for(let n of t.filter(o=>mt(o)))if(r){let o=n.replace(dt,"");r=ht(r)+o}else r=n;return r}var yt=Symbol.for("ufo:protocolRelative");function P(e="",t){let r=e.match(/^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i);if(r){let[,d,p=""]=r;return{protocol:d.toLowerCase(),pathname:p,href:d+p,auth:"",host:"",search:"",hash:""}}if(!lt(e,{acceptRelative:!0}))return t?P(t+e):Se(e);let[,n="",o,s=""]=e.replace(/\\/g,"/").match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/)||[],[,a="",c=""]=s.match(/([^#/?]*)(.*)?/)||[];n==="file:"&&(c=c.replace(/\/(?=[A-Za-z]:)/,""));let{pathname:i,search:u,hash:f}=Se(c);return{protocol:n.toLowerCase(),auth:o?o.slice(0,Math.max(0,o.length-1)):"",host:a,pathname:i,search:u,hash:f,[yt]:!n}}function Se(e=""){let[t="",r="",n=""]=(e.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:t,search:r,hash:n}}l();var wt=(()=>{let e=function(){};return e.prototype=Object.create(null),e})();function ke(e,t){if(typeof e!="string")throw new TypeError("argument str must be a string");let r=new wt,n=t||{},o=n.decode||gt,s=0;for(;s<e.length;){let a=e.indexOf("=",s);if(a===-1)break;let c=e.indexOf(";",s);if(c===-1)c=e.length;else if(c<a){s=e.lastIndexOf(";",a-1)+1;continue}let i=e.slice(s,a).trim();if(n?.filter&&!n?.filter(i)){s=c+1;continue}if(r[i]===void 0){let u=e.slice(a+1,c).trim();u.codePointAt(0)===34&&(u=u.slice(1,-1)),r[i]=_t(u,o)}s=c+1}return r}function gt(e){return e.includes("%")?decodeURIComponent(e):e}function _t(e,t){try{return t(e)}catch{return e}}l();var g={NORMAL:0,WILDCARD:1,PLACEHOLDER:2};function Oe(e={}){let t={options:e,rootNode:Ne(),staticRoutesMap:{}},r=n=>e.strictTrailingSlash?n:n.replace(/\/$/,"")||"/";if(e.routes)for(let n in e.routes)He(t,r(n),e.routes[n]);return{ctx:t,lookup:n=>Rt(t,r(n)),insert:(n,o)=>He(t,r(n),o),remove:n=>bt(t,r(n))}}function Rt(e,t){let r=e.staticRoutesMap[t];if(r)return r.data;let n=t.split("/"),o={},s=!1,a=null,c=e.rootNode,i=null;for(let u=0;u<n.length;u++){let f=n[u];c.wildcardChildNode!==null&&(a=c.wildcardChildNode,i=n.slice(u).join("/"));let d=c.children.get(f);if(d===void 0){if(c&&c.placeholderChildren.length>1){let p=n.length-u;c=c.placeholderChildren.find(B=>B.maxDepth===p)||null}else c=c.placeholderChildren[0]||null;if(!c)break;c.paramName&&(o[c.paramName]=f),s=!0}else c=d}return(c===null||c.data===null)&&a!==null&&(c=a,o[c.paramName||"_"]=i,s=!0),c?s?{...c.data,params:s?o:void 0}:c.data:null}function He(e,t,r){let n=!0,o=t.split("/"),s=e.rootNode,a=0,c=[s];for(let i of o){let u;if(u=s.children.get(i))s=u;else{let f=Et(i);u=Ne({type:f,parent:s}),s.children.set(i,u),f===g.PLACEHOLDER?(u.paramName=i==="*"?`_${a++}`:i.slice(1),s.placeholderChildren.push(u),n=!1):f===g.WILDCARD&&(s.wildcardChildNode=u,u.paramName=i.slice(3)||"_",n=!1),c.push(u),s=u}}for(let[i,u]of c.entries())u.maxDepth=Math.max(c.length-i,u.maxDepth||0);return s.data=r,n===!0&&(e.staticRoutesMap[t]=s),s}function bt(e,t){let r=!1,n=t.split("/"),o=e.rootNode;for(let s of n)if(o=o.children.get(s),!o)return r;if(o.data){let s=n.at(-1)||"";o.data=null,Object.keys(o.children).length===0&&o.parent&&(o.parent.children.delete(s),o.parent.wildcardChildNode=null,o.parent.placeholderChildren=[]),r=!0}return r}function Ne(e={}){return{type:e.type||g.NORMAL,maxDepth:0,parent:e.parent||null,children:new Map,data:e.data||null,paramName:e.paramName||null,wildcardChildNode:null,placeholderChildren:[]}}function Et(e){return e.startsWith("**")?g.WILDCARD:e[0]===":"||e==="*"?g.PLACEHOLDER:g.NORMAL}function qe(e){let t=Le("",e.ctx.rootNode);return Ct(t,e.ctx.options.strictTrailingSlash)}function Ct(e,t){return{ctx:{table:e},matchAll:r=>Me(r,e,t)}}function St(){return{static:new Map,wildcard:new Map,dynamic:new Map}}function Me(e,t,r){r!==!0&&e.endsWith("/")&&(e=e.slice(0,-1)||"/");let n=[];for(let[s,a]of Pe(t.wildcard))(e===s||e.startsWith(s+"/"))&&n.push(a);for(let[s,a]of Pe(t.dynamic))if(e.startsWith(s+"/")){let c="/"+e.slice(s.length).split("/").splice(2).join("/");n.push(...Me(c,a))}let o=t.static.get(e);return o&&n.push(o),n.filter(Boolean)}function Pe(e){return[...e.entries()].sort((t,r)=>t[0].length-r[0].length)}function Le(e,t){let r=St();function n(o,s){if(o){if(s.type===g.NORMAL&&!(o.includes("*")||o.includes(":")))s.data&&r.static.set(o,s.data);else if(s.type===g.WILDCARD)r.wildcard.set(o.replace("/**",""),s.data);else if(s.type===g.PLACEHOLDER){let a=Le("",s);s.data&&a.static.set("/",s.data),r.dynamic.set(o.replace(/\/\*|\/:\w+/,""),a);return}}for(let[a,c]of s.children.entries())n(`${o}/${a}`.replace("//","/"),c)}return n(e,t),r}l();function K(e){if(e===null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)==="[object Module]":!0}function X(e,t,r=".",n){if(!K(t))return X(e,{},r,n);let o={...t};for(let s of Object.keys(e)){if(s==="__proto__"||s==="constructor")continue;let a=e[s];a!=null&&(n&&n(o,s,a,r)||(Array.isArray(a)&&Array.isArray(o[s])?o[s]=[...a,...o[s]]:K(a)&&K(o[s])?o[s]=X(a,o[s],(r?`${r}.`:"")+s.toString(),n):o[s]=a))}return o}function Y(e){return(...t)=>t.reduce((r,n)=>X(r,n,"",e),{})}var Ie=Y(),Qr=Y((e,t,r)=>{if(e[t]!==void 0&&typeof r=="function")return e[t]=r(e[t]),!0}),Kr=Y((e,t,r)=>{if(Array.isArray(e[t])&&typeof r=="function")return e[t]=r(e[t]),!0});l();var At=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,xt=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,Tt=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function kt(e,t){if(e==="__proto__"||e==="constructor"&&t&&typeof t=="object"&&"prototype"in t){Ht(e);return}return t}function Ht(e){console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`)}function $e(e,t={}){if(typeof e!="string")return e;if(e[0]==='"'&&e[e.length-1]==='"'&&e.indexOf("\\")===-1)return e.slice(1,-1);let r=e.trim();if(r.length<=9)switch(r.toLowerCase()){case"true":return!0;case"false":return!1;case"undefined":return;case"null":return null;case"nan":return Number.NaN;case"infinity":return Number.POSITIVE_INFINITY;case"-infinity":return Number.NEGATIVE_INFINITY}if(!Tt.test(e)){if(t.strict)throw new SyntaxError("[destr] Invalid JSON");return e}try{if(At.test(e)||xt.test(e)){if(t.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(e,kt)}return JSON.parse(e)}catch(n){if(t.strict)throw n;return e}}function x(e,t){try{return t in e}catch{return!1}}var j=class extends Error{static __h3_error__=!0;statusCode=500;fatal=!1;unhandled=!1;statusMessage;data;cause;constructor(t,r={}){super(t,r),r.cause&&!this.cause&&(this.cause=r.cause)}toJSON(){let t={message:this.message,statusCode:E(this.statusCode,500)};return this.statusMessage&&(t.statusMessage=D(this.statusMessage)),this.data!==void 0&&(t.data=this.data),t}};function m(e){if(typeof e=="string")return new j(e);if(oe(e))return e;let t=new j(e.message??e.statusMessage??"",{cause:e.cause||e});if(x(e,"stack"))try{Object.defineProperty(t,"stack",{get(){return e.stack}})}catch{try{t.stack=e.stack}catch{}}if(e.data&&(t.data=e.data),e.statusCode?t.statusCode=E(e.statusCode,t.statusCode):e.status&&(t.statusCode=E(e.status,t.statusCode)),e.statusMessage?t.statusMessage=e.statusMessage:e.statusText&&(t.statusMessage=e.statusText),t.statusMessage){let r=t.statusMessage;D(t.statusMessage)!==r&&console.warn("[h3] Please prefer using `message` for longer error messages instead of `statusMessage`. In the future, `statusMessage` will be sanitized by default.")}return e.fatal!==void 0&&(t.fatal=e.fatal),e.unhandled!==void 0&&(t.unhandled=e.unhandled),t}function Pt(e,t,r){if(e.handled)return;let n=oe(t)?t:m(t),o={statusCode:n.statusCode,statusMessage:n.statusMessage,stack:[],data:n.data};if(r&&(o.stack=(n.stack||"").split(`
9
- `).map(a=>a.trim())),e.handled)return;let s=Number.parseInt(n.statusCode);q(e,s,n.statusMessage),e.node.res.setHeader("content-type",N.json),e.node.res.end(JSON.stringify(o,void 0,2))}function oe(e){return e?.constructor?.__h3_error__===!0}function un(e){return xe(e.path||"")}function fn(e,t={}){let r=e.context.params||{};if(t.decode){r={...r};for(let n in r)r[n]=H(r[n])}return r}function Ot(e,t,r){if(r&&e.method==="HEAD")return!0;if(typeof t=="string"){if(e.method===t)return!0}else if(t.includes(e.method))return!0;return!1}function Nt(e,t,r){if(!Ot(e,t,r))throw m({statusCode:405,statusMessage:"HTTP method is not allowed."})}function Fe(e){let t={};for(let r in e.node.req.headers){let n=e.node.req.headers[r];t[r]=Array.isArray(n)?n.filter(Boolean).join(", "):n}return t}function _(e,t){return Fe(e)[t.toLowerCase()]}var je=_;function dn(e,t={}){if(e.context.clientAddress)return e.context.clientAddress;if(t.xForwardedFor){let r=_(e,"x-forwarded-for")?.split(",").shift()?.trim();if(r)return r}if(e.node.req.socket.remoteAddress)return e.node.req.socket.remoteAddress}var ee=Symbol.for("h3RawBody"),Z=Symbol.for("h3ParsedBody"),We=["PATCH","POST","PUT","DELETE"];function ze(e,t="utf8"){Nt(e,We);let r=e._requestBody||e.web?.request?.body||e.node.req[ee]||e.node.req.rawBody||e.node.req.body;if(r){let s=Promise.resolve(r).then(a=>Buffer.isBuffer(a)?a:typeof a.pipeTo=="function"?new Promise((c,i)=>{let u=[];a.pipeTo(new WritableStream({write(f){u.push(f)},close(){c(Buffer.concat(u))},abort(f){i(f)}})).catch(i)}):typeof a.pipe=="function"?new Promise((c,i)=>{let u=[];a.on("data",f=>{u.push(f)}).on("end",()=>{c(Buffer.concat(u))}).on("error",i)}):a.constructor===Object?Buffer.from(JSON.stringify(a)):a instanceof URLSearchParams?Buffer.from(a.toString()):a instanceof FormData?new Response(a).bytes().then(c=>Buffer.from(c)):Buffer.from(a));return t?s.then(a=>a.toString(t)):s}if(!Number.parseInt(e.node.req.headers["content-length"]||"")&&!/\bchunked\b/i.test(String(e.node.req.headers["transfer-encoding"]??"")))return Promise.resolve(void 0);let n=e.node.req[ee]=new Promise((s,a)=>{let c=[];e.node.req.on("error",i=>{a(i)}).on("data",i=>{c.push(i)}).on("end",()=>{s(Buffer.concat(c))})});return t?n.then(s=>s.toString(t)):n}async function ln(e,t={}){let r=e.node.req;if(x(r,Z))return r[Z];let n=r.headers["content-type"]||"",o=await ze(e),s;return n==="application/json"?s=De(o,t.strict??!0):n.startsWith("application/x-www-form-urlencoded")?s=qt(o):n.startsWith("text/")?s=o:s=De(o,t.strict??!1),r[Z]=s,s}function hn(e){if(!We.includes(e.method))return;let t=e.web?.request?.body||e._requestBody;return t||(ee in e.node.req||"rawBody"in e.node.req||"body"in e.node.req||"__unenv__"in e.node.req?new ReadableStream({async start(n){let o=await ze(e,!1);o&&n.enqueue(o),n.close()}}):new ReadableStream({start:n=>{e.node.req.on("data",o=>{n.enqueue(o)}),e.node.req.on("end",()=>{n.close()}),e.node.req.on("error",o=>{n.error(o)})}}))}function De(e="",t){if(e)try{return $e(e,{strict:t})}catch{throw m({statusCode:400,statusMessage:"Bad Request",message:"Invalid JSON body"})}}function qt(e){let t=new URLSearchParams(e),r=Object.create(null);for(let[n,o]of t.entries())x(r,n)?(Array.isArray(r[n])||(r[n]=[r[n]]),r[n].push(o)):r[n]=o;return r}var N={html:"text/html",json:"application/json"},Mt=/[^\u0009\u0020-\u007E]/g;function D(e=""){return e.replace(Mt,"")}function E(e,t=200){return!e||(typeof e=="string"&&(e=Number.parseInt(e,10)),e<100||e>999)?t:e}function Lt(e){return ke(e.node.req.headers.cookie||"")}function pn(e,t){return Lt(e)[t]}function Ve(e){if(Array.isArray(e))return e.flatMap(f=>Ve(f));if(typeof e!="string")return[];let t=[],r=0,n,o,s,a,c,i=()=>{for(;r<e.length&&/\s/.test(e.charAt(r));)r+=1;return r<e.length},u=()=>(o=e.charAt(r),o!=="="&&o!==";"&&o!==",");for(;r<e.length;){for(n=r,c=!1;i();)if(o=e.charAt(r),o===","){for(s=r,r+=1,i(),a=r;r<e.length&&u();)r+=1;r<e.length&&e.charAt(r)==="="?(c=!0,r=a,t.push(e.slice(n,s)),n=r):r=s+1}else r+=1;(!c||r>=e.length)&&t.push(e.slice(n))}return t}var It=typeof setImmediate>"u"?e=>e():setImmediate;function w(e,t,r){return r&&$t(e,r),new Promise(n=>{It(()=>{e.handled||e.node.res.end(t),n()})})}function Ge(e,t){if(e.handled)return;!t&&e.node.res.statusCode!==200&&(t=e.node.res.statusCode);let r=E(t,204);r===204&&e.node.res.removeHeader("content-length"),e.node.res.writeHead(r),e.node.res.end()}function q(e,t,r){t&&(e.node.res.statusCode=E(t,e.node.res.statusCode)),r&&(e.node.res.statusMessage=D(r))}function $t(e,t){t&&e.node.res.statusCode!==304&&!e.node.res.getHeader("content-type")&&e.node.res.setHeader("content-type",t)}function mn(e,t,r=302){e.node.res.statusCode=E(r,e.node.res.statusCode),e.node.res.setHeader("location",t);let o=`<!DOCTYPE html><html><head><meta http-equiv="refresh" content="0; url=${t.replace(/"/g,"%22")}"></head></html>`;return w(e,o,N.html)}function O(e,t){return e.node.res.getHeader(t)}function jt(e,t){for(let[r,n]of Object.entries(t))e.node.res.setHeader(r,n)}function A(e,t,r){e.node.res.setHeader(t,r)}function Dt(e,t){for(let[r,n]of Object.entries(t))Ut(e,r,n)}var b=Dt;function Ut(e,t,r){let n=e.node.res.getHeader(t);if(!n){e.node.res.setHeader(t,r);return}Array.isArray(n)||(n=[n.toString()]),e.node.res.setHeader(t,[...n,r])}function Je(e){return!e||typeof e!="object"?!1:typeof e.pipe=="function"&&(typeof e._read=="function"||typeof e.abort=="function")||typeof e.pipeTo=="function"}function Bt(e){return typeof Response<"u"&&e instanceof Response}function U(e,t){if(!t||typeof t!="object")throw new Error("[h3] Invalid stream provided.");if(e.node.res._data=t,!e.node.res.socket)return e._handled=!0,Promise.resolve();if(x(t,"pipeTo")&&typeof t.pipeTo=="function")return t.pipeTo(new WritableStream({write(r){e.node.res.write(r)}})).then(()=>{e.node.res.end()});if(x(t,"pipe")&&typeof t.pipe=="function")return new Promise((r,n)=>{t.pipe(e.node.res),t.on&&(t.on("end",()=>{e.node.res.end(),r()}),t.on("error",o=>{n(o)})),e.node.res.on("close",()=>{t.abort&&t.abort()})});throw new Error("[h3] Invalid or incompatible stream provided.")}function Qe(e,t){for(let[r,n]of t.headers)r==="set-cookie"?e.node.res.appendHeader(r,Ve(n)):e.node.res.setHeader(r,n);if(t.status&&(e.node.res.statusCode=E(t.status,e.node.res.statusCode)),t.statusText&&(e.node.res.statusMessage=D(t.statusText)),t.redirected&&e.node.res.setHeader("location",t.url),!t.body){e.node.res.end();return}return U(e,t.body)}function Ft(e={}){return Ie(e,{origin:"*",methods:"*",allowHeaders:"*",exposeHeaders:"*",credentials:!1,maxAge:!1,preflight:{statusCode:204}})}function Wt(e){let t=_(e,"origin"),r=_(e,"access-control-request-method");return e.method==="OPTIONS"&&!!t&&!!r}function zt(e,t){let{origin:r}=t;return!e||!r||r==="*"||r==="null"?!0:Array.isArray(r)?r.some(n=>n instanceof RegExp?n.test(e):e===n):r(e)}function Ke(e,t){let{origin:r}=t,n=_(e,"origin");return!n||!r||r==="*"?{"access-control-allow-origin":"*"}:typeof r=="string"?{"access-control-allow-origin":r,vary:"origin"}:zt(n,t)?{"access-control-allow-origin":n,vary:"origin"}:{}}function Vt(e){let{methods:t}=e;return t?t==="*"?{"access-control-allow-methods":"*"}:t.length>0?{"access-control-allow-methods":t.join(",")}:{}:{}}function Xe(e){let{credentials:t}=e;return t?{"access-control-allow-credentials":"true"}:{}}function Gt(e,t){let{allowHeaders:r}=t;if(!r||r==="*"||r.length===0){let n=_(e,"access-control-request-headers");return n?{"access-control-allow-headers":n,vary:"access-control-request-headers"}:{}}return{"access-control-allow-headers":r.join(","),vary:"access-control-request-headers"}}function Ye(e){let{exposeHeaders:t}=e;return t?t==="*"?{"access-control-expose-headers":t}:{"access-control-expose-headers":t.join(",")}:{}}function Jt(e,t){b(e,Ke(e,t)),b(e,Xe(t)),b(e,Ye(t)),b(e,Vt(t)),b(e,Gt(e,t))}function Qt(e,t){b(e,Ke(e,t)),b(e,Xe(t)),b(e,Ye(t))}function yn(e,t){let r=Ft(t);return Wt(e)?(Jt(e,t),Ge(e,r.preflight.statusCode),!0):(Qt(e,t),!1)}var Kt=new Set(["transfer-encoding","accept-encoding","connection","keep-alive","upgrade","expect","host","accept"]);function wn(e,t){let r=Object.create(null),n=Fe(e);for(let o in n)(!Kt.has(o)||o==="host"&&t?.host)&&(r[o]=n[o]);return r}function $(e){let t="";e.id&&(t+=`id: ${Ue(e.id)}
10
- `),e.event&&(t+=`event: ${Ue(e.event)}
11
- `),typeof e.retry=="number"&&Number.isInteger(e.retry)&&(t+=`retry: ${e.retry}
12
- `);let r=typeof e.data=="string"?e.data:"";for(let n of r.split(/\r\n|\r|\n/))t+=`data: ${n}
13
- `;return t+=`
14
- `,t}function Ue(e){return e.replace(/[\n\r]/g,"")}function Xt(e){let t="";for(let r of e)t+=$(r);return t}function Yt(e){let t={"Content-Type":"text/event-stream","Cache-Control":"private, no-cache, no-store, no-transform, must-revalidate, max-age=0","X-Accel-Buffering":"no"};Zt(e)||(t.Connection="keep-alive"),jt(e,t)}function Zt(e){return je(e,":path")!==void 0&&je(e,":method")!==void 0}var te=class{_h3Event;_transformStream=new TransformStream;_writer;_encoder=new TextEncoder;_writerIsClosed=!1;_paused=!1;_unsentData;_disposed=!1;_handled=!1;constructor(t,r={}){this._h3Event=t,this._writer=this._transformStream.writable.getWriter(),this._writer.closed.then(()=>{this._writerIsClosed=!0}),r.autoclose!==!1&&this._h3Event.node.req.on("close",()=>this.close())}async push(t){if(typeof t=="string"){await this._sendEvent({data:t});return}if(Array.isArray(t)){if(t.length===0)return;if(typeof t[0]=="string"){let r=[];for(let n of t)r.push({data:n});await this._sendEvents(r);return}await this._sendEvents(t);return}await this._sendEvent(t)}async _sendEvent(t){if(!this._writerIsClosed){if(this._paused&&!this._unsentData){this._unsentData=$(t);return}if(this._paused){this._unsentData+=$(t);return}await this._writer.write(this._encoder.encode($(t))).catch()}}async _sendEvents(t){if(this._writerIsClosed)return;let r=Xt(t);if(this._paused&&!this._unsentData){this._unsentData=r;return}if(this._paused){this._unsentData+=r;return}await this._writer.write(this._encoder.encode(r)).catch()}pause(){this._paused=!0}get isPaused(){return this._paused}async resume(){this._paused=!1,await this.flush()}async flush(){this._writerIsClosed||this._unsentData?.length&&(await this._writer.write(this._encoder.encode(this._unsentData)),this._unsentData=void 0)}async close(){if(!this._disposed){if(!this._writerIsClosed)try{await this._writer.close()}catch{}this._h3Event._handled&&this._handled&&!this._h3Event.node.res.closed&&this._h3Event.node.res.end(),this._disposed=!0}}onClosed(t){this._writer.closed.then(t)}async send(){Yt(this._h3Event),q(this._h3Event,200),this._h3Event._handled=!0,this._handled=!0,await U(this._h3Event,this._transformStream.readable)}};function gn(e,t){return new te(e,t)}async function _n(e,t){if(e.method!=="GET"&&e.method!=="HEAD"){if(!t.fallthrough)throw m({statusMessage:"Method Not Allowed",statusCode:405});return!1}let r=Q(J(P(e.path).pathname));if(/(^|[\\/])(\.\.|%2e%2e|%2e\.|\.%2e)($|[\\/])/i.test(r)){if(!t.fallthrough)throw m({statusCode:404});return!1}let n=vt(_(e,"accept-encoding"),t.encodings);n.length>1&&A(e,"vary","accept-encoding");let o=r,s,a=er(r,n,t.indexNames||["/index.html"]);for(let u of a){let f=await t.getMeta(u);if(f){s=f,o=u;break}}if(!s){if(!t.fallthrough)throw m({statusCode:404});return!1}if(s.etag&&!O(e,"etag")&&A(e,"etag",s.etag),s.etag&&_(e,"if-none-match")===s.etag)return q(e,304,"Not Modified"),w(e,"");if(s.mtime){let u=new Date(s.mtime),f=_(e,"if-modified-since");if(f&&new Date(f)>=u)return q(e,304,"Not Modified"),w(e,null);O(e,"last-modified")||A(e,"last-modified",u.toUTCString())}if(s.type&&!O(e,"content-type")&&A(e,"content-type",s.type),s.encoding&&!O(e,"content-encoding")&&A(e,"content-encoding",s.encoding),s.size!==void 0&&s.size>0&&!O(e,"content-length")&&A(e,"content-length",s.size),e.method==="HEAD")return w(e,null);let i=await t.getContents(o);return Je(i)?U(e,i):w(e,i)}function vt(e,t){return!t||!e?[]:String(e||"").split(",").map(r=>t[r.trim()]).filter(Boolean)}function er(e,t,r){let n=[];for(let o of["",...r])for(let s of[...t,""])n.push(`${e}${o}${s}`);return n}var re=class{__is_event__=!0;node;web;context={};_method;_path;_headers;_requestBody;_handled=!1;_onBeforeResponseCalled;_onAfterResponseCalled;constructor(t,r){this.node={req:t,res:r}}get method(){return this._method||(this._method=(this.node.req.method||"GET").toUpperCase()),this._method}get path(){return this._path||this.node.req.url||"/"}get headers(){return this._headers||(this._headers=rr(this.node.req.headers)),this._headers}get handled(){return this._handled||this.node.res.writableEnded||this.node.res.headersSent}respondWith(t){return Promise.resolve(t).then(r=>Qe(this,r))}toString(){return`[${this.method}] ${this.path}`}toJSON(){return this.toString()}get req(){return this.node.req}get res(){return this.node.res}};function tr(e,t){return new re(e,t)}function rr(e){let t=new Headers;for(let[r,n]of Object.entries(e))if(Array.isArray(n))for(let o of n)t.append(r,o);else n&&t.set(r,n);return t}function nr(e){if(typeof e=="function")return e.__is_handler__=!0,e;let t={onRequest:Be(e.onRequest),onBeforeResponse:Be(e.onBeforeResponse)},r=n=>or(n,e.handler,t);return r.__is_handler__=!0,r.__resolve__=e.handler.__resolve__,r.__websocket__=e.websocket,r}function Be(e){return e?Array.isArray(e)?e:[e]:void 0}async function or(e,t,r){if(r.onRequest){for(let s of r.onRequest)if(await s(e),e.handled)return}let o={body:await t(e)};if(r.onBeforeResponse)for(let s of r.onBeforeResponse)await s(e,o);return o.body}var se=nr;function sr(e){return x(e,"__is_handler__")}function ae(e,t,r){return e}function ar(e){let t,r,n=()=>r?Promise.resolve(r):(t||(t=Promise.resolve(e()).then(s=>{let a=s.default||s;if(typeof a!="function")throw new TypeError("Invalid lazy handler result. It should be a function:",a);return r={handler:ae(s.default||s)},r})),t),o=se(s=>r?r.handler(s):n().then(a=>a.handler(s)));return o.__resolve__=n,o}var ir=ar,Rn=globalThis.Headers,bn=globalThis.Response;function En(e={}){let t=[],r=cr(t,e),n=ur(t);r.__resolve__=n;let o=dr(()=>hr(n,e)),s={use:(a,c,i)=>ne(s,a,c,i),resolve:n,handler:r,stack:t,options:e,get websocket(){return o()}};return s}function ne(e,t,r,n){if(Array.isArray(t))for(let o of t)ne(e,o,r,n);else if(Array.isArray(r))for(let o of r)ne(e,t,o,n);else typeof t=="string"?e.stack.push(v({...n,route:t,handler:r})):typeof t=="function"?e.stack.push(v({...r,handler:t})):e.stack.push(v({...t}));return e}function cr(e,t){let r=t.debug?2:void 0;return se(async n=>{n.node.req.originalUrl=n.node.req.originalUrl||n.node.req.url||"/";let o=n.node.req.url||"/",s=lr(n._path||o);n._path=s;let a=s!==o,c;t.onRequest&&await t.onRequest(n);for(let i of e){if(i.route.length>1){if(!s.startsWith(i.route))continue;c=s.slice(i.route.length)||"/"}else c=s;if(i.match&&!i.match(c,n))continue;n._path=c,n.node.req.url=a?i.route.length>1?o.slice(i.route.length)||"/":o:c;let u=await i.handler(n),f=u===void 0?void 0:await u;if(f!==void 0){let d={body:f};t.onBeforeResponse&&(n._onBeforeResponseCalled=!0,await t.onBeforeResponse(n,d)),await fr(n,d.body,r),t.onAfterResponse&&(n._onAfterResponseCalled=!0,await t.onAfterResponse(n,d));return}if(n.handled){t.onAfterResponse&&(n._onAfterResponseCalled=!0,await t.onAfterResponse(n,void 0));return}}if(!n.handled)throw m({statusCode:404,statusMessage:`Cannot find any path matching ${n.path||"/"}.`});t.onAfterResponse&&(n._onAfterResponseCalled=!0,await t.onAfterResponse(n,void 0))})}function ur(e){return async t=>{let r;for(let n of e){if(n.route==="/"&&!n.handler.__resolve__||!t.startsWith(n.route)||(r=t.slice(n.route.length)||"/",n.match&&!n.match(r,void 0)))continue;let o={route:n.route,handler:n.handler};if(o.handler.__resolve__){let s=await o.handler.__resolve__(r);if(!s)continue;o={...o,...s,route:Te(o.route||"/",s.route||"/")}}return o}}}function v(e){let t=e.handler;return t.handler&&(t=t.handler),e.lazy?t=ir(t):sr(t)||(t=ae(t,void 0,e.route)),{route:J(e.route),match:e.match,handler:t}}function fr(e,t,r){if(t===null)return Ge(e);if(t){if(Bt(t))return Qe(e,t);if(Je(t))return U(e,t);if(t.buffer)return w(e,t);if(t.arrayBuffer&&typeof t.arrayBuffer=="function")return t.arrayBuffer().then(o=>w(e,Buffer.from(o),t.type));if(t instanceof Error)throw m(t);if(typeof t.end=="function")return!0}let n=typeof t;if(n==="string")return w(e,t,N.html);if(n==="object"||n==="boolean"||n==="number")return w(e,JSON.stringify(t,void 0,r),N.json);if(n==="bigint")return w(e,t.toString(),N.json);throw m({statusCode:500,statusMessage:`[h3] Cannot send ${n} as response.`})}function dr(e){let t;return()=>(t||(t=e()),t)}function lr(e){let t=e.indexOf("?"),r=t===-1?e:e.slice(0,t),n=t===-1?"":e.slice(t);return(r.includes("%25")?G(r.replace(/%25/g,"%2525")):G(r))+n}function hr(e,t){return{...t.websocket,async resolve(r){let n=r.request?.url||r.url||"/",{pathname:o}=typeof n=="string"?P(n):n;return(await e(o))?.handler?.__websocket__||{}}}}var pr=["connect","delete","get","head","options","post","put","trace","patch"];function Cn(e={}){let t=Oe({}),r={},n,o={},s=(i,u,f)=>{let d=r[i];if(d||(r[i]=d={path:i,handlers:{}},t.insert(i,d)),Array.isArray(f))for(let p of f)s(i,u,p);else d.handlers[f]=ae(u);return o};o.use=o.add=(i,u,f)=>s(i,u,f||"all");for(let i of pr)o[i]=(u,f)=>o.add(u,f,i);let a=(i="/",u="get")=>{let f=i.indexOf("?");f!==-1&&(i=i.slice(0,Math.max(0,f)));let d=t.lookup(i);if(!d||!d.handlers)return{error:m({statusCode:404,name:"Not Found",statusMessage:`Cannot find any route matching ${i||"/"}.`})};let p=d.handlers[u]||d.handlers.all;if(!p){n||(n=qe(t));let B=n.matchAll(i).reverse();for(let M of B){if(M.handlers[u]){p=M.handlers[u],d.handlers[u]=d.handlers[u]||p;break}if(M.handlers.all){p=M.handlers.all,d.handlers.all=d.handlers.all||p;break}}}return p?{matched:d,handler:p}:{error:m({statusCode:405,name:"Method Not Allowed",statusMessage:`Method ${u} is not allowed on this route.`})}},c=e.preemptive||e.preemtive;return o.handler=se(i=>{let u=a(i.path,i.method.toLowerCase());if("error"in u){if(c)throw u.error;return}i.context.matchedRoute=u.matched;let f=u.matched.params||{};return i.context.params=f,Promise.resolve(u.handler(i)).then(d=>d===void 0&&c?null:d)}),o.handler.__resolve__=async i=>{i=Q(i);let u=a(i);if("error"in u)return;let f={route:u.matched.path,handler:u.handler};if(u.handler.__resolve__){let d=await u.handler.__resolve__(i);if(!d)return;f={...f,...d}}return f},o}function Sn(e){return async function(r,n){let o=tr(r,n);try{await e.handler(o)}catch(s){let a=m(s);if(oe(s)||(a.unhandled=!0),q(o,a.statusCode,a.statusMessage),e.options.onError&&await e.options.onError(a,o),o.handled)return;(a.unhandled||a.fatal)&&console.error("[h3]",a.fatal?"[fatal]":"[unhandled]",a),e.options.onBeforeResponse&&!o._onBeforeResponseCalled&&await e.options.onBeforeResponse(o,{body:a}),await Pt(o,a,!!e.options.debug),e.options.onAfterResponse&&!o._onAfterResponseCalled&&await e.options.onAfterResponse(o,{body:a})}}}function mr(e,t){y(t),t instanceof R?(t.message=`${e}
15
- ${t.message}`,he(t)):(le({headline:e,body:t.message}),h(`${e}
16
- ${t.stack??t.message}`))}function Nn(e,t){let r={delete:`Failed to delete file "${e}" from remote theme.`,upload:`Failed to upload file "${e}" to remote theme.`,default:e}[t??"default"]??e;return n=>{mr(r,n)}}function ie(e,t){return m({status:e.status??502,statusText:e.statusText??"Bad Gateway",cause:e,data:{url:(t??e.url)?.toString(),requestId:e.headers?.get("x-request-id")??void 0}})}function qn(e,t="Unexpected error during fetch"){let r=e,n=r.statusCode??502,o=r.statusMessage??"Bad Gateway",s=`${t.replace(/\.$/,"")} with status ${n} (${o}).`;r.data?.requestId&&(s+=`
17
- Request ID: ${r.data.requestId}`),r.data?.url&&(s+=`
18
- URL: ${r.data.url}`);let a=r.cause??e;return{headline:s,body:a.stack??r.stack??r.message??o,status:n,statusText:o,cause:a,requestId:r.data?.requestId,url:r.data?.url}}async function Fn(e,t){let r=_r(e,t),n=await yr(e,t),o,s=Object.keys({...t.replaceTemplates,...t.replaceExtensionTemplates});if(s.length>0){h(`\u2192 Rendering ${r} (with ${s})...`);let u=_e(t);o=await fetch(r,{method:"POST",body:u,redirect:"manual",headers:{...n,...S()}}).catch(f=>{throw ie(y(f),r)})}else h(`\u2192 Rendering ${r}...`),o=await fetch(r,{method:t.method,redirect:"manual",headers:{...n,...S()}}).catch(u=>{throw ie(y(u),r)});let a=o.headers.get("x-request-id");h(`\u2190 ${o.status} (request_id: ${a})`);let i=o.headers.get("Content-Type")?.includes("application/json");return o=new Response(o.body,o),i||o.headers.delete("Content-Type"),o}async function yr(e,t){return ve(e)?gr(e,t):wr(e,t)}async function wr(e,t){let r=await Ze(e,t),n=e.storefrontToken;return W({...t.headers,Authorization:`Bearer ${n}`,Cookie:r})}async function gr(e,t){let r=await Ze(e,t),n=e.storefrontToken,o={},s=["ACCEPT","CONTENT-TYPE","CONTENT-LENGTH"];for(let[a,c]of Object.entries(t.headers))s.includes(a.toUpperCase())&&(o[a]=c);return W({...o,...Rr(e),Authorization:`Bearer ${n}`,Cookie:r})}function Ze(e,t){let r=T(t.headers.cookie??t.headers.Cookie??""),n=e.sessionCookies??{};return I({...r,...n})}function _r(e,{path:t,sectionId:r,appBlockId:n,query:o}){let a=`${ce(e)}${t}`,c=new URLSearchParams({_fd:"0",pb:"0"});for(let[i,u]of o)c.append(i,u);return r?c.append("section_id",r):n&&c.append("app_block_id",n),`${a}?${c}`}function ce(e){return ve(e)?`https://${me()}/cli/sfr`:`https://${e.storeFqdn}`}function ve(e){return e.token.startsWith("shptka_")}function Rr(e){return{"X-Shopify-Shop":e.storeFqdn,"X-Shopify-Access-Token":e.token}}l();var br=1800*1e3,et=["layout/theme.liquid","config/settings_schema.json"];async function Zn(e,t,r,n){let o=await tt(e,t,r,n);return o.refresh=async()=>{h("Refreshing theme session...");let s=await tt(e,t,r,n);return C("theme-service:session:refreshed"),Object.assign(o,s),s},setInterval(()=>{o.refresh&&o.refresh().then(()=>h("Refreshed theme session via auto-refresher...")).catch(()=>h("Session could not be refreshed."))},br),o}async function tt(e,t,r,n){let o=ce(t),s=await de(t.storeFqdn,r,[],{forceRefresh:!1,noPrompt:!0}),a=await fe([],r,{forceRefresh:!1,noPrompt:!0}),c=await Er(o,e,t,a,n);return{...s,sessionCookies:c,storefrontToken:a}}async function Er(e,t,r,n,o){try{return await Re(e,r.storeFqdn,t,o,{"X-Shopify-Shop":r.storeFqdn,"X-Shopify-Access-Token":r.token,Authorization:`Bearer ${n}`})}catch(s){throw s instanceof k&&await Cr(t,r),s}}async function Cr(e,t){if(h(`Verifying if theme with id ${e} has required files...`),(await we(Number(e),et,t)).length!==et.length)throw y(new R(ye`Theme ${F.cyan(e)} is missing required files. Run ${F.cyan(`shopify theme delete -t ${e}`)} to delete it, then try your command again.`.value));h(`Theme with id ${e} has required files.`)}export{S as a,W as b,$r as c,jr as d,m as e,Pt as f,un as g,fn as h,Fe as i,_ as j,dn as k,ln as l,hn as m,pn as n,w as o,q as p,mn as q,A as r,yn as s,wn as t,gn as u,_n as v,nr as w,ar as x,En as y,Cn as z,Sn as A,mr as B,Nn as C,ie as D,qn as E,Fn as F,yr as G,Ze as H,ce as I,Zn as J,tt as K};
@@ -1,2 +0,0 @@
1
- import{a as T}from"./chunk-J3JPJCWP.js";import{a as de}from"./chunk-JK3NIHTX.js";import{b as te,c as re,d as oe,e as se,f as ne,h as ie,i as ae,k as le,l as ce,n as me}from"./chunk-3YDYZ232.js";import{a as j}from"./chunk-YMAWEIUR.js";import{A as Q,B as b,J as X,c as Y,s as B,w as N,x as V,y as x}from"./chunk-DTIWUT2T.js";import{c as Z,e as ee}from"./chunk-VJ6KDRZI.js";import{k as v,l as z,n as k}from"./chunk-5XDQ76DQ.js";import{n as C,p as P}from"./chunk-TUNUEOHO.js";import{ta as L,xa as _}from"./chunk-G4OQABDT.js";import{a as O}from"./chunk-5C7HDTHJ.js";import{J as K,P as J,s as W,u as M,v as q,w as R,y as U,z as G}from"./chunk-NTRAWIEJ.js";import{d as H,e as I}from"./chunk-VI34CKV6.js";import{d as g}from"./chunk-TPCG6DCA.js";import{Fb as y,Hb as p,Mb as E,Pb as f}from"./chunk-7FQFEB33.js";import{u as w}from"./chunk-A4SBXDZB.js";import{g as m}from"./chunk-VKWPEFWQ.js";m();m();m();m();var fe={workPromise:Promise.resolve()};async function ue(e,t,o,r,s){if(o.length===0)return fe;f("Initiating theme asset reconciliation process");let{filesOnlyPresentLocally:i,filesOnlyPresentOnRemote:n,filesWithConflictingChecksums:l}=$e(o,r),a=i.length===0&&n.length===0&&l.length===0;if(_(`theme-service:theme-reconciliation:manual:${a}`),a)return f("Local and remote checksums match - no need to reconcile theme assets"),fe;let c=await Oe({filesOnlyPresentLocally:i,filesOnlyPresentOnRemote:n,filesWithConflictingChecksums:l},s);return{workPromise:Fe(e,t,r,c)}}function $e(e,t){let o=new Set,r=[],s=[];for(let n of e){o.add(n.key);let l=t.files.get(n.key);l?n.checksum!==l.checksum&&s.push(n):r.push(n)}let i=Array.from(t.files.values()).filter(n=>!o.has(n.key));return{filesOnlyPresentOnRemote:A(r,t),filesOnlyPresentLocally:A(i,t),filesWithConflictingChecksums:A(s,t)}}function A(e,t){return t.applyIgnoreFilters(e).filter(r=>r.key.endsWith(".json"))}async function S(e,t,o){if(e.length===0)return;M({body:{list:{title:t,items:e.map(s=>s.key)}}}),await G({message:"Reconciliation Strategy",choices:[{label:o.remote.label,value:D},{label:o.local.label,value:he}]})===D?o.remote.callback(e):o.local.callback(e)}async function Fe(e,t,o,r){let{localFilesToDelete:s,filesToDownload:i,remoteFilesToDelete:n}=r,l=s.map(d=>o.delete(d.key)),a=T(i,P,async d=>{let u=await v(e.id,d.map(h=>h.key),t);return Promise.all(u.map(h=>{if(h)return o.write(h)}))}),c=z(e.id,n.map(d=>d.key),t);await Promise.all([...l,...a,c])}async function Oe(e,t){let{filesOnlyPresentLocally:o,filesOnlyPresentOnRemote:r,filesWithConflictingChecksums:s}=e,i=[],n=[],l=[];return t.noDelete||await S(o,"The files listed below are only present locally. What would you like to do?",{remote:{label:"Delete files from the local directory",callback:a=>{i.push(...a)}},local:{label:"Upload local files to the remote theme",callback:()=>{}}}),await S(r,"The files listed below are only present on the remote theme. What would you like to do?",{remote:{label:"Download remote files to the local directory",callback:a=>{n.push(...a)}},local:{label:"Delete files from the remote theme",callback:a=>{l.push(...a)}}}),await S(s,"The files listed below differ between the local and remote versions. What would you like to do?",{remote:{label:"Keep the remote version",callback:a=>{n.push(...a)}},local:{label:"Keep the local version",callback:()=>{}}}),{localFilesToDelete:i,filesToDownload:n,remoteFilesToDelete:l}}m();var Le=3e3,$=class extends Error{};function ye(e,t,o,r,s,i){f("Listening for changes in the theme editor");let n=5,l=0,a="",c=o,d=async()=>{await new Promise(u=>setTimeout(u,Le)),c=await _e(e,t,c,r,s).then(u=>(l=0,a="",u)).catch(u=>{if(l++,u.message!==a&&(a=u.message,b("Error while polling for changes.",u)),l>=n){let h=new g("Too many polling errors...","Please check the errors above and ensure you have a stable internet connection.");U(h),i(h)}return c})};setTimeout(async()=>{for(;;)await d()})}async function _e(e,t,o,r,s){let i=new Set(r.unsyncedFileKeys),n=pe(o,r,i),l=await k(e.id,t).then(d=>pe(d,r,i)),a=Ie(n,l),c=He(l,n);return await qe(r,a),await We(e,t,r,a),await Me(r,c,s),l}function He(e,t){let o=new Map(e.map(s=>[s.key,s]));return t.filter(s=>o.get(s.key)===void 0)}function Ie(e,t){let o=new Map(e.map(s=>[s.key,s]));return t.filter(s=>{let i=o.get(s.key);if(!i||i.checksum!==s.checksum)return!0})}async function We(e,t,o,r){let s=r.filter(n=>o.files.get(n.key)?.checksum!==n.checksum),i=T(s,P,async n=>v(e.id,n.map(l=>l.key),t).then(l=>Promise.all(l.map(async a=>{a&&(await o.write(a),E(p`• ${C.format(new Date)} Synced ${y.raw("\xBB")} ${y.gray(`download ${a.key} from remote theme`)}`))}))));await Promise.all(i)}async function Me(e,t,o){if(!o.noDelete)return Promise.all(t.map(r=>{if(e.files.get(r.key))return e.delete(r.key).then(()=>{E(p`• ${C.format(new Date)} Synced ${y.raw("\xBB")} ${y.gray(`remove ${r.key} from local theme`)}`)})}))}async function qe(e,t){let o=new Map(e.files);await Promise.all(t.map(r=>e.read(r.key)));for(let r of t){let s=o.get(r.key)?.checksum,i=e.files.get(r.key)?.checksum;if(s!==i)throw new $(`Detected changes to the file '${r.key}' on both local and remote sources. Aborting...`)}}function pe(e,t,o){return t.applyIgnoreFilters(e).filter(s=>s.key.endsWith(".json")).filter(s=>!o.has(s.key))}var he="local",D="remote";async function we(e,t,o,r,s,i){f("Initiating theme asset reconciliation process"),await r.ready();let{workPromise:n}=await ue(e,t,o,r,s);return{updatedRemoteChecksumsPromise:n.then(async()=>{let a=await k(e.id,t);return ye(e,t,a,r,s,i),a}),workPromise:n}}m();function ge(){if(Promise.withResolvers)return Promise.withResolvers();let e,t;return{promise:new Promise((r,s)=>{e=r,t=s}),resolve:e,reject:t}}import{createServer as Ue}from"node:http";function ke(e,t){let{promise:o,resolve:r,reject:s}=ge(),i=ie(e,t),n=Ge(e,t,s),l=Promise.all([i,n.workPromise]).then(()=>t.localThemeFileSystem.startWatcher(e.id.toString(),t.session)),a=Je(e,t,l);return{workPromise:l,serverStart:a.start,dispatchEvent:a.dispatch,renderDevSetupProgress:n.renderProgress,backgroundJobPromise:o,resolveBackgroundJob:r}}function Ge(e,t,o){let r=a=>(b("Failed to perform the initial theme synchronization.",a),o(a),new Promise(()=>{})),i=k(e.id,t.session).then(a=>Ke(e,t,a,o)),n=i.then(async({updatedRemoteChecksumsPromise:a})=>{let c=await a;return de(e,t.session,c,t.localThemeFileSystem,{nodelete:t.options.noDelete,deferPartialWork:!0,backgroundWorkCatch:r})});return{workPromise:n.then(a=>a.workPromise).catch(r),renderProgress:async()=>{if(t.options.themeEditorSync){let{workPromise:c}=await i;await ee([{title:"Performing file synchronization. This may take a while...",task:async()=>{await c}}])}let{renderThemeSyncProgress:a}=await n;await a()}}}function Ke(e,t,o,r){return t.options.themeEditorSync?we(e,t.session,o,t.localThemeFileSystem,{noDelete:t.options.noDelete,ignore:t.options.ignore,only:t.options.only},r):Promise.resolve({updatedRemoteChecksumsPromise:Promise.resolve(o),workPromise:Promise.resolve()})}function Je(e,t,o){let r=x(),s=[`http://${t.options.host}:${t.options.port}`,`https://${t.session.storeFqdn}`,"https://online-store-web.shopifyapps.com"];r.use(se(t.options.host,t.options.port)),r.use(V(async()=>(await o,N(n=>{n.node.req.headers.origin&&B(n,{origin:a=>s.includes(a),credentials:!0,methods:["GET","POST","HEAD","OPTIONS"],preflight:{statusCode:204}})})))),t.options.liveReload!=="off"&&r.use(ae(e,t)),r.use(oe(e,t)),r.use(te(e,t)),r.use(re(e,t));let i=Ue(Q(r));return{dispatch:r.handler.bind(r),start:async()=>new Promise(n=>i.listen({port:t.options.port,host:t.options.host},()=>n({close:async()=>{await Promise.all([new Promise(l=>{i.closeAllConnections(),i.close(l)})])}})))}}m();import{createServer as Te}from"net";var Pe=new Set;async function Re(e,t){if(e&&await F(e))return f(p`Port ${e.toString()} is free`),e;f(p`Getting a random port...`);let o=await be(()=>ve(),t?.maxTries,t?.waitTimeInSeconds);for(let r=0;r<(t?.maxTries??5)&&Pe.has(o);r++)o=await be(()=>ve(),t?.maxTries,t?.waitTimeInSeconds);return f(p`Random port obtained: ${y.raw(`${o}`)}`),Pe.add(o),o}async function F(e){return new Promise(t=>{let o=Te();o.unref(),o.once("error",()=>t(!1));try{o.listen(e,"localhost",()=>{o.close(()=>t(!0))})}catch(r){if(!(r instanceof RangeError))throw r;t(!1)}})}function ve(){return new Promise((e,t)=>{let o=Te();o.unref(),o.once("error",t),o.listen(0,"localhost",()=>{let r=o.address();if(r&&typeof r=="object"){let s=r.port;o.close(()=>e(s))}else o.close(()=>t(new Error("Unable to determine assigned port")))})})}async function be(e,t=5,o=1){let r=1;for(;;)try{return await e()}catch(s){if(r++<t)f(p`Unknown problem getting a random port: ${s.message}`),await J(o);else throw new g(s.message)}}import ze from"readline";var Ye="127.0.0.1",je=9292,Ee=!1;async function lr(e){if(!await me(e.directory)&&!await Z(e.force))return;e.password?.startsWith("shpat_")&&R({headline:"Admin API token missing features:",body:["Directly using an Admin API token will result in some missing features.","We recommend generating a password from the Theme Access app.","Alternatively, you can authenticate normally by not passing the --password flag.",`
2
- `,{list:{title:"Known limitations:",items:["Hot module reloading","Password protected storefronts"]}}],link:{label:"Theme Access app",url:"https://shopify.dev/docs/storefronts/themes/tools/theme-access"}}),e.listing&&await le(e.directory,e.listing);let t=await Y(e.adminSession).then(De=>De?j(e.storePassword,e.adminSession.storeFqdn):void 0),o=ne(),r=ce(e.directory,{filters:e,listing:e.listing,noDelete:e.noDelete,notify:e.notify}),s=e.host??Ye,i;if(e.port){if(!await F(e.port))throw new g(`Port ${e.port} is not available. Try a different port or remove the --port flag to use an available port.`);i=e.port}else i=await Re(je);let n={local:`http://${s}:${i}`,giftCard:`http://${s}:${i}/gift_cards/[store_id]/preview`,themeEditor:`https://${e.store}/admin/themes/${e.theme.id}/editor?hr=${i}`,preview:`https://${e.store}/?preview_theme_id=${e.theme.id}`},l=await t,c={session:await X(e.theme.id.toString(),e.adminSession,e.password,l),localThemeFileSystem:r,localThemeExtensionFileSystem:o,directory:e.directory,type:"theme",lastRequestedPath:"",options:{themeEditorSync:e["theme-editor-sync"],host:s,port:i,open:e.open,liveReload:e["live-reload"],standardEventsDevBundle:!0,standardEventsInspector:e["standard-events-inspector"],noDelete:e.noDelete,ignore:e.ignore,only:e.only,errorOverlay:e["error-overlay"]}},{serverStart:d,renderDevSetupProgress:u,backgroundJobPromise:h,resolveBackgroundJob:Ae}=ke(e.theme,c);ze.emitKeypressEvents(process.stdin);let Se=Ne(n,c,Ae);process.stdin.on("keypress",Se),await Promise.all([h,u().then(d).then(()=>{process.stdin.isTTY&&process.stdin.setRawMode(!0),xe(n),e.open&&Ce(n.local,"development server")})]),await Be(e.commandConfig,e.adminSession),process.exit(0)}async function Be(e,t){if(!Ee){Ee=!0;try{await H(()=>({store_fqdn_hash:O(t.storeFqdn)})),await I(()=>({store_fqdn:t.storeFqdn})),await L({config:e,exitMode:"ok"})}catch{}}}function Ne(e,t,o){let r=W(Ce,100,{leading:!0,trailing:!1});return(s,i)=>{if(i.ctrl&&i.name==="c"){o();return}switch(i.name){case void 0:break;case"t":r(e.local,"localhost");break;case"p":r(e.preview,"theme preview");break;case"e":r(t.lastRequestedPath==="/"?e.themeEditor:`${e.themeEditor}&previewPath=${encodeURIComponent(t.lastRequestedPath)}`,"theme editor");break;case"g":r(e.giftCard,"gift card preview");break;default:break}}}function Ce(e,t){K(e).catch(Ve(t))}function Ve(e){return t=>{R({headline:`Failed to open ${e}.`,body:t.stack??t.message})}}function xe(e){q({body:[{list:{title:w.bold("Preview your theme ")+w.cyan("(t)"),items:[{link:{url:e.local}}]}}],nextSteps:[[{link:{label:`Share your theme preview ${w.cyan("(p)")}`,url:e.preview}},{subdued:e.preview}],[{link:{label:`Customize your theme at the theme editor ${w.cyan("(e)")}`,url:e.themeEditor}}],[{link:{label:`Preview your gift cards ${w.cyan("(g)")}`,url:e.giftCard}}]]})}export{Re as a,F as b,lr as c,Ce as d};