shopify 4.3.0 → 4.4.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 (336) hide show
  1. package/dist/analytics-DWUYMFHO.js +1 -0
  2. package/dist/analytics-SOXP4UBD.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-2EROVVCL.js +1 -0
  24. package/dist/{chunk-MEIEEENL.js → chunk-2MMGFZDP.js} +1 -1
  25. package/dist/{chunk-3YDYZ232.js → chunk-2NWWMNU5.js} +8 -8
  26. package/dist/{chunk-WHNWE7P2.js → chunk-3CYHS4W2.js} +1 -1
  27. package/dist/{chunk-DNXYKGV2.js → chunk-3FBSBMSQ.js} +1 -1
  28. package/dist/chunk-3OZ6ZZ4T.js +5 -0
  29. package/dist/{chunk-UTO4Z6P6.js → chunk-442S5SDM.js} +1 -1
  30. package/dist/{chunk-2RBIR3NM.js → chunk-45MEVWH5.js} +1 -1
  31. package/dist/{chunk-N5LVGFDS.js → chunk-47MGPVED.js} +1 -1
  32. package/dist/{chunk-UYSF234H.js → chunk-4N6YTHFD.js} +1 -1
  33. package/dist/chunk-4TST2MNC.js +1 -0
  34. package/dist/{chunk-NILXAUUT.js → chunk-5GVXMNC4.js} +1 -1
  35. package/dist/{chunk-PMS4MNHB.js → chunk-5JNEWYD5.js} +1 -1
  36. package/dist/{chunk-ATSMK66C.js → chunk-5QQN3SKH.js} +1 -1
  37. package/dist/{chunk-DCLUZFT7.js → chunk-5QWYIBE6.js} +1 -1
  38. package/dist/chunk-5W443CKL.js +836 -0
  39. package/dist/{chunk-JUYJZUYU.js → chunk-67KMRBSZ.js} +1 -1
  40. package/dist/{chunk-UC7KMA6W.js → chunk-6DIHOMCB.js} +1 -1
  41. package/dist/{chunk-NTRAWIEJ.js → chunk-6EZ7JWBK.js} +6 -6
  42. package/dist/{chunk-25HJX3L2.js → chunk-6RL7FUPD.js} +1 -1
  43. package/dist/chunk-6YPEONHB.js +46 -0
  44. package/dist/{chunk-JEZ3PGVC.js → chunk-733R5OKQ.js} +1 -1
  45. package/dist/chunk-73W5BGAZ.js +1 -0
  46. package/dist/{chunk-Q7C44DX5.js → chunk-75LJTY7F.js} +1 -1
  47. package/dist/{chunk-JCIN73BE.js → chunk-7EJ4UVYI.js} +1 -1
  48. package/dist/{chunk-BL46CZ2M.js → chunk-7LATYPLU.js} +1 -1
  49. package/dist/{chunk-TP7E54WN.js → chunk-7SVMAJTR.js} +1 -1
  50. package/dist/{chunk-7572RLUP.js → chunk-7UOPCYMV.js} +1 -1
  51. package/dist/chunk-APN3VWN4.js +3 -0
  52. package/dist/{chunk-FOFJBRSL.js → chunk-AT2GDXN7.js} +1 -1
  53. package/dist/{chunk-4QTEPWEJ.js → chunk-ATXODH6C.js} +4 -4
  54. package/dist/chunk-AY4GIVME.js +4 -0
  55. package/dist/{chunk-TY6BZTG3.js → chunk-B7BUEEBR.js} +1 -1
  56. package/dist/{chunk-G2LVUM7N.js → chunk-B7S23DLF.js} +1 -1
  57. package/dist/chunk-BCD4KTLJ.js +1 -0
  58. package/dist/{chunk-CEHXOWA6.js → chunk-BIMOHK2P.js} +1 -1
  59. package/dist/{chunk-UB26DGTR.js → chunk-C3CVLSLS.js} +1 -1
  60. package/dist/{chunk-G3RWLAOG.js → chunk-CD5O2BIT.js} +1 -1
  61. package/dist/chunk-CPE7XCC6.js +593 -0
  62. package/dist/{chunk-TRYWVIVJ.js → chunk-CZXGQ53M.js} +1 -1
  63. package/dist/chunk-D6YDSGR4.js +3 -0
  64. package/dist/{chunk-33OHQUHZ.js → chunk-DHBYYHBT.js} +1 -1
  65. package/dist/{chunk-OU4SKQTC.js → chunk-DLNBTHKL.js} +2 -2
  66. package/dist/chunk-DO2SHYFU.js +1 -0
  67. package/dist/{chunk-7FQFEB33.js → chunk-DONEJHDG.js} +33 -33
  68. package/dist/{chunk-JAWKLBOB.js → chunk-DQ4HA72R.js} +1 -1
  69. package/dist/{chunk-CV5EQGES.js → chunk-DZLA2RJP.js} +1 -1
  70. package/dist/{chunk-GJXINXSU.js → chunk-EKHWL542.js} +46 -46
  71. package/dist/{chunk-USLYL5AC.js → chunk-F5QG42MA.js} +1 -1
  72. package/dist/{chunk-2XZBQZ5R.js → chunk-FA4K3JRN.js} +1 -1
  73. package/dist/{chunk-3SPDFV5D.js → chunk-FPLUMESQ.js} +1 -1
  74. package/dist/chunk-FU232KQ7.js +1 -0
  75. package/dist/{chunk-S22NCNAJ.js → chunk-FZKKKGUJ.js} +1 -1
  76. package/dist/chunk-G24L7MB3.js +1 -0
  77. package/dist/{chunk-RKDZGK5K.js → chunk-G2I2ZUBV.js} +1 -1
  78. package/dist/{chunk-4FFPTEKD.js → chunk-G2S346IS.js} +1 -1
  79. package/dist/{chunk-HCTZN7L4.js → chunk-GBZL4TTY.js} +1 -1
  80. package/dist/{chunk-AO3RFGNV.js → chunk-GFCLUGAG.js} +1 -1
  81. package/dist/{chunk-MRS6LAY7.js → chunk-GKRCTMWY.js} +1 -1
  82. package/dist/{chunk-JJ6RM54S.js → chunk-GTUKM3ZW.js} +1 -1
  83. package/dist/{chunk-YL3TYQGT.js → chunk-GUO7S4NW.js} +1 -1
  84. package/dist/{chunk-ANBOLDON.js → chunk-GW3VY3FZ.js} +1 -1
  85. package/dist/{chunk-OXJBYKMX.js → chunk-H5C3QTOO.js} +1 -1
  86. package/dist/{chunk-T3ERXB7F.js → chunk-H6WN7GP4.js} +1 -1
  87. package/dist/{chunk-NWXDOCL5.js → chunk-HA6NISOZ.js} +1 -1
  88. package/dist/{chunk-L2PC4MUV.js → chunk-HCN6HXA5.js} +1 -1
  89. package/dist/chunk-HM5H7WBE.js +1 -0
  90. package/dist/chunk-HZMP62GK.js +21 -0
  91. package/dist/{chunk-57PPQKJT.js → chunk-HZSAUZBX.js} +1 -1
  92. package/dist/{chunk-ZGJ3DFTQ.js → chunk-HZYRCG4R.js} +1 -1
  93. package/dist/{chunk-6JKGUQRD.js → chunk-I73E3BD5.js} +1 -1
  94. package/dist/{chunk-Q73GEVSJ.js → chunk-IG6LPVS4.js} +1 -1
  95. package/dist/{chunk-T4NS63K4.js → chunk-IIOIDMG3.js} +1 -1
  96. package/dist/{chunk-FQ5ZZX2G.js → chunk-IPQH2RHD.js} +1 -1
  97. package/dist/chunk-IX4KP6E3.js +2 -0
  98. package/dist/{chunk-A5HKAMAC.js → chunk-J2WCMQZZ.js} +1 -1
  99. package/dist/chunk-J3HXFQ2L.js +1 -0
  100. package/dist/{chunk-QDVJJKLB.js → chunk-J5TNYNR5.js} +1 -1
  101. package/dist/{chunk-SSCYLDSX.js → chunk-J7UQBC45.js} +1 -1
  102. package/dist/{chunk-Q77MM2N2.js → chunk-JAW32T6G.js} +1 -1
  103. package/dist/{chunk-OZBY45KT.js → chunk-JOZXRV5K.js} +1 -1
  104. package/dist/{chunk-S5IFJ737.js → chunk-KKUDXLK2.js} +1 -1
  105. package/dist/{chunk-HDC5V7RY.js → chunk-KN3FTJDU.js} +1 -1
  106. package/dist/{chunk-AERKD4TO.js → chunk-KSZ5K6LJ.js} +1 -1
  107. package/dist/{chunk-G3JJLXPH.js → chunk-LCPD2BYX.js} +1 -1
  108. package/dist/chunk-LKZ7ARYS.js +18 -0
  109. package/dist/{chunk-ZUKLGZOU.js → chunk-LOHUNOQ7.js} +1 -1
  110. package/dist/{chunk-ZM75DSIW.js → chunk-LOQIRLTD.js} +1 -1
  111. package/dist/{chunk-FIYAECXH.js → chunk-MFLQRQQT.js} +1 -1
  112. package/dist/chunk-MQICT2LR.js +1 -0
  113. package/dist/{chunk-RSRYC5ZF.js → chunk-MZMYBFZQ.js} +1 -1
  114. package/dist/{chunk-2EHBJWC6.js → chunk-NADNFSKS.js} +1 -1
  115. package/dist/{chunk-N3YTDGFY.js → chunk-NWDP5IZ2.js} +1 -1
  116. package/dist/{chunk-WVRGCNBZ.js → chunk-NY5OGHM5.js} +1 -1
  117. package/dist/chunk-O6KTFMCD.js +1 -0
  118. package/dist/{chunk-YSIBRY6C.js → chunk-OAI7VSLW.js} +1 -1
  119. package/dist/{chunk-GWHV62YT.js → chunk-OORCODNK.js} +1 -1
  120. package/dist/{chunk-W7DDV2EY.js → chunk-OQORDQLH.js} +1 -1
  121. package/dist/{chunk-JAWOP4HJ.js → chunk-PETINPMX.js} +1 -1
  122. package/dist/{chunk-5XDQ76DQ.js → chunk-PJYNAUQB.js} +1 -1
  123. package/dist/{chunk-5H3VTG77.js → chunk-PMXCJIBP.js} +1 -1
  124. package/dist/{chunk-OU3M32A2.js → chunk-POAICASX.js} +1 -1
  125. package/dist/{chunk-6KETAPWL.js → chunk-PUAMSBXS.js} +1 -1
  126. package/dist/{chunk-M2YINBHF.js → chunk-PZYP3MCL.js} +1 -1
  127. package/dist/chunk-Q7BOSHWX.js +7 -0
  128. package/dist/{chunk-HIQHYPLU.js → chunk-QJ7TI6CK.js} +1 -1
  129. package/dist/{chunk-VJ6KDRZI.js → chunk-QMXKGSFH.js} +1 -1
  130. package/dist/{chunk-3AOQKI4B.js → chunk-QPN2M26G.js} +1 -1
  131. package/dist/{chunk-5FVB7JHP.js → chunk-QS3FMN67.js} +1 -1
  132. package/dist/{chunk-VRJTLVG3.js → chunk-RF6NUGCU.js} +1 -1
  133. package/dist/{chunk-PXHY753L.js → chunk-RYGZCBO4.js} +1 -1
  134. package/dist/{chunk-MMIHHCMW.js → chunk-SKLUHLS2.js} +1 -1
  135. package/dist/{chunk-2GU7OY3H.js → chunk-SP2WUATO.js} +1 -1
  136. package/dist/chunk-SWI3LCPE.js +7 -0
  137. package/dist/{chunk-J3HX6ZGD.js → chunk-SXTDVUT3.js} +1 -1
  138. package/dist/{chunk-4J32OHLY.js → chunk-T5GSCWN5.js} +1 -1
  139. package/dist/{chunk-J5BRKYGE.js → chunk-TC3JOEMA.js} +1 -1
  140. package/dist/{chunk-5FFHQTRC.js → chunk-TJGUNVRI.js} +1 -1
  141. package/dist/{chunk-EVZA2TCI.js → chunk-TKG42KLM.js} +1 -1
  142. package/dist/{chunk-DYNH5SKT.js → chunk-TQUSREKP.js} +1 -1
  143. package/dist/{chunk-PCCK4YTE.js → chunk-U73TPLFE.js} +1 -1
  144. package/dist/{chunk-HOSFU6UP.js → chunk-UKK5P74A.js} +3 -3
  145. package/dist/chunk-UMT7DWR4.js +1 -0
  146. package/dist/chunk-UUC5YKAS.js +2 -0
  147. package/dist/chunk-UYK6CXAU.js +1 -0
  148. package/dist/{chunk-JSOGPMWB.js → chunk-V3RZ3DTW.js} +1 -1
  149. package/dist/{chunk-5O43334U.js → chunk-V6ZSIUO3.js} +1 -1
  150. package/dist/{chunk-YPBCSDFQ.js → chunk-VFWWZMOQ.js} +1 -1
  151. package/dist/{chunk-MIDYZPO4.js → chunk-VOJWKGCW.js} +1 -1
  152. package/dist/{chunk-AU5EZQW7.js → chunk-VQW35HIQ.js} +1 -1
  153. package/dist/{chunk-PFGYC53K.js → chunk-WAGAC3YI.js} +1 -1
  154. package/dist/{chunk-TPCG6DCA.js → chunk-WKBVT5WG.js} +1 -1
  155. package/dist/{chunk-KRQGLK2Q.js → chunk-WLO5H255.js} +1 -1
  156. package/dist/{chunk-M7YFD4EV.js → chunk-WNWQSHEC.js} +5 -5
  157. package/dist/{chunk-VI34CKV6.js → chunk-WRRUFK4Y.js} +1 -1
  158. package/dist/{chunk-LCZDC6EE.js → chunk-WVHB2HCQ.js} +1 -1
  159. package/dist/{chunk-YIRFEW5M.js → chunk-WZVQHMGI.js} +1 -1
  160. package/dist/{chunk-G2OHWAY2.js → chunk-X4DIJTIK.js} +1 -1
  161. package/dist/{chunk-S6B2ADVR.js → chunk-XH6ZP7M5.js} +1 -1
  162. package/dist/{chunk-7D45IAMQ.js → chunk-XV3I45NA.js} +1 -1
  163. package/dist/{chunk-2K7FGAT6.js → chunk-Y3WIZSRU.js} +1 -1
  164. package/dist/{chunk-2GAFKG64.js → chunk-Y66GQ6V2.js} +1 -1
  165. package/dist/{chunk-N3CNWCC2.js → chunk-YGKQCEVG.js} +1 -1
  166. package/dist/{chunk-2TMQG2UT.js → chunk-YLGSM42I.js} +1 -1
  167. package/dist/{chunk-JK3NIHTX.js → chunk-YQH2JHFA.js} +1 -1
  168. package/dist/{chunk-E7DHELFH.js → chunk-YYL356OX.js} +1 -1
  169. package/dist/chunk-Z4LC3WE5.js +7 -0
  170. package/dist/{chunk-PNP5OKNZ.js → chunk-Z74QYLNC.js} +1 -1
  171. package/dist/{chunk-5BKCIDMS.js → chunk-ZAMDXIVC.js} +1 -1
  172. package/dist/{chunk-WA3YC5W4.js → chunk-ZEENHLSC.js} +2 -2
  173. package/dist/{chunk-6LWOWDF4.js → chunk-ZIREP3EZ.js} +1 -1
  174. package/dist/chunk-ZIXWWU2N.js +275 -0
  175. package/dist/{chunk-N3NE4MVN.js → chunk-ZQ5JVD5X.js} +1 -1
  176. package/dist/{chunk-YVQXEPHY.js → chunk-ZULTG2D2.js} +1 -1
  177. package/dist/{chunk-UU5P2IYU.js → chunk-ZZFZBFVM.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-C2LOYIOU.js} +1 -1
  256. package/dist/{deprecations-KNUMDRIU.js → deprecations-QOHE6JG6.js} +1 -1
  257. package/dist/dist-FF6C4ZHS.js +1 -0
  258. package/dist/dist-Q676YGVI.js +1 -0
  259. package/dist/environments-EGD263DV.js +1 -0
  260. package/dist/error-66U2HJ37.js +1 -0
  261. package/dist/error-handler-SW2ALZ5Z.js +1 -0
  262. package/dist/{fs-LJWVNO4H.js → fs-JPQRUGZI.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-QWTDUPNR.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-FRYN3NWL.js} +1 -1
  278. package/dist/local-storage-DFH3LT5G.js +1 -0
  279. package/dist/{metadata-UEUN64TK.js → metadata-KZVLHQII.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-LVFBY4LY.js} +1 -1
  282. package/dist/notifications-system-DP443VTE.js +1 -0
  283. package/dist/{output-S6E37GJQ.js → output-NH4I5Y3C.js} +1 -1
  284. package/dist/{prettier-EGVCP5CY.js → prettier-6ZMB2MMO.js} +1 -1
  285. package/dist/system-GNOF6HMI.js +1 -0
  286. package/dist/tsconfig.tsbuildinfo +1 -1
  287. package/dist/ui-QOGKADWB.js +1 -0
  288. package/dist/upgrade-K4S6JW64.js +1 -0
  289. package/dist/version-FJFTTOZU.js +1 -0
  290. package/dist/version-ZI4GZX72.js +1 -0
  291. package/dist/{workerd-QOTT6UCO.js → workerd-U6WWWY73.js} +1 -1
  292. package/oclif.manifest.json +714 -122
  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-TUNUEOHO.js +0 -3
  319. package/dist/chunk-VPPWSKOY.js +0 -1
  320. package/dist/chunk-XVUHUA36.js +0 -1
  321. package/dist/chunk-YMAWEIUR.js +0 -1
  322. package/dist/dist-C5IV2YDQ.js +0 -1
  323. package/dist/dist-VL4KZWV2.js +0 -1
  324. package/dist/environments-YPRVO2CF.js +0 -1
  325. package/dist/error-XRBQTNFM.js +0 -1
  326. package/dist/error-handler-NI7D6GSY.js +0 -1
  327. package/dist/lib-AIKYSHWL.js +0 -1
  328. package/dist/lib-Q4PWEMFD.js +0 -1
  329. package/dist/local-storage-ZOZMA22B.js +0 -1
  330. package/dist/notifications-system-HLXJCAMG.js +0 -1
  331. package/dist/system-YQZNGSWB.js +0 -1
  332. package/dist/ui-D2FFWRK7.js +0 -1
  333. package/dist/upgrade-TVTCFMXM.js +0 -1
  334. package/dist/version-J6MDN7BZ.js +0 -1
  335. package/dist/version-RIRW5EXQ.js +0 -1
  336. /package/dist/{chunk-YLQ3LNNY.js → chunk-VDN6MEYI.js} +0 -0
