@shopify/cli 4.8.2 → 4.8.4

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 (305) hide show
  1. package/dist/analytics-M4OC7RPG.js +1 -0
  2. package/dist/{analytics-5K4B2DE4.js → analytics-RGIJMP4U.js} +1 -1
  3. package/dist/bootstrap.js +1 -1
  4. package/dist/{chunk-3NVQTA2F.js → chunk-2HW6VRJT.js} +1 -1
  5. package/dist/{chunk-IGRDJ4EC.js → chunk-2HYR6EUD.js} +1 -1
  6. package/dist/{chunk-MWJVYQVC.js → chunk-2IRRFPEY.js} +1 -1
  7. package/dist/{chunk-CAT3FQ6U.js → chunk-2SL443J6.js} +1 -1
  8. package/dist/{chunk-MJ3WNVMQ.js → chunk-2VJ6NBPV.js} +1 -1
  9. package/dist/{chunk-WJ6GLVIM.js → chunk-2WATX3XV.js} +1 -1
  10. package/dist/{chunk-QJW6UIRU.js → chunk-2ZROBXJX.js} +1 -1
  11. package/dist/{chunk-DJGDJSXS.js → chunk-3CZ7DKE5.js} +1 -1
  12. package/dist/{chunk-M47E7LE5.js → chunk-3DIRCEXA.js} +1 -1
  13. package/dist/{chunk-KANWS6HC.js → chunk-3DT4NS4S.js} +1 -1
  14. package/dist/{chunk-2AJKHY5T.js → chunk-3IQ6WXDD.js} +1 -1
  15. package/dist/{chunk-DD7FQDTB.js → chunk-43FRAUV6.js} +3 -3
  16. package/dist/chunk-44QD4QNO.js +1 -0
  17. package/dist/{chunk-XQIPACFV.js → chunk-4DLRS7MT.js} +3 -3
  18. package/dist/{chunk-EVIITVUM.js → chunk-4F3XYIEY.js} +1 -1
  19. package/dist/{chunk-2MMJVHYZ.js → chunk-4HOJJCZ6.js} +1 -1
  20. package/dist/{chunk-7MFISB2R.js → chunk-4OMKKYFC.js} +1 -1
  21. package/dist/{chunk-R7XKECV5.js → chunk-4ZTRKEA2.js} +1 -1
  22. package/dist/{chunk-ROIASQF4.js → chunk-5DMFEDKY.js} +1 -1
  23. package/dist/{chunk-3EO3UEPZ.js → chunk-5Z6EW3FA.js} +1 -1
  24. package/dist/{chunk-5EW33K5C.js → chunk-66G2HJ2A.js} +1 -1
  25. package/dist/{chunk-UXFTZHBG.js → chunk-66HW6J57.js} +1 -1
  26. package/dist/{chunk-XS6EKKTD.js → chunk-67QK26HI.js} +1 -1
  27. package/dist/{chunk-RR4KN46J.js → chunk-6A3TDSON.js} +1 -1
  28. package/dist/{chunk-F6SKKCKZ.js → chunk-6B727IUY.js} +1 -1
  29. package/dist/{chunk-ESTXKKAB.js → chunk-6C5AVMKR.js} +1 -1
  30. package/dist/{chunk-2JORC3Q5.js → chunk-6CR2EEZ3.js} +1 -1
  31. package/dist/{chunk-5FHTBBDR.js → chunk-6P5FGN6P.js} +1 -1
  32. package/dist/{chunk-NAIXUSEF.js → chunk-6QADNGH4.js} +1 -1
  33. package/dist/{chunk-YXS4SFIN.js → chunk-6V6UNUMM.js} +1 -1
  34. package/dist/chunk-6XLFFOPK.js +1 -0
  35. package/dist/{chunk-BZC3KLVQ.js → chunk-74CYT3VX.js} +1 -1
  36. package/dist/{chunk-73MCDHWW.js → chunk-7FVCUY54.js} +1 -1
  37. package/dist/{chunk-AAEJL2TP.js → chunk-7KLPRSQR.js} +1 -1
  38. package/dist/{chunk-AD6BC3N6.js → chunk-7LZ34C4S.js} +1 -1
  39. package/dist/{chunk-THEONODK.js → chunk-7VQBIGJB.js} +1 -1
  40. package/dist/{chunk-XMQJUFVE.js → chunk-A3U7JDUC.js} +1 -1
  41. package/dist/{chunk-NEREVIKL.js → chunk-A3V2A2I4.js} +1 -1
  42. package/dist/{chunk-LZC2EJLI.js → chunk-A5U4KKNV.js} +1 -1
  43. package/dist/{chunk-XLEGKHUM.js → chunk-AIILEPSK.js} +1 -1
  44. package/dist/{chunk-6ZCPQOWW.js → chunk-APUYMORT.js} +1 -1
  45. package/dist/{chunk-44OAVCF6.js → chunk-AQPOPSQ7.js} +1 -1
  46. package/dist/{chunk-T7RMEJNE.js → chunk-AU7GNCOK.js} +1 -1
  47. package/dist/{chunk-EUSOP35K.js → chunk-BAWBC66R.js} +1 -1
  48. package/dist/{chunk-N6SZTZNB.js → chunk-BG7QQU23.js} +1 -1
  49. package/dist/{chunk-AXZG7H2F.js → chunk-BHJ3TGS7.js} +1 -1
  50. package/dist/{chunk-A27WKAFQ.js → chunk-BHTHUKHU.js} +1 -1
  51. package/dist/{chunk-65YY4727.js → chunk-BV62ZERJ.js} +1 -1
  52. package/dist/{chunk-GV2JI5PS.js → chunk-BYX7SQPM.js} +1 -1
  53. package/dist/{chunk-5NT2BNMB.js → chunk-C4Y7PQDQ.js} +1 -1
  54. package/dist/{chunk-R5ONMTHY.js → chunk-CBMX6XI7.js} +1 -1
  55. package/dist/{chunk-WKCXSP6V.js → chunk-CFQ5G2QS.js} +1 -1
  56. package/dist/{chunk-NYHGIWKZ.js → chunk-CNK3ZO2B.js} +5 -5
  57. package/dist/{chunk-7CV75WGB.js → chunk-CP56F5UR.js} +1 -1
  58. package/dist/{chunk-XZSSBNGP.js → chunk-CSOCXWP6.js} +98 -92
  59. package/dist/{chunk-7LW23M5C.js → chunk-CVW2HMQO.js} +2 -2
  60. package/dist/{chunk-XLSKATCP.js → chunk-D6LQ56XT.js} +1 -1
  61. package/dist/{chunk-KQJBTX6K.js → chunk-D6QTOQEJ.js} +1 -1
  62. package/dist/{chunk-CLUMXUR5.js → chunk-DDZEYA2I.js} +1 -1
  63. package/dist/{chunk-WU5HO6FZ.js → chunk-DH3DMUE2.js} +1 -1
  64. package/dist/{chunk-4Y7WHAJX.js → chunk-DO4SRE4M.js} +1 -1
  65. package/dist/{chunk-LY7PSCG4.js → chunk-DUNE3INK.js} +1 -1
  66. package/dist/{chunk-JADBWMQS.js → chunk-DZZORIWL.js} +1 -1
  67. package/dist/{chunk-JIZ3BECO.js → chunk-EJJPEWSB.js} +1 -1
  68. package/dist/{chunk-PKGJTTCP.js → chunk-EQ2PD2ZA.js} +1 -1
  69. package/dist/{chunk-YRRGHHTP.js → chunk-ERBXXVOZ.js} +1 -1
  70. package/dist/{chunk-DLCJRY3W.js → chunk-FGRW7GT4.js} +1 -1
  71. package/dist/{chunk-HQHKCLIU.js → chunk-FRRA5MI2.js} +1 -1
  72. package/dist/{chunk-QB6J3J6O.js → chunk-FRVRTOTF.js} +1 -1
  73. package/dist/{chunk-2GDXU42J.js → chunk-FW3RORD7.js} +1 -1
  74. package/dist/{chunk-OCT65FRG.js → chunk-FY47X4NG.js} +1 -1
  75. package/dist/{chunk-PPWJM7KE.js → chunk-G2YTINLI.js} +1 -1
  76. package/dist/{chunk-N4WEI6JA.js → chunk-GGPMDCCB.js} +1 -1
  77. package/dist/{chunk-N7VI7OWJ.js → chunk-GINXNPAR.js} +1 -1
  78. package/dist/{chunk-EZ6VGZXC.js → chunk-GJHBAOGJ.js} +1 -1
  79. package/dist/{chunk-5GBIXC2Y.js → chunk-GTAYTMCP.js} +1 -1
  80. package/dist/{chunk-H72B4Y5L.js → chunk-H2HR2AQE.js} +1 -1
  81. package/dist/{chunk-I2PSC3VF.js → chunk-H7TDIRIU.js} +1 -1
  82. package/dist/{chunk-KLXOMT3K.js → chunk-HINK4QAR.js} +1 -1
  83. package/dist/{chunk-HGJIYWXY.js → chunk-HXVUDGLH.js} +1 -1
  84. package/dist/{chunk-EJCBL2W2.js → chunk-HYM3HBDG.js} +1 -1
  85. package/dist/{chunk-5LGEBELU.js → chunk-HYPY5WH6.js} +1 -1
  86. package/dist/{chunk-LHLYEFO7.js → chunk-IHEBV2KO.js} +1 -1
  87. package/dist/{chunk-YAPH7GMC.js → chunk-IHH5XTPV.js} +1 -1
  88. package/dist/{chunk-T4UZOUVM.js → chunk-JJJIRCQP.js} +1 -1
  89. package/dist/{chunk-6BNOQJHH.js → chunk-JQPPLSFT.js} +1 -1
  90. package/dist/{chunk-UXDW37V5.js → chunk-JWHQPDOK.js} +1 -1
  91. package/dist/{chunk-36ZTFNMR.js → chunk-JXG2T76F.js} +1 -1
  92. package/dist/{chunk-GZKEIUJT.js → chunk-K2DP5Z76.js} +1 -1
  93. package/dist/{chunk-2D46X762.js → chunk-KUZ5Z6HM.js} +1 -1
  94. package/dist/{chunk-4YMU5WAG.js → chunk-KWQGJ3VC.js} +1 -1
  95. package/dist/{chunk-HGRTQIGQ.js → chunk-KZU727AL.js} +1 -1
  96. package/dist/{chunk-T6M5V6RH.js → chunk-L2DCUVZV.js} +1 -1
  97. package/dist/{chunk-ZQQDUU3T.js → chunk-L3JBKCAS.js} +1 -1
  98. package/dist/{chunk-XTPBKTAX.js → chunk-L3M7PTHU.js} +1 -1
  99. package/dist/{chunk-N4N35AQP.js → chunk-L4LDNEFK.js} +1 -1
  100. package/dist/{chunk-R5EBKVQR.js → chunk-LAMTFOVF.js} +1 -1
  101. package/dist/{chunk-PEWR7SF6.js → chunk-LBA6FGKC.js} +1 -1
  102. package/dist/{chunk-QD2KPFUT.js → chunk-LEW5IJK6.js} +1 -1
  103. package/dist/{chunk-QYV62H24.js → chunk-LX5UXWZ7.js} +1 -1
  104. package/dist/{chunk-VEVKY5LR.js → chunk-M7VQLMSW.js} +1 -1
  105. package/dist/{chunk-26LLUNJJ.js → chunk-MBRFIXCU.js} +1 -1
  106. package/dist/{chunk-ZQ4KG6U2.js → chunk-MYLMGH7Y.js} +1 -1
  107. package/dist/{chunk-ATMII5E5.js → chunk-NBXXTQWA.js} +1 -1
  108. package/dist/{chunk-N6A3ISBE.js → chunk-NDT3F2PR.js} +1 -1
  109. package/dist/{chunk-BCWKIFNX.js → chunk-NHOF2IN6.js} +1 -1
  110. package/dist/{chunk-X3PGH5S4.js → chunk-NKC3K3XP.js} +1 -1
  111. package/dist/chunk-O72SHE3Q.js +7 -0
  112. package/dist/chunk-OAG72Q2O.js +1 -0
  113. package/dist/{chunk-5GK7UKIP.js → chunk-OPOPO7DG.js} +1 -1
  114. package/dist/{chunk-M6KOCZVH.js → chunk-OUA6EOLX.js} +1 -1
  115. package/dist/{chunk-7SHHNWHL.js → chunk-OY6L7J53.js} +1 -1
  116. package/dist/{chunk-RB7J7C3A.js → chunk-OYCAYEQE.js} +1 -1
  117. package/dist/{chunk-AFA4NLPV.js → chunk-PGWQHSDV.js} +1 -1
  118. package/dist/{chunk-EEKB5GN6.js → chunk-PM3HRKPR.js} +1 -1
  119. package/dist/{chunk-7MZEOTFK.js → chunk-PNNW7YQG.js} +1 -1
  120. package/dist/{chunk-YP35VTKI.js → chunk-POMWFTBD.js} +1 -1
  121. package/dist/{chunk-BC42C35S.js → chunk-QKTBYAUD.js} +1 -1
  122. package/dist/{chunk-7VW2J53A.js → chunk-QVO5CAJN.js} +2 -2
  123. package/dist/{chunk-76PGSVVM.js → chunk-QXR5DJC2.js} +1 -1
  124. package/dist/{chunk-AEUVT7IU.js → chunk-QZEDYQVT.js} +1 -1
  125. package/dist/{chunk-O2FGO4CJ.js → chunk-R3GLEZSE.js} +1 -1
  126. package/dist/{chunk-SNAIF3ST.js → chunk-RDS2WYQH.js} +1 -1
  127. package/dist/{chunk-HCTPSLRL.js → chunk-RHBLXZGU.js} +1 -1
  128. package/dist/{chunk-F2X7F5QX.js → chunk-RHNZA4IL.js} +1 -1
  129. package/dist/{chunk-564CWTLZ.js → chunk-RIM7FNP3.js} +1 -1
  130. package/dist/{chunk-S67RM4AH.js → chunk-S5H5U3PR.js} +1 -1
  131. package/dist/{chunk-CGYVLQCZ.js → chunk-SCLGMVNB.js} +1 -1
  132. package/dist/{chunk-RF54RVOL.js → chunk-SPNM3GES.js} +1 -1
  133. package/dist/{chunk-LQJMBNVQ.js → chunk-SVYHWGMI.js} +1 -1
  134. package/dist/{chunk-F4HKZVXJ.js → chunk-T4V7KOGJ.js} +3 -3
  135. package/dist/{chunk-472T4YTY.js → chunk-TA2M37OB.js} +1 -1
  136. package/dist/{chunk-A6FO2ZZW.js → chunk-TAY7HU7X.js} +2 -2
  137. package/dist/{chunk-ZKWJX5GE.js → chunk-TCFGEOE4.js} +12 -12
  138. package/dist/{chunk-CEDXFKIK.js → chunk-U6URYCC6.js} +1 -1
  139. package/dist/{chunk-3NSZBIHE.js → chunk-UJBMY5WR.js} +1 -1
  140. package/dist/{chunk-FGZNKGW5.js → chunk-UPGRXCFS.js} +1 -1
  141. package/dist/{chunk-5AFM6CVE.js → chunk-V2GLAK2W.js} +1 -1
  142. package/dist/{chunk-M6Z6NXCE.js → chunk-V4774HTF.js} +1 -1
  143. package/dist/{chunk-JP4O56VD.js → chunk-VBICZDA4.js} +1 -1
  144. package/dist/{chunk-7BYWIVUZ.js → chunk-VDGTHMIQ.js} +1 -1
  145. package/dist/{chunk-ZG3I4COP.js → chunk-VETLNJ56.js} +1 -1
  146. package/dist/{chunk-2JXH2CQB.js → chunk-VG3YVCZW.js} +1 -1
  147. package/dist/chunk-VJ5YOXKL.js +1 -0
  148. package/dist/{chunk-3QF47EX2.js → chunk-W4SGAPPR.js} +1 -1
  149. package/dist/{chunk-AHFOIPEK.js → chunk-W4SQE6NR.js} +1 -1
  150. package/dist/{chunk-TQRKW6W3.js → chunk-WAJRWCZY.js} +1 -1
  151. package/dist/{chunk-WAVWKGSF.js → chunk-WGFGWDWP.js} +1 -1
  152. package/dist/{chunk-BPI25I3Q.js → chunk-WGUCRVII.js} +1 -1
  153. package/dist/{chunk-WSPQWLOS.js → chunk-WY7QF7VU.js} +1 -1
  154. package/dist/{chunk-RFYFI72S.js → chunk-X4V2CD2H.js} +1 -1
  155. package/dist/{chunk-ATFKBLMQ.js → chunk-XHXKPRF5.js} +1 -1
  156. package/dist/{chunk-AGKG5G6X.js → chunk-XKHKXUQY.js} +1 -1
  157. package/dist/chunk-XOYICV6P.js +1 -0
  158. package/dist/{chunk-VNW2YMPM.js → chunk-XRJCD3AO.js} +1 -1
  159. package/dist/{chunk-DY64LYXB.js → chunk-XWXAFJFC.js} +1 -1
  160. package/dist/{chunk-D7S4HEQE.js → chunk-XYUTD6IU.js} +1 -1
  161. package/dist/{chunk-JVZ3VF4D.js → chunk-Y4BBTWM5.js} +1 -1
  162. package/dist/{chunk-D3DCP4OT.js → chunk-YHTONNIZ.js} +1 -1
  163. package/dist/{chunk-NL7WDQSR.js → chunk-YNFXYVYN.js} +1 -1
  164. package/dist/{chunk-KTILY5HE.js → chunk-Z2HN5L6G.js} +1 -1
  165. package/dist/{chunk-6F6LL5UM.js → chunk-Z5KYKXMH.js} +1 -1
  166. package/dist/{chunk-KKUA7VMA.js → chunk-ZAH6QID2.js} +1 -1
  167. package/dist/{chunk-Q4BTAXLS.js → chunk-ZCNNJCTQ.js} +1 -1
  168. package/dist/chunk-ZVA5F4QC.js +272 -0
  169. package/dist/{chunk-2ZGU7VWR.js → chunk-ZVJD6CUY.js} +1 -1
  170. package/dist/cli/commands/app/app-logs/sources.js +1 -1
  171. package/dist/cli/commands/app/build.js +1 -1
  172. package/dist/cli/commands/app/bulk/cancel.js +1 -1
  173. package/dist/cli/commands/app/bulk/execute.js +1 -1
  174. package/dist/cli/commands/app/bulk/status.js +1 -1
  175. package/dist/cli/commands/app/config/link.js +1 -1
  176. package/dist/cli/commands/app/config/pull.js +1 -1
  177. package/dist/cli/commands/app/config/use.js +1 -1
  178. package/dist/cli/commands/app/config/validate.js +1 -1
  179. package/dist/cli/commands/app/demo/watcher.js +1 -1
  180. package/dist/cli/commands/app/deploy.js +1 -1
  181. package/dist/cli/commands/app/dev/clean.js +1 -1
  182. package/dist/cli/commands/app/dev.js +1 -1
  183. package/dist/cli/commands/app/doctor/instructions.js +1 -1
  184. package/dist/cli/commands/app/doctor.js +1 -1
  185. package/dist/cli/commands/app/env/pull.js +1 -1
  186. package/dist/cli/commands/app/env/show.js +1 -1
  187. package/dist/cli/commands/app/execute.js +1 -1
  188. package/dist/cli/commands/app/function/build.js +1 -1
  189. package/dist/cli/commands/app/function/info.js +1 -1
  190. package/dist/cli/commands/app/function/replay.js +1 -1
  191. package/dist/cli/commands/app/function/run.js +1 -1
  192. package/dist/cli/commands/app/function/schema.js +1 -1
  193. package/dist/cli/commands/app/function/typegen.js +1 -1
  194. package/dist/cli/commands/app/generate/extension.js +1 -1
  195. package/dist/cli/commands/app/graphiql.js +1 -1
  196. package/dist/cli/commands/app/import-custom-data-definitions.js +1 -1
  197. package/dist/cli/commands/app/import-extensions.js +1 -1
  198. package/dist/cli/commands/app/info.js +1 -1
  199. package/dist/cli/commands/app/init.js +1 -1
  200. package/dist/cli/commands/app/logs.js +1 -1
  201. package/dist/cli/commands/app/release.js +1 -1
  202. package/dist/cli/commands/app/subscription-migrations/cancel.js +1 -1
  203. package/dist/cli/commands/app/subscription-migrations/list.js +1 -1
  204. package/dist/cli/commands/app/subscription-migrations/schedule.js +1 -1
  205. package/dist/cli/commands/app/subscription-migrations/status.js +1 -1
  206. package/dist/cli/commands/app/subscription-migrations/unschedule.js +1 -1
  207. package/dist/cli/commands/app/versions/list.js +1 -1
  208. package/dist/cli/commands/app/webhook/trigger.js +1 -1
  209. package/dist/cli/commands/auth/login.js +1 -1
  210. package/dist/cli/commands/auth/logout.js +1 -1
  211. package/dist/cli/commands/cache/clear.js +1 -1
  212. package/dist/cli/commands/config/autoupgrade/off.js +1 -1
  213. package/dist/cli/commands/config/autoupgrade/on.js +1 -1
  214. package/dist/cli/commands/config/autoupgrade/status.js +1 -1
  215. package/dist/cli/commands/debug/command-flags.js +1 -1
  216. package/dist/cli/commands/doc/fetch.js +1 -1
  217. package/dist/cli/commands/doc/search.js +1 -1
  218. package/dist/cli/commands/docs/generate.js +1 -1
  219. package/dist/cli/commands/doctor-release/doctor-release.js +1 -1
  220. package/dist/cli/commands/doctor-release/theme/index.js +1 -1
  221. package/dist/cli/commands/help.js +1 -1
  222. package/dist/cli/commands/kitchen-sink/async.js +1 -1
  223. package/dist/cli/commands/kitchen-sink/index.js +1 -1
  224. package/dist/cli/commands/kitchen-sink/prompts.js +1 -1
  225. package/dist/cli/commands/kitchen-sink/static.js +1 -1
  226. package/dist/cli/commands/notifications/generate.js +1 -1
  227. package/dist/cli/commands/notifications/list.js +1 -1
  228. package/dist/cli/commands/organization/list.js +1 -1
  229. package/dist/cli/commands/search.js +1 -1
  230. package/dist/cli/commands/send-analytics.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/command-registry.js +1 -1
  253. package/dist/{conf-store-OFRC7GO7.js → conf-store-H3UAVGN5.js} +1 -1
  254. package/dist/configs/all.yml +8 -5
  255. package/dist/configs/recommended.yml +8 -5
  256. package/dist/data/objects.json +487 -75
  257. package/dist/data/shopify_system_translations.json +8 -7
  258. package/dist/data/tags.json +23 -0
  259. package/dist/{deprecations-PSCEZAQH.js → deprecations-TEUM7CML.js} +1 -1
  260. package/dist/dist-62I5X3FS.js +1 -0
  261. package/dist/dist-YHZ5BTYD.js +1 -0
  262. package/dist/{environments-FFWXZPU5.js → environments-LAFWOQWO.js} +1 -1
  263. package/dist/{error-UHLTMPVC.js → error-6ZCGAC5E.js} +1 -1
  264. package/dist/error-handler-JNCW56EC.js +1 -0
  265. package/dist/{fs-N6AHVL6I.js → fs-QEWOWUPQ.js} +1 -1
  266. package/dist/hooks/did-you-mean.js +1 -1
  267. package/dist/hooks/hydrogen-init.js +1 -1
  268. package/dist/hooks/postrun.js +1 -1
  269. package/dist/hooks/prerun.js +1 -1
  270. package/dist/hooks/public-metadata.js +1 -1
  271. package/dist/hooks/sensitive-metadata.js +1 -1
  272. package/dist/hooks/tunnel-provider.js +1 -1
  273. package/dist/hooks/tunnel-start.js +1 -1
  274. package/dist/index.js +1 -1
  275. package/dist/{is-global-DDGO2AWZ.js → is-global-UYMEAGDR.js} +1 -1
  276. package/dist/{local-JZRBCKAH.js → local-Z4ZEMWE4.js} +1 -1
  277. package/dist/{metadata-KYBVCKB5.js → metadata-ZCQMB5AB.js} +1 -1
  278. package/dist/{node-package-manager-O3DQCYJC.js → node-package-manager-HMOTOBDS.js} +1 -1
  279. package/dist/notifications-system-RT3CY6LZ.js +1 -0
  280. package/dist/os-G6KDPJMC.js +1 -0
  281. package/dist/{output-VAVFLR73.js → output-BJCZYDNG.js} +1 -1
  282. package/dist/{system-3PB7N6PP.js → system-T4H2ISV6.js} +1 -1
  283. package/dist/tsconfig.tsbuildinfo +1 -1
  284. package/dist/{ui-YTGKLMHA.js → ui-4MQSY5IN.js} +1 -1
  285. package/dist/upgrade-4234MIYJ.js +1 -0
  286. package/dist/version-FRSRSCRX.js +1 -0
  287. package/dist/{version-5OTQ3U3D.js → version-RF7QQXRX.js} +1 -1
  288. package/dist/{workerd-GHAVFNOO.js → workerd-7E4H2DM3.js} +1 -1
  289. package/oclif.manifest.json +1 -1
  290. package/package.json +7 -7
  291. package/dist/analytics-3SII67XF.js +0 -1
  292. package/dist/chunk-BFL74TW2.js +0 -1
  293. package/dist/chunk-DWI2BHXZ.js +0 -1
  294. package/dist/chunk-GJ34J3XJ.js +0 -7
  295. package/dist/chunk-ID3AR4VW.js +0 -1
  296. package/dist/chunk-LX7W4GUD.js +0 -1
  297. package/dist/chunk-PIYTMQRC.js +0 -1
  298. package/dist/chunk-W25XMFZJ.js +0 -273
  299. package/dist/dist-733YLWJN.js +0 -1
  300. package/dist/dist-KOFJQ4RY.js +0 -1
  301. package/dist/error-handler-PVVDX7WF.js +0 -1
  302. package/dist/notifications-system-O7JENRRD.js +0 -1
  303. package/dist/os-ZZ47F6CA.js +0 -1
  304. package/dist/upgrade-XYGE5PDR.js +0 -1
  305. package/dist/version-P72VURM3.js +0 -1