@@ -1,3 +1,3 @@
1
- import{a as R}from"./chunk-VJEKDBGZ.js";import{e as l}from"./chunk-NTRAWIEJ.js";import{f as I}from"./chunk-VI34CKV6.js";import{d as n}from"./chunk-TPCG6DCA.js";import{Ea as b,Fb as a,Hb as s,Pb as f,Ta as G,Wa as C}from"./chunk-7FQFEB33.js";import{a as k,r as w}from"./chunk-S5IFJ737.js";import{q as g}from"./chunk-773TIA5M.js";import{e as D,g as $}from"./chunk-VKWPEFWQ.js";$();var A=D(R());async function r(t,e){try{return(await l("git",t,{cwd:e})).stdout}catch(o){if(o instanceof Error){let i=new n(o.message);throw i.stack=o.stack,"exitCode"in o&&Object.assign(i,{exitCode:o.exitCode}),i}throw o}}async function K(t,e="main"){f(s`Initializing git repository at ${a.path(t)}...`),await h(),await r(["init"],t),await r(["checkout","-b",e],t)}async function Q(t,e){try{return(await r(["check-ignore",...e],t)).split(`
1
+ import{a as R}from"./chunk-VJEKDBGZ.js";import{e as l}from"./chunk-6EZ7JWBK.js";import{f as I}from"./chunk-WRRUFK4Y.js";import{d as n}from"./chunk-WKBVT5WG.js";import{Ea as b,Fb as a,Hb as s,Pb as f,Ta as G,Wa as C}from"./chunk-DONEJHDG.js";import{a as k,r as w}from"./chunk-KKUDXLK2.js";import{q as g}from"./chunk-773TIA5M.js";import{e as D,g as $}from"./chunk-VKWPEFWQ.js";$();var A=D(R());async function r(t,e){try{return(await l("git",t,{cwd:e})).stdout}catch(o){if(o instanceof Error){let i=new n(o.message);throw i.stack=o.stack,"exitCode"in o&&Object.assign(i,{exitCode:o.exitCode}),i}throw o}}async function K(t,e="main"){f(s`Initializing git repository at ${a.path(t)}...`),await h(),await r(["init"],t),await r(["checkout","-b",e],t)}async function Q(t,e){try{return(await r(["check-ignore",...e],t)).split(`
2
2
  `).filter(Boolean)}catch(o){if(o instanceof n&&"exitCode"in o&&o.exitCode===1)return[];throw o}}async function V(t){return I("cmd_all_timing_network_ms")(async()=>{let{repoUrl:e,destination:o,shallow:i,latestTag:m}=t;if(f(s`Git-cloning repository ${e} into ${a.path(o)}...`),await h(),await G(o)){if(!await b(o))throw new n(s`Can't clone to ${a.path(o)}`,"The path exists but isn't a directory.");if((await C(["*",".*"],{cwd:o,deep:1,onlyFiles:!1})).length>0)throw new n(s`Directory ${a.path(o)} already exists and is not empty`,s`Choose a different name or remove the existing directory first.`)}let[v,d]=e.split("#");if(d&&m)throw new n("Error cloning the repository. Git can't clone the latest release with a 'branch'.");if(i&&m)throw new n("Error cloning the repository. Git can't clone the latest release with the 'shallow' property.");let u=["clone","--recurse-submodules"];d&&u.push("--branch",d),i&&u.push("--depth","1"),k()||u.push("-c","core.askpass=true"),u.push(v,o);try{if(await l("git",u),m){let c=await S(o,e);await r(["checkout",c],o)}}catch(c){if(c instanceof n)throw c;if(c instanceof Error){let x=new n(c.message);throw x.stack=c.stack,x}throw c}})}async function S(t,e){let o=await F(t);if(!o)throw new n(`Couldn't obtain the most recent tag of the repository ${e}`);return o}async function X(t){let o=await r(["log","-1","--format=%H%x00%ai%x00%s%x00%D%x00%b%x00%an%x00%ae"],t);if(!o.trim())throw new n("Must have at least one commit to run command",s`Run ${a.genericShellCommand("git commit -m 'Initial commit'")} to create your first commit.`);let i=o.split("\0");return{hash:i[0],date:i[1],message:i[2],refs:i[3],body:i[4],author_name:i[5],author_email:i[6]}}async function Y(t){await r(["add","--all"],t)}async function Z(t,e){let o=["commit","-m",t];return e?.author&&o.push("--author",e.author),await r(o,e?.directory),(await r(["rev-parse","HEAD"],e?.directory)).trim()}async function h(){if(!await w())throw new n("Git is necessary in the environment to continue",s`Install ${a.link("git","https://git-scm.com/book/en/v2/Getting-Started-Installing-Git")}`)}var p=class extends n{};async function N(t){if(await h(),!await E(t))throw new p(`${a.path(t??g())} is not a Git directory`)}async function tt(t){return await w()?E(t):!1}async function E(t){try{return await l("git",["rev-parse","--git-dir"],{cwd:t}),!0}catch(e){if(e instanceof Error&&"exitCode"in e&&e.exitCode===128)return!1;throw e}}var y=class extends n{};async function et(t){if(!await T(t))throw new y(`${a.path(t??g())} is not a clean Git directory`)}async function T(t){return(await r(["status","--porcelain"],t)).trim()===""}async function F(t){try{return(await r(["describe","--tags","--abbrev=0"],t)).trim()||void 0}catch(e){if(e instanceof n&&"exitCode"in e&&e.exitCode===128)return;throw e}}async function ot(t,e="origin"){if(f(s`Removing git remote ${e} from ${a.path(t)}...`),await h(),!(await r(["remote"],t)).split(`
3
3
  `).filter(Boolean).includes(e)){f(s`Remote ${e} does not exist, no action needed`);return}await r(["remote","remove",e],t)}export{K as a,Q as b,V as c,X as d,Y as e,Z as f,N as g,tt as h,y as i,et as j,T as k,ot as l};
@@ -1,4 +1,4 @@
1
- import{c as v}from"./chunk-DZQYG32N.js";import{a as y}from"./chunk-WHNWE7P2.js";import{a as c}from"./chunk-AVD3INWF.js";import{a as u}from"./chunk-MIDYZPO4.js";import{d as f}from"./chunk-VJ6KDRZI.js";import{k as p,q as m}from"./chunk-TUNUEOHO.js";import{xa as h}from"./chunk-G4OQABDT.js";import{b as l,d}from"./chunk-OXJBYKMX.js";import{r as O}from"./chunk-T6CC5WUU.js";import{e as F,g as a}from"./chunk-VKWPEFWQ.js";a();var t=F(O(),1);var w,o=class extends m{async command(r,n){let{ignore:g=[],only:_=[]}=r;h("theme-command:dev:single-env:authenticated");let i,e;if(r.theme){let s={filter:{theme:r.theme}};i=await u(n,s),e={...r,theme:i.id.toString(),store:n.storeFqdn}}else{i=await new c(n).findOrCreate();let s=r["theme-editor-sync"]&&i.createdAtRuntime;e={...r,theme:i.id.toString(),store:n.storeFqdn,"overwrite-json":s}}await f(i,"start development mode",r["allow-live"])&&(await v({adminSession:n,commandConfig:this.config,directory:e.path,store:e.store,password:e.password,storePassword:e["store-password"],theme:i,listing:e.listing,host:e.host,port:e.port,"live-reload":e["live-reload"],"error-overlay":e["error-overlay"],force:e.force,open:e.open,"theme-editor-sync":e["theme-editor-sync"],"standard-events-inspector":e["standard-events-inspector"],noDelete:e.nodelete,ignore:g,only:_,notify:e.notify}),await y({path:e.path,password:e.password,store:e.store,force:e.force,verbose:e.verbose,noColor:e["no-color"],silent:!0}))}};w=o;o.summary="Uploads the current theme as a development theme to the connected store, then prints theme editor and preview URLs to your terminal. While running, changes will push to the store in real time.";o.descriptionWithMarkdown=`
1
+ import{a as v}from"./chunk-IX4KP6E3.js";import{a as c}from"./chunk-BCD4KTLJ.js";import{a as u}from"./chunk-VOJWKGCW.js";import{a as y}from"./chunk-3CYHS4W2.js";import{d as f}from"./chunk-QMXKGSFH.js";import{p,v as m}from"./chunk-D6YDSGR4.js";import{xa as h}from"./chunk-5W443CKL.js";import{b as l,d}from"./chunk-H5C3QTOO.js";import{r as O}from"./chunk-T6CC5WUU.js";import{e as F,g as a}from"./chunk-VKWPEFWQ.js";a();var t=F(O(),1);var w,o=class extends m{async command(r,n){let{ignore:g=[],only:_=[]}=r;h("theme-command:dev:single-env:authenticated");let i,e;if(r.theme){let s={filter:{theme:r.theme}};i=await u(n,s),e={...r,theme:i.id.toString(),store:n.storeFqdn}}else{i=await new c(n).findOrCreate();let s=r["theme-editor-sync"]&&i.createdAtRuntime;e={...r,theme:i.id.toString(),store:n.storeFqdn,"overwrite-json":s}}await f(i,"start development mode",r["allow-live"])&&(await v({adminSession:n,commandConfig:this.config,directory:e.path,store:e.store,password:e.password,storePassword:e["store-password"],theme:i,listing:e.listing,host:e.host,port:e.port,"live-reload":e["live-reload"],"error-overlay":e["error-overlay"],force:e.force,open:e.open,"theme-editor-sync":e["theme-editor-sync"],"standard-events-inspector":e["standard-events-inspector"],noDelete:e.nodelete,ignore:g,only:_,notify:e.notify}),await y({path:e.path,password:e.password,store:e.store,force:e.force,verbose:e.verbose,noColor:e["no-color"],silent:!0}))}};w=o;o.summary="Uploads the current theme as a development theme to the connected store, then prints theme editor and preview URLs to your terminal. While running, changes will push to the store in real time.";o.descriptionWithMarkdown=`
2
2
  Uploads the current theme as the specified theme, or a [development theme](https://shopify.dev/docs/themes/tools/cli#development-themes), to a store so you can preview it.
3
3
 
4
4
  This command returns the following information:
@@ -1,4 +1,4 @@
1
- import{f as m,i as f}from"./chunk-UTO4Z6P6.js";import{d as s}from"./chunk-TPCG6DCA.js";import{$ as c,Ta as r,qa as h,wa as l}from"./chunk-7FQFEB33.js";import{d as o}from"./chunk-773TIA5M.js";import{g as a}from"./chunk-VKWPEFWQ.js";a();async function b(t,i){let n=t?.path??"",e=o(i,n);if(!await r(e))throw new s(`
1
+ import{f as m,i as f}from"./chunk-442S5SDM.js";import{d as s}from"./chunk-WKBVT5WG.js";import{$ as c,Ta as r,qa as h,wa as l}from"./chunk-DONEJHDG.js";import{d as o}from"./chunk-773TIA5M.js";import{g as a}from"./chunk-VKWPEFWQ.js";a();async function b(t,i){let n=t?.path??"",e=o(i,n);if(!await r(e))throw new s(`
2
2
  The extension is not available for ${t?.value}`);return e}async function k({name:t,app:i}){let n=c(t),e=o(i.directory,f.extensions.directoryName,n);if(await r(e))throw new s(`
3
3
  A directory with this name (${n}) already exists.
4
4
  Choose a new name for your extension.`);return await l(e),await h(o(e,m.lockFile)),e}async function v({localApp:t,developerPlatformClient:i,apiKey:n,organizationId:e}){let{dashboardManagedExtensionRegistrations:x}=(await i.appExtensionRegistrations({id:n,apiKey:n,organizationId:e})).app;return x.length>0||t.allExtensions.filter(u=>u.isThemeExtension).length>0||t.allExtensions.length>0}export{b as a,k as b,v as c};
@@ -1 +1 @@
1
- import{b as E}from"./chunk-OXJBYKMX.js";import{b}from"./chunk-HOSFU6UP.js";import{M as F,N}from"./chunk-NTRAWIEJ.js";import{r as U}from"./chunk-T6CC5WUU.js";import{Mb as k,T as C,Ta as w,ma as O}from"./chunk-7FQFEB33.js";import{u as n}from"./chunk-A4SBXDZB.js";import{k as R}from"./chunk-S5IFJ737.js";import{d as u,f as P,g as x,h as g,n as T,q as y}from"./chunk-773TIA5M.js";import{e as H,g as d}from"./chunk-VKWPEFWQ.js";d();d();d();d();var m=class{constructor(){this.assertions=[],this.registeredTests=[]}async runSuite(t){this.context=t,this.registeredTests=[];let e=[];this.tests();for(let i of this.registeredTests){this.assertions=[];let s=Date.now();try{await i.fn(),e.push({name:i.name,status:this.hasFailures()?"failed":"passed",duration:Date.now()-s,assertions:[...this.assertions]})}catch(r){e.push({name:i.name,status:"failed",duration:Date.now()-s,assertions:[...this.assertions],error:r instanceof Error?r:new Error(String(r))})}}return e}test(t,e){this.registeredTests.push({name:t,fn:e})}tests(){}async run(t,e){let i=e?.cwd??this.context.workingDirectory,s=await F(t,{cwd:i,env:e?.env});return{command:t,exitCode:s.exitCode,stdout:s.stdout,stderr:s.stderr,output:String(s.stdout)+String(s.stderr),success:s.exitCode===0}}async runInteractive(t,e){let i=e?.cwd??this.context.workingDirectory,s=0;try{await N(t,{cwd:i,env:e?.env,stdin:"inherit"})}catch{s=1}return{command:t,exitCode:s,stdout:"",stderr:"",output:"",success:s===0}}assertSuccess(t,e){this.assertions.push({description:e??`Command succeeded: ${t.command}`,passed:t.success,expected:"exit code 0",actual:`exit code ${t.exitCode}`})}assertError(t,e,i){let s=!t.success;if(e){let h=(typeof e=="string"?new RegExp(e):e).test(t.output),c;s?h?c="matched":c=`output: ${t.output.slice(0,200)}`:c="command succeeded",this.assertions.push({description:i??`Command failed with expected error: ${e}`,passed:s&&h,expected:`failure with error matching ${e}`,actual:c})}else this.assertions.push({description:i??`Command failed: ${t.command}`,passed:s,expected:"non-zero exit code",actual:`exit code ${t.exitCode}`})}async assertFile(t,e,i){let s=g(t)?t:u(this.context.workingDirectory,t),r=x(this.context.workingDirectory,s);if(!await w(s)){this.assertions.push({description:i??`File exists: ${r}`,passed:!1,expected:"file exists",actual:"file not found"});return}if(e){let c=await O(s),D=(typeof e=="string"?new RegExp(e):e).test(c);this.assertions.push({description:i??`File ${r} matches ${e}`,passed:D,expected:`content matching ${e}`,actual:D?"matched":`content: ${c.slice(0,200)}...`})}else this.assertions.push({description:i??`File exists: ${r}`,passed:!0,expected:"file exists",actual:"file exists"})}async assertNoFile(t,e){let i=g(t)?t:u(this.context.workingDirectory,t),s=x(this.context.workingDirectory,i),r=await w(i);this.assertions.push({description:e??`File does not exist: ${s}`,passed:!r,expected:"file does not exist",actual:r?"file exists":"file does not exist"})}async assertDirectory(t,e){let i=g(t)?t:u(this.context.workingDirectory,t),s=x(this.context.workingDirectory,i),r=await w(i);this.assertions.push({description:e??`Directory exists: ${s}`,passed:r,expected:"directory exists",actual:r?"directory exists":"directory not found"})}assertOutput(t,e,i){let r=(typeof e=="string"?new RegExp(e):e).test(t.output);this.assertions.push({description:i??`Output matches ${e}`,passed:r,expected:`output matching ${e}`,actual:r?"matched":`output: ${t.output.slice(0,200)}`})}assertJson(t,e,i){try{let s=JSON.parse(t.stdout);if(e){let r=e(s);this.assertions.push({description:i??"Output is valid JSON matching validator",passed:r,expected:"valid JSON matching validator",actual:r?"matched":"validator returned false"})}else this.assertions.push({description:i??"Output is valid JSON",passed:!0,expected:"valid JSON",actual:"valid JSON"});return s}catch{this.assertions.push({description:i??"Output is valid JSON",passed:!1,expected:"valid JSON",actual:`invalid JSON: ${t.stdout.slice(0,100)}`});return}}assert(t,e){this.assertions.push({description:e,passed:t,expected:"true",actual:String(t)})}assertEqual(t,e,i){this.assertions.push({description:i,passed:t===e,expected:String(e),actual:String(t)})}hasFailures(){return this.assertions.some(t=>!t.passed)}};m.description="Doctor test suite";var p=class extends m{constructor(){super(...arguments);this.themeName="";this.themePath=""}static{this.description="Tests the theme init command creates a valid theme structure"}tests(){this.test("init creates theme directory",async()=>{this.themeName=`doctor-theme-${C("creative")}`,this.themePath=u(this.context.workingDirectory,this.themeName);let e=await this.runInteractive(`shopify theme init ${this.themeName} --path ${this.context.workingDirectory}`);this.assertSuccess(e),this.context.themeName=this.themeName,this.context.themePath=this.themePath}),this.test("essential theme files exist",async()=>{let e=["layout/theme.liquid","config/settings_schema.json","templates/index.json"];await Promise.all(e.map(i=>this.assertFile(u(this.themePath,i))))}),this.test("theme directories exist",async()=>{let e=["sections","snippets","assets","locales"];await Promise.all(e.map(i=>this.assertDirectory(u(this.themePath,i))))}),this.test("layout/theme.liquid has valid content",async()=>{await this.assertFile(u(this.themePath,"layout/theme.liquid"),/<!doctype html>|<html|{{ content_for_header }}/i,"layout/theme.liquid contains expected Liquid markup")})}};d();var l=class extends m{static{this.description="Tests pushing a theme to the store creates an unpublished theme"}static{this.requiresStore=!0}tests(){this.test("push creates unpublished theme",async()=>{if(!this.context.themePath){this.assert(!1,"Theme init did not complete successfully; themePath is missing in context");return}let t=this.context.themeName??"doctor-theme",e=`shopify theme push --unpublished --json --path ${this.context.themePath} -t ${t}`;this.context.environment&&(e+=` -e ${this.context.environment}`),this.context.store&&(e+=` -s ${this.context.store}`),this.context.password&&(e+=` --password ${this.context.password}`);let i=await this.run(e);this.assertSuccess(i);let s=this.assertJson(i,r=>typeof r.theme?.id=="number");s?.theme&&(this.assert(typeof s.theme.id=="number","Theme was created with a valid ID"),this.assertEqual(s.theme.role,"unpublished","Theme role is unpublished"),this.assert(s.theme.editor_url.includes("/admin/themes/"),"Editor URL is provided"),this.assert(s.theme.preview_url.includes("preview_theme_id="),"Preview URL is provided"),this.context.themeId=String(s.theme.id),this.context.data.editorUrl=s.theme.editor_url,this.context.data.previewUrl=s.theme.preview_url)})}};d();function _(o){return{workingDirectory:o.path??y(),environment:o.environment,store:o.store,password:o.password,data:{}}}d();var a=o=>k(o),v;function J(o){v=o}function G(o){if(!v)return o;let t=/\/[^\s,)]+/g;return o.replace(t,e=>T(e,v))}function A(o,t){a(""),a(n.bold(n.cyan(`Suite: ${o}`))),a(n.dim(t))}function j(o){a(n.bold(n.blue(`Running: ${o}`)))}function q(o){let t=`(${(o.duration/1e3).toFixed(2)}s)`;if(o.status==="passed"){a(n.bold(n.green(`PASSED: ${o.name} ${n.dim(t)}`)));for(let e of I(o.assertions))a(e)}else if(o.status==="failed"){a(n.red(`FAILED: ${o.name} ${n.dim(t)}`));for(let e of I(o.assertions))a(e);o.error&&a(n.red(` Error: ${G(o.error.message)}`))}else a(n.yellow(`SKIPPED: ${o.name}`))}function S(o){let t=o.filter(h=>h.status==="passed").length,e=o.filter(h=>h.status==="failed").length,i=o.filter(h=>h.status==="skipped").length,s=o.length,r=o.reduce((h,c)=>h+c.duration,0);a(""),a(n.bold("\u2500".repeat(40))),e>0?a(n.red(n.bold(`Doctor Complete: ${e}/${s} tests failed`))):a(n.green(n.bold(`Doctor Complete: ${t}/${s} tests passed`))),a(` Passed: ${n.green(String(t))}`),a(` Failed: ${n.red(String(e))}`),i>0&&a(` Skipped: ${n.yellow(String(i))}`),a(` Total time: ${n.dim(`${(r/1e3).toFixed(2)}s`)}`)}function I(o){return o.map(t=>{if(t.passed)return n.green(` [OK] ${t.description}`);{let e=` (expected: ${t.expected}, actual: ${t.actual})`;return n.red(` [FAIL] ${t.description}${e}`)}})}var Y=[p,l];async function L(o){let t=[],e=_(o);J(e.workingDirectory);for(let i of Y){let s=new i,r=i.description??"Test suite";A(i.name,r);let h=await s.runSuite(e);for(let c of h)if(j(c.name),q(c),t.push(c),c.status==="failed")return S(t),t}return S(t),t}var f=H(U(),1);var $=class o extends b{static{this.description="Run all theme command doctor-release tests"}static{this.hidden=!0}static{this.flags={...E,path:f.Flags.string({char:"p",description:"The path to run tests in. Defaults to current directory.",env:"SHOPIFY_FLAG_PATH",parse:async t=>P(t),default:async()=>y()}),environment:f.Flags.string({char:"e",description:"The environment to use from shopify.theme.toml (required for store-connected tests).",env:"SHOPIFY_FLAG_ENVIRONMENT",required:!0}),store:f.Flags.string({char:"s",description:"Store URL (overrides environment).",env:"SHOPIFY_FLAG_STORE"}),password:f.Flags.string({description:"Password from Theme Access app (overrides environment).",env:"SHOPIFY_FLAG_PASSWORD"})}}async run(){if(!R())return;let{flags:t}=await this.parse(o);(await L({path:t.path,environment:t.environment,store:t.store,password:t.password})).some(s=>s.status==="failed")&&(process.exitCode=1)}};export{$ as a};
1
+ import{b as E}from"./chunk-H5C3QTOO.js";import{b}from"./chunk-UKK5P74A.js";import{M as F,N}from"./chunk-6EZ7JWBK.js";import{Mb as k,T as C,Ta as w,ma as O}from"./chunk-DONEJHDG.js";import{u as n}from"./chunk-A4SBXDZB.js";import{k as R}from"./chunk-KKUDXLK2.js";import{d as u,f as P,g as x,h as g,n as T,q as y}from"./chunk-773TIA5M.js";import{r as U}from"./chunk-T6CC5WUU.js";import{e as H,g as d}from"./chunk-VKWPEFWQ.js";d();d();d();d();var m=class{constructor(){this.assertions=[],this.registeredTests=[]}async runSuite(t){this.context=t,this.registeredTests=[];let e=[];this.tests();for(let i of this.registeredTests){this.assertions=[];let s=Date.now();try{await i.fn(),e.push({name:i.name,status:this.hasFailures()?"failed":"passed",duration:Date.now()-s,assertions:[...this.assertions]})}catch(r){e.push({name:i.name,status:"failed",duration:Date.now()-s,assertions:[...this.assertions],error:r instanceof Error?r:new Error(String(r))})}}return e}test(t,e){this.registeredTests.push({name:t,fn:e})}tests(){}async run(t,e){let i=e?.cwd??this.context.workingDirectory,s=await F(t,{cwd:i,env:e?.env});return{command:t,exitCode:s.exitCode,stdout:s.stdout,stderr:s.stderr,output:String(s.stdout)+String(s.stderr),success:s.exitCode===0}}async runInteractive(t,e){let i=e?.cwd??this.context.workingDirectory,s=0;try{await N(t,{cwd:i,env:e?.env,stdin:"inherit"})}catch{s=1}return{command:t,exitCode:s,stdout:"",stderr:"",output:"",success:s===0}}assertSuccess(t,e){this.assertions.push({description:e??`Command succeeded: ${t.command}`,passed:t.success,expected:"exit code 0",actual:`exit code ${t.exitCode}`})}assertError(t,e,i){let s=!t.success;if(e){let h=(typeof e=="string"?new RegExp(e):e).test(t.output),c;s?h?c="matched":c=`output: ${t.output.slice(0,200)}`:c="command succeeded",this.assertions.push({description:i??`Command failed with expected error: ${e}`,passed:s&&h,expected:`failure with error matching ${e}`,actual:c})}else this.assertions.push({description:i??`Command failed: ${t.command}`,passed:s,expected:"non-zero exit code",actual:`exit code ${t.exitCode}`})}async assertFile(t,e,i){let s=g(t)?t:u(this.context.workingDirectory,t),r=x(this.context.workingDirectory,s);if(!await w(s)){this.assertions.push({description:i??`File exists: ${r}`,passed:!1,expected:"file exists",actual:"file not found"});return}if(e){let c=await O(s),D=(typeof e=="string"?new RegExp(e):e).test(c);this.assertions.push({description:i??`File ${r} matches ${e}`,passed:D,expected:`content matching ${e}`,actual:D?"matched":`content: ${c.slice(0,200)}...`})}else this.assertions.push({description:i??`File exists: ${r}`,passed:!0,expected:"file exists",actual:"file exists"})}async assertNoFile(t,e){let i=g(t)?t:u(this.context.workingDirectory,t),s=x(this.context.workingDirectory,i),r=await w(i);this.assertions.push({description:e??`File does not exist: ${s}`,passed:!r,expected:"file does not exist",actual:r?"file exists":"file does not exist"})}async assertDirectory(t,e){let i=g(t)?t:u(this.context.workingDirectory,t),s=x(this.context.workingDirectory,i),r=await w(i);this.assertions.push({description:e??`Directory exists: ${s}`,passed:r,expected:"directory exists",actual:r?"directory exists":"directory not found"})}assertOutput(t,e,i){let r=(typeof e=="string"?new RegExp(e):e).test(t.output);this.assertions.push({description:i??`Output matches ${e}`,passed:r,expected:`output matching ${e}`,actual:r?"matched":`output: ${t.output.slice(0,200)}`})}assertJson(t,e,i){try{let s=JSON.parse(t.stdout);if(e){let r=e(s);this.assertions.push({description:i??"Output is valid JSON matching validator",passed:r,expected:"valid JSON matching validator",actual:r?"matched":"validator returned false"})}else this.assertions.push({description:i??"Output is valid JSON",passed:!0,expected:"valid JSON",actual:"valid JSON"});return s}catch{this.assertions.push({description:i??"Output is valid JSON",passed:!1,expected:"valid JSON",actual:`invalid JSON: ${t.stdout.slice(0,100)}`});return}}assert(t,e){this.assertions.push({description:e,passed:t,expected:"true",actual:String(t)})}assertEqual(t,e,i){this.assertions.push({description:i,passed:t===e,expected:String(e),actual:String(t)})}hasFailures(){return this.assertions.some(t=>!t.passed)}};m.description="Doctor test suite";var p=class extends m{constructor(){super(...arguments);this.themeName="";this.themePath=""}static{this.description="Tests the theme init command creates a valid theme structure"}tests(){this.test("init creates theme directory",async()=>{this.themeName=`doctor-theme-${C("creative")}`,this.themePath=u(this.context.workingDirectory,this.themeName);let e=await this.runInteractive(`shopify theme init ${this.themeName} --path ${this.context.workingDirectory}`);this.assertSuccess(e),this.context.themeName=this.themeName,this.context.themePath=this.themePath}),this.test("essential theme files exist",async()=>{let e=["layout/theme.liquid","config/settings_schema.json","templates/index.json"];await Promise.all(e.map(i=>this.assertFile(u(this.themePath,i))))}),this.test("theme directories exist",async()=>{let e=["sections","snippets","assets","locales"];await Promise.all(e.map(i=>this.assertDirectory(u(this.themePath,i))))}),this.test("layout/theme.liquid has valid content",async()=>{await this.assertFile(u(this.themePath,"layout/theme.liquid"),/<!doctype html>|<html|{{ content_for_header }}/i,"layout/theme.liquid contains expected Liquid markup")})}};d();var l=class extends m{static{this.description="Tests pushing a theme to the store creates an unpublished theme"}static{this.requiresStore=!0}tests(){this.test("push creates unpublished theme",async()=>{if(!this.context.themePath){this.assert(!1,"Theme init did not complete successfully; themePath is missing in context");return}let t=this.context.themeName??"doctor-theme",e=`shopify theme push --unpublished --json --path ${this.context.themePath} -t ${t}`;this.context.environment&&(e+=` -e ${this.context.environment}`),this.context.store&&(e+=` -s ${this.context.store}`),this.context.password&&(e+=` --password ${this.context.password}`);let i=await this.run(e);this.assertSuccess(i);let s=this.assertJson(i,r=>typeof r.theme?.id=="number");s?.theme&&(this.assert(typeof s.theme.id=="number","Theme was created with a valid ID"),this.assertEqual(s.theme.role,"unpublished","Theme role is unpublished"),this.assert(s.theme.editor_url.includes("/admin/themes/"),"Editor URL is provided"),this.assert(s.theme.preview_url.includes("preview_theme_id="),"Preview URL is provided"),this.context.themeId=String(s.theme.id),this.context.data.editorUrl=s.theme.editor_url,this.context.data.previewUrl=s.theme.preview_url)})}};d();function _(o){return{workingDirectory:o.path??y(),environment:o.environment,store:o.store,password:o.password,data:{}}}d();var a=o=>k(o),v;function J(o){v=o}function G(o){if(!v)return o;let t=/\/[^\s,)]+/g;return o.replace(t,e=>T(e,v))}function A(o,t){a(""),a(n.bold(n.cyan(`Suite: ${o}`))),a(n.dim(t))}function j(o){a(n.bold(n.blue(`Running: ${o}`)))}function q(o){let t=`(${(o.duration/1e3).toFixed(2)}s)`;if(o.status==="passed"){a(n.bold(n.green(`PASSED: ${o.name} ${n.dim(t)}`)));for(let e of I(o.assertions))a(e)}else if(o.status==="failed"){a(n.red(`FAILED: ${o.name} ${n.dim(t)}`));for(let e of I(o.assertions))a(e);o.error&&a(n.red(` Error: ${G(o.error.message)}`))}else a(n.yellow(`SKIPPED: ${o.name}`))}function S(o){let t=o.filter(h=>h.status==="passed").length,e=o.filter(h=>h.status==="failed").length,i=o.filter(h=>h.status==="skipped").length,s=o.length,r=o.reduce((h,c)=>h+c.duration,0);a(""),a(n.bold("\u2500".repeat(40))),e>0?a(n.red(n.bold(`Doctor Complete: ${e}/${s} tests failed`))):a(n.green(n.bold(`Doctor Complete: ${t}/${s} tests passed`))),a(` Passed: ${n.green(String(t))}`),a(` Failed: ${n.red(String(e))}`),i>0&&a(` Skipped: ${n.yellow(String(i))}`),a(` Total time: ${n.dim(`${(r/1e3).toFixed(2)}s`)}`)}function I(o){return o.map(t=>{if(t.passed)return n.green(` [OK] ${t.description}`);{let e=` (expected: ${t.expected}, actual: ${t.actual})`;return n.red(` [FAIL] ${t.description}${e}`)}})}var Y=[p,l];async function L(o){let t=[],e=_(o);J(e.workingDirectory);for(let i of Y){let s=new i,r=i.description??"Test suite";A(i.name,r);let h=await s.runSuite(e);for(let c of h)if(j(c.name),q(c),t.push(c),c.status==="failed")return S(t),t}return S(t),t}var f=H(U(),1);var $=class o extends b{static{this.description="Run all theme command doctor-release tests"}static{this.hidden=!0}static{this.flags={...E,path:f.Flags.string({char:"p",description:"The path to run tests in. Defaults to current directory.",env:"SHOPIFY_FLAG_PATH",parse:async t=>P(t),default:async()=>y()}),environment:f.Flags.string({char:"e",description:"The environment to use from shopify.theme.toml (required for store-connected tests).",env:"SHOPIFY_FLAG_ENVIRONMENT",required:!0}),store:f.Flags.string({char:"s",description:"Store URL (overrides environment).",env:"SHOPIFY_FLAG_STORE"}),password:f.Flags.string({description:"Password from Theme Access app (overrides environment).",env:"SHOPIFY_FLAG_PASSWORD"})}}async run(){if(!R())return;let{flags:t}=await this.parse(o);(await L({path:t.path,environment:t.environment,store:t.store,password:t.password})).some(s=>s.status==="failed")&&(process.exitCode=1)}};export{$ as a};
@@ -0,0 +1 @@
1
+ import{P as m}from"./chunk-6EZ7JWBK.js";import{d as c}from"./chunk-WKBVT5WG.js";import{Fb as l,Hb as n,Pb as a}from"./chunk-DONEJHDG.js";import{g as s}from"./chunk-VKWPEFWQ.js";s();import{createServer as d}from"net";var u=new Set;async function P(o,t){if(o&&await g(o))return a(n`Port ${o.toString()} is free`),o;a(n`Getting a random port...`);let r=await w(()=>f(),t?.maxTries,t?.waitTimeInSeconds);for(let e=0;e<(t?.maxTries??5)&&u.has(r);e++)r=await w(()=>f(),t?.maxTries,t?.waitTimeInSeconds);return a(n`Random port obtained: ${l.raw(`${r}`)}`),u.add(r),r}async function g(o){return new Promise(t=>{let r=d();r.unref(),r.once("error",()=>t(!1));try{r.listen(o,"localhost",()=>{r.close(()=>t(!0))})}catch(e){if(!(e instanceof RangeError))throw e;t(!1)}})}function f(){return new Promise((o,t)=>{let r=d();r.unref(),r.once("error",t),r.listen(0,"localhost",()=>{let e=r.address();if(e&&typeof e=="object"){let i=e.port;r.close(()=>o(i))}else r.close(()=>t(new Error("Unable to determine assigned port")))})})}async function w(o,t=5,r=1){let e=1;for(;;)try{return await o()}catch(i){if(e++<t)a(n`Unknown problem getting a random port: ${i.message}`),await m(r);else throw new c(i.message)}}export{P as a,g as b};
@@ -1 +1 @@
1
- import{a as n}from"./chunk-2RBIR3NM.js";import{b as i}from"./chunk-HOSFU6UP.js";import{g as e}from"./chunk-VKWPEFWQ.js";e();var t=class extends i{static{this.description="Generate a notifications.json file for the the CLI, appending a new notification to the current file."}static{this.hidden=!0}async run(){await n()}};export{t as a};
1
+ import{a as n}from"./chunk-45MEVWH5.js";import{b as i}from"./chunk-UKK5P74A.js";import{g as e}from"./chunk-VKWPEFWQ.js";e();var t=class extends i{static{this.description="Generate a notifications.json file for the the CLI, appending a new notification to the current file."}static{this.hidden=!0}async run(){await n()}};export{t as a};
@@ -1 +1 @@
1
- import{a as h,c as D,d as _,e as w}from"./chunk-JUYJZUYU.js";import{b as y,k as O,q as b}from"./chunk-TUNUEOHO.js";import{b as S,c as T}from"./chunk-OXJBYKMX.js";import{b as v}from"./chunk-N5LVGFDS.js";import{u as F}from"./chunk-NTRAWIEJ.js";import{r as G}from"./chunk-T6CC5WUU.js";import{Hb as a,Lb as L,Pb as l}from"./chunk-7FQFEB33.js";import{e as $,g as o}from"./chunk-VKWPEFWQ.js";o();o();o();var u;function p(){return u??(u=new v({projectName:"shopify-cli-host-theme-conf"})),u}function E(e){return l(a`Getting host theme...`),p().get(e)}function Y(e,t){l(a`Setting host theme...`),p().set(e,t)}function C(e){l(a`Removing host theme...`),p().delete(e)}function j(e,t){return{title:e,body:{tabularData:t}}}async function I(e,t){let n=t.storeFqdn,g=new w({...h.reduce((m,s)=>(m[s]=e.role===s,m),{}),theme:e.id?.toString()??e.name}),i=await D(t),x=y(),H=E(n);if(g.any()&&(i=_(n,i,g)),e.json)return L(JSON.stringify(i,null,2));let A=i.map(({id:m,name:s,role:d})=>{let f="";return d&&(f=`[${d}]`,[x,H].includes(`${m}`)&&(f+=" [current]")),[s,f,`#${m}`]}),R=[["name","role","id"],["\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500","\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500","\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"],...A];F({customSections:[...e.environment?[{title:`${n} theme library`,body:[{subdued:`Environment name: ${e.environment}`}]}]:[],j("",R)]})}var c=$(G(),1);var r=class extends b{async command(t,n){await I(t,n)}};r.description="Lists the themes in your store, along with their IDs and statuses.";r.flags={...S,...T,...O,role:c.Flags.custom({description:"Only list themes with the given role.",options:h,env:"SHOPIFY_FLAG_ROLE"})(),name:c.Flags.string({description:"Only list themes that contain the given name.",env:"SHOPIFY_FLAG_NAME"}),id:c.Flags.integer({description:"Only list theme with the given ID.",env:"SHOPIFY_FLAG_ID"})};r.multiEnvironmentsFlags=["store","password"];var oe=r;export{E as a,Y as b,C as c,oe as d};
1
+ import{a as h,c as D,d as _,e as w}from"./chunk-67KMRBSZ.js";import{g as y,p as O,v as b}from"./chunk-D6YDSGR4.js";import{b as S,c as T}from"./chunk-H5C3QTOO.js";import{b as v}from"./chunk-47MGPVED.js";import{u as F}from"./chunk-6EZ7JWBK.js";import{Hb as a,Lb as L,Pb as l}from"./chunk-DONEJHDG.js";import{r as G}from"./chunk-T6CC5WUU.js";import{e as $,g as o}from"./chunk-VKWPEFWQ.js";o();o();o();var u;function p(){return u??(u=new v({projectName:"shopify-cli-host-theme-conf"})),u}function E(e){return l(a`Getting host theme...`),p().get(e)}function Y(e,t){l(a`Setting host theme...`),p().set(e,t)}function C(e){l(a`Removing host theme...`),p().delete(e)}function j(e,t){return{title:e,body:{tabularData:t}}}async function I(e,t){let n=t.storeFqdn,g=new w({...h.reduce((m,s)=>(m[s]=e.role===s,m),{}),theme:e.id?.toString()??e.name}),i=await D(t),x=y(),H=E(n);if(g.any()&&(i=_(n,i,g)),e.json)return L(JSON.stringify(i,null,2));let A=i.map(({id:m,name:s,role:d})=>{let f="";return d&&(f=`[${d}]`,[x,H].includes(`${m}`)&&(f+=" [current]")),[s,f,`#${m}`]}),R=[["name","role","id"],["\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500","\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500","\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"],...A];F({customSections:[...e.environment?[{title:`${n} theme library`,body:[{subdued:`Environment name: ${e.environment}`}]}]:[],j("",R)]})}var c=$(G(),1);var r=class extends b{async command(t,n){await I(t,n)}};r.description="Lists the themes in your store, along with their IDs and statuses.";r.flags={...S,...T,...O,role:c.Flags.custom({description:"Only list themes with the given role.",options:h,env:"SHOPIFY_FLAG_ROLE"})(),name:c.Flags.string({description:"Only list themes that contain the given name.",env:"SHOPIFY_FLAG_NAME"}),id:c.Flags.integer({description:"Only list theme with the given ID.",env:"SHOPIFY_FLAG_ID"})};r.multiEnvironmentsFlags=["store","password"];var oe=r;export{E as a,Y as b,C as c,oe as d};
@@ -1 +1 @@
1
- import{b as n}from"./chunk-OXJBYKMX.js";import{u as r}from"./chunk-A4SBXDZB.js";import{g as e}from"./chunk-VKWPEFWQ.js";e();function v(o){o.verbose&&(process.env[n.verbose.env]="true"),o.noColor&&(r.level=0,process.env.FORCE_COLOR="0")}export{v as a};
1
+ import{b as n}from"./chunk-H5C3QTOO.js";import{u as r}from"./chunk-A4SBXDZB.js";import{g as e}from"./chunk-VKWPEFWQ.js";e();function v(o){o.verbose&&(process.env[n.verbose.env]="true"),o.noColor&&(r.level=0,process.env.FORCE_COLOR="0")}export{v as a};
@@ -1 +1 @@
1
- import{a as o}from"./chunk-OU3M32A2.js";import{b as e}from"./chunk-HOSFU6UP.js";import{g as i}from"./chunk-VKWPEFWQ.js";i();var t=class extends e{static{this.description="View the UI kit components that display static output"}static{this.hidden=!0}async run(){await o()}};export{t as a};
1
+ import{a as o}from"./chunk-POAICASX.js";import{b as e}from"./chunk-UKK5P74A.js";import{g as i}from"./chunk-VKWPEFWQ.js";i();var t=class extends e{static{this.description="View the UI kit components that display static output"}static{this.hidden=!0}async run(){await o()}};export{t as a};
@@ -1 +1 @@
1
- import{b as c}from"./chunk-CFOXXOO2.js";import{h as E,ua as T,va as u,xa as s}from"./chunk-G4OQABDT.js";import{F as w}from"./chunk-NTRAWIEJ.js";import{d as N}from"./chunk-TPCG6DCA.js";import{Pb as V,T as _}from"./chunk-7FQFEB33.js";import{g as l}from"./chunk-VKWPEFWQ.js";l();var j=/gid:\/\/shopify\/\w*\/(\d+)/,g="development",ne="live",ie="unpublished";function ae(e){return e.role===g}async function te(e){let n=await _("creative");return w({message:e,defaultValue:n})}function S(e){return`gid://shopify/OnlineStoreTheme/${e}`}function f(e){let n=j.exec(e);if(n&&n[1]!==void 0)return parseInt(n[1],10);throw new Error(`Invalid GID: ${e}`)}l();l();var F;(function(e){e.Delete="DELETE",e.Upload="UPLOAD"})(F||(F={}));l();function y(e){if(!e)return;e.processing??(e.processing=!1),e.createdAtRuntime??(e.createdAtRuntime=!1);let{id:n,name:a,role:i,processing:t,createdAtRuntime:d}=e;return{id:n,name:a,processing:t,createdAtRuntime:d,role:i==="main"?"live":i}}function re(e){if(!e)return;let{key:n,checksum:a,attachment:i,value:t}=e,d={size:(t||i||"").length,mtime:Date.now()};return{key:n,checksum:a,attachment:i,value:t,stats:d}}l();var A={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themeUpdate"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"OnlineStoreThemeInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themeUpdate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}},{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"theme"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"field"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var x={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themeDelete"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themeDelete"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"deletedThemeId"}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"field"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var I={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themeDuplicate"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"name"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themeDuplicate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}},{kind:"Argument",name:{kind:"Name",value:"name"},value:{kind:"Variable",name:{kind:"Name",value:"name"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"newTheme"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"field"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var O={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themePublish"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themePublish"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"theme"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"field"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var B={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themeCreate"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"name"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"source"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"URL"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"role"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ThemeRole"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themeCreate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"name"},value:{kind:"Variable",name:{kind:"Name",value:"name"}}},{kind:"Argument",name:{kind:"Name",value:"source"},value:{kind:"Variable",name:{kind:"Name",value:"source"}}},{kind:"Argument",name:{kind:"Name",value:"role"},value:{kind:"Variable",name:{kind:"Name",value:"role"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"theme"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"field"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var C={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"getThemeFileBodies"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"filenames"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"theme"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"files"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"250"}},{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}},{kind:"Argument",name:{kind:"Name",value:"filenames"},value:{kind:"Variable",name:{kind:"Name",value:"filenames"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"size"}},{kind:"Field",name:{kind:"Name",value:"checksumMd5"}},{kind:"Field",name:{kind:"Name",value:"body"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"OnlineStoreThemeFileBodyText"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"content"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"OnlineStoreThemeFileBodyBase64"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"contentBase64"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"OnlineStoreThemeFileBodyUrl"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"code"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"pageInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hasNextPage"}},{kind:"Field",name:{kind:"Name",value:"endCursor"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var q={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"getThemeFileChecksums"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"theme"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"files"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"250"}},{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"size"}},{kind:"Field",name:{kind:"Name",value:"checksumMd5"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"code"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"pageInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hasNextPage"}},{kind:"Field",name:{kind:"Name",value:"endCursor"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var P={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themeFilesUpsert"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"files"}},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"OnlineStoreThemeFilesUpsertFileInput"}}}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"themeId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themeFilesUpsert"},arguments:[{kind:"Argument",name:{kind:"Name",value:"files"},value:{kind:"Variable",name:{kind:"Name",value:"files"}}},{kind:"Argument",name:{kind:"Name",value:"themeId"},value:{kind:"Variable",name:{kind:"Name",value:"themeId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"upsertedThemeFiles"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var U={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themeFilesDelete"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"themeId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"files"}},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themeFilesDelete"},arguments:[{kind:"Argument",name:{kind:"Name",value:"themeId"},value:{kind:"Variable",name:{kind:"Name",value:"themeId"}}},{kind:"Argument",name:{kind:"Name",value:"files"},value:{kind:"Variable",name:{kind:"Name",value:"files"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"deletedThemeFiles"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"code"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var L={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"metafieldDefinitionsByOwnerType"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"ownerType"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"MetafieldOwnerType"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"metafieldDefinitions"},arguments:[{kind:"Argument",name:{kind:"Name",value:"ownerType"},value:{kind:"Variable",name:{kind:"Name",value:"ownerType"}}},{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"250"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"key"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"namespace"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"type"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"category"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var R={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"getThemes"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themes"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"50"}},{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"processing"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"pageInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hasNextPage"}},{kind:"Field",name:{kind:"Name",value:"endCursor"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var M={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"getTheme"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"theme"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"processing"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var G={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"findDevelopmentThemeByName"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"name"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themes"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"2"}},{kind:"Argument",name:{kind:"Name",value:"names"},value:{kind:"ListValue",values:[{kind:"Variable",name:{kind:"Name",value:"name"}}]}},{kind:"Argument",name:{kind:"Name",value:"roles"},value:{kind:"ListValue",values:[{kind:"EnumValue",value:"DEVELOPMENT"}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"processing"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var $={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"OnlineStorePasswordProtection"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"onlineStore"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"passwordProtection"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"enabled"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};var Q="https://cdn.shopify.com/static/online-store/theme-skeleton.zip",p={useNetworkLevelRetry:!0,useAbortSignal:!1,maxRetryTimeMs:90*1e3,recordCommandRetries:!0},z="the required theme access scope";async function rn(e,n){let a=S(e);s("theme-api:fetch-theme");try{let{theme:i}=await c({query:M,session:n,variables:{id:a},responseOptions:{handleErrors:!1},preferredBehaviour:p});if(i)return y({id:f(i.id),processing:i.processing,role:i.role.toLowerCase(),name:i.name})}catch(i){H(i),u(i),V(`Error fetching theme with ID: ${e}`)}}async function sn(e){let n=[],a=null;for(s("theme-api:fetch-themes");;){let i=await b({query:R,session:e,variables:{after:a},responseOptions:{handleErrors:!1},preferredBehaviour:p});i.themes||r("Failed to fetch themes");let{nodes:t,pageInfo:d}=i.themes;if(t.forEach(m=>{let o=y({id:f(m.id),processing:m.processing,role:m.role.toLowerCase(),name:m.name});o&&n.push(o)}),!d.hasNextPage)return n;a=d.endCursor}}async function kn(e,n){s("theme-api:find-development-theme-by-name");let{themes:a}=await b({query:G,session:n,variables:{name:e},responseOptions:{handleErrors:!1},preferredBehaviour:p});if(a||r("Failed to fetch themes"),a.nodes.length>1)throw u(new N(`More than one development theme is named "${e}"`));if(a.nodes.length===1){let{id:i,processing:t,role:d,name:m}=a.nodes[0];return y({id:f(i),processing:t,role:d.toLowerCase(),name:m})}}async function un(e,n){let a=e.src??Q;s("theme-api:create-theme");let{themeCreate:i}=await c({query:B,session:n,variables:{name:e.name??"",source:a,role:(e.role??g).toUpperCase()},responseOptions:{handleErrors:!1},preferredBehaviour:p});i||r("Failed to create theme");let{theme:t,userErrors:d}=i;if(d.length){let m=i.userErrors.map(o=>o.message).join(", ");throw u(new N(m))}return t||r("Failed to create theme"),y({id:f(t.id),name:t.name,role:t.role.toLowerCase()})}async function cn(e,n,a){let i=[],t=null;for(s("theme-api:fetch-assets");;){let d=await b({query:C,session:a,variables:{id:D(e),filenames:n,after:t},responseOptions:{handleErrors:!1},preferredBehaviour:p});if(!d.theme?.files?.nodes||!d.theme?.files?.pageInfo){let k=d.theme?.files?.userErrors.map(h=>h.filename).join(", ");r(`Error fetching assets: ${k}`)}let{nodes:m,pageInfo:o}=d.theme.files;if(i.push(...await Promise.all(m.map(async k=>{let{attachment:h,value:v}=await Z(k.body);return{attachment:h,key:k.filename,checksum:k.checksumMd5,value:v}}))),!o.hasNextPage)return i;t=o.endCursor}}async function pn(e,n,a){let t=[];s("theme-api:delete-assets");for(let d=0;d<n.length;d+=50){let m=n.slice(d,d+50),{themeFilesDelete:o}=await c({query:U,session:a,variables:{themeId:S(e),files:m},preferredBehaviour:p});o||r("Failed to delete theme assets");let{deletedThemeFiles:k,userErrors:h}=o;k&&k.forEach(v=>{t.push({key:v.filename,success:!0,operation:F.Delete})}),h.length>0&&h.forEach(v=>{v.filename?(u(`Asset deletion failed for ${v.filename}: ${v.message}`),t.push({key:v.filename,success:!1,operation:F.Delete,errors:{asset:[v.message]}})):r(`Failed to delete theme assets: ${v.message}`)})}return t}async function vn(e,n,a){let i=[];s("theme-api:bulk-upload-assets");for(let t=0;t<n.length;t+=50){let d=n.slice(t,t+50),m=X(d);T("theme-api:upload-files");let o=await K(e,m,a);T("theme-api:upload-files"),i.push(...W(o))}return i}function X(e){return e.map(n=>n.attachment?{filename:n.key,body:{type:"BASE64",value:n.attachment}}:{filename:n.key,body:{type:"TEXT",value:n.value??""}})}async function K(e,n,a){return c({query:P,session:a,variables:{themeId:D(e),files:n},preferredBehaviour:p})}function W(e){let{themeFilesUpsert:n}=e;n||r("Failed to upload theme files");let{upsertedThemeFiles:a,userErrors:i}=n,t=[];return a?.forEach(d=>{t.push({key:d.filename,success:!0,operation:F.Upload})}),i.forEach(d=>{d.filename||r(`Error uploading theme files: ${d.message}`),u(`Asset upload failed for ${d.filename}: ${d.message}`),t.push({key:d.filename,success:!1,operation:F.Upload,errors:{asset:[d.message]}})}),t}async function Nn(e,n){let a=[],i=null;for(s("theme-api:fetch-checksums");;){let t=await b({query:q,session:n,variables:{id:D(e),after:i},responseOptions:{handleErrors:!1},preferredBehaviour:p});if(!t?.theme?.files?.nodes||!t?.theme?.files?.pageInfo){let o=t.theme?.files?.userErrors.map(k=>k.filename).join(", ");throw u(new N(`Failed to fetch checksums for: ${o}`))}let{nodes:d,pageInfo:m}=t.theme.files;if(a.push(...d.map(o=>({key:o.filename,checksum:o.checksumMd5}))),!m.hasNextPage)return a;i=m.endCursor}}async function hn(e,n,a){let i=n.name,t={};i&&(t.name=i),s("theme-api:update-theme");let{themeUpdate:d}=await c({query:A,session:a,variables:{id:S(e),input:t},preferredBehaviour:p});d||r("Failed to update theme");let{theme:m,userErrors:o}=d;if(o.length){let k=d.userErrors.map(h=>h.message).join(", ");throw u(new N(k))}return m||r("Failed to update theme"),y({id:f(m.id),name:m.name,role:m.role.toLowerCase()})}async function fn(e,n){s("theme-api:publish-theme");let{themePublish:a}=await c({query:O,session:n,variables:{id:S(e)},preferredBehaviour:p});a||r("Failed to update theme");let{theme:i,userErrors:t}=a;if(t.length){let d=a.userErrors.map(m=>m.message).join(", ");throw u(new N(d))}return i||r("Failed to update theme"),y({id:f(i.id),name:i.name,role:i.role.toLowerCase()})}async function yn(e,n){s("theme-api:delete-theme");let{themeDelete:a}=await c({query:x,session:n,variables:{id:S(e)},preferredBehaviour:p});a||r("Failed to update theme");let{deletedThemeId:i,userErrors:t}=a;if(t.length){let d=a.userErrors.map(m=>m.message).join(", ");throw u(new N(d))}return i||r("Failed to update theme"),!0}async function Sn(e,n,a){let i;s("theme-api:duplicate-theme");let{themeDuplicate:t}=await c({query:I,session:a,variables:{id:S(e),name:n},preferredBehaviour:p,responseOptions:{onResponse:k=>{i=k.headers.get("x-request-id")??void 0}}});if(!t)return u("Failed to duplicate theme"),{theme:void 0,userErrors:[{message:"Failed to duplicate theme"}],requestId:i};let{newTheme:d,userErrors:m}=t;return m.length>0?{theme:void 0,userErrors:m,requestId:i}:d?{theme:y({id:f(d.id),name:d.name,role:d.role.toLowerCase()}),userErrors:[],requestId:i}:{theme:void 0,userErrors:[{message:"Failed to duplicate theme"}],requestId:i}}async function Fn(e,n){s("theme-api:fetch-metafield-definitions");let{metafieldDefinitions:a}=await c({query:L,session:n,variables:{ownerType:e}});return a.nodes.map(i=>({key:i.key,namespace:i.namespace,name:i.name,description:i.description,type:{name:i.type.name,category:i.type.category}}))}async function bn(e){s("theme-api:check-password-protection");let{onlineStore:n}=await c({query:$,session:e});n||r("Unable to get details about the storefront's password protection");let{passwordProtection:a}=n;return a.enabled}function r(e){throw u(new N(e))}async function b(e){try{return await c(e)}catch(n){throw H(n),n}}function H(e){if(!(e instanceof E))return;let n=Y(e);if(!n)return;let a=[["If you authenticated with an Admin API access token, update the app or integration that issued the token to include the required theme access scopes, then reauthorize it or generate a new token."],["For",{command:"theme pull"},{char:","},{command:"theme list"},{char:","},"and",{command:"theme info"},{char:","},"add the",{command:"read_themes"},"scope",{char:"."}],["For",{command:"theme push"},"and",{command:"theme dev"},{char:","},"add both the",{command:"read_themes"},"and",{command:"write_themes"},"scopes",{char:"."}],["If you authenticated with your Shopify account, make sure your staff or collaborator account can access Online Store themes, then run",{command:"shopify auth logout"},"and try again",{char:"."}],["See",{link:{label:"Shopify access scopes",url:"https://shopify.dev/api/usage/access-scopes"}},{char:"."}]];throw u(new N(`The authenticated account or access token is missing ${n}.`,void 0,a))}function Y(e){let n=e.response.errors;if(!Array.isArray(n))return;let a=n.find(t=>t.extensions?.code==="ACCESS_DENIED");if(!a)return;let i=a.extensions?.requiredAccess;return typeof i!="string"?z:i.trim().replace(/\.$/,"")||z}function D(e){return`gid://shopify/OnlineStoreTheme/${e}`}async function Z(e){switch(e.__typename){case"OnlineStoreThemeFileBodyText":return{value:e.content};case"OnlineStoreThemeFileBodyBase64":return{attachment:e.contentBase64};case"OnlineStoreThemeFileBodyUrl":try{let a=await(await fetch(e.url)).arrayBuffer();return{attachment:Buffer.from(a).toString("base64")}}catch{throw u(new N(`Error downloading content from URL: ${e.url}`))}}}export{re as a,g as b,ne as c,ie as d,ae as e,te as f,rn as g,sn as h,kn as i,un as j,cn as k,pn as l,vn as m,Nn as n,hn as o,fn as p,yn as q,Sn as r,Fn as s,bn as t};
1
+ import{b as c}from"./chunk-G24L7MB3.js";import{h as E,ua as T,va as u,xa as s}from"./chunk-5W443CKL.js";import{F as w}from"./chunk-6EZ7JWBK.js";import{d as N}from"./chunk-WKBVT5WG.js";import{Pb as V,T as _}from"./chunk-DONEJHDG.js";import{g as l}from"./chunk-VKWPEFWQ.js";l();var j=/gid:\/\/shopify\/\w*\/(\d+)/,g="development",ne="live",ie="unpublished";function ae(e){return e.role===g}async function te(e){let n=await _("creative");return w({message:e,defaultValue:n})}function S(e){return`gid://shopify/OnlineStoreTheme/${e}`}function f(e){let n=j.exec(e);if(n&&n[1]!==void 0)return parseInt(n[1],10);throw new Error(`Invalid GID: ${e}`)}l();l();var F;(function(e){e.Delete="DELETE",e.Upload="UPLOAD"})(F||(F={}));l();function y(e){if(!e)return;e.processing??(e.processing=!1),e.createdAtRuntime??(e.createdAtRuntime=!1);let{id:n,name:a,role:i,processing:t,createdAtRuntime:d}=e;return{id:n,name:a,processing:t,createdAtRuntime:d,role:i==="main"?"live":i}}function re(e){if(!e)return;let{key:n,checksum:a,attachment:i,value:t}=e,d={size:(t||i||"").length,mtime:Date.now()};return{key:n,checksum:a,attachment:i,value:t,stats:d}}l();var A={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themeUpdate"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"OnlineStoreThemeInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themeUpdate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}},{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"theme"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"field"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var x={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themeDelete"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themeDelete"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"deletedThemeId"}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"field"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var I={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themeDuplicate"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"name"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themeDuplicate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}},{kind:"Argument",name:{kind:"Name",value:"name"},value:{kind:"Variable",name:{kind:"Name",value:"name"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"newTheme"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"field"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var O={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themePublish"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themePublish"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"theme"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"field"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var B={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themeCreate"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"name"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"source"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"URL"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"role"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ThemeRole"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themeCreate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"name"},value:{kind:"Variable",name:{kind:"Name",value:"name"}}},{kind:"Argument",name:{kind:"Name",value:"source"},value:{kind:"Variable",name:{kind:"Name",value:"source"}}},{kind:"Argument",name:{kind:"Name",value:"role"},value:{kind:"Variable",name:{kind:"Name",value:"role"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"theme"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"field"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var C={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"getThemeFileBodies"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"filenames"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"theme"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"files"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"250"}},{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}},{kind:"Argument",name:{kind:"Name",value:"filenames"},value:{kind:"Variable",name:{kind:"Name",value:"filenames"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"size"}},{kind:"Field",name:{kind:"Name",value:"checksumMd5"}},{kind:"Field",name:{kind:"Name",value:"body"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"OnlineStoreThemeFileBodyText"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"content"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"OnlineStoreThemeFileBodyBase64"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"contentBase64"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"OnlineStoreThemeFileBodyUrl"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"code"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"pageInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hasNextPage"}},{kind:"Field",name:{kind:"Name",value:"endCursor"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var q={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"getThemeFileChecksums"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"theme"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"files"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"250"}},{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"size"}},{kind:"Field",name:{kind:"Name",value:"checksumMd5"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"code"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"pageInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hasNextPage"}},{kind:"Field",name:{kind:"Name",value:"endCursor"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var P={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themeFilesUpsert"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"files"}},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"OnlineStoreThemeFilesUpsertFileInput"}}}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"themeId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themeFilesUpsert"},arguments:[{kind:"Argument",name:{kind:"Name",value:"files"},value:{kind:"Variable",name:{kind:"Name",value:"files"}}},{kind:"Argument",name:{kind:"Name",value:"themeId"},value:{kind:"Variable",name:{kind:"Name",value:"themeId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"upsertedThemeFiles"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var U={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themeFilesDelete"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"themeId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"files"}},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themeFilesDelete"},arguments:[{kind:"Argument",name:{kind:"Name",value:"themeId"},value:{kind:"Variable",name:{kind:"Name",value:"themeId"}}},{kind:"Argument",name:{kind:"Name",value:"files"},value:{kind:"Variable",name:{kind:"Name",value:"files"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"deletedThemeFiles"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"code"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var L={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"metafieldDefinitionsByOwnerType"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"ownerType"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"MetafieldOwnerType"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"metafieldDefinitions"},arguments:[{kind:"Argument",name:{kind:"Name",value:"ownerType"},value:{kind:"Variable",name:{kind:"Name",value:"ownerType"}}},{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"250"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"key"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"namespace"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"type"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"category"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var R={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"getThemes"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themes"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"50"}},{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"processing"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"pageInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hasNextPage"}},{kind:"Field",name:{kind:"Name",value:"endCursor"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var M={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"getTheme"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"theme"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"processing"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var G={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"findDevelopmentThemeByName"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"name"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themes"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"2"}},{kind:"Argument",name:{kind:"Name",value:"names"},value:{kind:"ListValue",values:[{kind:"Variable",name:{kind:"Name",value:"name"}}]}},{kind:"Argument",name:{kind:"Name",value:"roles"},value:{kind:"ListValue",values:[{kind:"EnumValue",value:"DEVELOPMENT"}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"processing"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var $={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"OnlineStorePasswordProtection"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"onlineStore"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"passwordProtection"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"enabled"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};var Q="https://cdn.shopify.com/static/online-store/theme-skeleton.zip",p={useNetworkLevelRetry:!0,useAbortSignal:!1,maxRetryTimeMs:90*1e3,recordCommandRetries:!0},z="the required theme access scope";async function rn(e,n){let a=S(e);s("theme-api:fetch-theme");try{let{theme:i}=await c({query:M,session:n,variables:{id:a},responseOptions:{handleErrors:!1},preferredBehaviour:p});if(i)return y({id:f(i.id),processing:i.processing,role:i.role.toLowerCase(),name:i.name})}catch(i){H(i),u(i),V(`Error fetching theme with ID: ${e}`)}}async function sn(e){let n=[],a=null;for(s("theme-api:fetch-themes");;){let i=await b({query:R,session:e,variables:{after:a},responseOptions:{handleErrors:!1},preferredBehaviour:p});i.themes||r("Failed to fetch themes");let{nodes:t,pageInfo:d}=i.themes;if(t.forEach(m=>{let o=y({id:f(m.id),processing:m.processing,role:m.role.toLowerCase(),name:m.name});o&&n.push(o)}),!d.hasNextPage)return n;a=d.endCursor}}async function kn(e,n){s("theme-api:find-development-theme-by-name");let{themes:a}=await b({query:G,session:n,variables:{name:e},responseOptions:{handleErrors:!1},preferredBehaviour:p});if(a||r("Failed to fetch themes"),a.nodes.length>1)throw u(new N(`More than one development theme is named "${e}"`));if(a.nodes.length===1){let{id:i,processing:t,role:d,name:m}=a.nodes[0];return y({id:f(i),processing:t,role:d.toLowerCase(),name:m})}}async function un(e,n){let a=e.src??Q;s("theme-api:create-theme");let{themeCreate:i}=await c({query:B,session:n,variables:{name:e.name??"",source:a,role:(e.role??g).toUpperCase()},responseOptions:{handleErrors:!1},preferredBehaviour:p});i||r("Failed to create theme");let{theme:t,userErrors:d}=i;if(d.length){let m=i.userErrors.map(o=>o.message).join(", ");throw u(new N(m))}return t||r("Failed to create theme"),y({id:f(t.id),name:t.name,role:t.role.toLowerCase()})}async function cn(e,n,a){let i=[],t=null;for(s("theme-api:fetch-assets");;){let d=await b({query:C,session:a,variables:{id:D(e),filenames:n,after:t},responseOptions:{handleErrors:!1},preferredBehaviour:p});if(!d.theme?.files?.nodes||!d.theme?.files?.pageInfo){let k=d.theme?.files?.userErrors.map(h=>h.filename).join(", ");r(`Error fetching assets: ${k}`)}let{nodes:m,pageInfo:o}=d.theme.files;if(i.push(...await Promise.all(m.map(async k=>{let{attachment:h,value:v}=await Z(k.body);return{attachment:h,key:k.filename,checksum:k.checksumMd5,value:v}}))),!o.hasNextPage)return i;t=o.endCursor}}async function pn(e,n,a){let t=[];s("theme-api:delete-assets");for(let d=0;d<n.length;d+=50){let m=n.slice(d,d+50),{themeFilesDelete:o}=await c({query:U,session:a,variables:{themeId:S(e),files:m},preferredBehaviour:p});o||r("Failed to delete theme assets");let{deletedThemeFiles:k,userErrors:h}=o;k&&k.forEach(v=>{t.push({key:v.filename,success:!0,operation:F.Delete})}),h.length>0&&h.forEach(v=>{v.filename?(u(`Asset deletion failed for ${v.filename}: ${v.message}`),t.push({key:v.filename,success:!1,operation:F.Delete,errors:{asset:[v.message]}})):r(`Failed to delete theme assets: ${v.message}`)})}return t}async function vn(e,n,a){let i=[];s("theme-api:bulk-upload-assets");for(let t=0;t<n.length;t+=50){let d=n.slice(t,t+50),m=X(d);T("theme-api:upload-files");let o=await K(e,m,a);T("theme-api:upload-files"),i.push(...W(o))}return i}function X(e){return e.map(n=>n.attachment?{filename:n.key,body:{type:"BASE64",value:n.attachment}}:{filename:n.key,body:{type:"TEXT",value:n.value??""}})}async function K(e,n,a){return c({query:P,session:a,variables:{themeId:D(e),files:n},preferredBehaviour:p})}function W(e){let{themeFilesUpsert:n}=e;n||r("Failed to upload theme files");let{upsertedThemeFiles:a,userErrors:i}=n,t=[];return a?.forEach(d=>{t.push({key:d.filename,success:!0,operation:F.Upload})}),i.forEach(d=>{d.filename||r(`Error uploading theme files: ${d.message}`),u(`Asset upload failed for ${d.filename}: ${d.message}`),t.push({key:d.filename,success:!1,operation:F.Upload,errors:{asset:[d.message]}})}),t}async function Nn(e,n){let a=[],i=null;for(s("theme-api:fetch-checksums");;){let t=await b({query:q,session:n,variables:{id:D(e),after:i},responseOptions:{handleErrors:!1},preferredBehaviour:p});if(!t?.theme?.files?.nodes||!t?.theme?.files?.pageInfo){let o=t.theme?.files?.userErrors.map(k=>k.filename).join(", ");throw u(new N(`Failed to fetch checksums for: ${o}`))}let{nodes:d,pageInfo:m}=t.theme.files;if(a.push(...d.map(o=>({key:o.filename,checksum:o.checksumMd5}))),!m.hasNextPage)return a;i=m.endCursor}}async function hn(e,n,a){let i=n.name,t={};i&&(t.name=i),s("theme-api:update-theme");let{themeUpdate:d}=await c({query:A,session:a,variables:{id:S(e),input:t},preferredBehaviour:p});d||r("Failed to update theme");let{theme:m,userErrors:o}=d;if(o.length){let k=d.userErrors.map(h=>h.message).join(", ");throw u(new N(k))}return m||r("Failed to update theme"),y({id:f(m.id),name:m.name,role:m.role.toLowerCase()})}async function fn(e,n){s("theme-api:publish-theme");let{themePublish:a}=await c({query:O,session:n,variables:{id:S(e)},preferredBehaviour:p});a||r("Failed to update theme");let{theme:i,userErrors:t}=a;if(t.length){let d=a.userErrors.map(m=>m.message).join(", ");throw u(new N(d))}return i||r("Failed to update theme"),y({id:f(i.id),name:i.name,role:i.role.toLowerCase()})}async function yn(e,n){s("theme-api:delete-theme");let{themeDelete:a}=await c({query:x,session:n,variables:{id:S(e)},preferredBehaviour:p});a||r("Failed to update theme");let{deletedThemeId:i,userErrors:t}=a;if(t.length){let d=a.userErrors.map(m=>m.message).join(", ");throw u(new N(d))}return i||r("Failed to update theme"),!0}async function Sn(e,n,a){let i;s("theme-api:duplicate-theme");let{themeDuplicate:t}=await c({query:I,session:a,variables:{id:S(e),name:n},preferredBehaviour:p,responseOptions:{onResponse:k=>{i=k.headers.get("x-request-id")??void 0}}});if(!t)return u("Failed to duplicate theme"),{theme:void 0,userErrors:[{message:"Failed to duplicate theme"}],requestId:i};let{newTheme:d,userErrors:m}=t;return m.length>0?{theme:void 0,userErrors:m,requestId:i}:d?{theme:y({id:f(d.id),name:d.name,role:d.role.toLowerCase()}),userErrors:[],requestId:i}:{theme:void 0,userErrors:[{message:"Failed to duplicate theme"}],requestId:i}}async function Fn(e,n){s("theme-api:fetch-metafield-definitions");let{metafieldDefinitions:a}=await c({query:L,session:n,variables:{ownerType:e}});return a.nodes.map(i=>({key:i.key,namespace:i.namespace,name:i.name,description:i.description,type:{name:i.type.name,category:i.type.category}}))}async function bn(e){s("theme-api:check-password-protection");let{onlineStore:n}=await c({query:$,session:e});n||r("Unable to get details about the storefront's password protection");let{passwordProtection:a}=n;return a.enabled}function r(e){throw u(new N(e))}async function b(e){try{return await c(e)}catch(n){throw H(n),n}}function H(e){if(!(e instanceof E))return;let n=Y(e);if(!n)return;let a=[["If you authenticated with an Admin API access token, update the app or integration that issued the token to include the required theme access scopes, then reauthorize it or generate a new token."],["For",{command:"theme pull"},{char:","},{command:"theme list"},{char:","},"and",{command:"theme info"},{char:","},"add the",{command:"read_themes"},"scope",{char:"."}],["For",{command:"theme push"},"and",{command:"theme dev"},{char:","},"add both the",{command:"read_themes"},"and",{command:"write_themes"},"scopes",{char:"."}],["If you authenticated with your Shopify account, make sure your staff or collaborator account can access Online Store themes, then run",{command:"shopify auth logout"},"and try again",{char:"."}],["See",{link:{label:"Shopify access scopes",url:"https://shopify.dev/api/usage/access-scopes"}},{char:"."}]];throw u(new N(`The authenticated account or access token is missing ${n}.`,void 0,a))}function Y(e){let n=e.response.errors;if(!Array.isArray(n))return;let a=n.find(t=>t.extensions?.code==="ACCESS_DENIED");if(!a)return;let i=a.extensions?.requiredAccess;return typeof i!="string"?z:i.trim().replace(/\.$/,"")||z}function D(e){return`gid://shopify/OnlineStoreTheme/${e}`}async function Z(e){switch(e.__typename){case"OnlineStoreThemeFileBodyText":return{value:e.content};case"OnlineStoreThemeFileBodyBase64":return{attachment:e.contentBase64};case"OnlineStoreThemeFileBodyUrl":try{let a=await(await fetch(e.url)).arrayBuffer();return{attachment:Buffer.from(a).toString("base64")}}catch{throw u(new N(`Error downloading content from URL: ${e.url}`))}}}export{re as a,g as b,ne as c,ie as d,ae as e,te as f,rn as g,sn as h,kn as i,un as j,cn as k,pn as l,vn as m,Nn as n,hn as o,fn as p,yn as q,Sn as r,Fn as s,bn as t};
@@ -1 +1 @@
1
- import{b as n}from"./chunk-J3HX6ZGD.js";import{l as i}from"./chunk-TPCG6DCA.js";import{g as t}from"./chunk-VKWPEFWQ.js";t();t();var o=class extends i.ExtendableError{constructor(e,p){super(p),this.type=e}},d=r=>async()=>r,f=r=>async e=>e.provider!==r.provider?n(new o("invalid-provider")):r.action(e.port);var a="cloudflare",l=d({name:a});export{o as a,f as b,a as c,l as d};
1
+ import{b as n}from"./chunk-SXTDVUT3.js";import{l as i}from"./chunk-WKBVT5WG.js";import{g as t}from"./chunk-VKWPEFWQ.js";t();t();var o=class extends i.ExtendableError{constructor(e,p){super(p),this.type=e}},d=r=>async()=>r,f=r=>async e=>e.provider!==r.provider?n(new o("invalid-provider")):r.action(e.port);var a="cloudflare",l=d({name:a});export{o as a,f as b,a as c,l as d};
@@ -1,4 +1,4 @@
1
- import{C as s,u as e,v as o,w as n,x as i,y as t}from"./chunk-NTRAWIEJ.js";import{d,g as l}from"./chunk-TPCG6DCA.js";import{g as r}from"./chunk-VKWPEFWQ.js";r();async function u(){e({headline:"CLI update available.",body:["Run",{command:"npm run shopify upgrade"},{char:"."}]}),e({headline:["To connect this project to your shopify store cd into:",{filePath:"/my-store/hydrogen.config.js"},{char:"."}],body:["You can also try the following steps:",{list:{items:[["Run",{command:"shopify project connect"}],["Run",{command:"hydrogen start"}]]}}]}),e({headline:"About your app.",customSections:[{body:{tabularData:[["Configuration file",{filePath:"shopify.app.scalable-transaction-app.toml"}],["App name",{userInput:"scalable-transaction-app"}],["Access scopes","read_products,write_products"]],firstColumnSubdued:!0}}]}),e({headline:[{userInput:"my-app"},"initialized and ready to build."],nextSteps:[["Run",{command:"cd verification-app"}],["To preview your project, run",{command:"npm app dev"}],["To add extensions, run",{command:"npm generate extension"}]],reference:[["Run",{command:"npm shopify help"}],{link:{label:"Dev docs",url:"https://shopify.dev"}}],customSections:[{title:"Custom section",body:{list:{items:[{link:{label:"Item 1",url:"https://shopify.com"}},"Item 2",{link:{url:"https://community.shopify.com/"}}]}}},{title:"Custom section 2",body:{list:{items:["Item 1","Item 2","Item 3"]}}}]}),o({headline:"CLI updated.",body:"You are now running version 3.47."}),o({headline:"Deployment successful.",body:"Your extensions have been uploaded to your Shopify Partners Dashboard.",nextSteps:[{link:{label:"See your deployment and set it live",url:"https://partners.shopify.com/1797046/apps/4523695/deployments"}}]}),n({headline:"You have reached your limit of checkout extensions for this app.",body:"You can free up space for a new one by deleting an existing one."}),n({headline:"Required access scope update.",body:"The deadline for re-selecting your app scopes is May 1, 2022.",reference:[{link:{label:"Dev docs",url:"https://shopify.dev/app/scopes"}}]});let a=new l("Something went wrong.");a.stack=`
1
+ import{C as s,u as e,v as o,w as n,x as i,y as t}from"./chunk-6EZ7JWBK.js";import{d,g as l}from"./chunk-WKBVT5WG.js";import{g as r}from"./chunk-VKWPEFWQ.js";r();async function u(){e({headline:"CLI update available.",body:["Run",{command:"npm run shopify upgrade"},{char:"."}]}),e({headline:["To connect this project to your shopify store cd into:",{filePath:"/my-store/hydrogen.config.js"},{char:"."}],body:["You can also try the following steps:",{list:{items:[["Run",{command:"shopify project connect"}],["Run",{command:"hydrogen start"}]]}}]}),e({headline:"About your app.",customSections:[{body:{tabularData:[["Configuration file",{filePath:"shopify.app.scalable-transaction-app.toml"}],["App name",{userInput:"scalable-transaction-app"}],["Access scopes","read_products,write_products"]],firstColumnSubdued:!0}}]}),e({headline:[{userInput:"my-app"},"initialized and ready to build."],nextSteps:[["Run",{command:"cd verification-app"}],["To preview your project, run",{command:"npm app dev"}],["To add extensions, run",{command:"npm generate extension"}]],reference:[["Run",{command:"npm shopify help"}],{link:{label:"Dev docs",url:"https://shopify.dev"}}],customSections:[{title:"Custom section",body:{list:{items:[{link:{label:"Item 1",url:"https://shopify.com"}},"Item 2",{link:{url:"https://community.shopify.com/"}}]}}},{title:"Custom section 2",body:{list:{items:["Item 1","Item 2","Item 3"]}}}]}),o({headline:"CLI updated.",body:"You are now running version 3.47."}),o({headline:"Deployment successful.",body:"Your extensions have been uploaded to your Shopify Partners Dashboard.",nextSteps:[{link:{label:"See your deployment and set it live",url:"https://partners.shopify.com/1797046/apps/4523695/deployments"}}]}),n({headline:"You have reached your limit of checkout extensions for this app.",body:"You can free up space for a new one by deleting an existing one."}),n({headline:"Required access scope update.",body:"The deadline for re-selecting your app scopes is May 1, 2022.",reference:[{link:{label:"Dev docs",url:"https://shopify.dev/app/scopes"}}]});let a=new l("Something went wrong.");a.stack=`
2
2
  Error: Unexpected error
3
3
  at Module._compile (internal/modules/cjs/loader.js:1137:30)
4
4
  at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
@@ -1 +1 @@
1
- import{a as s}from"./chunk-N3NE4MVN.js";import{a as e}from"./chunk-ATSMK66C.js";import{a as o}from"./chunk-OU3M32A2.js";import{b as i}from"./chunk-HOSFU6UP.js";import{g as a}from"./chunk-VKWPEFWQ.js";a();var t=class extends i{static{this.description="View all the available UI kit components"}static{this.hiddenAliases=["kitchen-sink all"]}static{this.hidden=!0}async run(){await o(),await e(),await s()}};export{t as a};
1
+ import{a as s}from"./chunk-ZQ5JVD5X.js";import{a as e}from"./chunk-5QQN3SKH.js";import{a as o}from"./chunk-POAICASX.js";import{b as i}from"./chunk-UKK5P74A.js";import{g as a}from"./chunk-VKWPEFWQ.js";a();var t=class extends i{static{this.description="View all the available UI kit components"}static{this.hiddenAliases=["kitchen-sink all"]}static{this.hidden=!0}async run(){await o(),await e(),await s()}};export{t as a};
@@ -1,4 +1,4 @@
1
- import{a as C}from"./chunk-W7DDV2EY.js";import{a as N}from"./chunk-STJ3LWFL.js";import{a as v,b as J}from"./chunk-MIDYZPO4.js";import{a as p}from"./chunk-VJ6KDRZI.js";import{r as E}from"./chunk-5XDQ76DQ.js";import{k as c,m as F,q as S}from"./chunk-TUNUEOHO.js";import{O as w}from"./chunk-G4OQABDT.js";import{b as q,c as D}from"./chunk-OXJBYKMX.js";import{A as T,S as O,v as I,x as u}from"./chunk-NTRAWIEJ.js";import{r as M}from"./chunk-T6CC5WUU.js";import{Lb as a}from"./chunk-7FQFEB33.js";import{e as A,g as h}from"./chunk-VKWPEFWQ.js";h();h();async function _(t,o,e){let{name:r,verbose:d,noColor:l,json:m,force:x}=e,g=O()||x;if(C({verbose:d,noColor:l}),g&&!o){let s="A theme ID is required to duplicate a theme, specify one with the --theme flag";m?a(JSON.stringify({message:s,errors:[]})):u({body:[s]});return}let i=o?await J(t,o):await v(t,{header:"Select a theme to duplicate",filter:{theme:o}});if(!i){let s=`No theme with ID ${o} could be found. Use shopify theme list to find a theme ID.`;m?a(JSON.stringify({message:s,errors:[]})):u({body:[s]});return}if(i?.role==="development"){let s="Development themes can't be duplicated. Use shopify theme push to upload it to the store first.";m?a(JSON.stringify({message:s,errors:[]})):u({body:[s]});return}if(!g&&!await T({message:`Do you want to duplicate '${i.name}' on ${t.storeFqdn}?`,confirmationMessage:`Yes, duplicate '${i.name}'`,cancellationMessage:"No, cancel duplicate"}))return;let b=await E(i.id,r,t);m?j(i,t,b):P(i,t,b)}function P(t,o,e){if(e.userErrors&&e.userErrors.length>0){let r=e.userErrors.map(d=>d.message).join(", ");u({body:["The theme",...p(t),"could not be duplicated due to errors: ",{subdued:r},{char:"."},...e.requestId?[`
1
+ import{a as v,b as J}from"./chunk-VOJWKGCW.js";import{a as C}from"./chunk-OQORDQLH.js";import{a as p}from"./chunk-QMXKGSFH.js";import{a as N}from"./chunk-STJ3LWFL.js";import{r as E}from"./chunk-PJYNAUQB.js";import{p as c,r as F,v as S}from"./chunk-D6YDSGR4.js";import{O as w}from"./chunk-5W443CKL.js";import{b as q,c as D}from"./chunk-H5C3QTOO.js";import{A as T,S as O,v as I,x as u}from"./chunk-6EZ7JWBK.js";import{Lb as a}from"./chunk-DONEJHDG.js";import{r as M}from"./chunk-T6CC5WUU.js";import{e as A,g as h}from"./chunk-VKWPEFWQ.js";h();h();async function _(t,o,e){let{name:r,verbose:d,noColor:l,json:m,force:x}=e,g=O()||x;if(C({verbose:d,noColor:l}),g&&!o){let s="A theme ID is required to duplicate a theme, specify one with the --theme flag";m?a(JSON.stringify({message:s,errors:[]})):u({body:[s]});return}let i=o?await J(t,o):await v(t,{header:"Select a theme to duplicate",filter:{theme:o}});if(!i){let s=`No theme with ID ${o} could be found. Use shopify theme list to find a theme ID.`;m?a(JSON.stringify({message:s,errors:[]})):u({body:[s]});return}if(i?.role==="development"){let s="Development themes can't be duplicated. Use shopify theme push to upload it to the store first.";m?a(JSON.stringify({message:s,errors:[]})):u({body:[s]});return}if(!g&&!await T({message:`Do you want to duplicate '${i.name}' on ${t.storeFqdn}?`,confirmationMessage:`Yes, duplicate '${i.name}'`,cancellationMessage:"No, cancel duplicate"}))return;let b=await E(i.id,r,t);m?j(i,t,b):P(i,t,b)}function P(t,o,e){if(e.userErrors&&e.userErrors.length>0){let r=e.userErrors.map(d=>d.message).join(", ");u({body:["The theme",...p(t),"could not be duplicated due to errors: ",{subdued:r},{char:"."},...e.requestId?[`
2
2
  Request ID: `,{subdued:e.requestId}]:[]]})}else e.theme?I({body:["The theme",...p(t),"has been duplicated",{char:"."}],nextSteps:[[{link:{label:"View the duplicated theme",url:N(e.theme,o)}}]]}):u({body:["The theme",...p(t),"unexpectedly could not be duplicated",{char:"."},...e.requestId?[`
3
3
  Request ID: `,{subdued:e.requestId}]:[]]})}function j(t,o,e){if(e.userErrors&&e.userErrors.length>0)a(JSON.stringify({message:`The theme '${t.name}' could not be duplicated due to errors`,errors:e.userErrors.map(r=>r.message),requestId:e.requestId}));else if(e.theme){let{id:r,name:d,role:l}=e.theme,m={theme:{id:r,name:d,role:l,shop:o.storeFqdn}};a(JSON.stringify(m))}else a(JSON.stringify({message:`The theme '${t.name}' unexpectedly could not be duplicated `,errors:[],requestId:e.requestId}))}var f=A(M(),1);var y,n=class extends S{async run(){let{flags:o}=await this.parse(y),e=F(o),r=await w(e,o.password);await _(r,o.theme,o)}};y=n;n.summary="Duplicates a theme from your theme library.";n.usage=["theme duplicate","theme duplicate --theme 10 --name 'New Theme'"];n.descriptionWithMarkdown=`If you want to duplicate your local theme, you need to run \`shopify theme push\` first.
4
4
 
@@ -0,0 +1,7 @@
1
+ import{g as h}from"./chunk-VKWPEFWQ.js";h();h();var kt=String.fromCharCode;var Y=/\+/g;var Ce=/%2f/gi;function E(e=""){try{return decodeURIComponent(""+e)}catch{return""+e}}function L(e){return E(e.replace(Ce,"%252F"))}function Ae(e){return E(e.replace(Y," "))}function Se(e){return E(e.replace(Y," "))}function xe(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=Ae(n[1]);if(o==="__proto__"||o==="constructor")continue;let s=Se(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 He=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,Pe=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,Ne=/^([/\\]\s*){2,}[^/\\]/;var Oe=/\/$|\/\?|\/#/,Te=/^\.?\//;function Me(e,t={}){return typeof t=="boolean"&&(t={acceptRelative:t}),t.strict?He.test(e):Pe.test(e)||(t.acceptRelative?Ne.test(e):!1)}function q(e="",t){return t?Oe.test(e):e.endsWith("/")}function k(e="",t){if(!t)return(q(e)?e.slice(0,-1):e)||"/";if(!q(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 qe(e="",t){if(!t)return e.endsWith("/")?e:e+"/";if(q(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 Le(e=""){return e.startsWith("/")}function I(e=""){return Le(e)?e:"/"+e}function X(e){return xe(C(e).search)}function ke(e){return e&&e!=="/"}function Z(e,...t){let r=e||"";for(let n of t.filter(o=>ke(o)))if(r){let o=n.replace(Te,"");r=qe(r)+o}else r=n;return r}var Ie=Symbol.for("ufo:protocolRelative");function C(e="",t){let r=e.match(/^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i);if(r){let[,d,l=""]=r;return{protocol:d.toLowerCase(),pathname:l,href:d+l,auth:"",host:"",search:"",hash:""}}if(!Me(e,{acceptRelative:!0}))return t?C(t+e):K(e);let[,n="",o,s=""]=e.replace(/\\/g,"/").match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/)||[],[,a="",u=""]=s.match(/([^#/?]*)(.*)?/)||[];n==="file:"&&(u=u.replace(/\/(?=[A-Za-z]:)/,""));let{pathname:i,search:c,hash:f}=K(u);return{protocol:n.toLowerCase(),auth:o?o.slice(0,Math.max(0,o.length-1)):"",host:a,pathname:i,search:c,hash:f,[Ie]:!n}}function K(e=""){let[t="",r="",n=""]=(e.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:t,search:r,hash:n}}h();var je=(()=>{let e=function(){};return e.prototype=Object.create(null),e})();function v(e,t){if(typeof e!="string")throw new TypeError("argument str must be a string");let r=new je,n=t||{},o=n.decode||De,s=0;for(;s<e.length;){let a=e.indexOf("=",s);if(a===-1)break;let u=e.indexOf(";",s);if(u===-1)u=e.length;else if(u<a){s=e.lastIndexOf(";",a-1)+1;continue}let i=e.slice(s,a).trim();if(n?.filter&&!n?.filter(i)){s=u+1;continue}if(r[i]===void 0){let c=e.slice(a+1,u).trim();c.codePointAt(0)===34&&(c=c.slice(1,-1)),r[i]=Be(c,o)}s=u+1}return r}function De(e){return e.includes("%")?decodeURIComponent(e):e}function Be(e,t){try{return t(e)}catch{return e}}h();var y={NORMAL:0,WILDCARD:1,PLACEHOLDER:2};function re(e={}){let t={options:e,rootNode:ne(),staticRoutesMap:{}},r=n=>e.strictTrailingSlash?n:n.replace(/\/$/,"")||"/";if(e.routes)for(let n in e.routes)ee(t,r(n),e.routes[n]);return{ctx:t,lookup:n=>Ue(t,r(n)),insert:(n,o)=>ee(t,r(n),o),remove:n=>Fe(t,r(n))}}function Ue(e,t){let r=e.staticRoutesMap[t];if(r)return r.data;let n=t.split("/"),o={},s=!1,a=null,u=e.rootNode,i=null;for(let c=0;c<n.length;c++){let f=n[c];u.wildcardChildNode!==null&&(a=u.wildcardChildNode,i=n.slice(c).join("/"));let d=u.children.get(f);if(d===void 0){if(u&&u.placeholderChildren.length>1){let l=n.length-c;u=u.placeholderChildren.find(M=>M.maxDepth===l)||null}else u=u.placeholderChildren[0]||null;if(!u)break;u.paramName&&(o[u.paramName]=f),s=!0}else u=d}return(u===null||u.data===null)&&a!==null&&(u=a,o[u.paramName||"_"]=i,s=!0),u?s?{...u.data,params:s?o:void 0}:u.data:null}function ee(e,t,r){let n=!0,o=t.split("/"),s=e.rootNode,a=0,u=[s];for(let i of o){let c;if(c=s.children.get(i))s=c;else{let f=$e(i);c=ne({type:f,parent:s}),s.children.set(i,c),f===y.PLACEHOLDER?(c.paramName=i==="*"?`_${a++}`:i.slice(1),s.placeholderChildren.push(c),n=!1):f===y.WILDCARD&&(s.wildcardChildNode=c,c.paramName=i.slice(3)||"_",n=!1),u.push(c),s=c}}for(let[i,c]of u.entries())c.maxDepth=Math.max(u.length-i,c.maxDepth||0);return s.data=r,n===!0&&(e.staticRoutesMap[t]=s),s}function Fe(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||y.NORMAL,maxDepth:0,parent:e.parent||null,children:new Map,data:e.data||null,paramName:e.paramName||null,wildcardChildNode:null,placeholderChildren:[]}}function $e(e){return e.startsWith("**")?y.WILDCARD:e[0]===":"||e==="*"?y.PLACEHOLDER:y.NORMAL}function oe(e){let t=ae("",e.ctx.rootNode);return We(t,e.ctx.options.strictTrailingSlash)}function We(e,t){return{ctx:{table:e},matchAll:r=>se(r,e,t)}}function ze(){return{static:new Map,wildcard:new Map,dynamic:new Map}}function se(e,t,r){r!==!0&&e.endsWith("/")&&(e=e.slice(0,-1)||"/");let n=[];for(let[s,a]of te(t.wildcard))(e===s||e.startsWith(s+"/"))&&n.push(a);for(let[s,a]of te(t.dynamic))if(e.startsWith(s+"/")){let u="/"+e.slice(s.length).split("/").splice(2).join("/");n.push(...se(u,a))}let o=t.static.get(e);return o&&n.push(o),n.filter(Boolean)}function te(e){return[...e.entries()].sort((t,r)=>t[0].length-r[0].length)}function ae(e,t){let r=ze();function n(o,s){if(o){if(s.type===y.NORMAL&&!(o.includes("*")||o.includes(":")))s.data&&r.static.set(o,s.data);else if(s.type===y.WILDCARD)r.wildcard.set(o.replace("/**",""),s.data);else if(s.type===y.PLACEHOLDER){let a=ae("",s);s.data&&a.static.set("/",s.data),r.dynamic.set(o.replace(/\/\*|\/:\w+/,""),a);return}}for(let[a,u]of s.children.entries())n(`${o}/${a}`.replace("//","/"),u)}return n(e,t),r}h();function j(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 D(e,t,r=".",n){if(!j(t))return D(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]]:j(a)&&j(o[s])?o[s]=D(a,o[s],(r?`${r}.`:"")+s.toString(),n):o[s]=a))}return o}function B(e){return(...t)=>t.reduce((r,n)=>D(r,n,"",e),{})}var ie=B(),$t=B((e,t,r)=>{if(e[t]!==void 0&&typeof r=="function")return e[t]=r(e[t]),!0}),Wt=B((e,t,r)=>{if(Array.isArray(e[t])&&typeof r=="function")return e[t]=r(e[t]),!0});h();var Je=/"(?:_|\\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*:/,Qe=/"(?: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*:/,Ve=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function Ge(e,t){if(e==="__proto__"||e==="constructor"&&t&&typeof t=="object"&&"prototype"in t){Ke(e);return}return t}function Ke(e){console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`)}function ce(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(!Ve.test(e)){if(t.strict)throw new SyntaxError("[destr] Invalid JSON");return e}try{if(Je.test(e)||Qe.test(e)){if(t.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(e,Ge)}return JSON.parse(e)}catch(n){if(t.strict)throw n;return e}}function b(e,t){try{return t in e}catch{return!1}}var N=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:_(this.statusCode,500)};return this.statusMessage&&(t.statusMessage=O(this.statusMessage)),this.data!==void 0&&(t.data=this.data),t}};function p(e){if(typeof e=="string")return new N(e);if(Q(e))return e;let t=new N(e.message??e.statusMessage??"",{cause:e.cause||e});if(b(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.statusCode,t.statusCode):e.status&&(t.statusCode=_(e.status,t.statusCode)),e.statusMessage?t.statusMessage=e.statusMessage:e.statusText&&(t.statusMessage=e.statusText),t.statusMessage){let r=t.statusMessage;O(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 Ye(e,t,r){if(e.handled)return;let n=Q(t)?t:p(t),o={statusCode:n.statusCode,statusMessage:n.statusMessage,stack:[],data:n.data};if(r&&(o.stack=(n.stack||"").split(`
2
+ `).map(a=>a.trim())),e.handled)return;let s=Number.parseInt(n.statusCode);x(e,s,n.statusMessage),e.node.res.setHeader("content-type",S.json),e.node.res.end(JSON.stringify(o,void 0,2))}function Q(e){return e?.constructor?.__h3_error__===!0}function rr(e){return X(e.path||"")}function nr(e,t={}){let r=e.context.params||{};if(t.decode){r={...r};for(let n in r)r[n]=E(r[n])}return r}function Xe(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 Ze(e,t,r){if(!Xe(e,t,r))throw p({statusCode:405,statusMessage:"HTTP method is not allowed."})}function he(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 g(e,t){return he(e)[t.toLowerCase()]}var ue=g;function or(e,t={}){if(e.context.clientAddress)return e.context.clientAddress;if(t.xForwardedFor){let r=g(e,"x-forwarded-for")?.split(",").shift()?.trim();if(r)return r}if(e.node.req.socket.remoteAddress)return e.node.req.socket.remoteAddress}var $=Symbol.for("h3RawBody"),U=Symbol.for("h3ParsedBody"),pe=["PATCH","POST","PUT","DELETE"];function me(e,t="utf8"){Ze(e,pe);let r=e._requestBody||e.web?.request?.body||e.node.req[$]||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((u,i)=>{let c=[];a.pipeTo(new WritableStream({write(f){c.push(f)},close(){u(Buffer.concat(c))},abort(f){i(f)}})).catch(i)}):typeof a.pipe=="function"?new Promise((u,i)=>{let c=[];a.on("data",f=>{c.push(f)}).on("end",()=>{u(Buffer.concat(c))}).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(u=>Buffer.from(u)):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[$]=new Promise((s,a)=>{let u=[];e.node.req.on("error",i=>{a(i)}).on("data",i=>{u.push(i)}).on("end",()=>{s(Buffer.concat(u))})});return t?n.then(s=>s.toString(t)):n}async function sr(e,t={}){let r=e.node.req;if(b(r,U))return r[U];let n=r.headers["content-type"]||"",o=await me(e),s;return n==="application/json"?s=fe(o,t.strict??!0):n.startsWith("application/x-www-form-urlencoded")?s=ve(o):n.startsWith("text/")?s=o:s=fe(o,t.strict??!1),r[U]=s,s}function ar(e){if(!pe.includes(e.method))return;let t=e.web?.request?.body||e._requestBody;return t||($ 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 me(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 fe(e="",t){if(e)try{return ce(e,{strict:t})}catch{throw p({statusCode:400,statusMessage:"Bad Request",message:"Invalid JSON body"})}}function ve(e){let t=new URLSearchParams(e),r=Object.create(null);for(let[n,o]of t.entries())b(r,n)?(Array.isArray(r[n])||(r[n]=[r[n]]),r[n].push(o)):r[n]=o;return r}var S={html:"text/html",json:"application/json"},et=/[^\u0009\u0020-\u007E]/g;function O(e=""){return e.replace(et,"")}function _(e,t=200){return!e||(typeof e=="string"&&(e=Number.parseInt(e,10)),e<100||e>999)?t:e}function tt(e){return v(e.node.req.headers.cookie||"")}function ir(e,t){return tt(e)[t]}function ye(e){if(Array.isArray(e))return e.flatMap(f=>ye(f));if(typeof e!="string")return[];let t=[],r=0,n,o,s,a,u,i=()=>{for(;r<e.length&&/\s/.test(e.charAt(r));)r+=1;return r<e.length},c=()=>(o=e.charAt(r),o!=="="&&o!==";"&&o!==",");for(;r<e.length;){for(n=r,u=!1;i();)if(o=e.charAt(r),o===","){for(s=r,r+=1,i(),a=r;r<e.length&&c();)r+=1;r<e.length&&e.charAt(r)==="="?(u=!0,r=a,t.push(e.slice(n,s)),n=r):r=s+1}else r+=1;(!u||r>=e.length)&&t.push(e.slice(n))}return t}var rt=typeof setImmediate>"u"?e=>e():setImmediate;function m(e,t,r){return r&&nt(e,r),new Promise(n=>{rt(()=>{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=_(t,204);r===204&&e.node.res.removeHeader("content-length"),e.node.res.writeHead(r),e.node.res.end()}function x(e,t,r){t&&(e.node.res.statusCode=_(t,e.node.res.statusCode)),r&&(e.node.res.statusMessage=O(r))}function nt(e,t){t&&e.node.res.statusCode!==304&&!e.node.res.getHeader("content-type")&&e.node.res.setHeader("content-type",t)}function cr(e,t,r=302){e.node.res.statusCode=_(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 m(e,o,S.html)}function A(e,t){return e.node.res.getHeader(t)}function ot(e,t){for(let[r,n]of Object.entries(t))e.node.res.setHeader(r,n)}function R(e,t,r){e.node.res.setHeader(t,r)}function st(e,t){for(let[r,n]of Object.entries(t))at(e,r,n)}var w=st;function at(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 we(e){return!e||typeof e!="object"?!1:typeof e.pipe=="function"&&(typeof e._read=="function"||typeof e.abort=="function")||typeof e.pipeTo=="function"}function it(e){return typeof Response<"u"&&e instanceof Response}function T(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(b(t,"pipeTo")&&typeof t.pipeTo=="function")return t.pipeTo(new WritableStream({write(r){e.node.res.write(r)}})).then(()=>{e.node.res.end()});if(b(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 _e(e,t){for(let[r,n]of t.headers)r==="set-cookie"?e.node.res.appendHeader(r,ye(n)):e.node.res.setHeader(r,n);if(t.status&&(e.node.res.statusCode=_(t.status,e.node.res.statusCode)),t.statusText&&(e.node.res.statusMessage=O(t.statusText)),t.redirected&&e.node.res.setHeader("location",t.url),!t.body){e.node.res.end();return}return T(e,t.body)}function ct(e={}){return ie(e,{origin:"*",methods:"*",allowHeaders:"*",exposeHeaders:"*",credentials:!1,maxAge:!1,preflight:{statusCode:204}})}function ut(e){let t=g(e,"origin"),r=g(e,"access-control-request-method");return e.method==="OPTIONS"&&!!t&&!!r}function ft(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 Re(e,t){let{origin:r}=t,n=g(e,"origin");return!n||!r||r==="*"?{"access-control-allow-origin":"*"}:typeof r=="string"?{"access-control-allow-origin":r,vary:"origin"}:ft(n,t)?{"access-control-allow-origin":n,vary:"origin"}:{}}function dt(e){let{methods:t}=e;return t?t==="*"?{"access-control-allow-methods":"*"}:t.length>0?{"access-control-allow-methods":t.join(",")}:{}:{}}function be(e){let{credentials:t}=e;return t?{"access-control-allow-credentials":"true"}:{}}function lt(e,t){let{allowHeaders:r}=t;if(!r||r==="*"||r.length===0){let n=g(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 Ee(e){let{exposeHeaders:t}=e;return t?t==="*"?{"access-control-expose-headers":t}:{"access-control-expose-headers":t.join(",")}:{}}function ht(e,t){w(e,Re(e,t)),w(e,be(t)),w(e,Ee(t)),w(e,dt(t)),w(e,lt(e,t))}function pt(e,t){w(e,Re(e,t)),w(e,be(t)),w(e,Ee(t))}function ur(e,t){let r=ct(t);return ut(e)?(ht(e,t),ge(e,r.preflight.statusCode),!0):(pt(e,t),!1)}var mt=new Set(["transfer-encoding","accept-encoding","connection","keep-alive","upgrade","expect","host","accept"]);function fr(e,t){let r=Object.create(null),n=he(e);for(let o in n)(!mt.has(o)||o==="host"&&t?.host)&&(r[o]=n[o]);return r}function P(e){let t="";e.id&&(t+=`id: ${de(e.id)}
3
+ `),e.event&&(t+=`event: ${de(e.event)}
4
+ `),typeof e.retry=="number"&&Number.isInteger(e.retry)&&(t+=`retry: ${e.retry}
5
+ `);let r=typeof e.data=="string"?e.data:"";for(let n of r.split(/\r\n|\r|\n/))t+=`data: ${n}
6
+ `;return t+=`
7
+ `,t}function de(e){return e.replace(/[\n\r]/g,"")}function yt(e){let t="";for(let r of e)t+=P(r);return t}function gt(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"};wt(e)||(t.Connection="keep-alive"),ot(e,t)}function wt(e){return ue(e,":path")!==void 0&&ue(e,":method")!==void 0}var W=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=P(t);return}if(this._paused){this._unsentData+=P(t);return}await this._writer.write(this._encoder.encode(P(t))).catch()}}async _sendEvents(t){if(this._writerIsClosed)return;let r=yt(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(){gt(this._h3Event),x(this._h3Event,200),this._h3Event._handled=!0,this._handled=!0,await T(this._h3Event,this._transformStream.readable)}};function dr(e,t){return new W(e,t)}async function lr(e,t){if(e.method!=="GET"&&e.method!=="HEAD"){if(!t.fallthrough)throw p({statusMessage:"Method Not Allowed",statusCode:405});return!1}let r=I(k(C(e.path).pathname));if(/(^|[\\/])(\.\.|%2e%2e|%2e\.|\.%2e)($|[\\/])/i.test(r)){if(!t.fallthrough)throw p({statusCode:404});return!1}let n=_t(g(e,"accept-encoding"),t.encodings);n.length>1&&R(e,"vary","accept-encoding");let o=r,s,a=Rt(r,n,t.indexNames||["/index.html"]);for(let c of a){let f=await t.getMeta(c);if(f){s=f,o=c;break}}if(!s){if(!t.fallthrough)throw p({statusCode:404});return!1}if(s.etag&&!A(e,"etag")&&R(e,"etag",s.etag),s.etag&&g(e,"if-none-match")===s.etag)return x(e,304,"Not Modified"),m(e,"");if(s.mtime){let c=new Date(s.mtime),f=g(e,"if-modified-since");if(f&&new Date(f)>=c)return x(e,304,"Not Modified"),m(e,null);A(e,"last-modified")||R(e,"last-modified",c.toUTCString())}if(s.type&&!A(e,"content-type")&&R(e,"content-type",s.type),s.encoding&&!A(e,"content-encoding")&&R(e,"content-encoding",s.encoding),s.size!==void 0&&s.size>0&&!A(e,"content-length")&&R(e,"content-length",s.size),e.method==="HEAD")return m(e,null);let i=await t.getContents(o);return we(i)?T(e,i):m(e,i)}function _t(e,t){return!t||!e?[]:String(e||"").split(",").map(r=>t[r.trim()]).filter(Boolean)}function Rt(e,t,r){let n=[];for(let o of["",...r])for(let s of[...t,""])n.push(`${e}${o}${s}`);return n}var z=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=Et(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=>_e(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 bt(e,t){return new z(e,t)}function Et(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 Ct(e){if(typeof e=="function")return e.__is_handler__=!0,e;let t={onRequest:le(e.onRequest),onBeforeResponse:le(e.onBeforeResponse)},r=n=>At(n,e.handler,t);return r.__is_handler__=!0,r.__resolve__=e.handler.__resolve__,r.__websocket__=e.websocket,r}function le(e){return e?Array.isArray(e)?e:[e]:void 0}async function At(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 V=Ct;function St(e){return b(e,"__is_handler__")}function G(e,t,r){return e}function xt(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:G(s.default||s)},r})),t),o=V(s=>r?r.handler(s):n().then(a=>a.handler(s)));return o.__resolve__=n,o}var Ht=xt,hr=globalThis.Headers,pr=globalThis.Response;function mr(e={}){let t=[],r=Pt(t,e),n=Nt(t);r.__resolve__=n;let o=Tt(()=>qt(n,e)),s={use:(a,u,i)=>J(s,a,u,i),resolve:n,handler:r,stack:t,options:e,get websocket(){return o()}};return s}function J(e,t,r,n){if(Array.isArray(t))for(let o of t)J(e,o,r,n);else if(Array.isArray(r))for(let o of r)J(e,t,o,n);else typeof t=="string"?e.stack.push(F({...n,route:t,handler:r})):typeof t=="function"?e.stack.push(F({...r,handler:t})):e.stack.push(F({...t}));return e}function Pt(e,t){let r=t.debug?2:void 0;return V(async n=>{n.node.req.originalUrl=n.node.req.originalUrl||n.node.req.url||"/";let o=n.node.req.url||"/",s=Mt(n._path||o);n._path=s;let a=s!==o,u;t.onRequest&&await t.onRequest(n);for(let i of e){if(i.route.length>1){if(!s.startsWith(i.route))continue;u=s.slice(i.route.length)||"/"}else u=s;if(i.match&&!i.match(u,n))continue;n._path=u,n.node.req.url=a?i.route.length>1?o.slice(i.route.length)||"/":o:u;let c=await i.handler(n),f=c===void 0?void 0:await c;if(f!==void 0){let d={body:f};t.onBeforeResponse&&(n._onBeforeResponseCalled=!0,await t.onBeforeResponse(n,d)),await Ot(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 p({statusCode:404,statusMessage:`Cannot find any path matching ${n.path||"/"}.`});t.onAfterResponse&&(n._onAfterResponseCalled=!0,await t.onAfterResponse(n,void 0))})}function Nt(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:Z(o.route||"/",s.route||"/")}}return o}}}function F(e){let t=e.handler;return t.handler&&(t=t.handler),e.lazy?t=Ht(t):St(t)||(t=G(t,void 0,e.route)),{route:k(e.route),match:e.match,handler:t}}function Ot(e,t,r){if(t===null)return ge(e);if(t){if(it(t))return _e(e,t);if(we(t))return T(e,t);if(t.buffer)return m(e,t);if(t.arrayBuffer&&typeof t.arrayBuffer=="function")return t.arrayBuffer().then(o=>m(e,Buffer.from(o),t.type));if(t instanceof Error)throw p(t);if(typeof t.end=="function")return!0}let n=typeof t;if(n==="string")return m(e,t,S.html);if(n==="object"||n==="boolean"||n==="number")return m(e,JSON.stringify(t,void 0,r),S.json);if(n==="bigint")return m(e,t.toString(),S.json);throw p({statusCode:500,statusMessage:`[h3] Cannot send ${n} as response.`})}function Tt(e){let t;return()=>(t||(t=e()),t)}function Mt(e){let t=e.indexOf("?"),r=t===-1?e:e.slice(0,t),n=t===-1?"":e.slice(t);return(r.includes("%25")?L(r.replace(/%25/g,"%2525")):L(r))+n}function qt(e,t){return{...t.websocket,async resolve(r){let n=r.request?.url||r.url||"/",{pathname:o}=typeof n=="string"?C(n):n;return(await e(o))?.handler?.__websocket__||{}}}}var Lt=["connect","delete","get","head","options","post","put","trace","patch"];function yr(e={}){let t=re({}),r={},n,o={},s=(i,c,f)=>{let d=r[i];if(d||(r[i]=d={path:i,handlers:{}},t.insert(i,d)),Array.isArray(f))for(let l of f)s(i,c,l);else d.handlers[f]=G(c);return o};o.use=o.add=(i,c,f)=>s(i,c,f||"all");for(let i of Lt)o[i]=(c,f)=>o.add(c,f,i);let a=(i="/",c="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:p({statusCode:404,name:"Not Found",statusMessage:`Cannot find any route matching ${i||"/"}.`})};let l=d.handlers[c]||d.handlers.all;if(!l){n||(n=oe(t));let M=n.matchAll(i).reverse();for(let H of M){if(H.handlers[c]){l=H.handlers[c],d.handlers[c]=d.handlers[c]||l;break}if(H.handlers.all){l=H.handlers.all,d.handlers.all=d.handlers.all||l;break}}}return l?{matched:d,handler:l}:{error:p({statusCode:405,name:"Method Not Allowed",statusMessage:`Method ${c} is not allowed on this route.`})}},u=e.preemptive||e.preemtive;return o.handler=V(i=>{let c=a(i.path,i.method.toLowerCase());if("error"in c){if(u)throw c.error;return}i.context.matchedRoute=c.matched;let f=c.matched.params||{};return i.context.params=f,Promise.resolve(c.handler(i)).then(d=>d===void 0&&u?null:d)}),o.handler.__resolve__=async i=>{i=I(i);let c=a(i);if("error"in c)return;let f={route:c.matched.path,handler:c.handler};if(c.handler.__resolve__){let d=await c.handler.__resolve__(i);if(!d)return;f={...f,...d}}return f},o}function gr(e){return async function(r,n){let o=bt(r,n);try{await e.handler(o)}catch(s){let a=p(s);if(Q(s)||(a.unhandled=!0),x(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 Ye(o,a,!!e.options.debug),e.options.onAfterResponse&&!o._onAfterResponseCalled&&await e.options.onAfterResponse(o,{body:a})}}}export{p as a,Ye as b,rr as c,nr as d,he as e,g as f,or as g,sr as h,ar as i,ir as j,m as k,x as l,cr as m,R as n,ur as o,fr as p,dr as q,lr as r,Ct as s,xt as t,mr as u,yr as v,gr as w};
@@ -1,4 +1,4 @@
1
- import{a as o}from"./chunk-GCN4O7HM.js";import{q as i}from"./chunk-HDC5V7RY.js";import{b as r}from"./chunk-HOSFU6UP.js";import{u as e}from"./chunk-NTRAWIEJ.js";import{g as a}from"./chunk-VKWPEFWQ.js";a();var t=class extends r{static{this.summary="Check whether auto-upgrade is enabled, disabled, or not yet configured."}static{this.descriptionWithMarkdown=`Check whether auto-upgrade is enabled, disabled, or not yet configured.
1
+ import{a as o}from"./chunk-GCN4O7HM.js";import{q as i}from"./chunk-KN3FTJDU.js";import{b as r}from"./chunk-UKK5P74A.js";import{u as e}from"./chunk-6EZ7JWBK.js";import{g as a}from"./chunk-VKWPEFWQ.js";a();var t=class extends r{static{this.summary="Check whether auto-upgrade is enabled, disabled, or not yet configured."}static{this.descriptionWithMarkdown=`Check whether auto-upgrade is enabled, disabled, or not yet configured.
2
2
 
3
3
  When auto-upgrade is enabled, Shopify CLI automatically updates to the latest version after each command.
4
4
 
@@ -1 +1 @@
1
- import{c as d}from"./chunk-5XDQ76DQ.js";import{xa as i}from"./chunk-G4OQABDT.js";import{A as s,D as a,w as m,x as u}from"./chunk-NTRAWIEJ.js";import{g as c}from"./chunk-VKWPEFWQ.js";c();function f(e){return[`'${e.name}'`,{subdued:`(#${e.id})`}]}function y(e){return{list:{items:e.map(f)}}}async function T(e,r="It doesn't seem like you're running this command in a theme directory.",o,n){if(e)return!0;if(n)return u({headline:o?`Environment: ${o}`:"",body:r}),!1;if(m({body:r}),!process.stdout.isTTY)return!0;let t=await s({message:"Do you want to proceed?"});return i(`theme-service:confirm-directory:${t}`),t}async function v(e,r,o){if(e.role!==d||!process.stdout.isTTY||o)return!0;let n=`You're about to ${r} on your live theme "${e.name}". This will make changes visible to customers. Are you sure you want to proceed?`,t=await s({message:n,confirmationMessage:"Yes, proceed with live theme",cancellationMessage:"No, cancel"});return i(`theme-service:confirm-live-theme:${t}`),t}async function E(e,r,o=!1){e.length>0&&await a(e,{renderOptions:{stdout:r??process.stderr},noProgressBar:o})}export{f as a,y as b,T as c,v as d,E as e};
1
+ import{c as d}from"./chunk-PJYNAUQB.js";import{xa as i}from"./chunk-5W443CKL.js";import{A as s,D as a,w as m,x as u}from"./chunk-6EZ7JWBK.js";import{g as c}from"./chunk-VKWPEFWQ.js";c();function f(e){return[`'${e.name}'`,{subdued:`(#${e.id})`}]}function y(e){return{list:{items:e.map(f)}}}async function T(e,r="It doesn't seem like you're running this command in a theme directory.",o,n){if(e)return!0;if(n)return u({headline:o?`Environment: ${o}`:"",body:r}),!1;if(m({body:r}),!process.stdout.isTTY)return!0;let t=await s({message:"Do you want to proceed?"});return i(`theme-service:confirm-directory:${t}`),t}async function v(e,r,o){if(e.role!==d||!process.stdout.isTTY||o)return!0;let n=`You're about to ${r} on your live theme "${e.name}". This will make changes visible to customers. Are you sure you want to proceed?`,t=await s({message:n,confirmationMessage:"Yes, proceed with live theme",cancellationMessage:"No, cancel"});return i(`theme-service:confirm-live-theme:${t}`),t}async function E(e,r,o=!1){e.length>0&&await a(e,{renderOptions:{stdout:r??process.stderr},noProgressBar:o})}export{f as a,y as b,T as c,v as d,E as e};
@@ -1 +1 @@
1
- import{Ga as r}from"./chunk-4QTEPWEJ.js";import{a}from"./chunk-QDVJJKLB.js";import{q as i}from"./chunk-773TIA5M.js";import{g as e}from"./chunk-VKWPEFWQ.js";e();var c=3e3;async function n(o){let t;try{if(a.getAllPublicMetadata().api_key!==void 0)return;await Promise.race([r({directory:o,skipPrompts:!0}),new Promise(l=>{t=setTimeout(l,c)})])}catch{}finally{t&&clearTimeout(t)}}var m=async()=>(await n(i()),a.getAllPublicMetadata()),f=m;export{f as a};
1
+ import{Ga as r}from"./chunk-ATXODH6C.js";import{a}from"./chunk-J5TNYNR5.js";import{q as i}from"./chunk-773TIA5M.js";import{g as e}from"./chunk-VKWPEFWQ.js";e();var c=3e3;async function n(o){let t;try{if(a.getAllPublicMetadata().api_key!==void 0)return;await Promise.race([r({directory:o,skipPrompts:!0}),new Promise(l=>{t=setTimeout(l,c)})])}catch{}finally{t&&clearTimeout(t)}}var m=async()=>(await n(i()),a.getAllPublicMetadata()),f=m;export{f as a};
@@ -1 +1 @@
1
- import{a as i}from"./chunk-ATSMK66C.js";import{b as e}from"./chunk-HOSFU6UP.js";import{g as o}from"./chunk-VKWPEFWQ.js";o();var t=class extends e{static{this.description="View the UI kit components prompts"}static{this.hidden=!0}async run(){await i()}};export{t as a};
1
+ import{a as i}from"./chunk-5QQN3SKH.js";import{b as e}from"./chunk-UKK5P74A.js";import{g as o}from"./chunk-VKWPEFWQ.js";o();var t=class extends e{static{this.description="View the UI kit components prompts"}static{this.hidden=!0}async run(){await i()}};export{t as a};
@@ -1 +1 @@
1
- import{b as u,c as d}from"./chunk-7572RLUP.js";import{a as m}from"./chunk-S7F5KFQP.js";import{a}from"./chunk-5BKCIDMS.js";import{Ga as c,q as p}from"./chunk-4QTEPWEJ.js";import{b as e}from"./chunk-OXJBYKMX.js";import{v as n}from"./chunk-NTRAWIEJ.js";import{g as i}from"./chunk-VKWPEFWQ.js";i();var s,o=class extends m{async run(){let{flags:t}=await this.parse(s),{app:r}=await c({directory:t.path,userProvidedConfigName:t.config}),l=await d(r,t.path);return await p(l,{app:r,stdout:process.stdout,stderr:process.stderr,useTasks:!0,environment:"production"}),n({headline:"Function built successfully."}),{app:r}}};s=o;o.summary="Compile a function to wasm.";o.descriptionWithMarkdown="Compiles the function in your current directory to WebAssembly (Wasm) for testing purposes.";o.description=s.descriptionWithoutMarkdown();o.flags={...e,...a,...u};var k=o;export{k as a};
1
+ import{b as u,c as d}from"./chunk-7UOPCYMV.js";import{a as m}from"./chunk-MQICT2LR.js";import{a}from"./chunk-ZAMDXIVC.js";import{Ga as c,q as p}from"./chunk-ATXODH6C.js";import{b as e}from"./chunk-H5C3QTOO.js";import{v as n}from"./chunk-6EZ7JWBK.js";import{g as i}from"./chunk-VKWPEFWQ.js";i();var s,o=class extends m{async run(){let{flags:t}=await this.parse(s),{app:r}=await c({directory:t.path,userProvidedConfigName:t.config}),l=await d(r,t.path);return await p(l,{app:r,stdout:process.stdout,stderr:process.stderr,useTasks:!0,environment:"production"}),n({headline:"Function built successfully."}),{app:r}}};s=o;o.summary="Compile a function to wasm.";o.descriptionWithMarkdown="Compiles the function in your current directory to WebAssembly (Wasm) for testing purposes.";o.description=s.descriptionWithoutMarkdown();o.flags={...e,...a,...u};var k=o;export{k as a};
@@ -1 +1 @@
1
- import{b as n}from"./chunk-HOSFU6UP.js";import{u as t}from"./chunk-NTRAWIEJ.js";import{k as r}from"./chunk-S5IFJ737.js";import{g as o}from"./chunk-VKWPEFWQ.js";o();var e=class extends n{static{this.description="Run CLI doctor-release tests"}static{this.hidden=!0}async run(){r()&&t({headline:"Shopify CLI Doctor Release.",body:["Available doctor-release commands:",""," shopify doctor-release theme -e <environment> Run all theme command tests","","The -e/--environment flag is required to specify the store configuration.","Use --help with any command for more options."]})}};export{e as a};
1
+ import{b as n}from"./chunk-UKK5P74A.js";import{u as t}from"./chunk-6EZ7JWBK.js";import{k as r}from"./chunk-KKUDXLK2.js";import{g as o}from"./chunk-VKWPEFWQ.js";o();var e=class extends n{static{this.description="Run CLI doctor-release tests"}static{this.hidden=!0}async run(){r()&&t({headline:"Shopify CLI Doctor Release.",body:["Available doctor-release commands:",""," shopify doctor-release theme -e <environment> Run all theme command tests","","The -e/--environment flag is required to specify the store configuration.","Use --help with any command for more options."]})}};export{e as a};
@@ -1,4 +1,4 @@
1
- import{ha as a,i}from"./chunk-4QTEPWEJ.js";import{Fb as e,Hb as r}from"./chunk-7FQFEB33.js";import{g as u}from"./chunk-VKWPEFWQ.js";u();async function f(n,t,o){return c(n,t,o,"text")}async function c(n,t,o,S){return await a(t,o.source),S==="json"?r`${e.json({SHOPIFY_API_KEY:t.apiKey,SHOPIFY_API_SECRET:t.apiSecretKeys[0]?.secret,SCOPES:i(n.configuration)})}`:r`
1
+ import{ha as a,i}from"./chunk-ATXODH6C.js";import{Fb as e,Hb as r}from"./chunk-DONEJHDG.js";import{g as u}from"./chunk-VKWPEFWQ.js";u();async function f(n,t,o){return c(n,t,o,"text")}async function c(n,t,o,S){return await a(t,o.source),S==="json"?r`${e.json({SHOPIFY_API_KEY:t.apiKey,SHOPIFY_API_SECRET:t.apiSecretKeys[0]?.secret,SCOPES:i(n.configuration)})}`:r`
2
2
  ${e.green("SHOPIFY_API_KEY")}=${t.apiKey}
3
3
  ${e.green("SHOPIFY_API_SECRET")}=${t.apiSecretKeys[0]?.secret??""}
4
4
  ${e.green("SCOPES")}=${i(n.configuration)}
@@ -1 +1 @@
1
- import{a as b}from"./chunk-EKVTNWHM.js";import{a as k}from"./chunk-5BKCIDMS.js";import{Fa as N,ga as x}from"./chunk-4QTEPWEJ.js";import{b as C,c as R}from"./chunk-OXJBYKMX.js";import{C as y}from"./chunk-NTRAWIEJ.js";import{d as v}from"./chunk-TPCG6DCA.js";import{Fb as w,Hb as E,Lb as L,Mb as m,Vb as T,ca as h}from"./chunk-7FQFEB33.js";import{u as A}from"./chunk-A4SBXDZB.js";import{j as u}from"./chunk-773TIA5M.js";import{g as l}from"./chunk-VKWPEFWQ.js";l();l();var M=12;async function S(p,t,o){let n=await p.appVersions(t);if(!n.app)throw new v(`Invalid API Key: ${t.apiKey}`);let a=n.app.appVersions.nodes.map(e=>{let r=e.message??"";return{...e,status:e.status==="active"&&!o?A.green(`\u2605 ${e.status}`):e.status,createdBy:e.createdBy?.displayName??"",createdAt:h(new Date(e.createdAt)),message:r}});if(!o){let e=(process.stdout.columns??75)-M,r=e;a.forEach(s=>{let f=s.message.length+(s.versionTag?.length??0)+T(s.status).length+s.createdAt.length+s.createdBy.length;if(f>e){let I=f-s.message.length,g=Math.max(e-I,10);g<r&&(r=g)}}),a.forEach(s=>{s.message.length>r&&(s.message=`${s.message.slice(0,r-3)}...`)})}return{appVersions:a,totalResults:n.app.appVersions.pageInfo.totalResults,app:n.app}}async function c(p){let{remoteApp:t,developerPlatformClient:o,organization:n}=p,{appVersions:a,totalResults:e}=await S(o,t,p.json);if(p.json)return L(JSON.stringify(a,null,2));if(x({org:n.businessName,appName:t.title,configFile:u(p.app.configPath)}),a.length===0){m("No app versions found for this app");return}y({rows:a,columns:{versionTag:{header:"VERSION"},status:{header:"STATUS"},message:{header:"MESSAGE"},createdAt:{header:"DATE CREATED"},createdBy:{header:"CREATED BY"}}});let r=w.link(o.webUiName,[await o.appDeepLink(t),"versions"].join("/"));m(E`\nView all ${String(e)} app versions in the ${r}`)}var d,i=class extends b{async run(){let{flags:t}=await this.parse(d),{app:o,remoteApp:n,developerPlatformClient:a,organization:e}=await N({directory:t.path,clientId:t["client-id"],forceRelink:t.reset,userProvidedConfigName:t.config});return await c({app:o,remoteApp:n,organization:e,developerPlatformClient:a,json:t.json}),{app:o}}};d=i;i.summary="List deployed versions of your app.";i.descriptionWithMarkdown="Lists the deployed app versions. An app version is a snapshot of your app extensions.";i.description=d.descriptionWithoutMarkdown();i.flags={...C,...k,...R};var J=i;export{J as a};
1
+ import{a as b}from"./chunk-HM5H7WBE.js";import{a as k}from"./chunk-ZAMDXIVC.js";import{Fa as N,ga as x}from"./chunk-ATXODH6C.js";import{b as C,c as R}from"./chunk-H5C3QTOO.js";import{C as y}from"./chunk-6EZ7JWBK.js";import{d as v}from"./chunk-WKBVT5WG.js";import{Fb as w,Hb as E,Lb as L,Mb as m,Vb as T,ca as h}from"./chunk-DONEJHDG.js";import{u as A}from"./chunk-A4SBXDZB.js";import{j as u}from"./chunk-773TIA5M.js";import{g as l}from"./chunk-VKWPEFWQ.js";l();l();var M=12;async function S(p,t,o){let n=await p.appVersions(t);if(!n.app)throw new v(`Invalid API Key: ${t.apiKey}`);let a=n.app.appVersions.nodes.map(e=>{let r=e.message??"";return{...e,status:e.status==="active"&&!o?A.green(`\u2605 ${e.status}`):e.status,createdBy:e.createdBy?.displayName??"",createdAt:h(new Date(e.createdAt)),message:r}});if(!o){let e=(process.stdout.columns??75)-M,r=e;a.forEach(s=>{let f=s.message.length+(s.versionTag?.length??0)+T(s.status).length+s.createdAt.length+s.createdBy.length;if(f>e){let I=f-s.message.length,g=Math.max(e-I,10);g<r&&(r=g)}}),a.forEach(s=>{s.message.length>r&&(s.message=`${s.message.slice(0,r-3)}...`)})}return{appVersions:a,totalResults:n.app.appVersions.pageInfo.totalResults,app:n.app}}async function c(p){let{remoteApp:t,developerPlatformClient:o,organization:n}=p,{appVersions:a,totalResults:e}=await S(o,t,p.json);if(p.json)return L(JSON.stringify(a,null,2));if(x({org:n.businessName,appName:t.title,configFile:u(p.app.configPath)}),a.length===0){m("No app versions found for this app");return}y({rows:a,columns:{versionTag:{header:"VERSION"},status:{header:"STATUS"},message:{header:"MESSAGE"},createdAt:{header:"DATE CREATED"},createdBy:{header:"CREATED BY"}}});let r=w.link(o.webUiName,[await o.appDeepLink(t),"versions"].join("/"));m(E`\nView all ${String(e)} app versions in the ${r}`)}var d,i=class extends b{async run(){let{flags:t}=await this.parse(d),{app:o,remoteApp:n,developerPlatformClient:a,organization:e}=await N({directory:t.path,clientId:t["client-id"],forceRelink:t.reset,userProvidedConfigName:t.config});return await c({app:o,remoteApp:n,organization:e,developerPlatformClient:a,json:t.json}),{app:o}}};d=i;i.summary="List deployed versions of your app.";i.descriptionWithMarkdown="Lists the deployed app versions. An app version is a snapshot of your app extensions.";i.description=d.descriptionWithoutMarkdown();i.flags={...C,...k,...R};var J=i;export{J as a};
@@ -0,0 +1,7 @@
1
+ import{a as X,b as H,c as K}from"./chunk-UYK6CXAU.js";import{a as M,c as P,e as h,f as T,h as q,i as V,m as U,p as _,q as F,r as j,s as z,u as Q}from"./chunk-AY4GIVME.js";import{a as W}from"./chunk-HM5H7WBE.js";import{a as G,b as J}from"./chunk-ZAMDXIVC.js";import{b as L}from"./chunk-H5C3QTOO.js";import{E as R,a as D,u as v,v as d,w as E,x as A}from"./chunk-6EZ7JWBK.js";import{d as f,g as x}from"./chunk-WKBVT5WG.js";import{Fb as r,Hb as s,Lb as N,Ta as $,ma as S,ua as I}from"./chunk-DONEJHDG.js";import{g as m}from"./chunk-VKWPEFWQ.js";m();m();async function oe(t,e){if(t)return t.join(`
2
+ `);if(e){if(!await $(e))throw new f(s`Variable file not found at ${r.path(e)}. Please check the path and try again.`);return S(e,{encoding:"utf8"})}else return}async function Z(t){let{organization:e,remoteApp:i,store:n,query:a,variables:p,variableFile:k,outputFile:B,watch:ee=!1,version:te}=t,{adminSession:c,version:w}=await R({title:s`Authenticating`,task:async()=>{let o=await X(i,n.shopDomain),u=await T({adminSession:o,userSpecifiedVersion:te,minimumDefaultVersion:M});return{adminSession:o,version:u}},renderOptions:{stdout:process.stderr}}),C=await oe(p,k);ae(a,C),K(a,n),v({headline:"Starting bulk operation.",body:[{list:{items:H({organization:e,remoteApp:i,storeFqdn:n.shopDomain,version:w})}}]});let y=h(a)?await V({adminSession:c,query:a,variablesJsonl:C,version:w}):await q({adminSession:c,query:a,version:w});if(y?.userErrors?.length){A({headline:"Error creating bulk operation.",body:{list:{items:y.userErrors.map(o=>o.field?`${o.field.join(".")}: ${o.message}`:o.message)}}});return}let g=y?.bulkOperation;if(g)if(ee){let o=new D,u=await F(c,g.id,o.signal,()=>o.abort());o.signal.aborted?v({headline:`Bulk operation ${u.id} is still running in the background.`,body:b(u.id)}):await Y(u,B)}else{let o=await _(c,g.id);["FAILED","CANCELED","EXPIRED"].includes(o.status)?await Y(o,B):d({headline:"Bulk operation is running.",body:b(o.id),customSections:[{body:[{list:{items:[s`ID: ${r.cyan(o.id)}`.value]}}]}]})}else throw E({headline:"Bulk operation not created successfully.",body:"This is an unexpected error. Please try again later."}),new x("Bulk operation response returned null with no error message.")}async function Y(t,e){let i=U(t).value,a=[{body:[{list:{items:[s`ID: ${r.cyan(t.id)}`.value,s`Status: ${r.yellow(t.status)}`.value,s`Created at: ${r.gray(String(t.createdAt))}`.value,...t.completedAt?[s`Completed at: ${r.gray(String(t.completedAt))}`.value]:[]]}}]}];switch(t.status){case"CREATED":d({headline:"Bulk operation started.",body:b(t.id),customSections:a});break;case"RUNNING":d({headline:"Bulk operation is running.",body:b(t.id),customSections:a});break;case"COMPLETED":if(t.url){let p=await j(t.url),k=z(p);e?await I(e,p):N(p),k?E({headline:"Bulk operation completed with errors.",body:e?`Results written to ${e}. Check file for error details.`:"Check results for error details.",customSections:a}):d({headline:i,body:e?[`Results written to ${e}`]:void 0,customSections:a})}else d({headline:i,customSections:a});break;case"CANCELED":case"CANCELING":case"EXPIRED":case"FAILED":A({headline:i,customSections:a});break}}function ae(t,e){if(h(t)&&!e)throw new f(s`Bulk mutations require variables. Provide a JSONL file with ${r.yellow("--variable-file")} or individual JSON objects with ${r.yellow("--variables")}.`);if(!h(t)&&e)throw new f(s`The ${r.yellow("--variables")} and ${r.yellow("--variable-file")} flags can only be used with mutations, not queries.`)}function b(t){return[`Monitor its progress with:
3
+ `,{command:`shopify app bulk status --id=${P(t)}`}]}var O,l=class extends W{async run(){let{flags:e}=await this.parse(O),{query:i,appContextResult:n,store:a}=await Q(e);return await Z({organization:n.organization,remoteApp:n.remoteApp,store:a,query:i,variables:e.variables,variableFile:e["variable-file"],watch:e.watch??!1,outputFile:e["output-file"],...e.version&&{version:e.version}}),{app:n.app}}};O=l;l.summary="Execute bulk operations.";l.descriptionWithMarkdown=`Executes an Admin API GraphQL query or mutation on the specified store, as a bulk operation. Mutations are only allowed on dev stores.
4
+
5
+ Bulk operations allow you to process large amounts of data asynchronously. Learn more about [bulk query operations](https://shopify.dev/docs/api/usage/bulk-operations/queries) and [bulk mutation operations](https://shopify.dev/docs/api/usage/bulk-operations/imports).
6
+
7
+ Use [\`bulk status\`](https://shopify.dev/docs/api/shopify-cli/app/app-bulk-status) to check the status of your bulk operations.`;l.description=O.descriptionWithoutMarkdown();l.flags={...L,...G,...J};var we=l;export{we as a};
@@ -1 +1 @@
1
- import{c as u,d as t,l as h}from"./chunk-TPCG6DCA.js";import{g as i}from"./chunk-VKWPEFWQ.js";i();var o=e=>new a(e),s=e=>new n(e),a=class{constructor(r){this.value=r}isErr(){return!1}doOnOk(r){return r(this.value),o(this.value)}valueOrBug(){return this.value}valueOrAbort(){return this.value}map(r){return o(r(this.value))}mapError(r){return o(this.value)}},n=class{constructor(r){this.error=r}isErr(){return!0}doOnOk(r){return s(this.error)}valueOrBug(){throw this.error}valueOrAbort(){if(this.error instanceof u)throw this.error;if(this.error instanceof h.ExtendableError||this.error instanceof Error){let r=new t(this.error.message);throw r.stack=this.error.stack,r}else throw new t(`${this.error}`)}map(r){return s(this.error)}mapError(r){return s(r(this.error))}};export{o as a,s as b};
1
+ import{c as u,d as t,l as h}from"./chunk-WKBVT5WG.js";import{g as i}from"./chunk-VKWPEFWQ.js";i();var o=e=>new a(e),s=e=>new n(e),a=class{constructor(r){this.value=r}isErr(){return!1}doOnOk(r){return r(this.value),o(this.value)}valueOrBug(){return this.value}valueOrAbort(){return this.value}map(r){return o(r(this.value))}mapError(r){return o(this.value)}},n=class{constructor(r){this.error=r}isErr(){return!0}doOnOk(r){return s(this.error)}valueOrBug(){throw this.error}valueOrAbort(){if(this.error instanceof u)throw this.error;if(this.error instanceof h.ExtendableError||this.error instanceof Error){let r=new t(this.error.message);throw r.stack=this.error.stack,r}else throw new t(`${this.error}`)}map(r){return s(this.error)}mapError(r){return s(r(this.error))}};export{o as a,s as b};