@@ -1,4 +1,4 @@
1
- import{a as g0,b as _0}from"./chunk-5LGEBELU.js";import{b as m0,o as AB}from"./chunk-YLQ3LNNY.js";import{a as bB}from"./chunk-VJEKDBGZ.js";import{a as h0}from"./chunk-QD2KPFUT.js";import{A as N0,D as M0,E as qc,c as f0,h as p0,i as d0,j as D0,k as hi,l as _s,m as C0,n as w0,o as b0,p as kc,q as Vo,r as A0,s as S0,t as x0,u as P0,v as B0,w as I0,y as R0,z as Pd}from"./chunk-MJ3WNVMQ.js";import{a as l0}from"./chunk-WKCXSP6V.js";import{b as gs,c as Ct}from"./chunk-NEREVIKL.js";import{A as di,B as Di,C as no,E as Uc,I as O0,J as T0,a as bd,b as jr,c as Wo,g as Mc,i as jc,j as Ad,k as Sd,m as $c,n as y0,o as pi,p as F0,q as xd,r as E0,s as Ge,t as Ho,u as zo,v as v0,w as pn,x as Lc,y as gr,z as Te}from"./chunk-NL7WDQSR.js";import{aa as wB}from"./chunk-W25XMFZJ.js";import{a as zy,b as Vy}from"./chunk-R5ONMTHY.js";import{a as c0}from"./chunk-WAVWKGSF.js";import{a as mr}from"./chunk-I2PSC3VF.js";import{$ as EB,D as Ry,M as jy,N as $y,P as Fd,S as Ly,Y as yB,Z as Uy,_ as FB,aa as ky,b as ds,ba as vB,ca as fn,d as Sc,da as Pc,e as xc,fa as qy,ga as vt,i as Oy,ia as Ds,ja as Wy,k as gB,n as li,na as Hy,r as Ty,t as By,v as E,x as Iy}from"./chunk-NYHGIWKZ.js";import{m as Oc,n as Gy,s as Jy,t as Yy,w as Tc,x as Bc}from"./chunk-NAIXUSEF.js";import{A as Ic,B as Zy,D as Qy,E as Nr,F as vd,H as e0,J as ms,K as t0,M as r0,S as fi,V as Rc,y as ro,z as hs}from"./chunk-ESTXKKAB.js";import{a as CB}from"./chunk-5HBIIYSK.js";import{a as hd}from"./chunk-LX7W4GUD.js";import{d as _B,e as Ny,q as My}from"./chunk-BC42C35S.js";import{f as Ed}from"./chunk-VNW2YMPM.js";import{a as Bn,b as to}from"./chunk-RF54RVOL.js";import{h as k,j as In,k as Mr}from"./chunk-BFL74TW2.js";import{$a as ln,Ab as ce,Ba as wy,Bb as Rn,Db as s0,Ea as ci,Eb as a0,Fa as by,Ga as Cc,Ka as Ay,L as Qi,La as Sy,N as Bt,Oa as wc,Pa as xy,Q as hB,R as mB,T as Fy,Ta as X,Ua as Ut,V as ls,Wa as Ve,X as Lt,Xa as Py,Y as _d,_ as yd,aa as Ec,b as aB,bb as bc,c as cB,da as Ey,db as Ac,ea as qo,f as lB,gb as Ky,ha as vy,i as fB,k as pB,ka as fs,m as gy,ma as $e,n as _y,na as eo,oa as ps,pa as Ir,q as dB,qa as vc,qb as Ae,rb as Nc,sb as Se,u as yy,ua as mt,v as DB,va as Cy,w as gd,wa as Rr,xb as o0,zb as u0}from"./chunk-DD7FQDTB.js";import{b as uB,c as sB,e as hy,f as my,i as Xy}from"./chunk-B4OMIONW.js";import{f as n0,k as Cd,l as wd,m as i0}from"./chunk-D7S4HEQE.js";import{a as cs}from"./chunk-JD5P5RAJ.js";import{d as I,e as Zi,f as ot,g as Oe,h as fy,i as he,j as Re,k as yc,l as py,n as Fc,o as dy,s as Dy,t as md}from"./chunk-773TIA5M.js";import{a as ze,c as N,e as ai,f as oB,g as d}from"./chunk-VKWPEFWQ.js";var uF=N((Hc,oF)=>{d();(function(e,t){typeof Hc=="object"&&typeof oF<"u"?t(Hc,(mB(),oB(hB)),gB()):typeof define=="function"&&define.amd?define(["exports","tslib","graphql"],t):(e=typeof globalThis<"u"?globalThis:e||self,t(e["graphql-tag"]={},e.tslib,e.graphql))})(Hc,(function(e,t,r){"use strict";var n=new Map,o=new Map,s=!0,a=!1;function l(q){return q.replace(/[\s,]+/g," ").trim()}function p(q){return l(q.source.body.substring(q.start,q.end))}function m(q){var J=new Set,Q=[];return q.definitions.forEach(function(fe){if(fe.kind==="FragmentDefinition"){var ye=fe.name.value,We=p(fe.loc),gt=o.get(ye);gt&&!gt.has(We)?s&&console.warn("Warning: fragment with name "+ye+` already exists.
1
+ import{a as g0,b as _0}from"./chunk-HYPY5WH6.js";import{b as m0,o as AB}from"./chunk-YLQ3LNNY.js";import{a as bB}from"./chunk-VJEKDBGZ.js";import{a as h0}from"./chunk-LEW5IJK6.js";import{A as N0,D as M0,E as qc,c as f0,h as p0,i as d0,j as D0,k as hi,l as _s,m as C0,n as w0,o as b0,p as kc,q as Vo,r as A0,s as S0,t as x0,u as P0,v as B0,w as I0,y as R0,z as Pd}from"./chunk-2VJ6NBPV.js";import{a as l0}from"./chunk-CFQ5G2QS.js";import{b as gs,c as Ct}from"./chunk-A3V2A2I4.js";import{A as di,B as Di,C as no,E as Uc,I as O0,J as T0,a as bd,b as jr,c as Wo,g as Mc,i as jc,j as Ad,k as Sd,m as $c,n as y0,o as pi,p as F0,q as xd,r as E0,s as Ge,t as Ho,u as zo,v as v0,w as pn,x as Lc,y as gr,z as Te}from"./chunk-YNFXYVYN.js";import{aa as wB}from"./chunk-ZVA5F4QC.js";import{a as zy,b as Vy}from"./chunk-CBMX6XI7.js";import{a as c0}from"./chunk-WGFGWDWP.js";import{a as mr}from"./chunk-H7TDIRIU.js";import{$ as EB,D as Ry,M as jy,N as $y,P as Fd,S as Ly,Y as yB,Z as Uy,_ as FB,aa as ky,b as ds,ba as vB,ca as fn,d as Sc,da as Pc,e as xc,fa as qy,ga as vt,i as Oy,ia as Ds,ja as Wy,k as gB,n as li,na as Hy,r as Ty,t as By,v as E,x as Iy}from"./chunk-CNK3ZO2B.js";import{m as Oc,n as Gy,s as Jy,t as Yy,w as Tc,x as Bc}from"./chunk-6QADNGH4.js";import{A as Ic,B as Zy,D as Qy,E as Nr,F as vd,H as e0,J as ms,K as t0,M as r0,S as fi,V as Rc,y as ro,z as hs}from"./chunk-6C5AVMKR.js";import{a as CB}from"./chunk-5HBIIYSK.js";import{a as hd}from"./chunk-XOYICV6P.js";import{d as _B,e as Ny,q as My}from"./chunk-QKTBYAUD.js";import{f as Ed}from"./chunk-XRJCD3AO.js";import{a as Bn,b as to}from"./chunk-SPNM3GES.js";import{h as k,j as In,k as Mr}from"./chunk-OAG72Q2O.js";import{$a as ln,Ab as ce,Ba as wy,Bb as Rn,Db as s0,Ea as ci,Eb as a0,Fa as by,Ga as Cc,Ka as Ay,L as Qi,La as Sy,N as Bt,Oa as wc,Pa as xy,Q as hB,R as mB,T as Fy,Ta as X,Ua as Ut,V as ls,Wa as Ve,X as Lt,Xa as Py,Y as _d,_ as yd,aa as Ec,b as aB,bb as bc,c as cB,da as Ey,db as Ac,ea as qo,f as lB,gb as Ky,ha as vy,i as fB,k as pB,ka as fs,m as gy,ma as $e,n as _y,na as eo,oa as ps,pa as Ir,q as dB,qa as vc,qb as Ae,rb as Nc,sb as Se,u as yy,ua as mt,v as DB,va as Cy,w as gd,wa as Rr,xb as o0,zb as u0}from"./chunk-43FRAUV6.js";import{b as uB,c as sB,e as hy,f as my,i as Xy}from"./chunk-B4OMIONW.js";import{f as n0,k as Cd,l as wd,m as i0}from"./chunk-XYUTD6IU.js";import{a as cs}from"./chunk-JD5P5RAJ.js";import{d as I,e as Zi,f as ot,g as Oe,h as fy,i as he,j as Re,k as yc,l as py,n as Fc,o as dy,s as Dy,t as md}from"./chunk-773TIA5M.js";import{a as ze,c as N,e as ai,f as oB,g as d}from"./chunk-VKWPEFWQ.js";var uF=N((Hc,oF)=>{d();(function(e,t){typeof Hc=="object"&&typeof oF<"u"?t(Hc,(mB(),oB(hB)),gB()):typeof define=="function"&&define.amd?define(["exports","tslib","graphql"],t):(e=typeof globalThis<"u"?globalThis:e||self,t(e["graphql-tag"]={},e.tslib,e.graphql))})(Hc,(function(e,t,r){"use strict";var n=new Map,o=new Map,s=!0,a=!1;function l(q){return q.replace(/[\s,]+/g," ").trim()}function p(q){return l(q.source.body.substring(q.start,q.end))}function m(q){var J=new Set,Q=[];return q.definitions.forEach(function(fe){if(fe.kind==="FragmentDefinition"){var ye=fe.name.value,We=p(fe.loc),gt=o.get(ye);gt&&!gt.has(We)?s&&console.warn("Warning: fragment with name "+ye+` already exists.
2
2
  graphql-tag enforces all fragment names across your application to be unique; read more about
3
3
  this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):gt||o.set(ye,gt=new Set),gt.add(We),J.has(We)||(J.add(We),Q.push(fe))}else Q.push(fe)}),t.__assign(t.__assign({},q),{definitions:Q})}function g(q){var J=new Set(q.definitions);J.forEach(function(fe){fe.loc&&delete fe.loc,Object.keys(fe).forEach(function(ye){var We=fe[ye];We&&typeof We=="object"&&J.add(We)})});var Q=q.loc;return Q&&(delete Q.startToken,delete Q.endToken),q}function F(q){var J=l(q);if(!n.has(J)){var Q=r.parse(q,{experimentalFragmentVariables:a,allowLegacyFragmentVariables:a,experimentalFragmentArguments:a});if(!Q||Q.kind!=="Document")throw new Error("Not a valid GraphQL document.");n.set(J,g(m(Q)))}return n.get(J)}function w(q){for(var J=[],Q=1;Q<arguments.length;Q++)J[Q-1]=arguments[Q];typeof q=="string"&&(q=[q]);var fe=q[0];return J.forEach(function(ye,We){ye&&ye.kind==="Document"?fe+=ye.loc.source.body:fe+=ye,fe+=q[We+1]}),F(fe)}function v(){n.clear(),o.clear()}function S(){s=!1}function O(){a=!0}function P(){a=!1}var B={gql:w,resetCaches:v,disableFragmentWarnings:S,enableExperimentalFragmentVariables:O,disableExperimentalFragmentVariables:P};(function(q){q.gql=B.gql,q.resetCaches=B.resetCaches,q.disableFragmentWarnings=B.disableFragmentWarnings,q.enableExperimentalFragmentVariables=B.enableExperimentalFragmentVariables,q.disableExperimentalFragmentVariables=B.disableExperimentalFragmentVariables})(w||(w={})),w.default=w;var U=w;e.default=U,e.disableExperimentalFragmentVariables=P,e.disableFragmentWarnings=S,e.enableExperimentalFragmentVariables=O,e.gql=w,e.resetCaches=v,Object.defineProperty(e,"__esModule",{value:!0})}))});var aF=N((UH,sF)=>{d();sF.exports=uF().gql});var mF=N(hF=>{d();var VB=Object.create,zc=Object.defineProperty,KB=Object.getPrototypeOf,GB=Object.prototype.hasOwnProperty,JB=Object.getOwnPropertyNames,YB=Object.getOwnPropertyDescriptor,lF=e=>zc(e,"__esModule",{value:!0}),XB=(e,t)=>{lF(e);for(var r in t)zc(e,r,{get:t[r],enumerable:!0})},ZB=(e,t,r)=>{if(lF(e),t&&typeof t=="object"||typeof t=="function")for(let n of JB(t))!GB.call(e,n)&&n!=="default"&&zc(e,n,{get:()=>t[n],enumerable:!(r=YB(t,n))||r.enumerable});return e},Vc=e=>e&&e.__esModule?e:ZB(zc(e!=null?VB(KB(e)):{},"default",{value:e,enumerable:!0}),e);XB(hF,{default:()=>sI,generateContentsFromGraphqlString:()=>DF,generateGraphQLString:()=>pF});var QB=Vc(ze("fs")),eI=Vc(aF()),tI=Vc(ze("readline")),cF=Vc(ze("path")),fF=(e,t)=>{let r=t?t(e):e;return JSON.stringify(r,(n,o)=>o===void 0?"__undefined":o).replace(/"__undefined"/g,"undefined")},rI=(e,t)=>{let r=new Set,n=[],o=s=>{r.has(s)||(r.add(s),s.imports.forEach(a=>{let l=t[a.absolutePath];o(l)}),n.unshift(s))};return e.forEach(o),n},nI=e=>new Promise(t=>{let r=tI.default.createInterface({input:QB.default.createReadStream(e)}),n="",o=[],s=!1,a=(l,p)=>{let m=p.replace(l,""),g=m.replace(/"|'/g,""),F=cF.default.join(cF.default.dirname(e),g);o.push({absolutePath:F,relativePath:m})};r.on("line",l=>{l.startsWith("#import ")?a("#import ",l):l.startsWith("# import ")?a("# import ",l):s?n+=l+`
4
4
  `:l[0]!=="#"&&l!==""&&(s=!0,n+=l+`
@@ -246,7 +246,7 @@ Use caution as this may include production data on live stores.`]}:{}}):l=await
246
246
  `;a=a.concat(m,p)}return a}d();async function XX({app:e,appApiKey:t,extensionUuids:r,command:n},o=process.env){let s=e.dotenv;s??={path:I(e.directory,jE(e.configPath)),variables:{}};let a={...e.dotenv?.variables??{}};o[e.idEnvironmentVariableName]||(a[e.idEnvironmentVariableName]=t),Object.keys(r).forEach(p=>{let m=`SHOPIFY_${Ec(p)}_ID`;o[m]||(a[m]=r[p])});let l=n==="import-extensions";if(s.variables=a,l){let m=await X(s.path)?await $e(s.path):"",g=_0(m,a);await mt(s.path,g),e.dotenv=s}return e}function nv({app:e},t=process.env){let r={...e.dotenv?.variables,...t},n={},o=s=>{Object.keys(r).includes(s.idEnvironmentVariableName)&&(n[s.localIdentifier]=r[s.idEnvironmentVariableName])};return e.allExtensions.forEach(o),n}var iv=e=>({message:Se`Invalid Client ID: ${e}`,tryMessage:Se`You can find the Client ID in the app settings in the Developer Dashboard.`}),ov=["You can pass",{command:"--reset"},"to your command to reset your app configuration."],DR=(e,t=!1)=>[{list:{title:"Next steps:",items:["Check that your account has permission to develop apps for this organization or contact the owner of the organization to grant you permission",["Run",{command:"shopify auth login"},"to log into a different",t?"organization":"account","than",{bold:e}],["Pass",{command:"--reset"},"to your command to create a new app"]]}}],Dl=async e=>{let t=Pd(),r=await t.appFromIdentifiers(e.apiKey);if(!r){let n=await t.accountInfo()??{type:"UnknownAccount"},o="Unknown account",s=!1;throw $y(n)?(o=n.orgName,s=!0):jy(n)&&(o=n.email),new k(["No app with client ID",{command:e.apiKey},"found"],DR(o,s))}return r};async function gZ(e){let{noRelease:t,app:r,remoteApp:n,developerPlatformClient:o,organization:s}=e,a=await o.activeAppVersion(n);await hR(r),sv({org:s.businessName,appName:n.title,appDotEnv:r.dotenv?.path,configFile:Re(r.configPath),messages:[ov]});let l=await tv({app:r,appId:n.apiKey,appName:n.title,release:!t,developerPlatformClient:o,envIdentifiers:nv({app:r}),remoteApp:n,activeAppVersion:a,allowUpdates:e.allowUpdates,allowDeletes:e.allowDeletes}),p=!1;return a&&(p=a.appModuleVersions.some(m=>!m.registrationId)),{deployIdentifiers:l,didMigrateExtensionsToDevDash:p}}async function hR(e){let t=e.configuration.build?.include_config_on_deploy;if(t===void 0)return;await(await Ct.read(e.configPath)).remove("build.include_config_on_deploy"),t?mR():gR()}function mR(){ro({headline:"Your configuration file has been modified",body:["The `include_config_on_deploy` field is no longer supported, since all apps must now include configuration on deploy. It has been removed from your configuration file."],link:{label:"See Shopify CLI documentation.",url:"https://shopify.dev/docs/apps/build/cli-for-apps/app-configuration#build"}})}function gR(){Ic({headline:"Configuration is now included on deploy",body:["The `include_config_on_deploy` field is no longer supported and has been removed from your configuration file. Review this file to ensure it's up to date with the correct configuration."],link:{label:"See Shopify CLI documentation.",url:"https://shopify.dev/docs/apps/build/cli-for-apps/app-configuration#build"}})}async function uv(e){let t=Pd(),r=e.organizationId?await qc(e.organizationId,t):await _R(),{organization:n,apps:o,hasMorePages:s}=await t.orgAndApps(r.id),a=await LE(o,s,n,t,e);return await hD(a,t.organizationSource),a}async function _R(){let e=await M0();if(e.length===0)throw new k("No organizations found.","Make sure you have access to a Shopify organization.");return f0(e)}function _Z({organization:e,app:t,remoteApp:r,selectedStore:n,tunnelMode:o}){if(Dy())return;let s="Not yet configured",a=t.configuration.build?.automatically_update_urls_on_dev;a!==void 0&&(s=a?"Yes":"No");let l=[ov];o==="use-localhost"&&l.push(["Note:",{command:"--use-localhost"},"is not compatible with Shopify features which directly invoke your app","(such as Webhooks, App proxy, and Flow actions), or those which require testing your app from another","device (such as POS)."]),sv({org:e.businessName,appName:r.title,devStore:n.shopDomain,updateURLs:s,configFile:Re(t.configPath),messages:l})}function sv({org:e,appName:t,devStore:r,updateURLs:n,configFile:o,appDotEnv:s,messages:a}){let l=[];r&&l.push(r);let p=(s&&Re(s))??(o&&yr(o));ro({headline:o?`Using ${p} for default values:`:"Using these settings:",body:rv({appName:t,org:e,devStores:l,updateURLs:n,messages:a})})}async function hD(e,t){let n={[t===Vo.BusinessPlatform?"business_platform_id":"partner_id"]:ls(e.organizationId)};await mr.addPublicMetadata(()=>({...n,api_key:e.apiKey}))}d();d();async function av(e,t){ce(`Writing app configuration to ${t}`);let r=FR(structuredClone(e)),n=mD(r),o=new Ct(t,{});await o.replace(n),await o.transformRaw(yR)}function mD(e){if(e==null)return e;if(Array.isArray(e))return e.map(mD);if(typeof e=="object"){let t={};for(let[r,n]of Object.entries(e)){let o=mD(n);typeof o=="object"&&o!==null&&!Array.isArray(o)&&Object.keys(o).length===0||(t[r]=o)}return t}return e}function yR(e){let t=`# Learn more about configuring your app at https://shopify.dev/docs/apps/tools/cli/configuration
247
247
  `,r=`
248
248
  # Learn more at https://shopify.dev/docs/apps/tools/cli/configuration#access_scopes`,n=e.split(/(\r\n|\r|\n)/);return n.unshift(`
249
- `),n.unshift(t),n.forEach((o,s)=>{o==="[access_scopes]"&&n.splice(s+1,0,r)}),n.join("")}function FR(e){let t=e.webhooks;if(Array.isArray(t?.subscriptions)&&t.subscriptions.length){let r=no(e?.application_url);t.subscriptions=b0(t.subscriptions),t.subscriptions=t.subscriptions.map(({uri:n,...o})=>({uri:r&&n.includes(r)?n.replace(r,""):n,...o}))}return e}d();d();d();var ER=zo.extend({app_proxy:E.object({url:E.preprocess(no,jc(E.string({invalid_type_error:"Value must be string"}))),subpath:E.string({invalid_type_error:"Value must be a string"}),prefix:E.string({invalid_type_error:"Value must be a string"})}).optional()}),gD="app_proxy",vR={forward:(e,t)=>{let r=e;if(!r.app_proxy)return{};let n;return"application_url"in t&&(n=t?.application_url),{url:hi(r.app_proxy.url,n),subpath:r.app_proxy.subpath,prefix:r.app_proxy.prefix}},reverse:e=>{let t=e;return{app_proxy:{url:no(t.url),subpath:t.subpath,prefix:t.prefix}}}},CR=di({identifier:gD,schema:ER,transformConfig:vR,getDevSessionUpdateMessages:async e=>e.app_proxy?[`Using URL: ${e.app_proxy.url}`,"Any changes to prefix and subpath will only apply to new installs"]:[],patchWithAppDevURLs:(e,t)=>{t.appProxy&&(e.app_proxy={url:t.appProxy.proxyUrl,subpath:t.appProxy.proxySubPath,prefix:t.appProxy.proxySubPathPrefix})}}),cv=CR;d();var wR=zo.extend({pos:E.object({embedded:E.boolean({invalid_type_error:"Value must be Boolean"})}).optional()}),_D="point_of_sale",bR={embedded:"pos.embedded"},AR=di({identifier:_D,schema:wR,transformConfig:bR}),lv=AR;d();d();function fv(e,t){let r=e;if(!r.events?.subscription)return e;let n;return t&&"application_url"in t&&(n=t?.application_url),{...r,events:{...r.events,subscription:r.events.subscription.map(o=>({...o,uri:hi(o.uri,n)}))}}}function pv(e){let t=vt(e,"events"),r=vt(t,"api_version"),o=vt(t,"subscription")?.map(a=>{let{identifier:l,...p}=a;return p});return{events:r??o?{api_version:r,subscription:o}:{}}}var yD="events",SR={forward:fv,reverse:e=>pv(e)},xR=zo.extend({events:E.any().optional()}),PR=di({identifier:yD,schema:xR,transformConfig:SR}),dv=PR;d();var OR={forward:BR,reverse:e=>IR(e)},ED="privacy_compliance_webhooks",TR=di({identifier:ED,schema:kc,transformConfig:OR}),Dv=TR;function BR(e,t){let r=vt(e,"webhooks"),n;"application_url"in t&&(n=t?.application_url);let o=Wy({customers_redact_url:FD(RR(r),n),customers_data_request_url:FD(NR(r),n),shop_redact_url:FD(MR(r),n)});if(Object.keys(o).length===0)return o;{let{api_version:s}=r;return{api_version:s,...o}}}function IR(e){let t=vt(e,"customers_redact_url"),r=vt(e,"customers_data_request_url"),n=vt(e,"shop_redact_url"),o=[];return r&&o.push({compliance_topics:[Uc.CustomersDataRequest],uri:r}),t&&o.push({compliance_topics:[Uc.CustomersRedact],uri:t}),n&&o.push({compliance_topics:[Uc.ShopRedact],uri:n}),o.length===0?{}:{webhooks:{subscriptions:w0(o),privacy_compliance:void 0}}}function vD(e,t){return e.subscriptions?.find(r=>r.compliance_topics?.includes(t))?.uri}function FD(e,t){return t&&e?.startsWith("/")?`${no(t)}${e}`:e}function RR(e){return vD(e,"customers/redact")??e?.privacy_compliance?.customer_deletion_url}function NR(e){return vD(e,"customers/data_request")??e?.privacy_compliance?.customer_data_request_url}function MR(e){return vD(e,"shop/redact")??e?.privacy_compliance?.shop_deletion_url}d();var jR="@shopify/post-purchase-ui-extensions",$R=Ge.extend({metafields:E.array(pi).optional()}),LR=Te({identifier:"checkout_post_purchase",dependency:jR,partnersWebIdentifier:"post_purchase",schema:$R,appModuleFeatures:e=>["ui_preview","cart_url","esbuild","single_js_entry_path"],getOutputRelativePath:e=>`dist/${e.handle}.js`,clientSteps:[{lifecycle:"deploy",steps:[{id:"bundle-ui",name:"Bundle UI Extension",type:"bundle_ui",config:{}}]}],deployConfig:async(e,t)=>({metafields:e.metafields??[]})}),hv=LR;d();var UR="@shopify/checkout-ui-extensions",kR=Ge.extend({name:E.string(),extension_points:E.array(E.string()).optional(),metafields:E.array(pi).optional(),settings:E.object({fields:E.any().optional()}).optional()}),qR=Te({identifier:"checkout_ui_extension",dependency:UR,schema:kR,appModuleFeatures:e=>["ui_preview","cart_url","esbuild","single_js_entry_path","generates_source_maps"],getOutputRelativePath:e=>`dist/${e.handle}.js`,clientSteps:[{lifecycle:"deploy",steps:[{id:"bundle-ui",name:"Bundle UI Extension",type:"bundle_ui",config:{}}]}],deployConfig:async(e,t)=>({extension_points:e.extension_points,capabilities:e.capabilities,supported_features:e.supported_features,metafields:e.metafields??[],name:e.name,settings:e.settings,localization:await pn(t,"checkout_ui")})}),mv=qR;d();d();d();var wt={customer_reference:"customer_reference",order_reference:"order_reference",product_reference:"product_reference",marketing_activity_reference:"marketing_activity_reference",abandonment_reference:"abandonment_reference",company_reference:"company_reference",company_contact_reference:"company_contact_reference"},hQ=["customer","order","product","marketing_activity","abandonment","company","company_contact"],gv=[wt.customer_reference,wt.order_reference,wt.product_reference,wt.company_reference,wt.company_contact_reference],_v=[wt.customer_reference,wt.order_reference,wt.product_reference,wt.marketing_activity_reference,wt.abandonment_reference,wt.company_reference,wt.company_contact_reference],Qe={boolean:"boolean",email:"email",multiLineText:"multi_line_text_field",int:"number_integer",singleLineText:"single_line_text_field",url:"url",decimal:"number_decimal",schemaTypeReference:"schema_type_reference"},yv=[[Qe.boolean,"checkbox"],[Qe.email,"email"],[Qe.multiLineText,"text-multi-line"],[Qe.int,"int"],[Qe.singleLineText,"text-single-line"],[Qe.url,"url"],[Qe.decimal,"number"],[Qe.schemaTypeReference,"schema-type-reference"]],WR=[Qe.boolean,Qe.email,Qe.multiLineText,Qe.int,Qe.singleLineText,Qe.url,Qe.decimal],HR=[Qe.boolean,Qe.email,Qe.singleLineText,Qe.url,Qe.decimal,Qe.schemaTypeReference],Fv=yv.filter(([e])=>WR.includes(e)),Ev=yv.filter(([e])=>HR.includes(e));d();d();var zR=e=>{try{return new URL(e).protocol==="https:"}catch{return!1}},eu=(e,t,r)=>{let n=hi(t,r);if(n.startsWith("/"))throw new k(`Flow action ${e} is a relative URL, but no application_url is configured. Set application_url in your app configuration or use an absolute HTTPS URL.`);if(!zR(n))throw new k(`Flow action ${e} must resolve to an HTTPS URL. Set application_url to an HTTPS URL or use an absolute HTTPS URL.`);return n},hl=async(e,t)=>{if(!t)return"";let r=await Ve(I(e,t));if(r.length>1)throw new Error("Multiple files found for schema path");if(r.length===0)throw new Error("No file found for schema path");return $e(r[0])};d();var VR=new Map(Fv),KR=new Map(Ev),GR=(e,t)=>{let r=t==="flow_action"?VR:KR,n=CD(e.type),o=n?r.get("schema_type_reference"):r.get(e.type);if(typeof e.key!="string")throw new k(`key property must be specified for non-commerce object fields in ${JSON.stringify(e)}`);if(!o)throw new k(`Field type ${e.type} is not supported on Flow ${t==="flow_action"?"Actions":"Triggers"}`);let s={name:e.key,description:e.description,uiType:o};return t==="flow_action"&&(s.label=e.name,s.required=e.required),n&&(s.typeRefName=e.type.replace("schema.","")),s},JR=(e,t)=>{if(t==="flow_trigger"&&!gv.includes(e.type))throw new k(`Commerce object ${e.type} is not supported for Flow Triggers`);if(t==="flow_action"&&!_v.includes(e.type))throw new k(`Commerce object ${e.type} is not supported for Flow Actions`);let r=e.type.replace("_reference",""),n={name:`${r}_id`,uiType:t==="flow_action"?"commerce-object-id":r,description:e.description};return r==="marketing_activity"&&(n.uiType="marketing-activity-id",n.marketingActivityCreateUrl=e.marketingActivityCreateUrl,n.marketingActivityDeleteUrl=e.marketingActivityDeleteUrl),t==="flow_action"&&(n.label=`${qo(r)} ID`,n.required=e.required),n},ml=(e,t)=>t?t.map(n=>Object.keys(wt).includes(n.type)?JR(n,e):GR(n,e)):[];var wD=E0.extend({key:E.string().regex(/^[a-zA-Z\s]*$/,{message:"String must contain only alphabetic characters and spaces"}).optional()}),YR=Ho.extend({type:E.literal("flow_trigger"),name:E.string(),schema:E.string().optional(),settings:E.object({fields:E.array(wD).optional()}).optional()}).refine(e=>{let t=e.settings?.fields??[],r=t.every((o,s)=>gl(o,"flow_trigger",e.handle,s)),n=Cv(t,e.schema);return r&&n}),XR=Te({identifier:"flow_trigger",schema:YR,appModuleFeatures:e=>[],deployConfig:async(e,t)=>({title:e.name,description:e.description,fields:ml("flow_trigger",e.settings?.fields),schema_patch:await hl(t,e.schema)})}),vv=XR;function wv(e,t,r,n){let o=`'${e}' property must be a string for 'field[${n}]' ${JSON.stringify(t)} of flow extension '${r}'`;return{required_error:o,invalid_type_error:o}}var bD=E.object({type:E.string(),description:E.string().optional()}).strict(),gl=(e,t,r,n)=>{let o=Object.keys(wt).includes(e.type);return o?o?bD.extend({required:E.boolean().optional(),marketingActivityCreateUrl:E.string().optional(),marketingActivityDeleteUrl:E.string().optional()}).parse(e):bD.parse(e):t==="flow_action"?bD.extend({key:E.string(wv("key",e,r,n)),name:E.string(wv("name",e,r,n)),required:E.boolean().optional()}).parse(e):wD.parse(e)},CD=e=>e.startsWith("schema."),ZR=e=>/[\r\n\t]/.test(e),Bs=e=>jc(e,{message:'Invalid URL: URL must be an absolute HTTPS URL or a relative URL starting with a single slash (e.g. "/api/endpoint").'}).refine(t=>!ZR(t),{message:"Invalid URL: URL must not contain control characters such as newlines or tabs."}).refine(t=>!t.startsWith("//"),{message:"Invalid URL: Relative URLs must start with a single slash."}),bv=(e,t,r)=>{if(e||t){if(!e)throw new E.ZodError([{code:E.ZodIssueCode.custom,path:["extensions[0].config_page_url"],message:"To set a custom configuration page a `config_page_url` must be specified."}]);if(!t)throw new E.ZodError([{code:E.ZodIssueCode.custom,path:["extensions[0].config_page_preview_url"],message:"To set a custom configuration page a `config_page_preview_url` must be specified."}]);if(!r)throw new E.ZodError([{code:E.ZodIssueCode.custom,path:["extensions[0].validation_url"],message:"To set a custom configuration page a `validation_url` must be specified."}])}return!0},Cv=(e,t)=>{if(e.some(r=>CD(r.type))&&!t)throw new E.ZodError([{code:E.ZodIssueCode.custom,path:["extensions[0].schema"],message:"To reference schema types a `schema` must be specified."}]);return!0},Av=(e,t)=>{if(e||t){if(!e)throw new E.ZodError([{code:E.ZodIssueCode.custom,path:["extensions[0].return_type_ref"],message:"When uploading a schema a `return_type_ref` must be specified."}]);if(!t)throw new E.ZodError([{code:E.ZodIssueCode.custom,path:["extensions[0].schema"],message:"To set a return type a `schema` must be specified."}])}return!0};d();var Sv=["runtime_url","validation_url","config_page_url","config_page_preview_url"];var QR=Ho.extend({type:E.literal("flow_action"),name:E.string(),runtime_url:Bs(E.string({invalid_type_error:"Value must be string"})),validation_url:Bs(E.string({invalid_type_error:"Value must be string"})).optional(),config_page_url:Bs(E.string({invalid_type_error:"Value must be string"})).optional(),config_page_preview_url:Bs(E.string({invalid_type_error:"Value must be string"})).optional(),schema:E.string().optional(),return_type_ref:E.string().optional()}).refine(e=>{let t=bv(e.config_page_url,e.config_page_preview_url,e.validation_url),n=(e.settings?.fields??[]).every((s,a)=>gl(s,"flow_action",e.handle,a)),o=Av(e.return_type_ref,e.schema);return t&&n&&o}),eN=Te({identifier:"flow_action",schema:QR,appModuleFeatures:e=>[],patchWithAppDevURLs:(e,t)=>{for(let r of Sv){let n=e[r];typeof n=="string"&&n.startsWith("/")&&(e[r]=eu(r,n,t.applicationUrl))}},deployConfig:async(e,t,r,n,o)=>{let s=o?.appConfiguration,a=typeof s?.application_url=="string"?s.application_url:void 0;return{title:e.name,description:e.description,url:eu("runtime_url",e.runtime_url,a),fields:ml("flow_action",e.settings?.fields),validation_url:e.validation_url?eu("validation_url",e.validation_url,a):void 0,custom_configuration_page_url:e.config_page_url?eu("config_page_url",e.config_page_url,a):void 0,custom_configuration_page_preview_url:e.config_page_preview_url?eu("config_page_preview_url",e.config_page_preview_url,a):void 0,schema_patch:await hl(t,e.schema),return_type_ref:e.return_type_ref}}}),xv=eN;d();import tN from"fs";var Pv=["buyer_experience","customers","fulfillment","inventory_and_merch","loyalty","orders","promotion","risk","b2b","payment_reminders","custom_data","error_monitoring"],rN=["capture_at_fulfillment"],nN=Ho.extend({type:E.literal("flow_template"),name:E.string(),description:E.string().max(1024),template:E.object({categories:E.array(E.string().refine(e=>Pv.concat(rN).includes(e),e=>({message:`${e} is not a valid category. Valid categories include: ${Pv.join(", ")}.`}))),module:E.string(),require_app:E.boolean().optional(),discoverable:E.boolean().optional(),allow_one_click_activate:E.boolean().optional(),enabled:E.boolean().optional()})}),iN=Te({identifier:"flow_template",schema:nN,appModuleFeatures:e=>["ui_preview"],clientSteps:[{lifecycle:"deploy",steps:[{id:"copy-files",name:"Copy Files",type:"include_assets",config:{inclusions:[{type:"pattern",include:["**/*.flow","**/*.json","**/*.toml"]}]}}]}],deployConfig:async(e,t)=>({template_handle:e.handle,name:e.name,description:e.description,categories:e.template.categories,require_app:e.template.require_app,discoverable:e.template.discoverable,allow_one_click_activate:e.template.allow_one_click_activate,enabled:e.template.enabled,definition:await oN(t,e.template.module),localization:await pn(t,e.name)})});async function oN(e,t){let n=(await Ve(I(e,t)))[0];if(!n)throw new k(`Missing flow file with the path ${I(e,t)}`);return tN.readFileSync(n,"base64")}var Ov=iN;d();var uN=Ge.extend({build:E.object({command:E.string().transform(e=>e.trim()===""?void 0:e).optional(),path:E.string().optional(),watch:E.union([E.string(),E.string().array()]).optional(),wasm_opt:E.boolean().optional().default(!0),typegen_command:E.string().transform(e=>e.trim()===""?void 0:e).optional()}).optional(),name:E.string(),type:E.string(),configuration_ui:E.boolean().optional().default(!0),ui:E.object({enable_create:E.boolean().optional(),paths:E.object({create:E.string(),details:E.string()}).optional(),handle:E.string().optional()}).optional(),api_version:E.string(),input:E.object({variables:E.object({namespace:E.string(),key:E.string()}).optional()}).optional(),targeting:E.array(E.object({target:E.string(),input_query:E.string().optional(),export:E.string().optional()})).optional()}),sN=Te({identifier:"function",additionalIdentifiers:["order_discounts","cart_checkout_validation","cart_transform","delivery_customization","payment_customization","product_discounts","shipping_discounts","fulfillment_constraints","order_routing_location_rule","local_pickup_delivery_option_generator","pickup_point_delivery_option_generator"],schema:uN,appModuleFeatures:e=>["function"],getOutputRelativePath:e=>I("dist","index.wasm"),devSessionWatchConfig:e=>{let t=e.configuration;if(!t.build||!t.build.watch)return;let r=[t.build.watch].flat().map(n=>I(e.directory,n));return r.push(I(e.directory,"locales","**.json")),r.push(I(e.directory,"**","!(.)*.graphql")),r.push(I(e.directory,"**.toml")),{paths:r}},clientSteps:[{lifecycle:"deploy",steps:[{id:"build-function",name:"Build Function",type:"build_function",config:{}}]}],deployConfig:async(e,t,r)=>{let n,o=Sc(),s=I(t,"input.graphql");await X(s)&&(n=await $e(s));let a=e.targeting&&await Promise.all(e.targeting.map(async p=>{let m;return p.input_query&&(m=await aN(I(t,p.input_query))),{handle:p.target,export:p.export,input_query:m}})),l;return e.ui?.paths&&(l={app_bridge:{details_path:e.ui.paths.details,create_path:e.ui.paths.create}}),e.ui?.handle!==void 0&&(l={...l,ui_extension_handle:e.ui.handle}),{title:e.name,module_id:o,description:e.description,app_key:r,api_type:e.type==="function"?void 0:e.type,api_version:e.api_version,input_query:n,input_query_variables:e.input?.variables?{single_json_metafield:e.input.variables}:void 0,ui:l,enable_creation_ui:e.ui?.enable_create??!0,localization:await pn(t,"function"),targets:a}},preDeployValidation:async e=>{if(!await X(e.outputPath))throw new k(Se`The function extension "${e.handle}" hasn't compiled the wasm in the expected path: ${e.outputPath}`,"Make sure the build command outputs the wasm in the expected directory.")}});async function aN(e){if(await X(e))return $e(e);throw new k(`No input query file at ${e}.`,"Create the file or remove the line referencing it in the extension's TOML.")}var Tv=sN;d();d();d();var Bv=50,Fr=Ge.extend({api_version:E.string(),payment_session_url:E.string().url(),refund_session_url:E.string().url().optional(),capture_session_url:E.string().url().optional(),void_session_url:E.string().url().optional(),supported_countries:E.array(E.string()),supported_payment_methods:E.array(E.string()),test_mode_available:E.boolean(),merchant_label:E.string().max(Bv),input:E.object({metafield_identifiers:E.object({namespace:E.string(),key:E.string()}).optional()}).optional()}),gi=E.object({buyer_label:E.string().max(Bv).optional(),buyer_label_translations:E.array(E.object({locale:E.string(),label:E.string()})).optional()}),tu=E.object({supports_installments:E.boolean().optional(),supports_deferred_payments:E.boolean().optional()}),_l=E.object({multiple_capture:E.boolean().optional()}),_i=E.object({confirmation_callback_url:E.string().url().optional(),supports_3ds:E.boolean()}),Dn=E.object({supported_buyer_contexts:E.array(E.object({currency:E.string(),countries:E.array(E.string()).nonempty().optional()}).strict()).optional().refine(e=>e===void 0||e.every(t=>t.countries)||e.every(t=>!t.countries),{message:"Must all be defined with only a currency, or must all be defined with a currency plus countries -- a mixture of the two is not allowed"})});var AD="payments.offsite.render",Iv=Fr.merge(gi).merge(tu).merge(_i).merge(_l).merge(Dn).extend({targeting:E.array(E.object({target:E.literal(AD)})).length(1),supports_oversell_protection:E.boolean().optional(),supports_3ds:E.boolean().optional()}).refine(e=>!e.supports_oversell_protection||e.confirmation_callback_url,{message:"Property required when supports_oversell_protection is true",path:["confirmation_callback_url"]}).refine(e=>e.supports_installments===e.supports_deferred_payments,{message:"supports_installments and supports_deferred_payments must be the same"});function xee(e){return{api_version:e.api_version,payment_session_url:e.start_payment_session_url,refund_session_url:e.start_refund_session_url,capture_session_url:e.start_capture_session_url,void_session_url:e.start_void_session_url,confirmation_callback_url:e.confirmation_callback_url,multiple_capture:e.multiple_capture,merchant_label:e.merchant_label,supported_countries:e.supported_countries,supported_payment_methods:e.supported_payment_methods,supported_buyer_contexts:e.supported_buyer_contexts,test_mode_available:e.test_mode_available,buyer_label:e.default_buyer_label,buyer_label_translations:e.buyer_label_to_locale,supports_oversell_protection:e.supports_oversell_protection,supports_3ds:e.supports_3ds,supports_deferred_payments:e.supports_deferred_payments,supports_installments:e.supports_installments}}async function Rv(e){return{api_version:e.api_version,start_payment_session_url:e.payment_session_url,start_refund_session_url:e.refund_session_url,start_capture_session_url:e.capture_session_url,start_void_session_url:e.void_session_url,confirmation_callback_url:e.confirmation_callback_url,multiple_capture:e.multiple_capture,merchant_label:e.merchant_label,supported_countries:e.supported_countries,supported_payment_methods:e.supported_payment_methods,supported_buyer_contexts:e.supported_buyer_contexts,test_mode_available:e.test_mode_available,default_buyer_label:e.buyer_label,buyer_label_to_locale:e.buyer_label_translations,supports_oversell_protection:e.supports_oversell_protection,supports_3ds:e.supports_3ds,supports_deferred_payments:e.supports_deferred_payments,supports_installments:e.supports_installments}}d();d();function yi(e,t){let r=e.ui_extension_handle;if(r||!("ui_extension_registration_uuid"in e))return r;let n=t.find(o=>o.uuid===e.ui_extension_registration_uuid)?.title;return n?Lt(n):r}var SD="payments.redeemable.render",Nv=Fr.merge(gi).merge(Dn).extend({targeting:E.array(E.object({target:E.literal(SD)})).length(1),api_version:E.string(),balance_url:E.string().url(),ui_extension_handle:E.string().optional(),checkout_payment_method_fields:E.array(E.object({type:E.union([E.literal("string"),E.literal("number"),E.literal("boolean")]),required:E.boolean(),key:E.string()})).optional()});function jee(e,t){let r=yi(e,t);return{api_version:e.api_version,payment_session_url:e.start_payment_session_url,refund_session_url:e.start_refund_session_url,capture_session_url:e.start_capture_session_url,void_session_url:e.start_void_session_url,merchant_label:e.merchant_label,supported_countries:e.supported_countries,supported_payment_methods:e.supported_payment_methods,supported_buyer_contexts:e.supported_buyer_contexts,test_mode_available:e.test_mode_available,buyer_label:e.default_buyer_label,buyer_label_translations:e.buyer_label_to_locale,balance_url:e.balance_url,checkout_payment_method_fields:e.checkout_payment_method_fields?.map(n=>({key:n.key,type:n.type,required:n.required})),ui_extension_handle:r}}async function Mv(e){let t=e.supported_payment_methods[0]==="gift-card"?"gift_card":null;return{api_version:e.api_version,start_payment_session_url:e.payment_session_url,start_refund_session_url:e.refund_session_url,start_capture_session_url:e.capture_session_url,start_void_session_url:e.void_session_url,merchant_label:e.merchant_label,supported_countries:e.supported_countries,supported_payment_methods:e.supported_payment_methods,supported_buyer_contexts:e.supported_buyer_contexts,test_mode_available:e.test_mode_available,default_buyer_label:e.buyer_label,buyer_label_to_locale:e.buyer_label_translations,balance_url:e.balance_url,redeemable_type:t,checkout_payment_method_fields:e.checkout_payment_method_fields,ui_extension_handle:e.ui_extension_handle}}d();var xD="payments.custom-onsite.render",jv=7,$v=Fr.merge(gi).merge(tu).merge(_i).merge(Dn).extend({targeting:E.array(E.object({target:E.literal(xD)})).length(1),supports_3ds:E.boolean().optional(),update_payment_session_url:E.string().url().optional(),multiple_capture:E.boolean().optional(),supports_oversell_protection:E.boolean().optional(),modal_payment_method_fields:E.array(E.object({})).optional(),ui_extension_handle:E.string().optional(),start_verification_session_url:E.string().url().optional(),checkout_payment_method_fields:E.array(E.object({type:E.union([E.literal("string"),E.literal("number"),E.literal("boolean")]),required:E.boolean(),key:E.string()})).max(jv,`The extension can't have more than ${jv} checkout_payment_method_fields`).optional()}).refine(e=>e.supports_installments===e.supports_deferred_payments,{message:"supports_installments and supports_deferred_payments must be the same"});function Wee(e,t){let r=yi(e,t);return{api_version:e.api_version,payment_session_url:e.start_payment_session_url,refund_session_url:e.start_refund_session_url,capture_session_url:e.start_capture_session_url,void_session_url:e.start_void_session_url,confirmation_callback_url:e.confirmation_callback_url,update_payment_session_url:e.update_payment_session_url,start_verification_session_url:e.start_verification_session_url,merchant_label:e.merchant_label,supports_oversell_protection:e.supports_oversell_protection,supports_3ds:e.supports_3ds,supports_installments:e.supports_installments,supports_deferred_payments:e.supports_deferred_payments,supported_countries:e.supported_countries,supported_payment_methods:e.supported_payment_methods,supported_buyer_contexts:e.supported_buyer_contexts,test_mode_available:e.test_mode_available,multiple_capture:e.multiple_capture,buyer_label:e.default_buyer_label,buyer_label_translations:e.buyer_label_to_locale,checkout_payment_method_fields:e.checkout_payment_method_fields,modal_payment_method_fields:e.modal_payment_method_fields,ui_extension_handle:r}}async function Lv(e){return{api_version:e.api_version,start_payment_session_url:e.payment_session_url,start_refund_session_url:e.refund_session_url,start_capture_session_url:e.capture_session_url,start_void_session_url:e.void_session_url,confirmation_callback_url:e.confirmation_callback_url,update_payment_session_url:e.update_payment_session_url,start_verification_session_url:e.start_verification_session_url,merchant_label:e.merchant_label,supports_oversell_protection:e.supports_oversell_protection,supports_3ds:e.supports_3ds,supports_installments:e.supports_installments,supports_deferred_payments:e.supports_deferred_payments,supported_countries:e.supported_countries,supported_payment_methods:e.supported_payment_methods,supported_buyer_contexts:e.supported_buyer_contexts,test_mode_available:e.test_mode_available,multiple_capture:e.multiple_capture,default_buyer_label:e.buyer_label,buyer_label_to_locale:e.buyer_label_translations,checkout_payment_method_fields:e.checkout_payment_method_fields,modal_payment_method_fields:e.modal_payment_method_fields,ui_extension_handle:e.ui_extension_handle}}d();var PD="payments.custom-credit-card.render",Uv=7,kv=Fr.merge(gi).merge(_i).merge(Dn).required({refund_session_url:!0,capture_session_url:!0,void_session_url:!0}).extend({targeting:E.array(E.object({target:E.literal(PD)})).length(1),api_version:E.string(),multiple_capture:E.boolean(),checkout_hosted_fields:E.array(E.string()).optional(),ui_extension_handle:E.string().optional(),encryption_certificate_fingerprint:E.string(),checkout_payment_method_fields:E.array(E.object({type:E.union([E.literal("string"),E.literal("number"),E.literal("boolean")]),required:E.boolean(),key:E.string()})).max(Uv,`The extension can't have more than ${Uv} checkout_payment_method_fields`).optional()});function Jee(e,t){let r=yi(e,t);return{api_version:e.api_version,payment_session_url:e.start_payment_session_url,refund_session_url:e.start_refund_session_url,capture_session_url:e.start_capture_session_url,void_session_url:e.start_void_session_url,confirmation_callback_url:e.confirmation_callback_url,merchant_label:e.merchant_label,supports_3ds:e.supports_3ds,supported_countries:e.supported_countries,supported_payment_methods:e.supported_payment_methods,supported_buyer_contexts:e.supported_buyer_contexts,buyer_label:e.default_buyer_label,buyer_label_translations:e.buyer_label_to_locale,encryption_certificate_fingerprint:e.encryption_certificate.fingerprint,test_mode_available:e.test_mode_available,multiple_capture:e.multiple_capture,checkout_payment_method_fields:e.checkout_payment_method_fields,checkout_hosted_fields:e.checkout_hosted_fields,ui_extension_handle:r}}async function qv(e){return{api_version:e.api_version,start_payment_session_url:e.payment_session_url,start_refund_session_url:e.refund_session_url,start_capture_session_url:e.capture_session_url,start_void_session_url:e.void_session_url,confirmation_callback_url:e.confirmation_callback_url,merchant_label:e.merchant_label,supports_3ds:e.supports_3ds,supported_countries:e.supported_countries,supported_buyer_contexts:e.supported_buyer_contexts,default_buyer_label:e.buyer_label,buyer_label_to_locale:e.buyer_label_translations,encryption_certificate_fingerprint:e.encryption_certificate_fingerprint,supported_payment_methods:e.supported_payment_methods,test_mode_available:e.test_mode_available,multiple_capture:e.multiple_capture,checkout_payment_method_fields:e.checkout_payment_method_fields,checkout_hosted_fields:e.checkout_hosted_fields,ui_extension_handle:e.ui_extension_handle}}d();var OD="payments.credit-card.render",Wv=7,Hv=Fr.merge(tu).merge(_i).merge(_l).merge(Dn).required({refund_session_url:!0,capture_session_url:!0,void_session_url:!0}).extend({targeting:E.array(E.object({target:E.literal(OD)})).length(1),verification_session_url:E.string().url().optional(),ui_extension_handle:E.string().optional(),supports_moto:E.boolean({required_error:"supports_moto is required",invalid_type_error:"Value must be Boolean"}),encryption_certificate_fingerprint:E.string(),checkout_payment_method_fields:E.array(E.object({type:E.union([E.literal("string"),E.literal("number"),E.literal("boolean")]),required:E.boolean(),key:E.string()})).max(Wv,`The extension can't have more than ${Wv} checkout_payment_method_fields`).optional()}).refine(e=>!e.supports_3ds||e.confirmation_callback_url,{message:"Property required when supports_3ds is true",path:["confirmation_callback_url"]}).refine(e=>e.supports_installments===e.supports_deferred_payments,{message:"supports_installments and supports_deferred_payments must be the same"});function tte(e,t){let r=yi(e,t);return{api_version:e.api_version,payment_session_url:e.start_payment_session_url,refund_session_url:e.start_refund_session_url,capture_session_url:e.start_capture_session_url,void_session_url:e.start_void_session_url,confirmation_callback_url:e.confirmation_callback_url,multiple_capture:e.multiple_capture,merchant_label:e.merchant_label,supported_countries:e.supported_countries,supported_payment_methods:e.supported_payment_methods,supported_buyer_contexts:e.supported_buyer_contexts,test_mode_available:e.test_mode_available,supports_3ds:e.supports_3ds,supports_moto:e.supports_moto,supports_deferred_payments:e.supports_deferred_payments,supports_installments:e.supports_installments,verification_session_url:e.start_verification_session_url,encryption_certificate_fingerprint:e.encryption_certificate.fingerprint,checkout_payment_method_fields:e.checkout_payment_method_fields,ui_extension_handle:r}}async function zv(e){return{api_version:e.api_version,start_payment_session_url:e.payment_session_url,start_refund_session_url:e.refund_session_url,start_capture_session_url:e.capture_session_url,start_void_session_url:e.void_session_url,confirmation_callback_url:e.confirmation_callback_url,multiple_capture:e.multiple_capture,merchant_label:e.merchant_label,supported_countries:e.supported_countries,supported_payment_methods:e.supported_payment_methods,supported_buyer_contexts:e.supported_buyer_contexts,test_mode_available:e.test_mode_available,supports_3ds:e.supports_3ds,supports_moto:e.supports_moto,supports_deferred_payments:e.supports_deferred_payments,encryption_certificate_fingerprint:e.encryption_certificate_fingerprint,supports_installments:e.supports_installments,start_verification_session_url:e.verification_session_url,checkout_payment_method_fields:e.checkout_payment_method_fields,ui_extension_handle:e.ui_extension_handle}}d();var TD="payments.card-present.render",Vv=Fr.required({refund_session_url:!0,capture_session_url:!0,void_session_url:!0}).extend({targeting:E.array(E.object({target:E.literal(TD)})).length(1),sync_terminal_transaction_result_url:E.string().url().optional()});function ute(e){return{api_version:e.api_version,payment_session_url:e.start_payment_session_url,refund_session_url:e.start_refund_session_url,capture_session_url:e.start_capture_session_url,void_session_url:e.start_void_session_url,sync_terminal_transaction_result_url:e.sync_terminal_transaction_result_url,merchant_label:e.merchant_label,supported_countries:e.supported_countries,supported_payment_methods:e.supported_payment_methods,test_mode_available:e.test_mode_available}}async function Kv(e){return{api_version:e.api_version,start_payment_session_url:e.payment_session_url,start_refund_session_url:e.refund_session_url,start_capture_session_url:e.capture_session_url,start_void_session_url:e.void_session_url,sync_terminal_transaction_result_url:e.sync_terminal_transaction_result_url,merchant_label:e.merchant_label,supported_countries:e.supported_countries,supported_payment_methods:e.supported_payment_methods,test_mode_available:e.test_mode_available}}var cN=E.union([Iv,Nv,$v,kv,Hv,Vv]),lN=Te({identifier:"payments_extension",schema:cN,appModuleFeatures:e=>[],deployConfig:async(e,t)=>{switch(e.targeting[0]?.target){case AD:return Rv(e);case SD:return Mv(e);case OD:return zv(e);case xD:return Lv(e);case PD:return qv(e);case TD:return Kv(e);default:return{}}}}),Gv=lN;d();var BD="@shopify/retail-ui-extensions",fN=Ge.extend({name:E.string()}),pN=Te({identifier:"pos_ui_extension",dependency:BD,schema:fN,appModuleFeatures:e=>["ui_preview","esbuild","single_js_entry_path"],getOutputRelativePath:e=>`dist/${e.handle}.js`,clientSteps:[{lifecycle:"deploy",steps:[{id:"bundle-ui",name:"Bundle UI Extension",type:"bundle_ui",config:{}}]}],deployConfig:async(e,t)=>{let r=await Ss(BD,t);if(r==="not_found")throw new Mr(`Dependency ${BD} not found`);return{name:e.name,description:e.description,renderer_version:r?.version}}}),Jv=pN;d();var ID="@shopify/admin-ui-extensions",dN=Te({identifier:"product_subscription",additionalIdentifiers:["subscription_management"],dependency:ID,graphQLType:"subscription_management",schema:Ge,appModuleFeatures:e=>["ui_preview","esbuild","single_js_entry_path"],getOutputRelativePath:e=>`dist/${e.handle}.js`,clientSteps:[{lifecycle:"deploy",steps:[{id:"bundle-ui",name:"Bundle UI Extension",type:"bundle_ui",config:{}}]}],deployConfig:async(e,t)=>{let r=await Ss(ID,t);if(r==="not_found")throw new Mr(`Dependency ${ID} not found`);return{renderer_version:r?.version}}}),Yv=dN;d();var DN=E.object({key:E.string()}),hN=Ge.extend({production_api_base_url:E.string(),benchmark_api_base_url:E.string().optional(),calculate_taxes_api_endpoint:E.string(),input:E.object({metafield_identifiers:E.object({namespace:E.string(),key:E.string()}).optional()}).optional(),metafields:E.array(pi).optional(),cart_line_properties:E.array(DN).optional()}),mN=Te({identifier:"tax_calculation",schema:hN,appModuleFeatures:e=>[],getOutputRelativePath:e=>I("dist",`${e.handle}.js`),clientSteps:[{lifecycle:"deploy",steps:[{id:"create-tax-stub",name:"Create Tax Stub",type:"create_tax_stub",config:{}}]}],deployConfig:async(e,t)=>({production_api_base_url:e.production_api_base_url,benchmark_api_base_url:e.benchmark_api_base_url,calculate_taxes_api_endpoint:e.calculate_taxes_api_endpoint,metafields:e.metafields,cart_line_properties:e.cart_line_properties,api_version:e.api_version,metafield_identifiers:e.input?.metafield_identifiers})}),Xv=mN;d();var gN=Te({identifier:"theme",schema:Ge,partnersWebIdentifier:"theme_app_extension",graphQLType:"theme_app_extension",clientSteps:[{lifecycle:"deploy",steps:[{id:"build-theme",name:"Build Theme Extension",type:"build_theme",config:{}},{id:"bundle-theme",name:"Bundle Theme Extension",type:"bundle_theme",config:{}}]}],appModuleFeatures:e=>["theme"],deployConfig:async()=>({theme_extension:{files:{}}}),preDeployValidation:async e=>FN(e)}),rC=gN,RD=1024,nC=RD*1024,iC=10,_N=iC*nC,oC=500,yN=oC*RD,Zv=[".jpg",".jpeg",".json",".js",".css",".png",".svg",".wasm"],Qv=[".json"],uC={assets:{validator:new RegExp(`${Zv.join("|")}$`),failureMessage:e=>`Only these filetypes are supported in assets: ${Zv.join(", ")}`},blocks:{validator:/.liquid$/,failureMessage:e=>"Only .liquid files are allowed in blocks."},locales:{validator:new RegExp(`${Qv.join("|")}$`),failureMessage:e=>`Only these filetypes are supported in locales: ${Qv.join(", ")}`},snippets:{validator:/.liquid$/,failureMessage:e=>"Only .liquid files are allowed in snippets."}},eC=Object.keys(uC);async function FN(e){let t=await Cs(e),r=[],n=[];await Promise.all(t.map(async o=>{let s=Oe(e.directory,o),a=he(s);CN(s,a);let l=await Cc(o);n.push(l),["blocks","snippets"].includes(a)&&r.push(l)})),EN(tC(n)),vN(tC(r))}function EN(e){if(e>_N){let t=`${(e/nC).toFixed(2)} MB`;throw new k(`Your theme app extension exceeds the file size limit (${iC} MB). It's currently ${t}.`,"Reduce your total file size and try again.")}}function vN(e){if(e>yN){let t=`${(e/RD).toFixed(2)} kB`;throw new k(`Your theme app extension exceeds the total liquid file size limit (${oC} kB). It's currently ${t}.`,"Reduce your total file size and try again.")}}function CN(e,t){if(!eC.includes(t))throw new k(Se`Your theme app extension includes files in an unsupported directory, ${Ae.path(t)}`,`Make sure all theme app extension files are in the supported directories: ${eC.join(", ")}`);let r=uC[t];if(!e.match(r.validator))throw new k(`Invalid filename in your theme app extension: ${e}
249
+ `),n.unshift(t),n.forEach((o,s)=>{o==="[access_scopes]"&&n.splice(s+1,0,r)}),n.join("")}function FR(e){let t=e.webhooks;if(Array.isArray(t?.subscriptions)&&t.subscriptions.length){let r=no(e?.application_url);t.subscriptions=b0(t.subscriptions),t.subscriptions=t.subscriptions.map(({uri:n,...o})=>({uri:r&&n.includes(r)?n.replace(r,""):n,...o}))}return e}d();d();d();var ER=zo.extend({app_proxy:E.object({url:E.preprocess(no,jc(E.string({invalid_type_error:"Value must be string"}))),subpath:E.string({invalid_type_error:"Value must be a string"}),prefix:E.string({invalid_type_error:"Value must be a string"})}).optional()}),gD="app_proxy",vR={forward:(e,t)=>{let r=e;if(!r.app_proxy)return{};let n;return"application_url"in t&&(n=t?.application_url),{url:hi(r.app_proxy.url,n),subpath:r.app_proxy.subpath,prefix:r.app_proxy.prefix}},reverse:e=>{let t=e;return{app_proxy:{url:no(t.url),subpath:t.subpath,prefix:t.prefix}}}},CR=di({identifier:gD,schema:ER,transformConfig:vR,getDevSessionUpdateMessages:async e=>e.app_proxy?[`Using URL: ${e.app_proxy.url}`,"Any changes to prefix and subpath will only apply to new installs"]:[],patchWithAppDevURLs:(e,t)=>{t.appProxy&&(e.app_proxy={url:t.appProxy.proxyUrl,subpath:t.appProxy.proxySubPath,prefix:t.appProxy.proxySubPathPrefix})}}),cv=CR;d();var wR=zo.extend({pos:E.object({embedded:E.boolean({invalid_type_error:"Value must be Boolean"})}).optional()}),_D="point_of_sale",bR={embedded:"pos.embedded"},AR=di({identifier:_D,schema:wR,transformConfig:bR}),lv=AR;d();d();function fv(e,t){let r=e;if(!r.events?.subscription)return e;let n;return t&&"application_url"in t&&(n=t?.application_url),{...r,events:{...r.events,subscription:r.events.subscription.map(o=>({...o,uri:hi(o.uri,n)}))}}}function pv(e){let t=vt(e,"events"),r=vt(t,"api_version"),o=vt(t,"subscription")?.map(a=>{let{identifier:l,api_version:p,...m}=a;return p!==void 0&&p!==r?{...m,api_version:p}:m});return{events:r??o?{api_version:r,subscription:o}:{}}}var yD="events",SR={forward:fv,reverse:e=>pv(e)},xR=zo.extend({events:E.any().optional()}),PR=di({identifier:yD,schema:xR,transformConfig:SR}),dv=PR;d();var OR={forward:BR,reverse:e=>IR(e)},ED="privacy_compliance_webhooks",TR=di({identifier:ED,schema:kc,transformConfig:OR}),Dv=TR;function BR(e,t){let r=vt(e,"webhooks"),n;"application_url"in t&&(n=t?.application_url);let o=Wy({customers_redact_url:FD(RR(r),n),customers_data_request_url:FD(NR(r),n),shop_redact_url:FD(MR(r),n)});if(Object.keys(o).length===0)return o;{let{api_version:s}=r;return{api_version:s,...o}}}function IR(e){let t=vt(e,"customers_redact_url"),r=vt(e,"customers_data_request_url"),n=vt(e,"shop_redact_url"),o=[];return r&&o.push({compliance_topics:[Uc.CustomersDataRequest],uri:r}),t&&o.push({compliance_topics:[Uc.CustomersRedact],uri:t}),n&&o.push({compliance_topics:[Uc.ShopRedact],uri:n}),o.length===0?{}:{webhooks:{subscriptions:w0(o),privacy_compliance:void 0}}}function vD(e,t){return e.subscriptions?.find(r=>r.compliance_topics?.includes(t))?.uri}function FD(e,t){return t&&e?.startsWith("/")?`${no(t)}${e}`:e}function RR(e){return vD(e,"customers/redact")??e?.privacy_compliance?.customer_deletion_url}function NR(e){return vD(e,"customers/data_request")??e?.privacy_compliance?.customer_data_request_url}function MR(e){return vD(e,"shop/redact")??e?.privacy_compliance?.shop_deletion_url}d();var jR="@shopify/post-purchase-ui-extensions",$R=Ge.extend({metafields:E.array(pi).optional()}),LR=Te({identifier:"checkout_post_purchase",dependency:jR,partnersWebIdentifier:"post_purchase",schema:$R,appModuleFeatures:e=>["ui_preview","cart_url","esbuild","single_js_entry_path"],getOutputRelativePath:e=>`dist/${e.handle}.js`,clientSteps:[{lifecycle:"deploy",steps:[{id:"bundle-ui",name:"Bundle UI Extension",type:"bundle_ui",config:{}}]}],deployConfig:async(e,t)=>({metafields:e.metafields??[]})}),hv=LR;d();var UR="@shopify/checkout-ui-extensions",kR=Ge.extend({name:E.string(),extension_points:E.array(E.string()).optional(),metafields:E.array(pi).optional(),settings:E.object({fields:E.any().optional()}).optional()}),qR=Te({identifier:"checkout_ui_extension",dependency:UR,schema:kR,appModuleFeatures:e=>["ui_preview","cart_url","esbuild","single_js_entry_path","generates_source_maps"],getOutputRelativePath:e=>`dist/${e.handle}.js`,clientSteps:[{lifecycle:"deploy",steps:[{id:"bundle-ui",name:"Bundle UI Extension",type:"bundle_ui",config:{}}]}],deployConfig:async(e,t)=>({extension_points:e.extension_points,capabilities:e.capabilities,supported_features:e.supported_features,metafields:e.metafields??[],name:e.name,settings:e.settings,localization:await pn(t,"checkout_ui")})}),mv=qR;d();d();d();var wt={customer_reference:"customer_reference",order_reference:"order_reference",product_reference:"product_reference",marketing_activity_reference:"marketing_activity_reference",abandonment_reference:"abandonment_reference",company_reference:"company_reference",company_contact_reference:"company_contact_reference"},hQ=["customer","order","product","marketing_activity","abandonment","company","company_contact"],gv=[wt.customer_reference,wt.order_reference,wt.product_reference,wt.company_reference,wt.company_contact_reference],_v=[wt.customer_reference,wt.order_reference,wt.product_reference,wt.marketing_activity_reference,wt.abandonment_reference,wt.company_reference,wt.company_contact_reference],Qe={boolean:"boolean",email:"email",multiLineText:"multi_line_text_field",int:"number_integer",singleLineText:"single_line_text_field",url:"url",decimal:"number_decimal",schemaTypeReference:"schema_type_reference"},yv=[[Qe.boolean,"checkbox"],[Qe.email,"email"],[Qe.multiLineText,"text-multi-line"],[Qe.int,"int"],[Qe.singleLineText,"text-single-line"],[Qe.url,"url"],[Qe.decimal,"number"],[Qe.schemaTypeReference,"schema-type-reference"]],WR=[Qe.boolean,Qe.email,Qe.multiLineText,Qe.int,Qe.singleLineText,Qe.url,Qe.decimal],HR=[Qe.boolean,Qe.email,Qe.singleLineText,Qe.url,Qe.decimal,Qe.schemaTypeReference],Fv=yv.filter(([e])=>WR.includes(e)),Ev=yv.filter(([e])=>HR.includes(e));d();d();var zR=e=>{try{return new URL(e).protocol==="https:"}catch{return!1}},eu=(e,t,r)=>{let n=hi(t,r);if(n.startsWith("/"))throw new k(`Flow action ${e} is a relative URL, but no application_url is configured. Set application_url in your app configuration or use an absolute HTTPS URL.`);if(!zR(n))throw new k(`Flow action ${e} must resolve to an HTTPS URL. Set application_url to an HTTPS URL or use an absolute HTTPS URL.`);return n},hl=async(e,t)=>{if(!t)return"";let r=await Ve(I(e,t));if(r.length>1)throw new Error("Multiple files found for schema path");if(r.length===0)throw new Error("No file found for schema path");return $e(r[0])};d();var VR=new Map(Fv),KR=new Map(Ev),GR=(e,t)=>{let r=t==="flow_action"?VR:KR,n=CD(e.type),o=n?r.get("schema_type_reference"):r.get(e.type);if(typeof e.key!="string")throw new k(`key property must be specified for non-commerce object fields in ${JSON.stringify(e)}`);if(!o)throw new k(`Field type ${e.type} is not supported on Flow ${t==="flow_action"?"Actions":"Triggers"}`);let s={name:e.key,description:e.description,uiType:o};return t==="flow_action"&&(s.label=e.name,s.required=e.required),n&&(s.typeRefName=e.type.replace("schema.","")),s},JR=(e,t)=>{if(t==="flow_trigger"&&!gv.includes(e.type))throw new k(`Commerce object ${e.type} is not supported for Flow Triggers`);if(t==="flow_action"&&!_v.includes(e.type))throw new k(`Commerce object ${e.type} is not supported for Flow Actions`);let r=e.type.replace("_reference",""),n={name:`${r}_id`,uiType:t==="flow_action"?"commerce-object-id":r,description:e.description};return r==="marketing_activity"&&(n.uiType="marketing-activity-id",n.marketingActivityCreateUrl=e.marketingActivityCreateUrl,n.marketingActivityDeleteUrl=e.marketingActivityDeleteUrl),t==="flow_action"&&(n.label=`${qo(r)} ID`,n.required=e.required),n},ml=(e,t)=>t?t.map(n=>Object.keys(wt).includes(n.type)?JR(n,e):GR(n,e)):[];var wD=E0.extend({key:E.string().regex(/^[a-zA-Z\s]*$/,{message:"String must contain only alphabetic characters and spaces"}).optional()}),YR=Ho.extend({type:E.literal("flow_trigger"),name:E.string(),schema:E.string().optional(),settings:E.object({fields:E.array(wD).optional()}).optional()}).refine(e=>{let t=e.settings?.fields??[],r=t.every((o,s)=>gl(o,"flow_trigger",e.handle,s)),n=Cv(t,e.schema);return r&&n}),XR=Te({identifier:"flow_trigger",schema:YR,appModuleFeatures:e=>[],deployConfig:async(e,t)=>({title:e.name,description:e.description,fields:ml("flow_trigger",e.settings?.fields),schema_patch:await hl(t,e.schema)})}),vv=XR;function wv(e,t,r,n){let o=`'${e}' property must be a string for 'field[${n}]' ${JSON.stringify(t)} of flow extension '${r}'`;return{required_error:o,invalid_type_error:o}}var bD=E.object({type:E.string(),description:E.string().optional()}).strict(),gl=(e,t,r,n)=>{let o=Object.keys(wt).includes(e.type);return o?o?bD.extend({required:E.boolean().optional(),marketingActivityCreateUrl:E.string().optional(),marketingActivityDeleteUrl:E.string().optional()}).parse(e):bD.parse(e):t==="flow_action"?bD.extend({key:E.string(wv("key",e,r,n)),name:E.string(wv("name",e,r,n)),required:E.boolean().optional()}).parse(e):wD.parse(e)},CD=e=>e.startsWith("schema."),ZR=e=>/[\r\n\t]/.test(e),Bs=e=>jc(e,{message:'Invalid URL: URL must be an absolute HTTPS URL or a relative URL starting with a single slash (e.g. "/api/endpoint").'}).refine(t=>!ZR(t),{message:"Invalid URL: URL must not contain control characters such as newlines or tabs."}).refine(t=>!t.startsWith("//"),{message:"Invalid URL: Relative URLs must start with a single slash."}),bv=(e,t,r)=>{if(e||t){if(!e)throw new E.ZodError([{code:E.ZodIssueCode.custom,path:["extensions[0].config_page_url"],message:"To set a custom configuration page a `config_page_url` must be specified."}]);if(!t)throw new E.ZodError([{code:E.ZodIssueCode.custom,path:["extensions[0].config_page_preview_url"],message:"To set a custom configuration page a `config_page_preview_url` must be specified."}]);if(!r)throw new E.ZodError([{code:E.ZodIssueCode.custom,path:["extensions[0].validation_url"],message:"To set a custom configuration page a `validation_url` must be specified."}])}return!0},Cv=(e,t)=>{if(e.some(r=>CD(r.type))&&!t)throw new E.ZodError([{code:E.ZodIssueCode.custom,path:["extensions[0].schema"],message:"To reference schema types a `schema` must be specified."}]);return!0},Av=(e,t)=>{if(e||t){if(!e)throw new E.ZodError([{code:E.ZodIssueCode.custom,path:["extensions[0].return_type_ref"],message:"When uploading a schema a `return_type_ref` must be specified."}]);if(!t)throw new E.ZodError([{code:E.ZodIssueCode.custom,path:["extensions[0].schema"],message:"To set a return type a `schema` must be specified."}])}return!0};d();var Sv=["runtime_url","validation_url","config_page_url","config_page_preview_url"];var QR=Ho.extend({type:E.literal("flow_action"),name:E.string(),runtime_url:Bs(E.string({invalid_type_error:"Value must be string"})),validation_url:Bs(E.string({invalid_type_error:"Value must be string"})).optional(),config_page_url:Bs(E.string({invalid_type_error:"Value must be string"})).optional(),config_page_preview_url:Bs(E.string({invalid_type_error:"Value must be string"})).optional(),schema:E.string().optional(),return_type_ref:E.string().optional()}).refine(e=>{let t=bv(e.config_page_url,e.config_page_preview_url,e.validation_url),n=(e.settings?.fields??[]).every((s,a)=>gl(s,"flow_action",e.handle,a)),o=Av(e.return_type_ref,e.schema);return t&&n&&o}),eN=Te({identifier:"flow_action",schema:QR,appModuleFeatures:e=>[],patchWithAppDevURLs:(e,t)=>{for(let r of Sv){let n=e[r];typeof n=="string"&&n.startsWith("/")&&(e[r]=eu(r,n,t.applicationUrl))}},deployConfig:async(e,t,r,n,o)=>{let s=o?.appConfiguration,a=typeof s?.application_url=="string"?s.application_url:void 0;return{title:e.name,description:e.description,url:eu("runtime_url",e.runtime_url,a),fields:ml("flow_action",e.settings?.fields),validation_url:e.validation_url?eu("validation_url",e.validation_url,a):void 0,custom_configuration_page_url:e.config_page_url?eu("config_page_url",e.config_page_url,a):void 0,custom_configuration_page_preview_url:e.config_page_preview_url?eu("config_page_preview_url",e.config_page_preview_url,a):void 0,schema_patch:await hl(t,e.schema),return_type_ref:e.return_type_ref}}}),xv=eN;d();import tN from"fs";var Pv=["buyer_experience","customers","fulfillment","inventory_and_merch","loyalty","orders","promotion","risk","b2b","payment_reminders","custom_data","error_monitoring"],rN=["capture_at_fulfillment"],nN=Ho.extend({type:E.literal("flow_template"),name:E.string(),description:E.string().max(1024),template:E.object({categories:E.array(E.string().refine(e=>Pv.concat(rN).includes(e),e=>({message:`${e} is not a valid category. Valid categories include: ${Pv.join(", ")}.`}))),module:E.string(),require_app:E.boolean().optional(),discoverable:E.boolean().optional(),allow_one_click_activate:E.boolean().optional(),enabled:E.boolean().optional()})}),iN=Te({identifier:"flow_template",schema:nN,appModuleFeatures:e=>["ui_preview"],clientSteps:[{lifecycle:"deploy",steps:[{id:"copy-files",name:"Copy Files",type:"include_assets",config:{inclusions:[{type:"pattern",include:["**/*.flow","**/*.json","**/*.toml"]}]}}]}],deployConfig:async(e,t)=>({template_handle:e.handle,name:e.name,description:e.description,categories:e.template.categories,require_app:e.template.require_app,discoverable:e.template.discoverable,allow_one_click_activate:e.template.allow_one_click_activate,enabled:e.template.enabled,definition:await oN(t,e.template.module),localization:await pn(t,e.name)})});async function oN(e,t){let n=(await Ve(I(e,t)))[0];if(!n)throw new k(`Missing flow file with the path ${I(e,t)}`);return tN.readFileSync(n,"base64")}var Ov=iN;d();var uN=Ge.extend({build:E.object({command:E.string().transform(e=>e.trim()===""?void 0:e).optional(),path:E.string().optional(),watch:E.union([E.string(),E.string().array()]).optional(),wasm_opt:E.boolean().optional().default(!0),typegen_command:E.string().transform(e=>e.trim()===""?void 0:e).optional()}).optional(),name:E.string(),type:E.string(),configuration_ui:E.boolean().optional().default(!0),ui:E.object({enable_create:E.boolean().optional(),paths:E.object({create:E.string(),details:E.string()}).optional(),handle:E.string().optional()}).optional(),api_version:E.string(),input:E.object({variables:E.object({namespace:E.string(),key:E.string()}).optional()}).optional(),targeting:E.array(E.object({target:E.string(),input_query:E.string().optional(),export:E.string().optional()})).optional()}),sN=Te({identifier:"function",additionalIdentifiers:["order_discounts","cart_checkout_validation","cart_transform","delivery_customization","payment_customization","product_discounts","shipping_discounts","fulfillment_constraints","order_routing_location_rule","local_pickup_delivery_option_generator","pickup_point_delivery_option_generator"],schema:uN,appModuleFeatures:e=>["function"],getOutputRelativePath:e=>I("dist","index.wasm"),devSessionWatchConfig:e=>{let t=e.configuration;if(!t.build||!t.build.watch)return;let r=[t.build.watch].flat().map(n=>I(e.directory,n));return r.push(I(e.directory,"locales","**.json")),r.push(I(e.directory,"**","!(.)*.graphql")),r.push(I(e.directory,"**.toml")),{paths:r}},clientSteps:[{lifecycle:"deploy",steps:[{id:"build-function",name:"Build Function",type:"build_function",config:{}}]}],deployConfig:async(e,t,r)=>{let n,o=Sc(),s=I(t,"input.graphql");await X(s)&&(n=await $e(s));let a=e.targeting&&await Promise.all(e.targeting.map(async p=>{let m;return p.input_query&&(m=await aN(I(t,p.input_query))),{handle:p.target,export:p.export,input_query:m}})),l;return e.ui?.paths&&(l={app_bridge:{details_path:e.ui.paths.details,create_path:e.ui.paths.create}}),e.ui?.handle!==void 0&&(l={...l,ui_extension_handle:e.ui.handle}),{title:e.name,module_id:o,description:e.description,app_key:r,api_type:e.type==="function"?void 0:e.type,api_version:e.api_version,input_query:n,input_query_variables:e.input?.variables?{single_json_metafield:e.input.variables}:void 0,ui:l,enable_creation_ui:e.ui?.enable_create??!0,localization:await pn(t,"function"),targets:a}},preDeployValidation:async e=>{if(!await X(e.outputPath))throw new k(Se`The function extension "${e.handle}" hasn't compiled the wasm in the expected path: ${e.outputPath}`,"Make sure the build command outputs the wasm in the expected directory.")}});async function aN(e){if(await X(e))return $e(e);throw new k(`No input query file at ${e}.`,"Create the file or remove the line referencing it in the extension's TOML.")}var Tv=sN;d();d();d();var Bv=50,Fr=Ge.extend({api_version:E.string(),payment_session_url:E.string().url(),refund_session_url:E.string().url().optional(),capture_session_url:E.string().url().optional(),void_session_url:E.string().url().optional(),supported_countries:E.array(E.string()),supported_payment_methods:E.array(E.string()),test_mode_available:E.boolean(),merchant_label:E.string().max(Bv),input:E.object({metafield_identifiers:E.object({namespace:E.string(),key:E.string()}).optional()}).optional()}),gi=E.object({buyer_label:E.string().max(Bv).optional(),buyer_label_translations:E.array(E.object({locale:E.string(),label:E.string()})).optional()}),tu=E.object({supports_installments:E.boolean().optional(),supports_deferred_payments:E.boolean().optional()}),_l=E.object({multiple_capture:E.boolean().optional()}),_i=E.object({confirmation_callback_url:E.string().url().optional(),supports_3ds:E.boolean()}),Dn=E.object({supported_buyer_contexts:E.array(E.object({currency:E.string(),countries:E.array(E.string()).nonempty().optional()}).strict()).optional().refine(e=>e===void 0||e.every(t=>t.countries)||e.every(t=>!t.countries),{message:"Must all be defined with only a currency, or must all be defined with a currency plus countries -- a mixture of the two is not allowed"})});var AD="payments.offsite.render",Iv=Fr.merge(gi).merge(tu).merge(_i).merge(_l).merge(Dn).extend({targeting:E.array(E.object({target:E.literal(AD)})).length(1),supports_oversell_protection:E.boolean().optional(),supports_3ds:E.boolean().optional()}).refine(e=>!e.supports_oversell_protection||e.confirmation_callback_url,{message:"Property required when supports_oversell_protection is true",path:["confirmation_callback_url"]}).refine(e=>e.supports_installments===e.supports_deferred_payments,{message:"supports_installments and supports_deferred_payments must be the same"});function xee(e){return{api_version:e.api_version,payment_session_url:e.start_payment_session_url,refund_session_url:e.start_refund_session_url,capture_session_url:e.start_capture_session_url,void_session_url:e.start_void_session_url,confirmation_callback_url:e.confirmation_callback_url,multiple_capture:e.multiple_capture,merchant_label:e.merchant_label,supported_countries:e.supported_countries,supported_payment_methods:e.supported_payment_methods,supported_buyer_contexts:e.supported_buyer_contexts,test_mode_available:e.test_mode_available,buyer_label:e.default_buyer_label,buyer_label_translations:e.buyer_label_to_locale,supports_oversell_protection:e.supports_oversell_protection,supports_3ds:e.supports_3ds,supports_deferred_payments:e.supports_deferred_payments,supports_installments:e.supports_installments}}async function Rv(e){return{api_version:e.api_version,start_payment_session_url:e.payment_session_url,start_refund_session_url:e.refund_session_url,start_capture_session_url:e.capture_session_url,start_void_session_url:e.void_session_url,confirmation_callback_url:e.confirmation_callback_url,multiple_capture:e.multiple_capture,merchant_label:e.merchant_label,supported_countries:e.supported_countries,supported_payment_methods:e.supported_payment_methods,supported_buyer_contexts:e.supported_buyer_contexts,test_mode_available:e.test_mode_available,default_buyer_label:e.buyer_label,buyer_label_to_locale:e.buyer_label_translations,supports_oversell_protection:e.supports_oversell_protection,supports_3ds:e.supports_3ds,supports_deferred_payments:e.supports_deferred_payments,supports_installments:e.supports_installments}}d();d();function yi(e,t){let r=e.ui_extension_handle;if(r||!("ui_extension_registration_uuid"in e))return r;let n=t.find(o=>o.uuid===e.ui_extension_registration_uuid)?.title;return n?Lt(n):r}var SD="payments.redeemable.render",Nv=Fr.merge(gi).merge(Dn).extend({targeting:E.array(E.object({target:E.literal(SD)})).length(1),api_version:E.string(),balance_url:E.string().url(),ui_extension_handle:E.string().optional(),checkout_payment_method_fields:E.array(E.object({type:E.union([E.literal("string"),E.literal("number"),E.literal("boolean")]),required:E.boolean(),key:E.string()})).optional()});function jee(e,t){let r=yi(e,t);return{api_version:e.api_version,payment_session_url:e.start_payment_session_url,refund_session_url:e.start_refund_session_url,capture_session_url:e.start_capture_session_url,void_session_url:e.start_void_session_url,merchant_label:e.merchant_label,supported_countries:e.supported_countries,supported_payment_methods:e.supported_payment_methods,supported_buyer_contexts:e.supported_buyer_contexts,test_mode_available:e.test_mode_available,buyer_label:e.default_buyer_label,buyer_label_translations:e.buyer_label_to_locale,balance_url:e.balance_url,checkout_payment_method_fields:e.checkout_payment_method_fields?.map(n=>({key:n.key,type:n.type,required:n.required})),ui_extension_handle:r}}async function Mv(e){let t=e.supported_payment_methods[0]==="gift-card"?"gift_card":null;return{api_version:e.api_version,start_payment_session_url:e.payment_session_url,start_refund_session_url:e.refund_session_url,start_capture_session_url:e.capture_session_url,start_void_session_url:e.void_session_url,merchant_label:e.merchant_label,supported_countries:e.supported_countries,supported_payment_methods:e.supported_payment_methods,supported_buyer_contexts:e.supported_buyer_contexts,test_mode_available:e.test_mode_available,default_buyer_label:e.buyer_label,buyer_label_to_locale:e.buyer_label_translations,balance_url:e.balance_url,redeemable_type:t,checkout_payment_method_fields:e.checkout_payment_method_fields,ui_extension_handle:e.ui_extension_handle}}d();var xD="payments.custom-onsite.render",jv=7,$v=Fr.merge(gi).merge(tu).merge(_i).merge(Dn).extend({targeting:E.array(E.object({target:E.literal(xD)})).length(1),supports_3ds:E.boolean().optional(),update_payment_session_url:E.string().url().optional(),multiple_capture:E.boolean().optional(),supports_oversell_protection:E.boolean().optional(),modal_payment_method_fields:E.array(E.object({})).optional(),ui_extension_handle:E.string().optional(),start_verification_session_url:E.string().url().optional(),checkout_payment_method_fields:E.array(E.object({type:E.union([E.literal("string"),E.literal("number"),E.literal("boolean")]),required:E.boolean(),key:E.string()})).max(jv,`The extension can't have more than ${jv} checkout_payment_method_fields`).optional()}).refine(e=>e.supports_installments===e.supports_deferred_payments,{message:"supports_installments and supports_deferred_payments must be the same"});function Wee(e,t){let r=yi(e,t);return{api_version:e.api_version,payment_session_url:e.start_payment_session_url,refund_session_url:e.start_refund_session_url,capture_session_url:e.start_capture_session_url,void_session_url:e.start_void_session_url,confirmation_callback_url:e.confirmation_callback_url,update_payment_session_url:e.update_payment_session_url,start_verification_session_url:e.start_verification_session_url,merchant_label:e.merchant_label,supports_oversell_protection:e.supports_oversell_protection,supports_3ds:e.supports_3ds,supports_installments:e.supports_installments,supports_deferred_payments:e.supports_deferred_payments,supported_countries:e.supported_countries,supported_payment_methods:e.supported_payment_methods,supported_buyer_contexts:e.supported_buyer_contexts,test_mode_available:e.test_mode_available,multiple_capture:e.multiple_capture,buyer_label:e.default_buyer_label,buyer_label_translations:e.buyer_label_to_locale,checkout_payment_method_fields:e.checkout_payment_method_fields,modal_payment_method_fields:e.modal_payment_method_fields,ui_extension_handle:r}}async function Lv(e){return{api_version:e.api_version,start_payment_session_url:e.payment_session_url,start_refund_session_url:e.refund_session_url,start_capture_session_url:e.capture_session_url,start_void_session_url:e.void_session_url,confirmation_callback_url:e.confirmation_callback_url,update_payment_session_url:e.update_payment_session_url,start_verification_session_url:e.start_verification_session_url,merchant_label:e.merchant_label,supports_oversell_protection:e.supports_oversell_protection,supports_3ds:e.supports_3ds,supports_installments:e.supports_installments,supports_deferred_payments:e.supports_deferred_payments,supported_countries:e.supported_countries,supported_payment_methods:e.supported_payment_methods,supported_buyer_contexts:e.supported_buyer_contexts,test_mode_available:e.test_mode_available,multiple_capture:e.multiple_capture,default_buyer_label:e.buyer_label,buyer_label_to_locale:e.buyer_label_translations,checkout_payment_method_fields:e.checkout_payment_method_fields,modal_payment_method_fields:e.modal_payment_method_fields,ui_extension_handle:e.ui_extension_handle}}d();var PD="payments.custom-credit-card.render",Uv=7,kv=Fr.merge(gi).merge(_i).merge(Dn).required({refund_session_url:!0,capture_session_url:!0,void_session_url:!0}).extend({targeting:E.array(E.object({target:E.literal(PD)})).length(1),api_version:E.string(),multiple_capture:E.boolean(),checkout_hosted_fields:E.array(E.string()).optional(),ui_extension_handle:E.string().optional(),encryption_certificate_fingerprint:E.string(),checkout_payment_method_fields:E.array(E.object({type:E.union([E.literal("string"),E.literal("number"),E.literal("boolean")]),required:E.boolean(),key:E.string()})).max(Uv,`The extension can't have more than ${Uv} checkout_payment_method_fields`).optional()});function Jee(e,t){let r=yi(e,t);return{api_version:e.api_version,payment_session_url:e.start_payment_session_url,refund_session_url:e.start_refund_session_url,capture_session_url:e.start_capture_session_url,void_session_url:e.start_void_session_url,confirmation_callback_url:e.confirmation_callback_url,merchant_label:e.merchant_label,supports_3ds:e.supports_3ds,supported_countries:e.supported_countries,supported_payment_methods:e.supported_payment_methods,supported_buyer_contexts:e.supported_buyer_contexts,buyer_label:e.default_buyer_label,buyer_label_translations:e.buyer_label_to_locale,encryption_certificate_fingerprint:e.encryption_certificate.fingerprint,test_mode_available:e.test_mode_available,multiple_capture:e.multiple_capture,checkout_payment_method_fields:e.checkout_payment_method_fields,checkout_hosted_fields:e.checkout_hosted_fields,ui_extension_handle:r}}async function qv(e){return{api_version:e.api_version,start_payment_session_url:e.payment_session_url,start_refund_session_url:e.refund_session_url,start_capture_session_url:e.capture_session_url,start_void_session_url:e.void_session_url,confirmation_callback_url:e.confirmation_callback_url,merchant_label:e.merchant_label,supports_3ds:e.supports_3ds,supported_countries:e.supported_countries,supported_buyer_contexts:e.supported_buyer_contexts,default_buyer_label:e.buyer_label,buyer_label_to_locale:e.buyer_label_translations,encryption_certificate_fingerprint:e.encryption_certificate_fingerprint,supported_payment_methods:e.supported_payment_methods,test_mode_available:e.test_mode_available,multiple_capture:e.multiple_capture,checkout_payment_method_fields:e.checkout_payment_method_fields,checkout_hosted_fields:e.checkout_hosted_fields,ui_extension_handle:e.ui_extension_handle}}d();var OD="payments.credit-card.render",Wv=7,Hv=Fr.merge(tu).merge(_i).merge(_l).merge(Dn).required({refund_session_url:!0,capture_session_url:!0,void_session_url:!0}).extend({targeting:E.array(E.object({target:E.literal(OD)})).length(1),verification_session_url:E.string().url().optional(),ui_extension_handle:E.string().optional(),supports_moto:E.boolean({required_error:"supports_moto is required",invalid_type_error:"Value must be Boolean"}),encryption_certificate_fingerprint:E.string(),checkout_payment_method_fields:E.array(E.object({type:E.union([E.literal("string"),E.literal("number"),E.literal("boolean")]),required:E.boolean(),key:E.string()})).max(Wv,`The extension can't have more than ${Wv} checkout_payment_method_fields`).optional()}).refine(e=>!e.supports_3ds||e.confirmation_callback_url,{message:"Property required when supports_3ds is true",path:["confirmation_callback_url"]}).refine(e=>e.supports_installments===e.supports_deferred_payments,{message:"supports_installments and supports_deferred_payments must be the same"});function tte(e,t){let r=yi(e,t);return{api_version:e.api_version,payment_session_url:e.start_payment_session_url,refund_session_url:e.start_refund_session_url,capture_session_url:e.start_capture_session_url,void_session_url:e.start_void_session_url,confirmation_callback_url:e.confirmation_callback_url,multiple_capture:e.multiple_capture,merchant_label:e.merchant_label,supported_countries:e.supported_countries,supported_payment_methods:e.supported_payment_methods,supported_buyer_contexts:e.supported_buyer_contexts,test_mode_available:e.test_mode_available,supports_3ds:e.supports_3ds,supports_moto:e.supports_moto,supports_deferred_payments:e.supports_deferred_payments,supports_installments:e.supports_installments,verification_session_url:e.start_verification_session_url,encryption_certificate_fingerprint:e.encryption_certificate.fingerprint,checkout_payment_method_fields:e.checkout_payment_method_fields,ui_extension_handle:r}}async function zv(e){return{api_version:e.api_version,start_payment_session_url:e.payment_session_url,start_refund_session_url:e.refund_session_url,start_capture_session_url:e.capture_session_url,start_void_session_url:e.void_session_url,confirmation_callback_url:e.confirmation_callback_url,multiple_capture:e.multiple_capture,merchant_label:e.merchant_label,supported_countries:e.supported_countries,supported_payment_methods:e.supported_payment_methods,supported_buyer_contexts:e.supported_buyer_contexts,test_mode_available:e.test_mode_available,supports_3ds:e.supports_3ds,supports_moto:e.supports_moto,supports_deferred_payments:e.supports_deferred_payments,encryption_certificate_fingerprint:e.encryption_certificate_fingerprint,supports_installments:e.supports_installments,start_verification_session_url:e.verification_session_url,checkout_payment_method_fields:e.checkout_payment_method_fields,ui_extension_handle:e.ui_extension_handle}}d();var TD="payments.card-present.render",Vv=Fr.required({refund_session_url:!0,capture_session_url:!0,void_session_url:!0}).extend({targeting:E.array(E.object({target:E.literal(TD)})).length(1),sync_terminal_transaction_result_url:E.string().url().optional()});function ute(e){return{api_version:e.api_version,payment_session_url:e.start_payment_session_url,refund_session_url:e.start_refund_session_url,capture_session_url:e.start_capture_session_url,void_session_url:e.start_void_session_url,sync_terminal_transaction_result_url:e.sync_terminal_transaction_result_url,merchant_label:e.merchant_label,supported_countries:e.supported_countries,supported_payment_methods:e.supported_payment_methods,test_mode_available:e.test_mode_available}}async function Kv(e){return{api_version:e.api_version,start_payment_session_url:e.payment_session_url,start_refund_session_url:e.refund_session_url,start_capture_session_url:e.capture_session_url,start_void_session_url:e.void_session_url,sync_terminal_transaction_result_url:e.sync_terminal_transaction_result_url,merchant_label:e.merchant_label,supported_countries:e.supported_countries,supported_payment_methods:e.supported_payment_methods,test_mode_available:e.test_mode_available}}var cN=E.union([Iv,Nv,$v,kv,Hv,Vv]),lN=Te({identifier:"payments_extension",schema:cN,appModuleFeatures:e=>[],deployConfig:async(e,t)=>{switch(e.targeting[0]?.target){case AD:return Rv(e);case SD:return Mv(e);case OD:return zv(e);case xD:return Lv(e);case PD:return qv(e);case TD:return Kv(e);default:return{}}}}),Gv=lN;d();var BD="@shopify/retail-ui-extensions",fN=Ge.extend({name:E.string()}),pN=Te({identifier:"pos_ui_extension",dependency:BD,schema:fN,appModuleFeatures:e=>["ui_preview","esbuild","single_js_entry_path"],getOutputRelativePath:e=>`dist/${e.handle}.js`,clientSteps:[{lifecycle:"deploy",steps:[{id:"bundle-ui",name:"Bundle UI Extension",type:"bundle_ui",config:{}}]}],deployConfig:async(e,t)=>{let r=await Ss(BD,t);if(r==="not_found")throw new Mr(`Dependency ${BD} not found`);return{name:e.name,description:e.description,renderer_version:r?.version}}}),Jv=pN;d();var ID="@shopify/admin-ui-extensions",dN=Te({identifier:"product_subscription",additionalIdentifiers:["subscription_management"],dependency:ID,graphQLType:"subscription_management",schema:Ge,appModuleFeatures:e=>["ui_preview","esbuild","single_js_entry_path"],getOutputRelativePath:e=>`dist/${e.handle}.js`,clientSteps:[{lifecycle:"deploy",steps:[{id:"bundle-ui",name:"Bundle UI Extension",type:"bundle_ui",config:{}}]}],deployConfig:async(e,t)=>{let r=await Ss(ID,t);if(r==="not_found")throw new Mr(`Dependency ${ID} not found`);return{renderer_version:r?.version}}}),Yv=dN;d();var DN=E.object({key:E.string()}),hN=Ge.extend({production_api_base_url:E.string(),benchmark_api_base_url:E.string().optional(),calculate_taxes_api_endpoint:E.string(),input:E.object({metafield_identifiers:E.object({namespace:E.string(),key:E.string()}).optional()}).optional(),metafields:E.array(pi).optional(),cart_line_properties:E.array(DN).optional()}),mN=Te({identifier:"tax_calculation",schema:hN,appModuleFeatures:e=>[],getOutputRelativePath:e=>I("dist",`${e.handle}.js`),clientSteps:[{lifecycle:"deploy",steps:[{id:"create-tax-stub",name:"Create Tax Stub",type:"create_tax_stub",config:{}}]}],deployConfig:async(e,t)=>({production_api_base_url:e.production_api_base_url,benchmark_api_base_url:e.benchmark_api_base_url,calculate_taxes_api_endpoint:e.calculate_taxes_api_endpoint,metafields:e.metafields,cart_line_properties:e.cart_line_properties,api_version:e.api_version,metafield_identifiers:e.input?.metafield_identifiers})}),Xv=mN;d();var gN=Te({identifier:"theme",schema:Ge,partnersWebIdentifier:"theme_app_extension",graphQLType:"theme_app_extension",clientSteps:[{lifecycle:"deploy",steps:[{id:"build-theme",name:"Build Theme Extension",type:"build_theme",config:{}},{id:"bundle-theme",name:"Bundle Theme Extension",type:"bundle_theme",config:{}}]}],appModuleFeatures:e=>["theme"],deployConfig:async()=>({theme_extension:{files:{}}}),preDeployValidation:async e=>FN(e)}),rC=gN,RD=1024,nC=RD*1024,iC=10,_N=iC*nC,oC=500,yN=oC*RD,Zv=[".jpg",".jpeg",".json",".js",".css",".png",".svg",".wasm"],Qv=[".json"],uC={assets:{validator:new RegExp(`${Zv.join("|")}$`),failureMessage:e=>`Only these filetypes are supported in assets: ${Zv.join(", ")}`},blocks:{validator:/.liquid$/,failureMessage:e=>"Only .liquid files are allowed in blocks."},locales:{validator:new RegExp(`${Qv.join("|")}$`),failureMessage:e=>`Only these filetypes are supported in locales: ${Qv.join(", ")}`},snippets:{validator:/.liquid$/,failureMessage:e=>"Only .liquid files are allowed in snippets."}},eC=Object.keys(uC);async function FN(e){let t=await Cs(e),r=[],n=[];await Promise.all(t.map(async o=>{let s=Oe(e.directory,o),a=he(s);CN(s,a);let l=await Cc(o);n.push(l),["blocks","snippets"].includes(a)&&r.push(l)})),EN(tC(n)),vN(tC(r))}function EN(e){if(e>_N){let t=`${(e/nC).toFixed(2)} MB`;throw new k(`Your theme app extension exceeds the file size limit (${iC} MB). It's currently ${t}.`,"Reduce your total file size and try again.")}}function vN(e){if(e>yN){let t=`${(e/RD).toFixed(2)} kB`;throw new k(`Your theme app extension exceeds the total liquid file size limit (${oC} kB). It's currently ${t}.`,"Reduce your total file size and try again.")}}function CN(e,t){if(!eC.includes(t))throw new k(Se`Your theme app extension includes files in an unsupported directory, ${Ae.path(t)}`,`Make sure all theme app extension files are in the supported directories: ${eC.join(", ")}`);let r=uC[t];if(!e.match(r.validator))throw new k(`Invalid filename in your theme app extension: ${e}
250
250
  ${r.failureMessage(e)}`)}function tC(e){return e.reduce((t,r)=>t+r,0)}d();d();var L2=ai(Th(),1);import{createRequire as wU}from"module";async function Em(){let e=await import("./typescript-5R4Y7PXE.js");return e.default??e}var j2=wU(import.meta.url),$2="@shopify/ui-extensions";function bU(e){let t=e.toLowerCase().replace(/(::|\.).+$/,"");switch(t){case"purchase":return"checkout";case"pos":return"point-of-sale";default:return t}}function vm(e){let t=e[0];return t?`${$2}/${bU(t)}`:$2}function ia(e){let[t,r]=e.split("-");return!t||!r?null:{year:parseInt(t,10),month:parseInt(r,10)}}async function U2(e,t){let r=await Em(),n=r.findConfigFile(e,r.sys.fileExists.bind(r.sys),"tsconfig.json");if(!n)return{compilerOptions:{},configPath:void 0,hasExplicitFiles:!1};let o=ot(n),s=t?.get(o);if(s)return s;let a=r.readConfigFile(n,r.sys.readFile.bind(r.sys));if(a.error)return{compilerOptions:{},configPath:o,hasExplicitFiles:!1};let l=r.parseJsonConfigFileContent(a.config,r.sys,he(n)),p=!!(l.raw?.files??l.raw?.include),m={compilerOptions:l.options,configPath:o,fileNames:l.fileNames,hasExplicitFiles:p};return t?.set(o,m),m}async function AU(e,t){if(!e.startsWith("./")&&!e.startsWith("../"))return null;let r=ot(t,e),n=["",".js",".jsx",".ts",".tsx"];for(let o of n){let s=r+o;if(await X(s)&&!s.includes("node_modules"))return s}for(let o of[".js",".jsx",".ts",".tsx"]){let s=I(r,`index${o}`);if(await X(s)&&!s.includes("node_modules"))return s}return null}function k2(e){return e.length>0&&e.every(t=>t.isTypeOnly)}function SU(e,t){if(e.importClause?.isTypeOnly)return!0;let r=e.importClause?.namedBindings;return e.importClause?.name||!r?!1:t.isNamedImports(r)&&k2(r.elements)}function xU(e,t){if(e.isTypeOnly)return!0;let r=e.exportClause;return r?t.isNamedExports(r)&&k2(r.elements):!1}function PU(e,t){return t?dy(ot(t),ot(e)):!0}function OU(e,t){if(!t.allowedFiles)return!0;let r=ot(e);return t.allowedFiles.has(r)||!!t.alwaysAllowedFiles?.has(r)}function q2(e,t){return!e.includes("node_modules")&&!e.endsWith(".d.ts")&&OU(e,t)}function TU(e,t){let r=ot(e),n=(t.allowedFiles?.has(r)??!1)||(t.alwaysAllowedFiles?.has(r)??!1);return q2(e,t)&&(PU(e,t.boundaryDirectory)||n)}async function BU(e,t={}){try{let r=ot(e),n=t.importCache?.get(r);if(n)return n;let o=await Em(),s=eo(e).toString(),a=[],{compilerOptions:l}=await U2(e,t.tsConfigCache),p=o.ScriptKind.JSX;e.endsWith(".ts")?p=o.ScriptKind.TS:e.endsWith(".tsx")&&(p=o.ScriptKind.TSX);let m=o.createSourceFile(e,s,o.ScriptTarget.Latest,!0,p),g=new Set,F=[],w=v=>{if(o.isImportDeclaration(v)&&v.moduleSpecifier&&o.isStringLiteral(v.moduleSpecifier)){if(SU(v,o))return;F.push(v.moduleSpecifier.text)}else if(o.isCallExpression(v)&&v.expression.kind===o.SyntaxKind.ImportKeyword){let S=v.arguments[0];S&&o.isStringLiteral(S)&&F.push(S.text)}else if(o.isExportDeclaration(v)&&v.moduleSpecifier&&o.isStringLiteral(v.moduleSpecifier)){if(xU(v,o))return;F.push(v.moduleSpecifier.text)}o.forEachChild(v,w)};w(m);for(let v of F){if(!v||g.has(v))continue;g.add(v);let S=o.resolveModuleName(v,e,l,o.sys);if(S.resolvedModule?.resolvedFileName){let O=S.resolvedModule.resolvedFileName;O.includes("node_modules")||a.push(O)}else{let O=await AU(v,he(e));O&&a.push(O)}}return t.importCache?.set(r,a),a}catch(r){if(r instanceof k)throw r;return[]}}async function pf(e,t={},r=new Set){if(r.has(e))return[];r.add(e);let n=(await BU(e,t)).filter(s=>q2(s,t)),o=[...n];for(let s of n){if(!TU(s,t))continue;let a=await pf(s,t,r);o.push(...a)}return Bt(o)}async function Cm(e,t,r={}){let{configPath:n,fileNames:o,hasExplicitFiles:s}=await U2(e,r.tsConfigCache);if(!(!n||!s))return new Set((o??[]).map(a=>ot(a)))}async function IU(e){let t;try{t=eo(e).toString()}catch{return!1}let r=await Em(),n=r.createSourceFile(e,t,r.ScriptTarget.Latest,!0,r.ScriptKind.TS),o=!1,s=a=>{if(!o){if(r.isExportDeclaration(a)&&a.exportClause&&r.isNamedExports(a.exportClause)){for(let l of a.exportClause.elements)if(l.name.text==="ShopifyGlobal"){o=!0;return}}r.forEachChild(a,s)}};return s(n),o}async function RU(e,t){let r=async n=>{let o=`import('@shopify/ui-extensions/${n}').Api`,s=t.get(n);return s&&await IU(s)?`${o} & import('@shopify/ui-extensions/${n}').ShopifyGlobal`:o};return e.length===1?r(e[0]??""):e.length>1?`(${(await Promise.all(e.map(r))).join(" | ")})`:null}async function NU(e,t,{includesTools:r,includesIntents:n},o){let s=await RU(e,t);if(!s)return null;if(!r&&!n)return s;let a=s;return n&&(a=`import('${o}').WithGeneratedIntents<${a}, ShopifyGeneratedIntentVariants>`),r&&(a=`import('${o}').WithGeneratedTools<${a}, ShopifyTools>`),a}async function W2({fullPath:e,typeFilePath:t,targets:r,apiVersion:n,toolsTypeDefinition:o,intentsTypeDefinition:s}){try{let a=new Map,l=!!o,p=!!s;for(let v of r)try{let S=j2.resolve(`@shopify/ui-extensions/${v}`,{paths:[e,t]});a.set(v,S)}catch{let{year:O,month:P}=ia(n)??{year:2025,month:10};throw new k(`Type reference for ${v} could not be found. You might be using the wrong @shopify/ui-extensions version.`,`Fix the error by ensuring you have the correct version of @shopify/ui-extensions, for example ~${O}.${P}.0, in your dependencies.`)}let m=vm(r);if(l||p)try{j2.resolve(m,{paths:[e,t]})}catch{let{year:S,month:O}=ia(n)??{year:2025,month:10};throw new k(`Type reference for ${m} could not be found. You might be using the wrong @shopify/ui-extensions version.`,`Fix the error by ensuring you have the correct version of @shopify/ui-extensions, for example ~${S}.${O}.0, in your dependencies.`)}let g=Fc(e,he(t)),F=await NU(r,a,{includesTools:l,includesIntents:p},m);return F?["//@ts-ignore",`declare module './${g}' {`,...o?[o]:[],...s?[s]:[],` const shopify: ${F};`," const globalThis: { shopify: typeof shopify };","}",""].join(`
251
251
  `):null}catch(a){if(a instanceof k)throw a;let{year:l,month:p}=ia(n)??{year:2025,month:10};throw new k("Type reference could not be found. You might be using the wrong @shopify/ui-extensions version.",`Fix the error by ensuring you have the correct version of @shopify/ui-extensions, for example ~${l}.${p}.0, in your dependencies.`)}}async function H2(e,t){let r=he(e),n=await ln("tsconfig.json",{cwd:r,type:"file"});if(n){let o=ot(n),s=ot(t);if(o.startsWith(s))return he(n)}}var MU=E.object({name:E.string(),description:E.string(),inputSchema:E.object({}).passthrough(),outputSchema:E.object({}).passthrough().optional()}),z2=E.array(MU),V2=E.object({value:E.object({}).passthrough().optional(),inputSchema:E.object({}).passthrough(),outputSchema:E.object({}).passthrough().optional()});function jU(e){return qo(`${e.action} ${e.type}`.replace(/[^a-zA-Z0-9]+/g," "))}async function K2(e,{generatedTypesHelperImportPath:t}){if(e.length===0)return"";let r=new Set,n=e.map(async a=>{let l=`${a.action}:${a.type}`;if(r.has(l))throw new k(`Intent "${l}" is defined multiple times. Intents must be unique within a target.`);r.add(l);let p=jU(a),m=`${p}IntentInput`,g=`${p}IntentValue`,F=`${p}IntentOutput`,w=`${p}IntentRequest`,v=await oa(m,a.inputSchema),S=await oa(g,a.valueSchema),O=await oa(F,a.outputSchema),P=`interface ${w} {
252
252
  action: ${JSON.stringify(a.action)};
@@ -1 +1 @@
1
- import{a as n}from"./chunk-D3DCP4OT.js";import{b as i}from"./chunk-XQIPACFV.js";import{g as e}from"./chunk-VKWPEFWQ.js";e();var t=class extends i{static description="Generate a notifications.json file for the the CLI, appending a new notification to the current file.";static hidden=!0;async run(){await n()}};export{t as a};
1
+ import{a as n}from"./chunk-YHTONNIZ.js";import{b as i}from"./chunk-4DLRS7MT.js";import{g as e}from"./chunk-VKWPEFWQ.js";e();var t=class extends i{static description="Generate a notifications.json file for the the CLI, appending a new notification to the current file.";static hidden=!0;async run(){await n()}};export{t as a};
@@ -1,4 +1,4 @@
1
- import{a as e}from"./chunk-GCN4O7HM.js";import{b as r}from"./chunk-XQIPACFV.js";import{y as i}from"./chunk-ESTXKKAB.js";import{t}from"./chunk-BC42C35S.js";import{g as a}from"./chunk-VKWPEFWQ.js";a();var o=class extends r{static summary="Disable automatic upgrades for Shopify CLI.";static descriptionWithMarkdown=`Disable automatic upgrades for Shopify CLI.
1
+ import{a as e}from"./chunk-GCN4O7HM.js";import{b as r}from"./chunk-4DLRS7MT.js";import{y as i}from"./chunk-6C5AVMKR.js";import{t}from"./chunk-QKTBYAUD.js";import{g as a}from"./chunk-VKWPEFWQ.js";a();var o=class extends r{static summary="Disable automatic upgrades for Shopify CLI.";static descriptionWithMarkdown=`Disable automatic upgrades for Shopify CLI.
2
2
 
3
3
  When auto-upgrade is disabled, Shopify CLI won't automatically update. Run \`shopify upgrade\` to update manually.
4
4
 
@@ -1,4 +1,4 @@
1
- import{a as v,b as f}from"./chunk-YY6TFARF.js";import{a as u}from"./chunk-ATFKBLMQ.js";import{a as y}from"./chunk-3QF47EX2.js";import{a as w}from"./chunk-ZQ4KG6U2.js";import{p as d,v as c}from"./chunk-4Y7WHAJX.js";import{b as p}from"./chunk-GZKEIUJT.js";import{N as m,y as s}from"./chunk-ESTXKKAB.js";import{a as E}from"./chunk-CTNBSUVU.js";import{e as T,g as i}from"./chunk-VKWPEFWQ.js";i();i();async function g(t,e){let r=new u(t),F=(await(e.development?r.find():r.fetch()))?.id,n=await y(t,{header:"Select a theme to open",filter:{live:e.live,theme:e.development?`${F}`:e.theme}}),l=v(n,t),a=f(n,t);s({body:["Preview information for theme",...w(n),`
1
+ import{a as v,b as f}from"./chunk-YY6TFARF.js";import{a as u}from"./chunk-XHXKPRF5.js";import{a as y}from"./chunk-W4SGAPPR.js";import{a as w}from"./chunk-MYLMGH7Y.js";import{p as d,v as c}from"./chunk-DO4SRE4M.js";import{b as p}from"./chunk-K2DP5Z76.js";import{N as m,y as s}from"./chunk-6C5AVMKR.js";import{a as E}from"./chunk-CTNBSUVU.js";import{e as T,g as i}from"./chunk-VKWPEFWQ.js";i();i();async function g(t,e){let r=new u(t),F=(await(e.development?r.find():r.fetch()))?.id,n=await y(t,{header:"Select a theme to open",filter:{live:e.live,theme:e.development?`${F}`:e.theme}}),l=v(n,t),a=f(n,t);s({body:["Preview information for theme",...w(n),`
2
2
 
3
3
  `,{list:{items:[{link:{label:"Preview your theme",url:l}},{link:{label:"Customize your theme at the theme editor",url:a}}]}}]}),e.editor?await m(a):await m(l)}var o=T(E(),1);var h=class extends c{static summary="Opens the preview of your remote theme.";static descriptionWithMarkdown=`Returns links that let you preview the specified theme. The following links are returned:
4
4
 
@@ -1,3 +1,3 @@
1
- import{a as j}from"./chunk-OCT65FRG.js";import{c as O,i as k,o as x}from"./chunk-7SHHNWHL.js";import{a as E}from"./chunk-3QF47EX2.js";import{e as R}from"./chunk-ZQ4KG6U2.js";import{p as v,v as A}from"./chunk-4Y7WHAJX.js";import{b as F,c as L}from"./chunk-GZKEIUJT.js";import{N as y}from"./chunk-ESTXKKAB.js";import{h as T}from"./chunk-BFL74TW2.js";import{a as D}from"./chunk-CTNBSUVU.js";import{$a as $,Ab as n,la as w,ua as P,wb as S}from"./chunk-DD7FQDTB.js";import{d as l,i as u}from"./chunk-773TIA5M.js";import{e as q,g as p}from"./chunk-VKWPEFWQ.js";p();p();p();import{fileURLToPath as U}from"node:url";async function _(...r){let e=await $("package.json",{cwd:U(import.meta.url),type:"file"});if(!e)throw new Error("Failed to find CLI root path");return e.endsWith("/packages/theme/package.json")?l(u(e),"assets",...r):l(u(e),"dist","assets",...r)}async function b(r,e,i,t,a,m){let c=await O(r)?await j(m,r.storeFqdn):void 0;if(a)throw new T("Unable to use Admin API or Theme Access tokens with the profile command","You must authenticate manually by not passing the --password flag.");let f=await x(e,r,a,c),o=await k(f,{method:"GET",path:i,query:[],themeId:e,headers:{Accept:"application/vnd.speedscope+json"}});if(o.status!==200){let h=await o.text();throw new Error(`Bad response: ${o.status}: ${h}`)}let s=await o.text();t?S(s):await I(s)}async function I(r){let e=process.env.WSL_DISTRO_NAME,i=e?`//wsl$/${e}`:"",t=await _("speedscope","index.html");n(`[Theme Profile] Resolved URL to open: ${t}`);let a="liquid-profile",m=Buffer.from(r).toString("base64"),c=`speedscope.loadFileFromBase64(${JSON.stringify(a)}, ${JSON.stringify(m)})`,f=`speedscope-${Number(new Date)}-${process.pid}`,o=l(w(),`${f}.js`);n(`[Theme Profile] writing JS file to: ${o}`),await P(o,c),n(`[Theme Profile] JS file created successfully: ${o}`),t=`${i}${t}`,o=`${i}${o}`,t+=`#localProfilePath=${o}`;let s=l(w(),`${f}.html`);n(`[Theme Profile] writing HTML file to: ${s}`),await P(s,`<script>window.location=${JSON.stringify(t)}</script>`),n(`[Theme Profile] HTML file created successfully: ${s}`),s=`${i}${s}`,t=`file://${s}`,n(`[Theme Profile] Opening URL: ${t}`);let h=await y(t);n(`[Theme Profile] URL opened successfully: ${h}`)}var d=q(D(),1);var g=class extends A{static summary="Profile the Liquid rendering of a theme page.";static usage=["theme profile","theme profile --url /products/classic-leather-jacket"];static descriptionWithMarkdown=`Profile the Shopify Liquid on a given page.
1
+ import{a as j}from"./chunk-FY47X4NG.js";import{c as O,i as k,o as x}from"./chunk-OY6L7J53.js";import{a as E}from"./chunk-W4SGAPPR.js";import{e as R}from"./chunk-MYLMGH7Y.js";import{p as v,v as A}from"./chunk-DO4SRE4M.js";import{b as F,c as L}from"./chunk-K2DP5Z76.js";import{N as y}from"./chunk-6C5AVMKR.js";import{h as T}from"./chunk-OAG72Q2O.js";import{a as D}from"./chunk-CTNBSUVU.js";import{$a as $,Ab as n,la as w,ua as P,wb as S}from"./chunk-43FRAUV6.js";import{d as l,i as u}from"./chunk-773TIA5M.js";import{e as q,g as p}from"./chunk-VKWPEFWQ.js";p();p();p();import{fileURLToPath as U}from"node:url";async function _(...r){let e=await $("package.json",{cwd:U(import.meta.url),type:"file"});if(!e)throw new Error("Failed to find CLI root path");return e.endsWith("/packages/theme/package.json")?l(u(e),"assets",...r):l(u(e),"dist","assets",...r)}async function b(r,e,i,t,a,m){let c=await O(r)?await j(m,r.storeFqdn):void 0;if(a)throw new T("Unable to use Admin API or Theme Access tokens with the profile command","You must authenticate manually by not passing the --password flag.");let f=await x(e,r,a,c),o=await k(f,{method:"GET",path:i,query:[],themeId:e,headers:{Accept:"application/vnd.speedscope+json"}});if(o.status!==200){let h=await o.text();throw new Error(`Bad response: ${o.status}: ${h}`)}let s=await o.text();t?S(s):await I(s)}async function I(r){let e=process.env.WSL_DISTRO_NAME,i=e?`//wsl$/${e}`:"",t=await _("speedscope","index.html");n(`[Theme Profile] Resolved URL to open: ${t}`);let a="liquid-profile",m=Buffer.from(r).toString("base64"),c=`speedscope.loadFileFromBase64(${JSON.stringify(a)}, ${JSON.stringify(m)})`,f=`speedscope-${Number(new Date)}-${process.pid}`,o=l(w(),`${f}.js`);n(`[Theme Profile] writing JS file to: ${o}`),await P(o,c),n(`[Theme Profile] JS file created successfully: ${o}`),t=`${i}${t}`,o=`${i}${o}`,t+=`#localProfilePath=${o}`;let s=l(w(),`${f}.html`);n(`[Theme Profile] writing HTML file to: ${s}`),await P(s,`<script>window.location=${JSON.stringify(t)}</script>`),n(`[Theme Profile] HTML file created successfully: ${s}`),s=`${i}${s}`,t=`file://${s}`,n(`[Theme Profile] Opening URL: ${t}`);let h=await y(t);n(`[Theme Profile] URL opened successfully: ${h}`)}var d=q(D(),1);var g=class extends A{static summary="Profile the Liquid rendering of a theme page.";static usage=["theme profile","theme profile --url /products/classic-leather-jacket"];static descriptionWithMarkdown=`Profile the Shopify Liquid on a given page.
2
2
 
3
3
  This command will open a web page with the Speedscope profiler detailing the time spent executing Liquid on the given page.`;static description=this.descriptionWithoutMarkdown();static flags={...F,...v,theme:d.Flags.string({char:"t",description:"Theme ID or name of the remote theme.",env:"SHOPIFY_FLAG_THEME_ID"}),url:d.Flags.string({description:"The url to be used as context",env:"SHOPIFY_FLAG_URL",default:"/"}),"store-password":d.Flags.string({description:"The password for storefronts with password protection.",env:"SHOPIFY_FLAG_STORE_PASSWORD"}),...L};static multiEnvironmentsFlags=null;async command(e,i){let{password:t}=e,a;e.theme?a={filter:{theme:e.theme}}:a={filter:{live:!0}};let m=await E(i,a),c=[{title:`Generating Liquid profile for ${i.storeFqdn} ${e.url}`,task:async()=>{await b(i,m.id.toString(),e.url,e.json,t,e["store-password"])}}];await R(c)}};export{g as a};
@@ -1,3 +1,3 @@
1
- import{a as oe}from"./chunk-5NT2BNMB.js";import{d as ie}from"./chunk-GZKEIUJT.js";import{a as ne,b as se}from"./chunk-XQIPACFV.js";import{Aa as U,Ba as V,D as w,K as C,T as L,b as K,ya as Q}from"./chunk-NYHGIWKZ.js";import{A as N,B as I,E as te,a as W,x as ee}from"./chunk-ESTXKKAB.js";import{e as x}from"./chunk-BC42C35S.js";import{d as X,e as Z}from"./chunk-VNW2YMPM.js";import{h as F,k as re}from"./chunk-BFL74TW2.js";import{a as Ie}from"./chunk-CTNBSUVU.js";import{Ab as h,Fa as J,Ua as _,qb as R,sb as l}from"./chunk-DD7FQDTB.js";import{d as z,f as k,i as Y,q as $}from"./chunk-773TIA5M.js";import{e as Te,g as f}from"./chunk-VKWPEFWQ.js";f();var T=Te(Ie(),1);var q={path:T.Flags.string({description:"The path where you want to run the command. Defaults to the current working directory.",env:"SHOPIFY_FLAG_PATH",parse:async t=>{let e=k(t);return _(e)?J(e)?e:(I({headline:"The path must be a directory, not a file.",body:[`The provided path is not a directory: ${e}`,`Did you mean: ${Y(e)}`]}),process.exit(1)):(I({headline:"A path was explicitly provided but doesn't exist.",body:[`Please check the path and try again: ${e}`]}),process.exit(1))},default:async()=>$(),noCacheDefault:!0}),password:T.Flags.string({description:"Password generated from the Theme Access app or an Admin API token.",env:"SHOPIFY_CLI_THEME_TOKEN"}),store:T.Flags.string({char:"s",description:"Store URL. It can be the store prefix (example) or the full myshopify.com URL (example.myshopify.com, https://example.myshopify.com).",env:"SHOPIFY_FLAG_STORE",parse:async t=>w(t)}),environment:T.Flags.string({char:"e",description:"The environment to apply to the current command.",env:"SHOPIFY_FLAG_ENVIRONMENT",multiple:!0})},ae="Wrap the value in double quotes if you're using wildcards.",qe=t=>({only:T.Flags.string({char:"o",multiple:!0,description:`${t.charAt(0).toUpperCase()+t.slice(1)} only the specified files (Multiple flags allowed). ${ae}`,env:"SHOPIFY_FLAG_ONLY"}),ignore:T.Flags.string({char:"x",multiple:!0,description:`Skip ${t}ing the specified files (Multiple flags allowed). ${ae}`,env:"SHOPIFY_FLAG_IGNORE"})});f();f();import{AsyncLocalStorage as _e}from"node:async_hooks";var pe=new _e,ce,ue,me,de;function S(){return ce??=new x({projectName:"shopify-cli-theme-conf"}),ce}function O(){return ue??=new x({projectName:"shopify-cli-development-theme-config"}),ue}function j(){return me??=new x({projectName:"shopify-cli-repl-theme-config"}),me}function D(){return de??=new x({projectName:"shopify-cli-theme-store-password"}),de}function M(t=S()){return pe.getStore()?.store??t.get("themeStore")}function fe(t,e=S()){e.set("themeStore",t)}function He(t=S()){return h(l`Getting development theme...`),O().get(v(t))}function ze(t,e=S()){h(l`Setting development theme...`),O().set(v(e),t)}function Ye(t=S()){h(l`Removing development theme...`),O().delete(v(t))}function Je(t=S()){return h(l`Getting REPL theme...`),j().get(v(t))}function We(t,e=S()){h(l`Setting REPL theme to ${t}...`),j().set(v(e),t)}function Ke(t=S()){h(l`Removing REPL theme...`),j().delete(v(t))}function Qe(t=S()){let e=v(t);return h(l`Getting storefront password for shop ${e}...`),D().get(e)}function Ve(t,e=S()){let o=v(e);h(l`Setting storefront password for shop ${o}...`),D().set(o,t)}function Xe(t=S()){let e=v(t);h(l`Removing storefront password for ${e}...`),D().delete(e)}function v(t=S()){let e=M(t);if(!e)throw new re("Theme store is not set. This indicates an unexpected issue with the CLI. Please report this to the Shopify CLI team.",["It may be possible to recover by running",{command:"shopify theme list --store <store>"},"(setting the store flag to the store you wish to use) and then running the command again."]);return e}async function he(t,e){return pe.run({store:t},e)}function le(t){let e=t.store??M();if(!e)throw Q(new F("A store is required",`Specify the store passing ${l`${R.genericShellCommand(`--${q.store.name}=example.myshopify.com`)}`.value} or set the ${l`${R.genericShellCommand(q.store.env)}`.value} environment variable.`));return fe(e),e}f();f();var Se="shopify.theme.toml",ct=new Intl.DateTimeFormat(void 0,{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"}),ut=["**/.git","**/.vscode","**/.hg","**/.bzr","**/.svn","**/_darcs","**/CVS","**/*.sublime-(project|workspace)","**/.DS_Store","**/.sass-cache","**/Thumbs.db","**/desktop.ini","**/config.yml","**/node_modules/",".prettierrc.json","**/{blocks,layout,snippets}/**/*.liquid.tmp.*","**/{config,locales}/**/*.json.tmp.*","**/{sections,templates}/**/*.{liquid,json}.tmp.*"],mt=50;f();f();var B="7e9cb568cfd431c538f36d1ad3f2b4f6";var Fe="shopify-cli-store",be=240*1e3,ge;function P(){return ge??=new x({projectName:Fe}),ge}function b(t){return`${B}::${Ee(t)}`}function Ee(t){return t.replace(/\\/g,"\\\\").replace(/\./g,"\\.")}function d(t){return typeof t=="string"}function ke(t){if(!t||typeof t!="object")return;let e=t;if(typeof e.id=="number")return{id:e.id,...d(e.email)?{email:e.email}:{},...d(e.firstName)?{firstName:e.firstName}:{},...d(e.lastName)?{lastName:e.lastName}:{},...typeof e.accountOwner=="boolean"?{accountOwner:e.accountOwner}:{}}}function $e(t){if(!t||typeof t!="object")return;let e=t;if(!(!d(e.shopId)||!d(e.name)||!d(e.createdAt)))return{shopId:e.shopId,name:e.name,createdAt:e.createdAt,...d(e.placeholderAccountUuid)?{placeholderAccountUuid:e.placeholderAccountUuid}:{},...d(e.country)?{country:e.country}:{},...d(e.accessUrl)?{accessUrl:e.accessUrl}:{}}}function Pe(t){if(!t||typeof t!="object")return;let e=t;if(!d(e.store)||!d(e.clientId)||!d(e.userId)||!d(e.accessToken)||!Array.isArray(e.scopes)||!e.scopes.every(d)||!d(e.acquiredAt))return;let o=ke(e.associatedUser),r=e.kind==="preview"?"preview":"standard",n=r==="preview"?$e(e.preview):void 0;if(!(r==="preview"&&!n))return{store:e.store,clientId:e.clientId,userId:e.userId,accessToken:e.accessToken,scopes:e.scopes,acquiredAt:e.acquiredAt,...d(e.refreshToken)?{refreshToken:e.refreshToken}:{},...d(e.expiresAt)?{expiresAt:e.expiresAt}:{},...d(e.refreshTokenExpiresAt)?{refreshTokenExpiresAt:e.refreshTokenExpiresAt}:{},...o?{associatedUser:o}:{},...r==="preview"?{kind:r}:{},...n?{preview:n}:{}}}function ye(t,e,o){if(!e||typeof e!="object")return;let{sessionsByUserId:r,currentUserId:n}=e;if(!(r!==void 0||n!==void 0))return;let s=b(t);if(!r||typeof r!="object"||Array.isArray(r)||typeof n!="string"){o.delete(s);return}let a=Object.fromEntries(Object.entries(r).flatMap(([u,c])=>{let p=Pe(c);return p?[[u,p]]:[]}));if(Object.keys(a).length!==Object.keys(r).length)if(a[n])o.set(s,{currentUserId:n,sessionsByUserId:a});else{o.delete(s);return}return{currentUserId:n,sessionsByUserId:a}}function G(t,e){return ye(t,e.get(b(t)),e)}function Ce(t){return t.config?.store??{}}function we(t=P()){let e=[],o=`${B}::`;for(let[r,n]of Object.entries(Ce(t))){if(!r.startsWith(o))continue;let i=ye(r.slice(o.length),n,t),s=i?.sessionsByUserId[i.currentUserId];s&&e.push(s)}return e}function Ae(t,e=P()){let o=w(t),r=G(o,e);if(!r)return;let n=r.sessionsByUserId[r.currentUserId];if(!n){e.delete(b(o));return}return n}function wt(t,e=P()){let o=b(t.store),r=G(t.store,e),n={currentUserId:t.userId,sessionsByUserId:{...r?.sessionsByUserId??{},[t.userId]:t}};e.set(o,n)}function At(t,e,o){let r=w(t),n=typeof e=="string"?e:void 0,i=(typeof e=="string"?o:e)??P(),s=b(r);if(!n){i.delete(s);return}let a=G(r,i);if(!a)return;let{[n]:u,...c}=a.sessionsByUserId,p=Object.keys(c);if(p.length===0){i.delete(s);return}i.set(s,{currentUserId:a.currentUserId===n?p[0]:a.currentUserId,sessionsByUserId:c})}function ve(t){if(!t.expiresAt)return!1;let e=new Date(t.expiresAt).getTime();return Number.isNaN(e)?!0:e-be<Date.now()}var H=class extends se{static baseFlags=ie;environmentsFilename(){return Se}async command(e,o,r=!1,n,i){}async run(e){let o=this.constructor,r=o.multiEnvironmentsFlags,{args:n,flags:i}=await this.parse(o),s="password"in o.flags,a=(Array.isArray(i.environment)?i.environment:[i.environment]).filter(Boolean),u=r!==null&&r.some(m=>Array.isArray(m)?m.includes("store"):m==="store");if(a.length<=1){if(a[0]&&!i.store&&u)throw new F("Please provide a valid environment.");let m=s?await this.createSession(i):void 0,A=this.constructor.name.toLowerCase();if(U(`theme-command:${A}:single-env:authenticated`),i.path&&!_(i.path))throw new F(`Path does not exist: ${i.path}`);try{await this.command(i,m,!1,n)}finally{await this.logAnalyticsData(m)}return}if(r===null){N({body:"This command does not support multiple environments."});return}let{flags:c}=await this.parse(ne(o),this.argv);if("path"in c){this.errorOnGlobalPath();return}let p=await this.loadEnvironments(a,i,c),g=await this.validateEnvironments(p,r,s);"force"in o.flags&&!i.force&&!await this.showConfirmation(this.constructor.name,r,g)||await this.runConcurrent(g.valid)}storeAuthScopes(){}async loadEnvironments(e,o,r){let n=new Map;for(let i of e){let s=await oe(i,"shopify.theme.toml",{from:o.path,silent:!0});s?.store&&typeof s.store=="string"&&(s.store=w(s.store)),s?.path&&typeof s.path=="string"&&(s.path=k(s.path)),n.set(i,{flags:{...o,...s,...r,environment:[i]},validationFlags:{...s,...r}})}return n}async validateEnvironments(e,o,r){let n=[],i=[],s=r?this.storeAuthSessionsForTheme(Array.from(e.values()).map(({validationFlags:u})=>u)):new Map,a=Array.from(e.entries()).map(([u,{flags:c,validationFlags:p}])=>({environmentName:u,flags:c,validationFlags:p,storeAuthSession:this.storeAuthSessionFromCache(p,s)}));for(let{environmentName:u,flags:c,validationFlags:p,storeAuthSession:g}of a){let y=this.validConfig(p,o,u,g);if(y!==!0){let m=y.join(", ");i.push({environment:u,reason:`Missing flags: ${m}`});continue}n.push({environment:u,flags:c,requiresAuth:r,storeAuthSession:g})}return{valid:n,invalid:i}}async showConfirmation(e,o,r){let s={message:[`Run ${e.toLowerCase()} in the following environments?`],confirmationMessage:"Yes, proceed",cancellationMessage:"Cancel"},a=[...r.valid.map(({environment:u,flags:c})=>{let p=o.map(g=>{let y=Array.isArray(g)?g.find(m=>c[m]):g;if(y==="password")return"password";if(y==="path"&&typeof c.path=="string"){let m=c.path.split(/[/\\]/);if(m.length===1)return`path: ${c.path}`;let A=m[0]===""?`/${m[1]}`:m[0],E=m.at(-1);return`path: ${A}/.../${E}`}return y&&`${y}: ${c[y]}`}).join(", ");return[u,{subdued:p||"No flags required"}]}),...r.invalid.map(({environment:u,reason:c})=>[u,{error:`Skipping | ${c}`}])];return s.infoTable={Environment:a},r.invalid.length>0&&(s.confirmationMessage="Proceed anyway (will skip invalid environments)"),te(s)}async runConcurrent(e){let o=new W,r=e.map(s=>s.flags.store),n=new Set(r),i=r.length===n.size?[e]:this.createSequentialGroups(e);for(let s of i)await ee({processes:s.map(({environment:a,flags:u,requiresAuth:c,storeAuthSession:p})=>({prefix:a,action:async(g,y,m)=>{try{let A=u.store;await he(A,async()=>{let E=c?await this.createSession(u,p):void 0,xe=this.constructor.name.toLowerCase();U(`theme-command:${xe}:multi-env:authenticated`);try{await this.command(u,E,!0,{},{stdout:g,stderr:y})}finally{await this.logAnalyticsData(E)}})}catch(A){A instanceof Error&&(A.message=`Environment ${a} failed:
1
+ import{a as oe}from"./chunk-C4Y7PQDQ.js";import{d as ie}from"./chunk-K2DP5Z76.js";import{a as ne,b as se}from"./chunk-4DLRS7MT.js";import{Aa as U,Ba as V,D as w,K as C,T as L,b as K,ya as Q}from"./chunk-CNK3ZO2B.js";import{A as N,B as I,E as te,a as W,x as ee}from"./chunk-6C5AVMKR.js";import{e as x}from"./chunk-QKTBYAUD.js";import{d as X,e as Z}from"./chunk-XRJCD3AO.js";import{h as F,k as re}from"./chunk-OAG72Q2O.js";import{a as Ie}from"./chunk-CTNBSUVU.js";import{Ab as h,Fa as J,Ua as _,qb as R,sb as l}from"./chunk-43FRAUV6.js";import{d as z,f as k,i as Y,q as $}from"./chunk-773TIA5M.js";import{e as Te,g as f}from"./chunk-VKWPEFWQ.js";f();var T=Te(Ie(),1);var q={path:T.Flags.string({description:"The path where you want to run the command. Defaults to the current working directory.",env:"SHOPIFY_FLAG_PATH",parse:async t=>{let e=k(t);return _(e)?J(e)?e:(I({headline:"The path must be a directory, not a file.",body:[`The provided path is not a directory: ${e}`,`Did you mean: ${Y(e)}`]}),process.exit(1)):(I({headline:"A path was explicitly provided but doesn't exist.",body:[`Please check the path and try again: ${e}`]}),process.exit(1))},default:async()=>$(),noCacheDefault:!0}),password:T.Flags.string({description:"Password generated from the Theme Access app or an Admin API token.",env:"SHOPIFY_CLI_THEME_TOKEN"}),store:T.Flags.string({char:"s",description:"Store URL. It can be the store prefix (example) or the full myshopify.com URL (example.myshopify.com, https://example.myshopify.com).",env:"SHOPIFY_FLAG_STORE",parse:async t=>w(t)}),environment:T.Flags.string({char:"e",description:"The environment to apply to the current command.",env:"SHOPIFY_FLAG_ENVIRONMENT",multiple:!0})},ae="Wrap the value in double quotes if you're using wildcards.",qe=t=>({only:T.Flags.string({char:"o",multiple:!0,description:`${t.charAt(0).toUpperCase()+t.slice(1)} only the specified files (Multiple flags allowed). ${ae}`,env:"SHOPIFY_FLAG_ONLY"}),ignore:T.Flags.string({char:"x",multiple:!0,description:`Skip ${t}ing the specified files (Multiple flags allowed). ${ae}`,env:"SHOPIFY_FLAG_IGNORE"})});f();f();import{AsyncLocalStorage as _e}from"node:async_hooks";var pe=new _e,ce,ue,me,de;function S(){return ce??=new x({projectName:"shopify-cli-theme-conf"}),ce}function O(){return ue??=new x({projectName:"shopify-cli-development-theme-config"}),ue}function j(){return me??=new x({projectName:"shopify-cli-repl-theme-config"}),me}function D(){return de??=new x({projectName:"shopify-cli-theme-store-password"}),de}function M(t=S()){return pe.getStore()?.store??t.get("themeStore")}function fe(t,e=S()){e.set("themeStore",t)}function He(t=S()){return h(l`Getting development theme...`),O().get(v(t))}function ze(t,e=S()){h(l`Setting development theme...`),O().set(v(e),t)}function Ye(t=S()){h(l`Removing development theme...`),O().delete(v(t))}function Je(t=S()){return h(l`Getting REPL theme...`),j().get(v(t))}function We(t,e=S()){h(l`Setting REPL theme to ${t}...`),j().set(v(e),t)}function Ke(t=S()){h(l`Removing REPL theme...`),j().delete(v(t))}function Qe(t=S()){let e=v(t);return h(l`Getting storefront password for shop ${e}...`),D().get(e)}function Ve(t,e=S()){let o=v(e);h(l`Setting storefront password for shop ${o}...`),D().set(o,t)}function Xe(t=S()){let e=v(t);h(l`Removing storefront password for ${e}...`),D().delete(e)}function v(t=S()){let e=M(t);if(!e)throw new re("Theme store is not set. This indicates an unexpected issue with the CLI. Please report this to the Shopify CLI team.",["It may be possible to recover by running",{command:"shopify theme list --store <store>"},"(setting the store flag to the store you wish to use) and then running the command again."]);return e}async function he(t,e){return pe.run({store:t},e)}function le(t){let e=t.store??M();if(!e)throw Q(new F("A store is required",`Specify the store passing ${l`${R.genericShellCommand(`--${q.store.name}=example.myshopify.com`)}`.value} or set the ${l`${R.genericShellCommand(q.store.env)}`.value} environment variable.`));return fe(e),e}f();f();var Se="shopify.theme.toml",ct=new Intl.DateTimeFormat(void 0,{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"}),ut=["**/.git","**/.vscode","**/.hg","**/.bzr","**/.svn","**/_darcs","**/CVS","**/*.sublime-(project|workspace)","**/.DS_Store","**/.sass-cache","**/Thumbs.db","**/desktop.ini","**/config.yml","**/node_modules/",".prettierrc.json","**/{blocks,layout,snippets}/**/*.liquid.tmp.*","**/{config,locales}/**/*.json.tmp.*","**/{sections,templates}/**/*.{liquid,json}.tmp.*"],mt=50;f();f();var B="7e9cb568cfd431c538f36d1ad3f2b4f6";var Fe="shopify-cli-store",be=240*1e3,ge;function P(){return ge??=new x({projectName:Fe}),ge}function b(t){return`${B}::${Ee(t)}`}function Ee(t){return t.replace(/\\/g,"\\\\").replace(/\./g,"\\.")}function d(t){return typeof t=="string"}function ke(t){if(!t||typeof t!="object")return;let e=t;if(typeof e.id=="number")return{id:e.id,...d(e.email)?{email:e.email}:{},...d(e.firstName)?{firstName:e.firstName}:{},...d(e.lastName)?{lastName:e.lastName}:{},...typeof e.accountOwner=="boolean"?{accountOwner:e.accountOwner}:{}}}function $e(t){if(!t||typeof t!="object")return;let e=t;if(!(!d(e.shopId)||!d(e.name)||!d(e.createdAt)))return{shopId:e.shopId,name:e.name,createdAt:e.createdAt,...d(e.placeholderAccountUuid)?{placeholderAccountUuid:e.placeholderAccountUuid}:{},...d(e.country)?{country:e.country}:{},...d(e.accessUrl)?{accessUrl:e.accessUrl}:{}}}function Pe(t){if(!t||typeof t!="object")return;let e=t;if(!d(e.store)||!d(e.clientId)||!d(e.userId)||!d(e.accessToken)||!Array.isArray(e.scopes)||!e.scopes.every(d)||!d(e.acquiredAt))return;let o=ke(e.associatedUser),r=e.kind==="preview"?"preview":"standard",n=r==="preview"?$e(e.preview):void 0;if(!(r==="preview"&&!n))return{store:e.store,clientId:e.clientId,userId:e.userId,accessToken:e.accessToken,scopes:e.scopes,acquiredAt:e.acquiredAt,...d(e.refreshToken)?{refreshToken:e.refreshToken}:{},...d(e.expiresAt)?{expiresAt:e.expiresAt}:{},...d(e.refreshTokenExpiresAt)?{refreshTokenExpiresAt:e.refreshTokenExpiresAt}:{},...o?{associatedUser:o}:{},...r==="preview"?{kind:r}:{},...n?{preview:n}:{}}}function ye(t,e,o){if(!e||typeof e!="object")return;let{sessionsByUserId:r,currentUserId:n}=e;if(!(r!==void 0||n!==void 0))return;let s=b(t);if(!r||typeof r!="object"||Array.isArray(r)||typeof n!="string"){o.delete(s);return}let a=Object.fromEntries(Object.entries(r).flatMap(([u,c])=>{let p=Pe(c);return p?[[u,p]]:[]}));if(Object.keys(a).length!==Object.keys(r).length)if(a[n])o.set(s,{currentUserId:n,sessionsByUserId:a});else{o.delete(s);return}return{currentUserId:n,sessionsByUserId:a}}function G(t,e){return ye(t,e.get(b(t)),e)}function Ce(t){return t.config?.store??{}}function we(t=P()){let e=[],o=`${B}::`;for(let[r,n]of Object.entries(Ce(t))){if(!r.startsWith(o))continue;let i=ye(r.slice(o.length),n,t),s=i?.sessionsByUserId[i.currentUserId];s&&e.push(s)}return e}function Ae(t,e=P()){let o=w(t),r=G(o,e);if(!r)return;let n=r.sessionsByUserId[r.currentUserId];if(!n){e.delete(b(o));return}return n}function wt(t,e=P()){let o=b(t.store),r=G(t.store,e),n={currentUserId:t.userId,sessionsByUserId:{...r?.sessionsByUserId??{},[t.userId]:t}};e.set(o,n)}function At(t,e,o){let r=w(t),n=typeof e=="string"?e:void 0,i=(typeof e=="string"?o:e)??P(),s=b(r);if(!n){i.delete(s);return}let a=G(r,i);if(!a)return;let{[n]:u,...c}=a.sessionsByUserId,p=Object.keys(c);if(p.length===0){i.delete(s);return}i.set(s,{currentUserId:a.currentUserId===n?p[0]:a.currentUserId,sessionsByUserId:c})}function ve(t){if(!t.expiresAt)return!1;let e=new Date(t.expiresAt).getTime();return Number.isNaN(e)?!0:e-be<Date.now()}var H=class extends se{static baseFlags=ie;environmentsFilename(){return Se}async command(e,o,r=!1,n,i){}async run(e){let o=this.constructor,r=o.multiEnvironmentsFlags,{args:n,flags:i}=await this.parse(o),s="password"in o.flags,a=(Array.isArray(i.environment)?i.environment:[i.environment]).filter(Boolean),u=r!==null&&r.some(m=>Array.isArray(m)?m.includes("store"):m==="store");if(a.length<=1){if(a[0]&&!i.store&&u)throw new F("Please provide a valid environment.");let m=s?await this.createSession(i):void 0,A=this.constructor.name.toLowerCase();if(U(`theme-command:${A}:single-env:authenticated`),i.path&&!_(i.path))throw new F(`Path does not exist: ${i.path}`);try{await this.command(i,m,!1,n)}finally{await this.logAnalyticsData(m)}return}if(r===null){N({body:"This command does not support multiple environments."});return}let{flags:c}=await this.parse(ne(o),this.argv);if("path"in c){this.errorOnGlobalPath();return}let p=await this.loadEnvironments(a,i,c),g=await this.validateEnvironments(p,r,s);"force"in o.flags&&!i.force&&!await this.showConfirmation(this.constructor.name,r,g)||await this.runConcurrent(g.valid)}storeAuthScopes(){}async loadEnvironments(e,o,r){let n=new Map;for(let i of e){let s=await oe(i,"shopify.theme.toml",{from:o.path,silent:!0});s?.store&&typeof s.store=="string"&&(s.store=w(s.store)),s?.path&&typeof s.path=="string"&&(s.path=k(s.path)),n.set(i,{flags:{...o,...s,...r,environment:[i]},validationFlags:{...s,...r}})}return n}async validateEnvironments(e,o,r){let n=[],i=[],s=r?this.storeAuthSessionsForTheme(Array.from(e.values()).map(({validationFlags:u})=>u)):new Map,a=Array.from(e.entries()).map(([u,{flags:c,validationFlags:p}])=>({environmentName:u,flags:c,validationFlags:p,storeAuthSession:this.storeAuthSessionFromCache(p,s)}));for(let{environmentName:u,flags:c,validationFlags:p,storeAuthSession:g}of a){let y=this.validConfig(p,o,u,g);if(y!==!0){let m=y.join(", ");i.push({environment:u,reason:`Missing flags: ${m}`});continue}n.push({environment:u,flags:c,requiresAuth:r,storeAuthSession:g})}return{valid:n,invalid:i}}async showConfirmation(e,o,r){let s={message:[`Run ${e.toLowerCase()} in the following environments?`],confirmationMessage:"Yes, proceed",cancellationMessage:"Cancel"},a=[...r.valid.map(({environment:u,flags:c})=>{let p=o.map(g=>{let y=Array.isArray(g)?g.find(m=>c[m]):g;if(y==="password")return"password";if(y==="path"&&typeof c.path=="string"){let m=c.path.split(/[/\\]/);if(m.length===1)return`path: ${c.path}`;let A=m[0]===""?`/${m[1]}`:m[0],E=m.at(-1);return`path: ${A}/.../${E}`}return y&&`${y}: ${c[y]}`}).join(", ");return[u,{subdued:p||"No flags required"}]}),...r.invalid.map(({environment:u,reason:c})=>[u,{error:`Skipping | ${c}`}])];return s.infoTable={Environment:a},r.invalid.length>0&&(s.confirmationMessage="Proceed anyway (will skip invalid environments)"),te(s)}async runConcurrent(e){let o=new W,r=e.map(s=>s.flags.store),n=new Set(r),i=r.length===n.size?[e]:this.createSequentialGroups(e);for(let s of i)await ee({processes:s.map(({environment:a,flags:u,requiresAuth:c,storeAuthSession:p})=>({prefix:a,action:async(g,y,m)=>{try{let A=u.store;await he(A,async()=>{let E=c?await this.createSession(u,p):void 0,xe=this.constructor.name.toLowerCase();U(`theme-command:${xe}:multi-env:authenticated`);try{await this.command(u,E,!0,{},{stdout:g,stderr:y})}finally{await this.logAnalyticsData(E)}})}catch(A){A instanceof Error&&(A.message=`Environment ${a} failed:
2
2
 
3
3
  ${A.message}`,I({body:[A.message]}))}}})),abortSignal:o.signal,showTimestamps:!0,renderOptions:{stdout:process.stderr}})}createSequentialGroups(e){let o=[];return e.forEach(r=>{let n=o.find(i=>!i.some(s=>s.flags.store===r.flags.store));n?n.push(r):o.push([r])}),o}async createSession(e,o){let r=le({store:e.store}),n=e.password;return n?await L(r,n):o??await this.storeAuthSessionForTheme({store:r})??await L(r,n)}async storeAuthSessionForTheme(e){let o=this.storeAuthScopes();if(!o)return;let r=typeof e.store=="string"?e.store:void 0,n=e.password;if(!r||n)return;let i=w(r),s=Ae(i);if(s)return this.adminSessionFromStoreAuthSession(s,i,o)}storeAuthSessionsForTheme(e){let o=this.storeAuthScopes();if(!o)return new Map;let r=new Set(e.filter(({store:n,password:i})=>typeof n=="string"&&!i).map(({store:n})=>w(n)));return r.size===0?new Map:new Map(we().map(n=>{let i=w(n.store);if(!r.has(i))return;let s=this.adminSessionFromStoreAuthSession(n,i,o);return s?[i,s]:void 0}).filter(n=>n!==void 0))}storeAuthSessionFromCache(e,o){let r=typeof e.store=="string"?e.store:void 0,n=e.password;if(!(!r||n))return o.get(w(r))}adminSessionFromStoreAuthSession(e,o,r){if(ve(e)){h(`Ignoring stored store auth session for ${o}: it expired at ${e.expiresAt??"unknown"}.`);return}if(!this.hasRequiredStoreAuthScopes(e.scopes,r)){h(`Ignoring stored store auth session for ${o}: it is missing required scopes (has: ${e.scopes.join(", ")}; needs: ${r.join(", ")}).`);return}return h(`Using stored store auth session for ${o} (scopes: ${e.scopes.join(", ")}).`),C(e.userId),{token:e.accessToken,storeFqdn:o}}expandImpliedStoreAuthScopes(e){let o=new Set(e);for(let r of e){let n=r.match(/^(unauthenticated_)?write_(.*)$/);n&&o.add(`${n[1]??""}read_${n[2]}`)}return o}hasRequiredStoreAuthScopes(e,o){let r=this.expandImpliedStoreAuthScopes(e);return o.every(n=>r.has(n))}validConfig(e,o,r,n){let i=o.filter(s=>Array.isArray(s)?!s.some(a=>this.hasRequiredFlag(e,a,n)):!this.hasRequiredFlag(e,s,n)).map(s=>Array.isArray(s)?s.join(" or "):s);return i.length>0?(N({body:[`Missing required flags in environment configuration${r?` for ${r}`:""}:`,{list:{items:i}}]}),i):!0}hasRequiredFlag(e,o,r){return o==="password"&&r?!0:!!e[o]}errorOnGlobalPath(){let e=z($(),"shopify.theme.toml"),o=_(e);I({body:["Can't use `--path` flag with multiple environments.",...o?["Configure each environment's theme path in your shopify.theme.toml file instead."]:["Run this command from the directory containing shopify.theme.toml.","No shopify.theme.toml found in current directory."]]})}async logAnalyticsData(e){if(!e)return;let o=V();await X(()=>({store_fqdn_hash:K(e.storeFqdn),store_domain:e.storeFqdn,cmd_theme_timings:JSON.stringify(o.timings),cmd_theme_errors:JSON.stringify(o.errors),cmd_theme_retries:JSON.stringify(o.retries),cmd_theme_events:JSON.stringify(o.events)})),await Z(()=>({store_fqdn:e.storeFqdn}))}};export{B as a,we as b,Ae as c,wt as d,At as e,M as f,He as g,ze as h,Ye as i,Je as j,We as k,Ke as l,Qe as m,Ve as n,Xe as o,q as p,qe as q,le as r,ct as s,ut as t,mt as u,H as v};
@@ -1,4 +1,4 @@
1
- import{a as V}from"./chunk-F4HKZVXJ.js";import{k as q,l as H,n as I}from"./chunk-ZKWJX5GE.js";import{a as Y}from"./chunk-N6SZTZNB.js";import{b as L}from"./chunk-BCWKIFNX.js";import{a as p,b as w}from"./chunk-YY6TFARF.js";import{a as N}from"./chunk-ATFKBLMQ.js";import{a as F}from"./chunk-3QF47EX2.js";import{a as y,c as U}from"./chunk-ZQ4KG6U2.js";import{b as g,c as x,d as M,f as _,j as R,n as j,p as D}from"./chunk-5GBIXC2Y.js";import{r as k}from"./chunk-4Y7WHAJX.js";import{aa as B}from"./chunk-W25XMFZJ.js";import{T as b,xa as a,ya as O}from"./chunk-NYHGIWKZ.js";import{A as d,B as C,E as P,z as f}from"./chunk-ESTXKKAB.js";import{h as S}from"./chunk-BFL74TW2.js";import{wb as $}from"./chunk-DD7FQDTB.js";import{f as T,q as l}from"./chunk-773TIA5M.js";import{e as z,g as v}from"./chunk-VKWPEFWQ.js";v();var A=z(B(),1);async function Te(e,t,r,o){let n=e.environment?.[0],s=t??await b(k({store:e.store}),e.password);if(e.strict){let m=e.json?"json":"text",{offenses:c}=await L(e.path??l(),m);if(c.length>0&&c.filter(J=>J.severity===A.Severity.ERROR).length>0)throw O(new S(n?`[${n}] Theme check failed. Please fix the errors before pushing.`:"Theme check failed. Please fix the errors before pushing."))}a("theme-service:push:setup"),Y({verbose:e.verbose,noColor:e.noColor});let i=e.force??!1,h=e.path?T(e.path):l();if(!await I(h)&&!await U(i,void 0,n,r))return;e.listing&&await q(h,e.listing);let u=await Z(s,e,r);u&&(a("theme-service:push:setup"),await W(u,s,{allowLive:e.allowLive??!1,environment:n,force:i,ignore:e.ignore??[],json:e.json??!1,multiEnvironment:r,nodelete:e.nodelete??!1,only:e.only??[],path:h,publish:e.publish??!1,listing:e.listing},o))}async function W(e,t,r,o){a("theme-service:push:file-system");let n=await j(e.id,t),s=H(r.path,{filters:r,listing:r.listing});a("theme-service:push:file-system");let{uploadResults:i,renderThemeSyncProgress:h}=V(e,t,n,s,r,o);await h(),r.publish&&await D(e.id,t),await G(i,e,t,r)}function E(e){for(let[t,r]of e.entries())if(!r.success)return!0;return!1}async function G(e,t,r,o){o.json?K(t,r,e,o.environment):o.publish?Q(r,e,o.environment):X(t,r,e,o.environment)}function K(e,t,r,o){let n={environment:o,theme:{id:e.id,name:e.name,role:e.role,shop:t.storeFqdn,editor_url:w(e,t),preview_url:p(e,t)}};if(E(r)){let i=`${o?`[${o}] `:""}The theme '${e.name}' was pushed with errors`;n.theme.warning=i;let h={};for(let[u,m]of r.entries())!m.success&&m.errors?.asset&&(h[u]=m.errors.asset);Object.keys(h).length>0&&(n.theme.errors=h)}$(JSON.stringify(n))}function Q(e,t,r){let o=r?[{subdued:`Environment: ${r}
1
+ import{a as V}from"./chunk-T4V7KOGJ.js";import{k as q,l as H,n as I}from"./chunk-TCFGEOE4.js";import{a as Y}from"./chunk-BG7QQU23.js";import{b as L}from"./chunk-NHOF2IN6.js";import{a as p,b as w}from"./chunk-YY6TFARF.js";import{a as N}from"./chunk-XHXKPRF5.js";import{a as F}from"./chunk-W4SGAPPR.js";import{a as y,c as U}from"./chunk-MYLMGH7Y.js";import{b as g,c as x,d as M,f as _,j as R,n as j,p as D}from"./chunk-GTAYTMCP.js";import{r as k}from"./chunk-DO4SRE4M.js";import{aa as B}from"./chunk-ZVA5F4QC.js";import{T as b,xa as a,ya as O}from"./chunk-CNK3ZO2B.js";import{A as d,B as C,E as P,z as f}from"./chunk-6C5AVMKR.js";import{h as S}from"./chunk-OAG72Q2O.js";import{wb as $}from"./chunk-43FRAUV6.js";import{f as T,q as l}from"./chunk-773TIA5M.js";import{e as z,g as v}from"./chunk-VKWPEFWQ.js";v();var A=z(B(),1);async function Te(e,t,r,o){let n=e.environment?.[0],s=t??await b(k({store:e.store}),e.password);if(e.strict){let m=e.json?"json":"text",{offenses:c}=await L(e.path??l(),m);if(c.length>0&&c.filter(J=>J.severity===A.Severity.ERROR).length>0)throw O(new S(n?`[${n}] Theme check failed. Please fix the errors before pushing.`:"Theme check failed. Please fix the errors before pushing."))}a("theme-service:push:setup"),Y({verbose:e.verbose,noColor:e.noColor});let i=e.force??!1,h=e.path?T(e.path):l();if(!await I(h)&&!await U(i,void 0,n,r))return;e.listing&&await q(h,e.listing);let u=await Z(s,e,r);u&&(a("theme-service:push:setup"),await W(u,s,{allowLive:e.allowLive??!1,environment:n,force:i,ignore:e.ignore??[],json:e.json??!1,multiEnvironment:r,nodelete:e.nodelete??!1,only:e.only??[],path:h,publish:e.publish??!1,listing:e.listing},o))}async function W(e,t,r,o){a("theme-service:push:file-system");let n=await j(e.id,t),s=H(r.path,{filters:r,listing:r.listing});a("theme-service:push:file-system");let{uploadResults:i,renderThemeSyncProgress:h}=V(e,t,n,s,r,o);await h(),r.publish&&await D(e.id,t),await G(i,e,t,r)}function E(e){for(let[t,r]of e.entries())if(!r.success)return!0;return!1}async function G(e,t,r,o){o.json?K(t,r,e,o.environment):o.publish?Q(r,e,o.environment):X(t,r,e,o.environment)}function K(e,t,r,o){let n={environment:o,theme:{id:e.id,name:e.name,role:e.role,shop:t.storeFqdn,editor_url:w(e,t),preview_url:p(e,t)}};if(E(r)){let i=`${o?`[${o}] `:""}The theme '${e.name}' was pushed with errors`;n.theme.warning=i;let h={};for(let[u,m]of r.entries())!m.success&&m.errors?.asset&&(h[u]=m.errors.asset);Object.keys(h).length>0&&(n.theme.errors=h)}$(JSON.stringify(n))}function Q(e,t,r){let o=r?[{subdued:`Environment: ${r}
2
2
 
3
3
  `}]:[];E(t)?d({body:[...o,`Your theme was published with errors and is now live at https://${e.storeFqdn}`]}):f({body:[...o,`Your theme is now live at https://${e.storeFqdn}`]})}function X(e,t,r,o){let n=o?[{subdued:`Environment: ${o}
4
4
 
@@ -1,4 +1,4 @@
1
- import{a as C}from"./chunk-ID3AR4VW.js";import{a as R}from"./chunk-N7VI7OWJ.js";import{R as I,S as E,U as x,wa as F}from"./chunk-7LW23M5C.js";import{b as k}from"./chunk-GZKEIUJT.js";import{B as v,H as h,z as g}from"./chunk-ESTXKKAB.js";import{d as w}from"./chunk-VNW2YMPM.js";import{j as A}from"./chunk-BFL74TW2.js";import{a as y}from"./chunk-CTNBSUVU.js";import{e as b,g as a}from"./chunk-VKWPEFWQ.js";a();a();async function P(o){let{developerPlatformClient:e,app:l,remoteApp:s}=o,{extensionIdentifiersBreakdown:r,versionDetails:n}=await I(e,s,o.version),i=E({localApp:l,versionAppModules:n.appModuleVersions,activeAppVersion:await e.activeAppVersion(s)});if(!await x({configExtensionIdentifiersBreakdown:i,extensionIdentifiersBreakdown:r,appTitle:s.title,release:!0,allowUpdates:o.force||o.allowUpdates,allowDeletes:o.force||o.allowDeletes}))throw new A;let d=[{title:"Releasing version",task:async m=>{m.appRelease=await e.release({app:s,version:{versionId:n.uuid,appVersionId:n.id}})}}],{appRelease:{appRelease:p}}=await h(d),c=[{link:{label:n.versionTag??void 0,url:n.location}},n.message?`
1
+ import{a as C}from"./chunk-VJ5YOXKL.js";import{a as R}from"./chunk-GINXNPAR.js";import{R as I,S as E,U as x,wa as F}from"./chunk-CVW2HMQO.js";import{b as k}from"./chunk-K2DP5Z76.js";import{B as v,H as h,z as g}from"./chunk-6C5AVMKR.js";import{d as w}from"./chunk-XRJCD3AO.js";import{j as A}from"./chunk-OAG72Q2O.js";import{a as y}from"./chunk-CTNBSUVU.js";import{e as b,g as a}from"./chunk-VKWPEFWQ.js";a();a();async function P(o){let{developerPlatformClient:e,app:l,remoteApp:s}=o,{extensionIdentifiersBreakdown:r,versionDetails:n}=await I(e,s,o.version),i=E({localApp:l,versionAppModules:n.appModuleVersions,activeAppVersion:await e.activeAppVersion(s)});if(!await x({configExtensionIdentifiersBreakdown:i,extensionIdentifiersBreakdown:r,appTitle:s.title,release:!0,allowUpdates:o.force||o.allowUpdates,allowDeletes:o.force||o.allowDeletes}))throw new A;let d=[{title:"Releasing version",task:async m=>{m.appRelease=await e.release({app:s,version:{versionId:n.uuid,appVersionId:n.id}})}}],{appRelease:{appRelease:p}}=await h(d),c=[{link:{label:n.versionTag??void 0,url:n.location}},n.message?`
2
2
  ${n.message}`:""];if(p.userErrors&&p.userErrors.length>0){let m=p.userErrors?.map(_=>_.message).join(", ");v({headline:"Version couldn't be released.",body:[...c,`${c.length>0?`
3
3
 
4
4
  `:""}${m}`]})}else g({headline:"Version released to users.",body:c})}var t=b(y(),1);var f=class o extends C{static summary="Release an app version.";static usage="app release --version <version>";static descriptionWithMarkdown="Releases an existing app version. Pass the name of the version that you want to release using the `--version` flag.";static description=this.descriptionWithoutMarkdown();static flags={...k,...R,"allow-updates":t.Flags.boolean({hidden:!1,description:"Allows adding and updating extensions and configuration without requiring user confirmation. Recommended option for CI/CD environments. Required in non-interactive environments unless --allow-deletes is provided.",env:"SHOPIFY_FLAG_ALLOW_UPDATES"}),"allow-deletes":t.Flags.boolean({hidden:!1,description:"Allows removing extensions and configuration without requiring user confirmation. For CI/CD environments, the recommended flag is --allow-updates. Required in non-interactive environments unless --allow-updates is provided.",env:"SHOPIFY_FLAG_ALLOW_DELETES"}),version:t.Flags.string({hidden:!1,description:"The name of the app version to release.",env:"SHOPIFY_FLAG_VERSION",required:!0})};static nonTTYFlagRequirements(){return[{flags:["allow-updates","allow-deletes"]}]}async run(){let{flags:e}=await this.parse(o),l=e["client-id"];await w(()=>({cmd_app_reset_used:e.reset}));let s=e["allow-updates"],r=e["allow-deletes"],n=!!(s&&r),{app:i,remoteApp:u,developerPlatformClient:d}=await F({directory:e.path,clientId:l,forceRelink:e.reset,userProvidedConfigName:e.config});return await P({app:i,remoteApp:u,developerPlatformClient:d,force:n,allowUpdates:s,allowDeletes:r,version:e.version}),{app:i}}};export{f as a};
@@ -1,4 +1,4 @@
1
- import{a as d}from"./chunk-N7VI7OWJ.js";import{T as a}from"./chunk-7LW23M5C.js";import{b as l,c as g,f as S}from"./chunk-GZKEIUJT.js";import{n as o}from"./chunk-NYHGIWKZ.js";import{a as C}from"./chunk-CTNBSUVU.js";import{e as h,g as e}from"./chunk-VKWPEFWQ.js";e();e();var P=["HONOR_BILLING_PRICE","PLAN_PRICE"],T=["OPT_OUT","WHEN_REQUIRED"],f=["UNSCHEDULED","SCHEDULED","MIGRATED"];var r=h(C(),1);var u={...l,...d,...g},F={watch:r.Flags.boolean({description:"Display the current operation state while polling, then output the final outcome when every operation reaches a terminal status.",env:"SHOPIFY_FLAG_WATCH",default:!1})},y={watch:r.Flags.boolean({description:"Display the current operation state while polling, then output the final state when every operation reaches a terminal status.",env:"SHOPIFY_FLAG_WATCH",default:!1})},R={...u,status:r.Flags.option({description:"Filter subscriptions by migration status.",env:"SHOPIFY_FLAG_STATUS",options:[...f]})()},L={...u,input:r.Flags.string({char:"i",description:"Path to the migration CSV. If omitted, standard input is used.",env:"SHOPIFY_FLAG_INPUT"}),force:S(r.Flags.boolean({char:"f",description:"Skip confirmation.",env:"SHOPIFY_FLAG_FORCE",default:!1})),...F},_={...u,id:r.Flags.string({description:"The app subscription migration operation ID. Can be specified multiple times.",env:"SHOPIFY_FLAG_ID",required:!0,multiple:!0})},v={..._,...y};e();e();var I=o`
1
+ import{a as d}from"./chunk-GINXNPAR.js";import{T as a}from"./chunk-CVW2HMQO.js";import{b as l,c as g,f as S}from"./chunk-K2DP5Z76.js";import{n as o}from"./chunk-CNK3ZO2B.js";import{a as C}from"./chunk-CTNBSUVU.js";import{e as h,g as e}from"./chunk-VKWPEFWQ.js";e();e();var P=["HONOR_BILLING_PRICE","PLAN_PRICE"],T=["OPT_OUT","WHEN_REQUIRED"],f=["UNSCHEDULED","SCHEDULED","MIGRATED"];var r=h(C(),1);var u={...l,...d,...g},F={watch:r.Flags.boolean({description:"Display the current operation state while polling, then output the final outcome when every operation reaches a terminal status.",env:"SHOPIFY_FLAG_WATCH",default:!1})},y={watch:r.Flags.boolean({description:"Display the current operation state while polling, then output the final state when every operation reaches a terminal status.",env:"SHOPIFY_FLAG_WATCH",default:!1})},R={...u,status:r.Flags.option({description:"Filter subscriptions by migration status.",env:"SHOPIFY_FLAG_STATUS",options:[...f]})()},L={...u,input:r.Flags.string({char:"i",description:"Path to the migration CSV. If omitted, standard input is used.",env:"SHOPIFY_FLAG_INPUT"}),force:S(r.Flags.boolean({char:"f",description:"Skip confirmation.",env:"SHOPIFY_FLAG_FORCE",default:!1})),...F},_={...u,id:r.Flags.string({description:"The app subscription migration operation ID. Can be specified multiple times.",env:"SHOPIFY_FLAG_ID",required:!0,multiple:!0})},v={..._,...y};e();e();var I=o`
2
2
  query MigratableAppSubscriptions(
3
3
  $apiKey: String!
4
4
  $first: Int!
@@ -1,2 +1,2 @@
1
- import{W as X,ca as z,da as j,ea as v,fa as J,ga as A,ha as W,ia as k,ja as q,ka as N,la as B,ma as L,na as K,oa as R,pa as Q}from"./chunk-7LW23M5C.js";import{c as H}from"./chunk-NEREVIKL.js";import{b as T,e as G,m as l}from"./chunk-NL7WDQSR.js";import{D as x,z as U}from"./chunk-ESTXKKAB.js";import{h as C,j as P}from"./chunk-BFL74TW2.js";import{Ta as V,X as c,_ as b,qa as F,sb as $,wa as I,ya as D}from"./chunk-DD7FQDTB.js";import{d as E,j as M}from"./chunk-773TIA5M.js";import{g as s}from"./chunk-VKWPEFWQ.js";s();s();function Y(e){switch(e){case d.Offsite:return v;case d.CreditCard:return L;case d.CustomCreditCard:return N;case d.CustomOnsite:return k;case d.Redeemable:return A;case d.CardPresent:return R}}var d;(function(e){e.Offsite="payments_app",e.CreditCard="payments_app_credit_card",e.CustomCreditCard="payments_app_custom_credit_card",e.CustomOnsite="payments_app_custom_onsite",e.Redeemable="payments_app_redeemable",e.CardPresent="payments_app_card_present"})(d||(d={}));function Z(e,t){let i=e.activeVersion?.context??e.draftVersion?.context??Y(e.type);switch(i){case v:return w(e,t,J);case L:return w(e,t,K);case N:return w(e,t,B);case k:return w(e,t,q);case A:return w(e,t,W);case R:return w(e,t,Q);default:throw new Error(`Unsupported extension: ${i}`)}}function w(e,t,i){let n=(e.activeVersion??e.draftVersion)?.config;if(!n)throw new Error("No config found for extension");let r=JSON.parse(n),p=i(r,t);p&&delete p.api_version;let a=e.activeVersion?.context??e.draftVersion?.context??Y(e.type);return{api_version:r.api_version,extensions:[{name:e.title,type:"payments_extension",handle:c(e.title.substring(0,l)),...p,targeting:[{target:`${a}`}]}]}}s();s();var pe=new Map(j.map(e=>[e[1],e[0]])),fe=(e,t)=>{let i=pe.get(e.uiType);if(!i)throw new C(`Field type ${e.uiType} is not supported`);let o={key:e.name,description:e.description??void 0,type:i};return t==="flow_action_definition"&&(o.name=e.label,o.required=e.required),o},ue=(e,t)=>{let n={type:t==="flow_action_definition"?`${e.name.replace("_id","")}_reference`:`${e.uiType}_reference`};return t==="flow_action_definition"&&(n.required=e.required),e.uiType==="marketing-activity-id"&&(n.marketingActivityCreateUrl=e.marketingActivityCreateUrl,n.marketingActivityDeleteUrl=e.marketingActivityDeleteUrl),n},ee=(e,t)=>t?t.map(o=>o.uiType==="commerce-object-id"||o.uiType==="marketing-activity-id"||z.includes(o.uiType)?ue(o,e):fe(o,e)):[];function te(e){let t=e.activeVersion?.config??e.draftVersion?.config;if(!t)throw new Error("No config found for extension");let i=e.type==="flow_action_definition"?"https://url.com/api/execute":void 0,o;if(e.type==="flow_trigger_discovery_webhook"){let n=JSON.parse(t);o={extensions:[{type:"flow_trigger_lifecycle_callback",name:e.title,handle:c(e.title.substring(0,l)),url:n.url}]}}else{let n=JSON.parse(t),r=ee(e.type,n.fields??[]);o={extensions:[{type:e.type.replace("_definition",""),name:n.title,handle:c(e.title.substring(0,l)),description:n.description,runtime_url:n.url??i,config_page_url:n.custom_configuration_page_url,config_page_preview_url:n.custom_configuration_page_preview_url,validation_url:n.validation_url}],settings:(r?.length??0)>0?{fields:r}:void 0}}return o}s();s();var ie=e=>{let t=e.split("#");if(t.length!==2||t.some(p=>p===""||p===void 0))throw new Error("Invalid context");let i="admin",o=de(t[0]??""),n=me(t[1]??""),r="link";return n==="selection"?[i,`${o}-index`,`${n}-action`,r].join("."):[i,`${o}-${n}`,"action",r].join(".")},me=e=>{switch(e.toLocaleLowerCase()){case"show":return"details";case"index":return"index";case"action":return"selection";case"fulfilled_card":return"fulfilled-card";default:throw new Error(`Invalid context location: ${e}`)}},de=e=>e.toLocaleLowerCase()==="variants"?"product-variant":b(e.toLocaleLowerCase().replace(new RegExp("(s)$"),""));function ne(e,t,i){let o=e.activeVersion?.config??e.draftVersion?.config;if(!o)throw new Error("No config found for extension");let n=e.activeVersion?.context??e.draftVersion?.context;if(!n)throw new Error("No context found for link extension");let r=JSON.parse(o);if(i.embedded)try{let a=new URL(r.url),_=a.pathname.startsWith("/")?a.pathname.substring(1):a.pathname,u=new URL(`app://${_}`);u.search=a.search,u.hash=a.hash,r.url=u.toString()}catch{}return{extensions:[{type:"admin_link",name:r.text,handle:c(e.title.substring(0,l)),targeting:[{url:r.url,target:ie(n)}]}]}}s();var ge={facebook:"social",instagram:"social",google:"search",pinterest:"social",bing:"search",email:"email",snapchat:"social",sms:"sms",verizon_media:"display",ebay:"marketplace",tiktok:"social",flow:"email"},_e={facebook:"facebook.com",instagram:"instagram.com",google:"google.com",pinterest:"pinterest.com",bing:"bing.com",snapchat:"snapchat.com",verizon_media:null,email:null,sms:null,ebay:"ebay.com",tiktok:"tiktok.com",flow:null};function ye(e){let t=new URL(e);return t.pathname+t.search+t.hash}function oe(e){let t=e.activeVersion?.config??e.draftVersion?.config;if(!t)throw new Error("No config found for extension");let i=JSON.parse(t);return{extensions:[{type:"marketing_activity",name:e.title,handle:c(e.title.substring(0,l)),title:i.title,description:i.description,api_path:ye(i.app_api_url),tactic:i.tactic,marketing_channel:ge[i.platform]??"",referring_domain:_e[i.platform]??"",is_automation:i.is_automation,use_external_editor:i.use_external_editor,preview_data:i.preview_data,fields:i.fields.map(({id:n,...r})=>r)}]}}s();function re(e){let t=e.activeVersion?.config??e.draftVersion?.config;if(!t)throw new Error("No config found for extension");let i=JSON.parse(t);return{extensions:[{type:"subscription_link_extension",name:e.title,handle:c(e.title.substring(0,l)),pattern:i.pattern}]}}var O=[{label:"Payments Extensions",value:"payments",extensionTypes:["payments_app","payments_app_credit_card","payments_app_custom_credit_card","payments_app_custom_onsite","payments_app_redeemable","payments_extension"],buildExtensionConfig:Z},{label:"Flow Extensions",value:"flow",extensionTypes:["flow_action_definition","flow_trigger_definition","flow_trigger_discovery_webhook"],buildExtensionConfig:te},{label:"Marketing Activity Extensions",value:"marketing activity",extensionTypes:["marketing_activity_extension"],buildExtensionConfig:oe},{label:"Subscription Link Extensions",value:"subscription link",extensionTypes:["subscription_link","subscription_link_extension"],buildExtensionConfig:re},{label:"Admin Link extensions",value:"link extension",extensionTypes:["app_link","bulk_action"],buildExtensionConfig:ne}];function se(e){return O.filter(t=>t.extensionTypes.some(i=>e.some(o=>o.type.toLowerCase()===i.toLowerCase())))}async function ft(e){if(e.length===1&&e[0])return e[0];let t=e.map(n=>({label:n.label,value:n.value})),i=await x({message:"Extension type to migrate",choices:t}),o=e.find(n=>n.value===i);if(o===void 0)throw new C("Invalid migration choice");return o}s();var vt=O.flatMap(e=>e.extensionTypes),g;(function(e){e.Write="write",e.Skip="skip",e.Cancel="cancel"})(g||(g={}));async function Ee({name:e,app:t}){let i=b(e),o=E(t.directory,G.extensions.directoryName,i);if(await V(o)){let n=[{label:"Overwrite local TOML with remote configuration",value:g.Write},{label:"Keep local TOML",value:g.Skip},{label:"Cancel",value:g.Cancel}],r=await x({message:`Directory "${i}" already exists. What would you like to do?`,choices:n});if(r===g.Cancel)throw new P;return{directory:o,action:r}}return await I(o),await F(E(o,T.lockFile)),{directory:o,action:g.Write}}async function Ce(e){let{app:t,remoteApp:i,extensionTypes:o,extensions:n,buildExtensionConfig:r,all:p}=e,a=n.filter(f=>o.includes(f.type.toLowerCase()));if(a=we(t,a),a.length===0)throw new C("No extensions to migrate");if(!p){let f=a.map(y=>({label:y.title,value:y.uuid}));a.length>1&&f.push({label:"All",value:"All"});let m=await x({message:"Extensions to migrate",choices:f});m!=="All"&&(a=[a.find(y=>y?.uuid===m)])}let _={},u=a.map(async f=>{let{directory:m,action:y}=await Ee({app:t,name:f.title}),ae=c(f.title.substring(0,l));if(_[ae]=f.uuid,y===g.Write){let S=r(f,n,t.configuration),ce=E(m,"shopify.extension.toml");await new H(ce,S).replace(S);let le=E(m,T.lockFile);await D(le)}return{extension:f,directory:E("extensions",M(m))}}),h=await Promise.all(u);xe(h),await X({app:t,appApiKey:i.apiKey,extensionUuids:_,command:"import-extensions"})}function we(e,t){let i=e.dotenv?.variables??{},o=e.allExtensions.map(n=>i[n.idEnvironmentVariableName]);return t.filter(n=>!o.includes(n.uuid))}async function At(e){let t=se(e.extensions);await Promise.all(t.map(async i=>Ce({...e,extensionTypes:i.extensionTypes,buildExtensionConfig:i.buildExtensionConfig,all:!0})))}function xe(e){U({headline:["Imported the following extensions from the dashboard:"],body:e.map(t=>$`• "${t.extension.title}" at: ${t.directory}`.value).join(`
1
+ import{W as X,ca as z,da as j,ea as v,fa as J,ga as A,ha as W,ia as k,ja as q,ka as N,la as B,ma as L,na as K,oa as R,pa as Q}from"./chunk-CVW2HMQO.js";import{c as H}from"./chunk-A3V2A2I4.js";import{b as T,e as G,m as l}from"./chunk-YNFXYVYN.js";import{D as x,z as U}from"./chunk-6C5AVMKR.js";import{h as C,j as P}from"./chunk-OAG72Q2O.js";import{Ta as V,X as c,_ as b,qa as F,sb as $,wa as I,ya as D}from"./chunk-43FRAUV6.js";import{d as E,j as M}from"./chunk-773TIA5M.js";import{g as s}from"./chunk-VKWPEFWQ.js";s();s();function Y(e){switch(e){case d.Offsite:return v;case d.CreditCard:return L;case d.CustomCreditCard:return N;case d.CustomOnsite:return k;case d.Redeemable:return A;case d.CardPresent:return R}}var d;(function(e){e.Offsite="payments_app",e.CreditCard="payments_app_credit_card",e.CustomCreditCard="payments_app_custom_credit_card",e.CustomOnsite="payments_app_custom_onsite",e.Redeemable="payments_app_redeemable",e.CardPresent="payments_app_card_present"})(d||(d={}));function Z(e,t){let i=e.activeVersion?.context??e.draftVersion?.context??Y(e.type);switch(i){case v:return w(e,t,J);case L:return w(e,t,K);case N:return w(e,t,B);case k:return w(e,t,q);case A:return w(e,t,W);case R:return w(e,t,Q);default:throw new Error(`Unsupported extension: ${i}`)}}function w(e,t,i){let n=(e.activeVersion??e.draftVersion)?.config;if(!n)throw new Error("No config found for extension");let r=JSON.parse(n),p=i(r,t);p&&delete p.api_version;let a=e.activeVersion?.context??e.draftVersion?.context??Y(e.type);return{api_version:r.api_version,extensions:[{name:e.title,type:"payments_extension",handle:c(e.title.substring(0,l)),...p,targeting:[{target:`${a}`}]}]}}s();s();var pe=new Map(j.map(e=>[e[1],e[0]])),fe=(e,t)=>{let i=pe.get(e.uiType);if(!i)throw new C(`Field type ${e.uiType} is not supported`);let o={key:e.name,description:e.description??void 0,type:i};return t==="flow_action_definition"&&(o.name=e.label,o.required=e.required),o},ue=(e,t)=>{let n={type:t==="flow_action_definition"?`${e.name.replace("_id","")}_reference`:`${e.uiType}_reference`};return t==="flow_action_definition"&&(n.required=e.required),e.uiType==="marketing-activity-id"&&(n.marketingActivityCreateUrl=e.marketingActivityCreateUrl,n.marketingActivityDeleteUrl=e.marketingActivityDeleteUrl),n},ee=(e,t)=>t?t.map(o=>o.uiType==="commerce-object-id"||o.uiType==="marketing-activity-id"||z.includes(o.uiType)?ue(o,e):fe(o,e)):[];function te(e){let t=e.activeVersion?.config??e.draftVersion?.config;if(!t)throw new Error("No config found for extension");let i=e.type==="flow_action_definition"?"https://url.com/api/execute":void 0,o;if(e.type==="flow_trigger_discovery_webhook"){let n=JSON.parse(t);o={extensions:[{type:"flow_trigger_lifecycle_callback",name:e.title,handle:c(e.title.substring(0,l)),url:n.url}]}}else{let n=JSON.parse(t),r=ee(e.type,n.fields??[]);o={extensions:[{type:e.type.replace("_definition",""),name:n.title,handle:c(e.title.substring(0,l)),description:n.description,runtime_url:n.url??i,config_page_url:n.custom_configuration_page_url,config_page_preview_url:n.custom_configuration_page_preview_url,validation_url:n.validation_url}],settings:(r?.length??0)>0?{fields:r}:void 0}}return o}s();s();var ie=e=>{let t=e.split("#");if(t.length!==2||t.some(p=>p===""||p===void 0))throw new Error("Invalid context");let i="admin",o=de(t[0]??""),n=me(t[1]??""),r="link";return n==="selection"?[i,`${o}-index`,`${n}-action`,r].join("."):[i,`${o}-${n}`,"action",r].join(".")},me=e=>{switch(e.toLocaleLowerCase()){case"show":return"details";case"index":return"index";case"action":return"selection";case"fulfilled_card":return"fulfilled-card";default:throw new Error(`Invalid context location: ${e}`)}},de=e=>e.toLocaleLowerCase()==="variants"?"product-variant":b(e.toLocaleLowerCase().replace(new RegExp("(s)$"),""));function ne(e,t,i){let o=e.activeVersion?.config??e.draftVersion?.config;if(!o)throw new Error("No config found for extension");let n=e.activeVersion?.context??e.draftVersion?.context;if(!n)throw new Error("No context found for link extension");let r=JSON.parse(o);if(i.embedded)try{let a=new URL(r.url),_=a.pathname.startsWith("/")?a.pathname.substring(1):a.pathname,u=new URL(`app://${_}`);u.search=a.search,u.hash=a.hash,r.url=u.toString()}catch{}return{extensions:[{type:"admin_link",name:r.text,handle:c(e.title.substring(0,l)),targeting:[{url:r.url,target:ie(n)}]}]}}s();var ge={facebook:"social",instagram:"social",google:"search",pinterest:"social",bing:"search",email:"email",snapchat:"social",sms:"sms",verizon_media:"display",ebay:"marketplace",tiktok:"social",flow:"email"},_e={facebook:"facebook.com",instagram:"instagram.com",google:"google.com",pinterest:"pinterest.com",bing:"bing.com",snapchat:"snapchat.com",verizon_media:null,email:null,sms:null,ebay:"ebay.com",tiktok:"tiktok.com",flow:null};function ye(e){let t=new URL(e);return t.pathname+t.search+t.hash}function oe(e){let t=e.activeVersion?.config??e.draftVersion?.config;if(!t)throw new Error("No config found for extension");let i=JSON.parse(t);return{extensions:[{type:"marketing_activity",name:e.title,handle:c(e.title.substring(0,l)),title:i.title,description:i.description,api_path:ye(i.app_api_url),tactic:i.tactic,marketing_channel:ge[i.platform]??"",referring_domain:_e[i.platform]??"",is_automation:i.is_automation,use_external_editor:i.use_external_editor,preview_data:i.preview_data,fields:i.fields.map(({id:n,...r})=>r)}]}}s();function re(e){let t=e.activeVersion?.config??e.draftVersion?.config;if(!t)throw new Error("No config found for extension");let i=JSON.parse(t);return{extensions:[{type:"subscription_link_extension",name:e.title,handle:c(e.title.substring(0,l)),pattern:i.pattern}]}}var O=[{label:"Payments Extensions",value:"payments",extensionTypes:["payments_app","payments_app_credit_card","payments_app_custom_credit_card","payments_app_custom_onsite","payments_app_redeemable","payments_extension"],buildExtensionConfig:Z},{label:"Flow Extensions",value:"flow",extensionTypes:["flow_action_definition","flow_trigger_definition","flow_trigger_discovery_webhook"],buildExtensionConfig:te},{label:"Marketing Activity Extensions",value:"marketing activity",extensionTypes:["marketing_activity_extension"],buildExtensionConfig:oe},{label:"Subscription Link Extensions",value:"subscription link",extensionTypes:["subscription_link","subscription_link_extension"],buildExtensionConfig:re},{label:"Admin Link extensions",value:"link extension",extensionTypes:["app_link","bulk_action"],buildExtensionConfig:ne}];function se(e){return O.filter(t=>t.extensionTypes.some(i=>e.some(o=>o.type.toLowerCase()===i.toLowerCase())))}async function ft(e){if(e.length===1&&e[0])return e[0];let t=e.map(n=>({label:n.label,value:n.value})),i=await x({message:"Extension type to migrate",choices:t}),o=e.find(n=>n.value===i);if(o===void 0)throw new C("Invalid migration choice");return o}s();var vt=O.flatMap(e=>e.extensionTypes),g;(function(e){e.Write="write",e.Skip="skip",e.Cancel="cancel"})(g||(g={}));async function Ee({name:e,app:t}){let i=b(e),o=E(t.directory,G.extensions.directoryName,i);if(await V(o)){let n=[{label:"Overwrite local TOML with remote configuration",value:g.Write},{label:"Keep local TOML",value:g.Skip},{label:"Cancel",value:g.Cancel}],r=await x({message:`Directory "${i}" already exists. What would you like to do?`,choices:n});if(r===g.Cancel)throw new P;return{directory:o,action:r}}return await I(o),await F(E(o,T.lockFile)),{directory:o,action:g.Write}}async function Ce(e){let{app:t,remoteApp:i,extensionTypes:o,extensions:n,buildExtensionConfig:r,all:p}=e,a=n.filter(f=>o.includes(f.type.toLowerCase()));if(a=we(t,a),a.length===0)throw new C("No extensions to migrate");if(!p){let f=a.map(y=>({label:y.title,value:y.uuid}));a.length>1&&f.push({label:"All",value:"All"});let m=await x({message:"Extensions to migrate",choices:f});m!=="All"&&(a=[a.find(y=>y?.uuid===m)])}let _={},u=a.map(async f=>{let{directory:m,action:y}=await Ee({app:t,name:f.title}),ae=c(f.title.substring(0,l));if(_[ae]=f.uuid,y===g.Write){let S=r(f,n,t.configuration),ce=E(m,"shopify.extension.toml");await new H(ce,S).replace(S);let le=E(m,T.lockFile);await D(le)}return{extension:f,directory:E("extensions",M(m))}}),h=await Promise.all(u);xe(h),await X({app:t,appApiKey:i.apiKey,extensionUuids:_,command:"import-extensions"})}function we(e,t){let i=e.dotenv?.variables??{},o=e.allExtensions.map(n=>i[n.idEnvironmentVariableName]);return t.filter(n=>!o.includes(n.uuid))}async function At(e){let t=se(e.extensions);await Promise.all(t.map(async i=>Ce({...e,extensionTypes:i.extensionTypes,buildExtensionConfig:i.buildExtensionConfig,all:!0})))}function xe(e){U({headline:["Imported the following extensions from the dashboard:"],body:e.map(t=>$`• "${t.extension.title}" at: ${t.directory}`.value).join(`
2
2
  `)})}s();async function Lt({developerPlatformClient:e,apiKey:t,organizationId:i,extensionTypes:o,onlyDashboardManaged:n=!1}){let r=await e.appExtensionRegistrations({id:t,apiKey:t,organizationId:i}),{dashboardManagedExtensionRegistrations:p,extensionRegistrations:a}=r.app;return(n?p:a.concat(p)).filter(u=>{let h=o.includes(u.type.toLowerCase()),f=u.activeVersion&&u.activeVersion.config,m=u.draftVersion&&u.draftVersion.config;return h&&(f??m)})}export{se as a,ft as b,vt as c,Ce as d,we as e,At as f,Lt as g};
@@ -1,2 +1,2 @@
1
- import{w as d}from"./chunk-F2X7F5QX.js";import{a as l}from"./chunk-ID3AR4VW.js";import{a as m}from"./chunk-N7VI7OWJ.js";import{wa as f}from"./chunk-7LW23M5C.js";import{b as u}from"./chunk-GZKEIUJT.js";import{Ib as p,wb as c}from"./chunk-DD7FQDTB.js";import{g as i}from"./chunk-VKWPEFWQ.js";i();i();function h(a){let o=d(a),t=new Map;o.forEach(s=>{let e=s.split(".");if(e.length>=2){let r=e[0];t.has(r)||t.set(r,[]),t.set(r,[...t.get(r),s])}});for(let[s,e]of t)c(p(s,e.join(`
1
+ import{w as d}from"./chunk-RHNZA4IL.js";import{a as l}from"./chunk-VJ5YOXKL.js";import{a as m}from"./chunk-GINXNPAR.js";import{wa as f}from"./chunk-CVW2HMQO.js";import{b as u}from"./chunk-K2DP5Z76.js";import{Ib as p,wb as c}from"./chunk-43FRAUV6.js";import{g as i}from"./chunk-VKWPEFWQ.js";i();i();function h(a){let o=d(a),t=new Map;o.forEach(s=>{let e=s.split(".");if(e.length>=2){let r=e[0];t.has(r)||t.set(r,[]),t.set(r,[...t.get(r),s])}});for(let[s,e]of t)c(p(s,e.join(`
2
2
  `)))}var n=class a extends l{static summary="Print out a list of sources that may be used with the logs command.";static descriptionWithMarkdown="The output source names can be used with the `--source` argument of `shopify app logs` to filter log output. Currently only function extensions are supported as sources.";static description=this.descriptionWithoutMarkdown();static flags={...u,...m};async run(){let{flags:o}=await this.parse(a),{app:t}=await f({directory:o.path,clientId:o["client-id"],forceRelink:o.reset,userProvidedConfigName:o.config});return t.errors.isEmpty()?h(t):process.exit(2),{app:t}}};export{n as a};
@@ -1 +1 @@
1
- import{b}from"./chunk-PPWJM7KE.js";import{j as c,l as f,o as T}from"./chunk-7SHHNWHL.js";import{a as F}from"./chunk-3QF47EX2.js";import{p as y,v as O}from"./chunk-4Y7WHAJX.js";import{b as I}from"./chunk-GZKEIUJT.js";import{s as v,xa as w}from"./chunk-NYHGIWKZ.js";import{z as S}from"./chunk-ESTXKKAB.js";import{h as a}from"./chunk-BFL74TW2.js";import{a as A}from"./chunk-CTNBSUVU.js";import{Ua as l,ma as u,xb as _}from"./chunk-DD7FQDTB.js";import{e as x,g as d}from"./chunk-VKWPEFWQ.js";d();d();d();async function P({session:e,overridesContent:r,themeId:t}){w("theme-preview:create");let m=`${f(e)}/theme_preview.json?preview_theme_id=${t}`,o=await c(e,{headers:{"Content-Type":"application/json"}}),i=await v(m,{method:"POST",body:r,headers:o});if(!i.ok)throw new a(`Theme preview request failed with status ${i.status}: ${i.statusText}`);let n=await J(i);return w("theme-preview:create"),n}async function g({session:e,overridesContent:r,themeId:t,previewIdentifier:s}){w("theme-preview:update");let o=`${f(e)}/theme_preview.json?preview_theme_id=${t}&preview_identifier=${encodeURIComponent(s)}`,i=await c(e,{headers:{"Content-Type":"application/json"}}),n=await v(o,{method:"POST",body:r,headers:i});if(!n.ok)throw new a(`Theme preview request failed with status ${n.status}: ${n.statusText}`);let E=await J(n);return w("theme-preview:update"),E}async function J(e){let r=await e.json();if(r.error)throw new a(`Theme preview failed: ${r.error}`);if(!r.url||!r.preview_identifier)throw new a("Theme preview returned an unexpected response");return{url:r.url,preview_identifier:r.preview_identifier}}async function $(e){if(!l(e.overrideJson))throw new a(`Override file not found: ${e.overrideJson}`);let r=await u(e.overrideJson),t;try{t=JSON.parse(r)}catch(i){let n=i instanceof Error?i.message:String(i);throw new a(`Failed to parse override file: ${e.overrideJson}`,n)}let s=await T(e.themeId,e.adminSession,e.password),m=JSON.stringify(t),o=e.previewIdentifier?await g({session:s,overridesContent:m,themeId:e.themeId,previewIdentifier:e.previewIdentifier}):await P({session:s,overridesContent:m,themeId:e.themeId});e.json?_(JSON.stringify({url:o.url,preview_identifier:o.preview_identifier})):S({body:[{list:{title:e.previewIdentifier?"Preview updated":"Preview is ready",items:[{link:{url:o.url}},`Preview ID: ${o.preview_identifier}`]}}]}),e.open&&b(o.url,"theme preview")}var p=x(A(),1);var h=class extends O{static summary="Applies JSON overrides to a theme and returns a preview URL.";static descriptionWithMarkdown="Applies a JSON overrides file to a theme and creates or updates a preview. This lets you quickly preview changes.\n\n The command returns a preview URL and a preview identifier. You can reuse the preview identifier with `--preview-id` to update an existing preview instead of creating a new one.";static description=this.descriptionWithoutMarkdown();static flags={...I,...y,theme:p.Flags.string({char:"t",description:"Theme ID or name of the remote theme.",env:"SHOPIFY_FLAG_THEME_ID",required:!0}),overrides:p.Flags.string({description:"Path to a JSON overrides file.",env:"SHOPIFY_FLAG_OVERRIDES",required:!0}),"preview-id":p.Flags.string({description:"An existing preview identifier to update instead of creating a new preview.",env:"SHOPIFY_FLAG_PREVIEW_ID"}),open:p.Flags.boolean({description:"Automatically launch the theme preview in your default web browser.",env:"SHOPIFY_FLAG_OPEN",default:!1}),json:p.Flags.boolean({description:"Output the preview URL and identifier as JSON.",env:"SHOPIFY_FLAG_JSON",default:!1})};static multiEnvironmentsFlags=null;async command(r,t){let s=await F(t,{filter:{theme:r.theme}});await $({adminSession:t,overrideJson:r.overrides,themeId:s.id.toString(),previewIdentifier:r["preview-id"],open:r.open,password:r.password,json:r.json})}};export{h as a};
1
+ import{b}from"./chunk-G2YTINLI.js";import{j as c,l as f,o as T}from"./chunk-OY6L7J53.js";import{a as F}from"./chunk-W4SGAPPR.js";import{p as y,v as O}from"./chunk-DO4SRE4M.js";import{b as I}from"./chunk-K2DP5Z76.js";import{s as v,xa as w}from"./chunk-CNK3ZO2B.js";import{z as S}from"./chunk-6C5AVMKR.js";import{h as a}from"./chunk-OAG72Q2O.js";import{a as A}from"./chunk-CTNBSUVU.js";import{Ua as l,ma as u,xb as _}from"./chunk-43FRAUV6.js";import{e as x,g as d}from"./chunk-VKWPEFWQ.js";d();d();d();async function P({session:e,overridesContent:r,themeId:t}){w("theme-preview:create");let m=`${f(e)}/theme_preview.json?preview_theme_id=${t}`,o=await c(e,{headers:{"Content-Type":"application/json"}}),i=await v(m,{method:"POST",body:r,headers:o});if(!i.ok)throw new a(`Theme preview request failed with status ${i.status}: ${i.statusText}`);let n=await J(i);return w("theme-preview:create"),n}async function g({session:e,overridesContent:r,themeId:t,previewIdentifier:s}){w("theme-preview:update");let o=`${f(e)}/theme_preview.json?preview_theme_id=${t}&preview_identifier=${encodeURIComponent(s)}`,i=await c(e,{headers:{"Content-Type":"application/json"}}),n=await v(o,{method:"POST",body:r,headers:i});if(!n.ok)throw new a(`Theme preview request failed with status ${n.status}: ${n.statusText}`);let E=await J(n);return w("theme-preview:update"),E}async function J(e){let r=await e.json();if(r.error)throw new a(`Theme preview failed: ${r.error}`);if(!r.url||!r.preview_identifier)throw new a("Theme preview returned an unexpected response");return{url:r.url,preview_identifier:r.preview_identifier}}async function $(e){if(!l(e.overrideJson))throw new a(`Override file not found: ${e.overrideJson}`);let r=await u(e.overrideJson),t;try{t=JSON.parse(r)}catch(i){let n=i instanceof Error?i.message:String(i);throw new a(`Failed to parse override file: ${e.overrideJson}`,n)}let s=await T(e.themeId,e.adminSession,e.password),m=JSON.stringify(t),o=e.previewIdentifier?await g({session:s,overridesContent:m,themeId:e.themeId,previewIdentifier:e.previewIdentifier}):await P({session:s,overridesContent:m,themeId:e.themeId});e.json?_(JSON.stringify({url:o.url,preview_identifier:o.preview_identifier})):S({body:[{list:{title:e.previewIdentifier?"Preview updated":"Preview is ready",items:[{link:{url:o.url}},`Preview ID: ${o.preview_identifier}`]}}]}),e.open&&b(o.url,"theme preview")}var p=x(A(),1);var h=class extends O{static summary="Applies JSON overrides to a theme and returns a preview URL.";static descriptionWithMarkdown="Applies a JSON overrides file to a theme and creates or updates a preview. This lets you quickly preview changes.\n\n The command returns a preview URL and a preview identifier. You can reuse the preview identifier with `--preview-id` to update an existing preview instead of creating a new one.";static description=this.descriptionWithoutMarkdown();static flags={...I,...y,theme:p.Flags.string({char:"t",description:"Theme ID or name of the remote theme.",env:"SHOPIFY_FLAG_THEME_ID",required:!0}),overrides:p.Flags.string({description:"Path to a JSON overrides file.",env:"SHOPIFY_FLAG_OVERRIDES",required:!0}),"preview-id":p.Flags.string({description:"An existing preview identifier to update instead of creating a new preview.",env:"SHOPIFY_FLAG_PREVIEW_ID"}),open:p.Flags.boolean({description:"Automatically launch the theme preview in your default web browser.",env:"SHOPIFY_FLAG_OPEN",default:!1}),json:p.Flags.boolean({description:"Output the preview URL and identifier as JSON.",env:"SHOPIFY_FLAG_JSON",default:!1})};static multiEnvironmentsFlags=null;async command(r,t){let s=await F(t,{filter:{theme:r.theme}});await $({adminSession:t,overrideJson:r.overrides,themeId:s.id.toString(),previewIdentifier:r["preview-id"],open:r.open,password:r.password,json:r.json})}};export{h as a};
@@ -1 +1 @@
1
- import{D as h,E as e,F as r,J as o,K as s,n}from"./chunk-ESTXKKAB.js";import{g as i}from"./chunk-VKWPEFWQ.js";i();async function y(){await h({message:"Associate your project with the org Castile Ventures?",choices:[{label:"first",value:"first",disabled:!0},{label:"second",value:"second"},{label:"third (limit reached)",value:"third",disabled:!0},{label:"fourth (limit reached)",value:"fourth",disabled:!0},{label:"fifth",value:"fifth",group:"Automations",disabled:!0},{label:"sixth",value:"sixth",group:"Automations"},{label:"seventh",value:"seventh"},{label:"eighth (limit reached)",value:"eighth",group:"Merchant Admin",disabled:!0},{label:"ninth",value:"ninth",group:"Merchant Admin"},{label:"tenth",value:"tenth"}],infoTable:[{header:"add",items:["new-ext"],bullet:"+"},{header:"remove",items:["integrated-demand-ext","order-discount"],bullet:"-"}]}),await o({message:"App project name (can be changed later)",defaultValue:"expansive commerce app",validate:t=>{if(t.includes("shopify"))return`Can't include "shopify" in the name`}});let l=[{label:"first",value:"first"},{label:"second",value:"second"},{label:"third",value:"third"},{label:"fourth",value:"fourth"},{label:"fifth",value:"fifth"},{label:"sixth",value:"sixth"},{label:"seventh",value:"seventh"},{label:"eighth",value:"eighth"},{label:"ninth",value:"ninth"},{label:"tenth",value:"tenth"},{label:"eleventh",value:"eleventh"},{label:"twelfth",value:"twelfth"},{label:"thirteenth",value:"thirteenth"},{label:"fourteenth",value:"fourteenth"},{label:"fifteenth",value:"fifteenth"},{label:"sixteenth",value:"sixteenth"},{label:"seventeenth",value:"seventeenth"},{label:"eighteenth",value:"eighteenth"},{label:"nineteenth",value:"nineteenth"},{label:"twentieth",value:"twentieth"},{label:"twenty-first",value:"twenty-first"},{label:"twenty-second",value:"twenty-second"},{label:"twenty-third",value:"twenty-third"},{label:"twenty-fourth",value:"twenty-fourth"},{label:"twenty-fifth",value:"twenty-fifth"},{label:"twenty-sixth",value:"twenty-sixth"},{label:"twenty-seventh",value:"twenty-seventh"},{label:"twenty-eighth",value:"twenty-eighth"},{label:"twenty-ninth",value:"twenty-ninth"},{label:"thirtieth",value:"thirtieth"},{label:"thirty-first",value:"thirty-first"},{label:"thirty-second",value:"thirty-second"},{label:"thirty-third",value:"thirty-third"},{label:"thirty-fourth",value:"thirty-fourth"},{label:"thirty-fifth",value:"thirty-fifth"},{label:"thirty-sixth",value:"thirty-sixth"},{label:"thirty-seventh",value:"thirty-seventh"},{label:"thirty-eighth",value:"thirty-eighth"},{label:"thirty-ninth",value:"thirty-ninth"},{label:"fortieth",value:"fortieth"},{label:"forty-first",value:"forty-first"},{label:"forty-second",value:"forty-second"},{label:"forty-third",value:"forty-third"},{label:"forty-fourth",value:"forty-fourth"},{label:"forty-fifth",value:"forty-fifth"},{label:"forty-sixth",value:"forty-sixth"},{label:"forty-seventh",value:"forty-seventh"},{label:"forty-eighth",value:"forty-eighth"},{label:"forty-ninth",value:"forty-ninth"},{label:"fiftieth",value:"fiftieth"}];await r({message:"Template",choices:l,search(t){return Promise.resolve({data:l.filter(f=>f.label.includes(t))})}});let a=[["first theme",{subdued:"(#1)"}],["second theme",{subdued:"(#2)"}]];await e({message:"Add the following themes to the store?",infoTable:{"":a},confirmationMessage:"Yes, add them",cancellationMessage:"Cancel"});let u={title:{color:"red",text:`${n.warning} This can't be undone.`},body:"The action you are executing should be confirmed to proceed."};await e({message:"Delete the following themes from the store?",infoTable:{"":a},infoMessage:u,confirmationMessage:"Yes, delete them",cancellationMessage:"Cancel",defaultValue:!1}),await e({message:["Make the following changes to your",{filePath:".env"},"file?"],defaultValue:!0,confirmationMessage:"Yes, confirm changes",cancellationMessage:"No, make changes later"}),await s({message:"Release this version of Mega App?",infoTable:[{header:"Includes",items:["My subscription extension","Order discount function","Subscription cancelled trigger","Add subscription action"],bullet:"+"},{header:"Removes",items:["product-discount-function","product-subscription-extension"],bullet:"-"}],confirmation:"Mega App"})}export{y as a};
1
+ import{D as h,E as e,F as r,J as o,K as s,n}from"./chunk-6C5AVMKR.js";import{g as i}from"./chunk-VKWPEFWQ.js";i();async function y(){await h({message:"Associate your project with the org Castile Ventures?",choices:[{label:"first",value:"first",disabled:!0},{label:"second",value:"second"},{label:"third (limit reached)",value:"third",disabled:!0},{label:"fourth (limit reached)",value:"fourth",disabled:!0},{label:"fifth",value:"fifth",group:"Automations",disabled:!0},{label:"sixth",value:"sixth",group:"Automations"},{label:"seventh",value:"seventh"},{label:"eighth (limit reached)",value:"eighth",group:"Merchant Admin",disabled:!0},{label:"ninth",value:"ninth",group:"Merchant Admin"},{label:"tenth",value:"tenth"}],infoTable:[{header:"add",items:["new-ext"],bullet:"+"},{header:"remove",items:["integrated-demand-ext","order-discount"],bullet:"-"}]}),await o({message:"App project name (can be changed later)",defaultValue:"expansive commerce app",validate:t=>{if(t.includes("shopify"))return`Can't include "shopify" in the name`}});let l=[{label:"first",value:"first"},{label:"second",value:"second"},{label:"third",value:"third"},{label:"fourth",value:"fourth"},{label:"fifth",value:"fifth"},{label:"sixth",value:"sixth"},{label:"seventh",value:"seventh"},{label:"eighth",value:"eighth"},{label:"ninth",value:"ninth"},{label:"tenth",value:"tenth"},{label:"eleventh",value:"eleventh"},{label:"twelfth",value:"twelfth"},{label:"thirteenth",value:"thirteenth"},{label:"fourteenth",value:"fourteenth"},{label:"fifteenth",value:"fifteenth"},{label:"sixteenth",value:"sixteenth"},{label:"seventeenth",value:"seventeenth"},{label:"eighteenth",value:"eighteenth"},{label:"nineteenth",value:"nineteenth"},{label:"twentieth",value:"twentieth"},{label:"twenty-first",value:"twenty-first"},{label:"twenty-second",value:"twenty-second"},{label:"twenty-third",value:"twenty-third"},{label:"twenty-fourth",value:"twenty-fourth"},{label:"twenty-fifth",value:"twenty-fifth"},{label:"twenty-sixth",value:"twenty-sixth"},{label:"twenty-seventh",value:"twenty-seventh"},{label:"twenty-eighth",value:"twenty-eighth"},{label:"twenty-ninth",value:"twenty-ninth"},{label:"thirtieth",value:"thirtieth"},{label:"thirty-first",value:"thirty-first"},{label:"thirty-second",value:"thirty-second"},{label:"thirty-third",value:"thirty-third"},{label:"thirty-fourth",value:"thirty-fourth"},{label:"thirty-fifth",value:"thirty-fifth"},{label:"thirty-sixth",value:"thirty-sixth"},{label:"thirty-seventh",value:"thirty-seventh"},{label:"thirty-eighth",value:"thirty-eighth"},{label:"thirty-ninth",value:"thirty-ninth"},{label:"fortieth",value:"fortieth"},{label:"forty-first",value:"forty-first"},{label:"forty-second",value:"forty-second"},{label:"forty-third",value:"forty-third"},{label:"forty-fourth",value:"forty-fourth"},{label:"forty-fifth",value:"forty-fifth"},{label:"forty-sixth",value:"forty-sixth"},{label:"forty-seventh",value:"forty-seventh"},{label:"forty-eighth",value:"forty-eighth"},{label:"forty-ninth",value:"forty-ninth"},{label:"fiftieth",value:"fiftieth"}];await r({message:"Template",choices:l,search(t){return Promise.resolve({data:l.filter(f=>f.label.includes(t))})}});let a=[["first theme",{subdued:"(#1)"}],["second theme",{subdued:"(#2)"}]];await e({message:"Add the following themes to the store?",infoTable:{"":a},confirmationMessage:"Yes, add them",cancellationMessage:"Cancel"});let u={title:{color:"red",text:`${n.warning} This can't be undone.`},body:"The action you are executing should be confirmed to proceed."};await e({message:"Delete the following themes from the store?",infoTable:{"":a},infoMessage:u,confirmationMessage:"Yes, delete them",cancellationMessage:"Cancel",defaultValue:!1}),await e({message:["Make the following changes to your",{filePath:".env"},"file?"],defaultValue:!0,confirmationMessage:"Yes, confirm changes",cancellationMessage:"No, make changes later"}),await s({message:"Release this version of Mega App?",infoTable:[{header:"Includes",items:["My subscription extension","Order discount function","Subscription cancelled trigger","Add subscription action"],bullet:"+"},{header:"Removes",items:["product-discount-function","product-subscription-extension"],bullet:"-"}],confirmation:"Mega App"})}export{y as a};
@@ -1,4 +1,4 @@
1
- import{b as S}from"./chunk-XMQJUFVE.js";import{a as A,b as B,c as L,f as I,j as x,k as $,m as N,t as q}from"./chunk-DJGDJSXS.js";import{a as P}from"./chunk-ID3AR4VW.js";import{a as z}from"./chunk-N7VI7OWJ.js";import{b as C}from"./chunk-GZKEIUJT.js";import{D as E,W as g}from"./chunk-NYHGIWKZ.js";import{B as w,G as T,y as u,z as v}from"./chunk-ESTXKKAB.js";import{k as D}from"./chunk-BFL74TW2.js";import{a as K}from"./chunk-CTNBSUVU.js";import{Cb as b,ba as k,ga as y,qb as l,sb as d}from"./chunk-DD7FQDTB.js";import{i as m}from"./chunk-B4OMIONW.js";import{e as _,g as c}from"./chunk-VKWPEFWQ.js";c();c();async function M(e){let{organization:o,storeFqdn:t,operationId:r,remoteApp:a}=e;u({headline:"Checking bulk operation status.",body:[{list:{items:S({organization:o,remoteApp:a,storeFqdn:t})}}]});let s=a.apiSecretKeys[0]?.secret;if(!s)throw new D("No API secret keys found for app");let p=await g(t,a.apiKey,s),i=await x({adminSession:p,operationId:r,version:await I({adminSession:p,minimumDefaultVersion:A})});i?U(i):w({headline:"Bulk operation not found.",body:d`ID: ${l.yellow(r)}`.value})}async function R(e){let{organization:o,storeFqdn:t,remoteApp:r}=e;u({headline:"Listing bulk operations.",body:[{list:{items:S({organization:o,remoteApp:r,storeFqdn:t})}}]});let a=r.apiSecretKeys[0]?.secret;if(!a)throw new D("No API secret keys found for app");let s=await g(t,r.apiKey,a),i=(await $({adminSession:s,version:await I({adminSession:s,minimumDefaultVersion:A})})).map(n=>({id:L(n.id),status:G(n.status),count:H(n.objectCount),dateCreated:k(new Date(String(n.createdAt))),dateFinished:n.completedAt?k(new Date(String(n.completedAt))):"",results:W(n.url??n.partialDataUrl)}));b(),i.length===0?u({body:"No bulk operations found in the last 7 days."}):T({rows:i,columns:{id:{header:"ID",color:"yellow"},status:{header:"STATUS"},count:{header:"COUNT"},dateCreated:{header:"DATE CREATED",color:"cyan"},dateFinished:{header:"DATE FINISHED",color:"cyan"},results:{header:"RESULTS"}}}),b()}function U(e){let{id:o,status:t,createdAt:r,completedAt:a,url:s,partialDataUrl:p}=e,i=N(e).value,n=V(r,a),f=d`ID: ${l.yellow(o)}\n${n}`.value;if(t==="COMPLETED"){let h=s?l.link("Download results",s):"";v({headline:i,body:d`${f}\n${h}`.value})}else if(t==="FAILED"){let h=p?l.link("Download partial results",p):"";w({headline:i,body:d`${f}\n${h}`.value})}else u({headline:i,body:f})}function V(e,o){let t=new Date;return o?`Finished ${y(new Date(String(o)),t)}`:`Started ${y(new Date(String(e)),t)}`}function G(e){return e==="COMPLETED"?m.green(e):e==="FAILED"?m.red(e):m.dim(e)}function H(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function W(e){return e?d`${l.link("download",e)}`.value:""}var F=_(K(),1);var O=class e extends P{static summary="Check the status of bulk operations.";static descriptionWithMarkdown=`Check the status of a specific bulk operation by ID, or list all bulk operations belonging to this app on this store in the last 7 days.
1
+ import{b as S}from"./chunk-A3U7JDUC.js";import{a as A,b as B,c as L,f as I,j as x,k as $,m as N,t as q}from"./chunk-3CZ7DKE5.js";import{a as P}from"./chunk-VJ5YOXKL.js";import{a as z}from"./chunk-GINXNPAR.js";import{b as C}from"./chunk-K2DP5Z76.js";import{D as E,W as g}from"./chunk-CNK3ZO2B.js";import{B as w,G as T,y as u,z as v}from"./chunk-6C5AVMKR.js";import{k as D}from"./chunk-OAG72Q2O.js";import{a as K}from"./chunk-CTNBSUVU.js";import{Cb as b,ba as k,ga as y,qb as l,sb as d}from"./chunk-43FRAUV6.js";import{i as m}from"./chunk-B4OMIONW.js";import{e as _,g as c}from"./chunk-VKWPEFWQ.js";c();c();async function M(e){let{organization:o,storeFqdn:t,operationId:r,remoteApp:a}=e;u({headline:"Checking bulk operation status.",body:[{list:{items:S({organization:o,remoteApp:a,storeFqdn:t})}}]});let s=a.apiSecretKeys[0]?.secret;if(!s)throw new D("No API secret keys found for app");let p=await g(t,a.apiKey,s),i=await x({adminSession:p,operationId:r,version:await I({adminSession:p,minimumDefaultVersion:A})});i?U(i):w({headline:"Bulk operation not found.",body:d`ID: ${l.yellow(r)}`.value})}async function R(e){let{organization:o,storeFqdn:t,remoteApp:r}=e;u({headline:"Listing bulk operations.",body:[{list:{items:S({organization:o,remoteApp:r,storeFqdn:t})}}]});let a=r.apiSecretKeys[0]?.secret;if(!a)throw new D("No API secret keys found for app");let s=await g(t,r.apiKey,a),i=(await $({adminSession:s,version:await I({adminSession:s,minimumDefaultVersion:A})})).map(n=>({id:L(n.id),status:G(n.status),count:H(n.objectCount),dateCreated:k(new Date(String(n.createdAt))),dateFinished:n.completedAt?k(new Date(String(n.completedAt))):"",results:W(n.url??n.partialDataUrl)}));b(),i.length===0?u({body:"No bulk operations found in the last 7 days."}):T({rows:i,columns:{id:{header:"ID",color:"yellow"},status:{header:"STATUS"},count:{header:"COUNT"},dateCreated:{header:"DATE CREATED",color:"cyan"},dateFinished:{header:"DATE FINISHED",color:"cyan"},results:{header:"RESULTS"}}}),b()}function U(e){let{id:o,status:t,createdAt:r,completedAt:a,url:s,partialDataUrl:p}=e,i=N(e).value,n=V(r,a),f=d`ID: ${l.yellow(o)}\n${n}`.value;if(t==="COMPLETED"){let h=s?l.link("Download results",s):"";v({headline:i,body:d`${f}\n${h}`.value})}else if(t==="FAILED"){let h=p?l.link("Download partial results",p):"";w({headline:i,body:d`${f}\n${h}`.value})}else u({headline:i,body:f})}function V(e,o){let t=new Date;return o?`Finished ${y(new Date(String(o)),t)}`:`Started ${y(new Date(String(e)),t)}`}function G(e){return e==="COMPLETED"?m.green(e):e==="FAILED"?m.red(e):m.dim(e)}function H(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:String(e)}function W(e){return e?d`${l.link("download",e)}`.value:""}var F=_(K(),1);var O=class e extends P{static summary="Check the status of bulk operations.";static descriptionWithMarkdown=`Check the status of a specific bulk operation by ID, or list all bulk operations belonging to this app on this store in the last 7 days.
2
2
 
3
3
  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).
4
4
 
@@ -1 +1 @@
1
- import{a as m}from"./chunk-F6SKKCKZ.js";import{a as p}from"./chunk-ID3AR4VW.js";import{a as n}from"./chunk-N7VI7OWJ.js";import{wa as r}from"./chunk-7LW23M5C.js";import{b as s}from"./chunk-GZKEIUJT.js";import{wb as e}from"./chunk-DD7FQDTB.js";import{g as o}from"./chunk-VKWPEFWQ.js";o();var i=class d extends p{static summary="Display app and extensions environment variables.";static descriptionWithMarkdown="Displays environment variables that can be used to deploy apps and app extensions.";static description=this.descriptionWithoutMarkdown();static flags={...s,...n};async run(){let{flags:t}=await this.parse(d),{app:a,remoteApp:l,organization:c}=await r({directory:t.path,clientId:t["client-id"],forceRelink:t.reset,userProvidedConfigName:t.config});return e(await m(a,l,c)),{app:a}}};export{i as a};
1
+ import{a as m}from"./chunk-6B727IUY.js";import{a as p}from"./chunk-VJ5YOXKL.js";import{a as n}from"./chunk-GINXNPAR.js";import{wa as r}from"./chunk-CVW2HMQO.js";import{b as s}from"./chunk-K2DP5Z76.js";import{wb as e}from"./chunk-43FRAUV6.js";import{g as o}from"./chunk-VKWPEFWQ.js";o();var i=class d extends p{static summary="Display app and extensions environment variables.";static descriptionWithMarkdown="Displays environment variables that can be used to deploy apps and app extensions.";static description=this.descriptionWithoutMarkdown();static flags={...s,...n};async run(){let{flags:t}=await this.parse(d),{app:a,remoteApp:l,organization:c}=await r({directory:t.path,clientId:t["client-id"],forceRelink:t.reset,userProvidedConfigName:t.config});return e(await m(a,l,c)),{app:a}}};export{i as a};
@@ -1 +1 @@
1
- import{d as l}from"./chunk-7SHHNWHL.js";import{c as t}from"./chunk-YY6TFARF.js";import{f as i,m,n as w,o as d,r as f}from"./chunk-4Y7WHAJX.js";import{J as n}from"./chunk-ESTXKKAB.js";import{g as a}from"./chunk-VKWPEFWQ.js";a();async function y(o,r,P){i()||f({store:r});let e=o??m()??await p(["Enter your",{link:{label:"store password",url:t(r)}}]),s=!1;for(;!await l(e,r,P);)s||(d(),s=!0),e=await p(["Incorrect",{link:{label:"store password",url:t(r)}},{char:"."},"Please try again"]);return w(e),e}async function p(o){return n({message:o,password:!0})}export{y as a};
1
+ import{d as l}from"./chunk-OY6L7J53.js";import{c as t}from"./chunk-YY6TFARF.js";import{f as i,m,n as w,o as d,r as f}from"./chunk-DO4SRE4M.js";import{J as n}from"./chunk-6C5AVMKR.js";import{g as a}from"./chunk-VKWPEFWQ.js";a();async function y(o,r,P){i()||f({store:r});let e=o??m()??await p(["Enter your",{link:{label:"store password",url:t(r)}}]),s=!1;for(;!await l(e,r,P);)s||(d(),s=!0),e=await p(["Incorrect",{link:{label:"store password",url:t(r)}},{char:"."},"Please try again"]);return w(e),e}async function p(o){return n({message:o,password:!0})}export{y as a};