@shopify/cli 4.7.1 → 4.8.1

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 (325) hide show
  1. package/dist/analytics-32PK45SE.js +1 -0
  2. package/dist/analytics-TQHJN5PY.js +1 -0
  3. package/dist/assets/hydrogen/starter/AGENTS.md +5 -0
  4. package/dist/assets/hydrogen/starter/CHANGELOG.md +9 -0
  5. package/dist/assets/hydrogen/starter/CLAUDE.md +1 -0
  6. package/dist/assets/hydrogen/starter/package.json +3 -3
  7. package/dist/bootstrap.js +1 -1
  8. package/dist/{chunk-UK4WXL4G.js → chunk-22JJHQVU.js} +1 -1
  9. package/dist/{chunk-ULR25PTO.js → chunk-2BHYBR2F.js} +1 -1
  10. package/dist/{chunk-22NROZ5X.js → chunk-2R6KOKWG.js} +46 -46
  11. package/dist/{chunk-3HCWJRL6.js → chunk-32IIURQB.js} +1 -1
  12. package/dist/{chunk-YCU7ZCIG.js → chunk-33PLVLCE.js} +1 -1
  13. package/dist/{chunk-RA3WWB2S.js → chunk-36OXWMXZ.js} +1 -1
  14. package/dist/{chunk-UZVON6GP.js → chunk-3A2HLI4D.js} +1 -1
  15. package/dist/{chunk-26DH5P7S.js → chunk-3ACZB27E.js} +1 -1
  16. package/dist/{chunk-JQUEW7CB.js → chunk-3FTP36HH.js} +1 -1
  17. package/dist/{chunk-4FCS6PJY.js → chunk-3GAN6KS6.js} +1 -1
  18. package/dist/{chunk-22NWEE5U.js → chunk-3LBHSZSR.js} +1 -1
  19. package/dist/chunk-3NVQXPTU.js +1 -0
  20. package/dist/{chunk-XMQFQUUK.js → chunk-3NYK63U4.js} +1 -1
  21. package/dist/{chunk-R5EGWWZH.js → chunk-3R7OHZ4C.js} +1 -1
  22. package/dist/{chunk-5WGT45CO.js → chunk-4ARQFW35.js} +1 -1
  23. package/dist/{chunk-FELV7GWY.js → chunk-4ASQQTCD.js} +1 -1
  24. package/dist/chunk-4IG7WG6V.js +1 -0
  25. package/dist/{chunk-SCXL5UQ4.js → chunk-4QAM7ROJ.js} +1 -1
  26. package/dist/{chunk-IENBHP2S.js → chunk-4QBJ5JBX.js} +15 -16
  27. package/dist/{chunk-I2LNQKIJ.js → chunk-4QXDDAMD.js} +1 -1
  28. package/dist/{chunk-2S3GOPRL.js → chunk-562EV2EJ.js} +1 -1
  29. package/dist/{chunk-AWHS336T.js → chunk-565SON6A.js} +1 -1
  30. package/dist/{chunk-46BKAF3F.js → chunk-5AMPXLKT.js} +1 -1
  31. package/dist/chunk-5CC4QYN4.js +1 -0
  32. package/dist/{chunk-USBP7H7J.js → chunk-5G2W7QKA.js} +1 -1
  33. package/dist/{chunk-U46RPVQA.js → chunk-5PWJTOWK.js} +1 -1
  34. package/dist/{chunk-RXUOQZ32.js → chunk-5THZTE44.js} +1 -1
  35. package/dist/{chunk-N4KDWHT2.js → chunk-5U4UTFA4.js} +1 -1
  36. package/dist/{chunk-PV6T52KB.js → chunk-6633X2JU.js} +1 -1
  37. package/dist/chunk-6HMTAB2V.js +2 -0
  38. package/dist/{chunk-U3F6GPCE.js → chunk-6JC2PM43.js} +1 -1
  39. package/dist/{chunk-6R62DGJG.js → chunk-6T5AZZUI.js} +1 -1
  40. package/dist/{chunk-J2VRPZFC.js → chunk-6U4BOZ73.js} +1 -1
  41. package/dist/{chunk-UZV5H2JI.js → chunk-6USL7BKQ.js} +1 -1
  42. package/dist/{chunk-WTES5ZXR.js → chunk-7CPYFKFK.js} +1 -1
  43. package/dist/{chunk-CRP4PQU2.js → chunk-7DGVNVW3.js} +1 -1
  44. package/dist/{chunk-3KM2GKXH.js → chunk-7DJNASBC.js} +1 -1
  45. package/dist/{chunk-EMETQFFJ.js → chunk-7DLMETRR.js} +1 -1
  46. package/dist/{chunk-JJSV7HNM.js → chunk-7JG3CKDE.js} +1 -1
  47. package/dist/{chunk-WR6LRE4I.js → chunk-7USNGNVI.js} +1 -1
  48. package/dist/{chunk-6QJIGFQJ.js → chunk-AICVQH4V.js} +1 -1
  49. package/dist/{chunk-PK73ZSND.js → chunk-AINDVTMY.js} +39 -39
  50. package/dist/{chunk-5MD7GNEY.js → chunk-AVX7CIDJ.js} +1 -1
  51. package/dist/chunk-AXLLN6DZ.js +2 -0
  52. package/dist/{chunk-WOIAYH5U.js → chunk-AXMSJ46T.js} +1 -1
  53. package/dist/{chunk-4FI2YBRF.js → chunk-B3I7OMRN.js} +1 -1
  54. package/dist/{chunk-VXX4EZ7G.js → chunk-BHDFVO2R.js} +1 -1
  55. package/dist/{chunk-N7425436.js → chunk-BKYTBTQ5.js} +1 -1
  56. package/dist/{chunk-KBBITJSF.js → chunk-BMDCOBUR.js} +1 -1
  57. package/dist/{chunk-KRLEEYLL.js → chunk-CKZOLGWI.js} +1 -1
  58. package/dist/{chunk-WXSDPMIZ.js → chunk-CSAVYME2.js} +1 -1
  59. package/dist/{chunk-R2RULBBV.js → chunk-D2R7HPCT.js} +1 -1
  60. package/dist/{chunk-RM3B7AFT.js → chunk-DQVNW6EQ.js} +1 -1
  61. package/dist/chunk-DS7OKDQN.js +1 -0
  62. package/dist/chunk-E3FZRPNL.js +1 -0
  63. package/dist/{chunk-HOVIGRE4.js → chunk-E7I5YT53.js} +1 -1
  64. package/dist/chunk-EDHR546O.js +97 -0
  65. package/dist/{chunk-X5JQU6T7.js → chunk-EIBQRJTQ.js} +1 -1
  66. package/dist/{chunk-QASOHYDS.js → chunk-F2DO3R6R.js} +1 -1
  67. package/dist/{chunk-CUUCRIGC.js → chunk-F5BTQI5W.js} +1 -1
  68. package/dist/{chunk-7EUIO4ZO.js → chunk-FH36PGZH.js} +12 -12
  69. package/dist/{chunk-YFKEESYB.js → chunk-FM6VJLE7.js} +1 -1
  70. package/dist/{chunk-I6XH7XDX.js → chunk-FZUPL5YO.js} +1 -1
  71. package/dist/{chunk-5JW4JQWZ.js → chunk-GCTCRKET.js} +1 -1
  72. package/dist/{chunk-ZULQKYJ6.js → chunk-GTIBT4V6.js} +1 -1
  73. package/dist/{chunk-6ELAWKMY.js → chunk-GVEJO3WM.js} +1 -1
  74. package/dist/{chunk-HQUWYKSJ.js → chunk-GYFRTLML.js} +2 -2
  75. package/dist/{chunk-P5OQUFH6.js → chunk-GZEPWYMP.js} +1 -1
  76. package/dist/{chunk-OF6CV5R4.js → chunk-H6HILX7D.js} +1 -1
  77. package/dist/chunk-H7IQZNKR.js +1 -0
  78. package/dist/{chunk-ZBSC2KZ7.js → chunk-HEIZ3RSD.js} +1 -1
  79. package/dist/{chunk-3WV7DQMM.js → chunk-HEWKCSY7.js} +3 -3
  80. package/dist/{chunk-HRHNJFAA.js → chunk-HFRWZQOF.js} +1 -1
  81. package/dist/{chunk-PU3NATV4.js → chunk-HKSRCMQ7.js} +1 -1
  82. package/dist/{chunk-PEHLR7XP.js → chunk-HZDEDEAS.js} +1 -1
  83. package/dist/{chunk-RY4YUBG3.js → chunk-ILHEVBNU.js} +1 -1
  84. package/dist/chunk-IMSPA67L.js +5 -0
  85. package/dist/chunk-IPSY5EEL.js +1 -0
  86. package/dist/{chunk-IF6EYTHG.js → chunk-J3PS4JF2.js} +2 -2
  87. package/dist/{chunk-7S73765P.js → chunk-JDEOBIXA.js} +1 -1
  88. package/dist/{chunk-GW4JHUIA.js → chunk-JLR6X5NA.js} +1 -1
  89. package/dist/{chunk-6G5TDB45.js → chunk-JVXKDM2E.js} +1 -1
  90. package/dist/{chunk-NSZHEXZK.js → chunk-KAAC4VIW.js} +1 -1
  91. package/dist/{chunk-K3VLFPPI.js → chunk-KEUMU5TQ.js} +1 -1
  92. package/dist/{chunk-3MN3WLA2.js → chunk-KPJRLS53.js} +1 -1
  93. package/dist/{chunk-2F2DXTRI.js → chunk-L6OBJDYK.js} +1 -1
  94. package/dist/{chunk-XMJFT4WP.js → chunk-LC2BDU4B.js} +1 -1
  95. package/dist/{chunk-O4G6TE26.js → chunk-LEPENRGG.js} +1 -1
  96. package/dist/{chunk-QHLY2IID.js → chunk-LH7KQZDD.js} +1 -1
  97. package/dist/{chunk-WSCSFFLH.js → chunk-LIH7CQO7.js} +2 -2
  98. package/dist/chunk-LJO22Z6S.js +1 -0
  99. package/dist/{chunk-JNIPCLAF.js → chunk-LQGF3RKX.js} +1 -1
  100. package/dist/chunk-LTRJWOI6.js +11 -0
  101. package/dist/chunk-MA6QRENS.js +1 -0
  102. package/dist/chunk-MNTJZ6JO.js +15 -0
  103. package/dist/chunk-NQRSFMS7.js +273 -0
  104. package/dist/chunk-NV4SPMQS.js +1 -0
  105. package/dist/{chunk-7JIYJMRN.js → chunk-O2X6EVXQ.js} +1 -1
  106. package/dist/chunk-OBRMBYTG.js +1 -0
  107. package/dist/{chunk-OJSJWGP2.js → chunk-ODFOSJU3.js} +1 -1
  108. package/dist/{chunk-LKZQSER3.js → chunk-OJE7S6D4.js} +1 -1
  109. package/dist/{chunk-VXYABRFY.js → chunk-OTVZU5AQ.js} +1 -1
  110. package/dist/{chunk-27UEK3FU.js → chunk-OYFNB5RY.js} +1 -1
  111. package/dist/{chunk-SJGPJDGH.js → chunk-PCL4UWAE.js} +1 -1
  112. package/dist/{chunk-MTTBBZSR.js → chunk-PGBXHL2G.js} +1 -1
  113. package/dist/{chunk-KNVHXIEB.js → chunk-PJTRZSH4.js} +1 -1
  114. package/dist/{chunk-Y6UZW73M.js → chunk-PPC3RJDZ.js} +1 -1
  115. package/dist/{chunk-O4RHWBBM.js → chunk-PROWADZL.js} +1 -1
  116. package/dist/{chunk-PQG7XSQP.js → chunk-PSH4QKUX.js} +1 -1
  117. package/dist/chunk-PSUNX2YX.js +1 -0
  118. package/dist/{chunk-AIA7JVSJ.js → chunk-PSYQTFPK.js} +1 -1
  119. package/dist/{chunk-WMZS3Y4Z.js → chunk-PVZE65R7.js} +1 -1
  120. package/dist/{chunk-77AC3OJQ.js → chunk-QH7QOLZK.js} +1 -1
  121. package/dist/{chunk-XTXYS7LB.js → chunk-QMYCJ2TM.js} +1 -1
  122. package/dist/{chunk-O53YIDJL.js → chunk-QPT6DUMC.js} +1 -1
  123. package/dist/{chunk-IQT6LOA2.js → chunk-R4YJM7KY.js} +1 -1
  124. package/dist/{chunk-LBREJXT6.js → chunk-RAOMLN5A.js} +1 -1
  125. package/dist/{chunk-HU4GFVEN.js → chunk-RHJLAYNK.js} +1 -1
  126. package/dist/{chunk-SGIMJQEM.js → chunk-RNFZJQVV.js} +1 -1
  127. package/dist/{chunk-UAJBQEGE.js → chunk-RRQYOGEA.js} +1 -1
  128. package/dist/{chunk-DMFEYI4G.js → chunk-S5FGFQHD.js} +1 -1
  129. package/dist/chunk-SAKMJGXL.js +2 -0
  130. package/dist/{chunk-P5WLH64A.js → chunk-SEGZQCXZ.js} +1 -1
  131. package/dist/{chunk-EWS2RNM6.js → chunk-SIVRBIKH.js} +1 -1
  132. package/dist/chunk-T24RA3WI.js +1 -0
  133. package/dist/{chunk-JNVCCE6M.js → chunk-T74ECTO7.js} +1 -1
  134. package/dist/{chunk-SYF6LGQB.js → chunk-TBEG57SV.js} +1 -1
  135. package/dist/{chunk-DLSUDLXD.js → chunk-TCP4OG3D.js} +1 -1
  136. package/dist/{chunk-RY4MPX5A.js → chunk-TQNGFSCI.js} +1 -1
  137. package/dist/{chunk-HCQABTQL.js → chunk-TVQVZHNP.js} +1 -1
  138. package/dist/chunk-U42P3F7Y.js +1 -0
  139. package/dist/{chunk-ZDDLEFVO.js → chunk-U63A4OUA.js} +1 -1
  140. package/dist/{chunk-KT5MDCII.js → chunk-U7ELUEH2.js} +1 -1
  141. package/dist/{chunk-KDBKEVCF.js → chunk-UBJYXNCN.js} +1 -1
  142. package/dist/{chunk-53IU36CL.js → chunk-UBX3HUMH.js} +1 -1
  143. package/dist/{chunk-4WGJUVXS.js → chunk-UCJ3NHJH.js} +3 -3
  144. package/dist/{chunk-GJ4A4QKE.js → chunk-UMZG254H.js} +1 -1
  145. package/dist/{chunk-VPY47DBW.js → chunk-UPTF2HK6.js} +1 -1
  146. package/dist/{chunk-WEWLPJK2.js → chunk-UXL2A5UK.js} +1 -1
  147. package/dist/chunk-V6UCVTJT.js +7 -0
  148. package/dist/{chunk-4VJ6YK7U.js → chunk-VFQW2QL2.js} +1 -1
  149. package/dist/{chunk-EULSSTWY.js → chunk-VM6EBNGR.js} +1 -1
  150. package/dist/chunk-VPRDI4TT.js +5 -0
  151. package/dist/{chunk-6K3AJTNO.js → chunk-VRO6QBVN.js} +1 -1
  152. package/dist/{chunk-LKQ3EJ6Z.js → chunk-WIBPVYPN.js} +1 -1
  153. package/dist/{chunk-IX4IGE5H.js → chunk-WJEVB67Y.js} +1 -1
  154. package/dist/chunk-WLGEAJBU.js +1705 -0
  155. package/dist/chunk-WSJ5PUK6.js +3 -0
  156. package/dist/chunk-WT2KJHUO.js +2 -0
  157. package/dist/{chunk-MK7MOLLI.js → chunk-WVQZOLZJ.js} +1 -1
  158. package/dist/chunk-X3KYRBGE.js +560 -0
  159. package/dist/{chunk-Z66ZSXKB.js → chunk-X4JCATEE.js} +1 -1
  160. package/dist/{chunk-IA3XNJ56.js → chunk-XH66VYZA.js} +1 -1
  161. package/dist/{chunk-PS2UVFHP.js → chunk-XNKAPGJD.js} +1 -1
  162. package/dist/chunk-XNP7PMGC.js +6 -0
  163. package/dist/{chunk-CNMJ6QXM.js → chunk-XRVMKP53.js} +3 -3
  164. package/dist/{chunk-YXDIHVPY.js → chunk-XSUX2XAW.js} +1 -1
  165. package/dist/{chunk-PE4TV5IJ.js → chunk-XZUL2HVC.js} +1 -1
  166. package/dist/{chunk-AFT6ABDE.js → chunk-Y6DYQWQK.js} +1 -1
  167. package/dist/{chunk-GFWXVO72.js → chunk-YAA7OGRM.js} +114 -114
  168. package/dist/{chunk-ELSDVDT7.js → chunk-YMS6RVE5.js} +1 -1
  169. package/dist/{chunk-VRH3HWYA.js → chunk-YUNINHOR.js} +1 -1
  170. package/dist/{chunk-QT367CYF.js → chunk-YY2JHCIG.js} +1 -1
  171. package/dist/chunk-YZKBG7UZ.js +3 -0
  172. package/dist/chunk-ZJ6DWT36.js +3 -0
  173. package/dist/{chunk-S2WUVD7V.js → chunk-ZLMXR2XV.js} +1 -1
  174. package/dist/{chunk-K63FW7Q7.js → chunk-ZYEGQSF5.js} +1 -1
  175. package/dist/cli/commands/app/app-logs/sources.js +1 -1
  176. package/dist/cli/commands/app/build.js +1 -1
  177. package/dist/cli/commands/app/bulk/cancel.js +1 -1
  178. package/dist/cli/commands/app/bulk/execute.js +1 -1
  179. package/dist/cli/commands/app/bulk/status.js +1 -1
  180. package/dist/cli/commands/app/config/link.js +1 -1
  181. package/dist/cli/commands/app/config/pull.js +1 -1
  182. package/dist/cli/commands/app/config/use.js +1 -1
  183. package/dist/cli/commands/app/config/validate.js +1 -1
  184. package/dist/cli/commands/app/demo/watcher.js +1 -1
  185. package/dist/cli/commands/app/deploy.js +1 -1
  186. package/dist/cli/commands/app/dev/clean.js +1 -1
  187. package/dist/cli/commands/app/dev.js +1 -1
  188. package/dist/cli/commands/app/doctor/instructions.js +1 -0
  189. package/dist/cli/commands/app/doctor.js +1 -0
  190. package/dist/cli/commands/app/env/pull.js +1 -1
  191. package/dist/cli/commands/app/env/show.js +1 -1
  192. package/dist/cli/commands/app/execute.js +1 -1
  193. package/dist/cli/commands/app/function/build.js +1 -1
  194. package/dist/cli/commands/app/function/info.js +1 -1
  195. package/dist/cli/commands/app/function/replay.js +1 -1
  196. package/dist/cli/commands/app/function/run.js +1 -1
  197. package/dist/cli/commands/app/function/schema.js +1 -1
  198. package/dist/cli/commands/app/function/typegen.js +1 -1
  199. package/dist/cli/commands/app/generate/extension.js +1 -1
  200. package/dist/cli/commands/app/graphiql.js +1 -1
  201. package/dist/cli/commands/app/import-custom-data-definitions.js +1 -1
  202. package/dist/cli/commands/app/import-extensions.js +1 -1
  203. package/dist/cli/commands/app/info.js +1 -1
  204. package/dist/cli/commands/app/init.js +1 -1
  205. package/dist/cli/commands/app/logs.js +1 -1
  206. package/dist/cli/commands/app/release.js +1 -1
  207. package/dist/cli/commands/app/subscription-migrations/cancel.js +1 -0
  208. package/dist/cli/commands/app/subscription-migrations/list.js +1 -0
  209. package/dist/cli/commands/app/subscription-migrations/schedule.js +1 -0
  210. package/dist/cli/commands/app/subscription-migrations/status.js +1 -0
  211. package/dist/cli/commands/app/subscription-migrations/unschedule.js +1 -0
  212. package/dist/cli/commands/app/versions/list.js +1 -1
  213. package/dist/cli/commands/app/webhook/trigger.js +1 -1
  214. package/dist/cli/commands/auth/login.js +1 -1
  215. package/dist/cli/commands/auth/logout.js +1 -1
  216. package/dist/cli/commands/cache/clear.js +1 -1
  217. package/dist/cli/commands/config/autoupgrade/off.js +1 -1
  218. package/dist/cli/commands/config/autoupgrade/on.js +1 -1
  219. package/dist/cli/commands/config/autoupgrade/status.js +1 -1
  220. package/dist/cli/commands/debug/command-flags.js +1 -1
  221. package/dist/cli/commands/doc/fetch.js +1 -1
  222. package/dist/cli/commands/doc/search.js +1 -1
  223. package/dist/cli/commands/docs/generate.js +1 -1
  224. package/dist/cli/commands/doctor-release/doctor-release.js +1 -1
  225. package/dist/cli/commands/doctor-release/theme/index.js +1 -1
  226. package/dist/cli/commands/help.js +1 -1
  227. package/dist/cli/commands/kitchen-sink/async.js +1 -1
  228. package/dist/cli/commands/kitchen-sink/index.js +1 -1
  229. package/dist/cli/commands/kitchen-sink/prompts.js +1 -1
  230. package/dist/cli/commands/kitchen-sink/static.js +1 -1
  231. package/dist/cli/commands/notifications/generate.js +1 -1
  232. package/dist/cli/commands/notifications/list.js +1 -1
  233. package/dist/cli/commands/organization/list.js +1 -1
  234. package/dist/cli/commands/search.js +1 -1
  235. package/dist/cli/commands/send-analytics.js +1 -1
  236. package/dist/cli/commands/theme/check.js +1 -1
  237. package/dist/cli/commands/theme/console.js +1 -1
  238. package/dist/cli/commands/theme/delete.js +1 -1
  239. package/dist/cli/commands/theme/dev.js +1 -1
  240. package/dist/cli/commands/theme/duplicate.js +1 -1
  241. package/dist/cli/commands/theme/info.js +1 -1
  242. package/dist/cli/commands/theme/init.js +1 -1
  243. package/dist/cli/commands/theme/language-server.js +1 -1
  244. package/dist/cli/commands/theme/list.js +1 -1
  245. package/dist/cli/commands/theme/metafields/pull.js +1 -1
  246. package/dist/cli/commands/theme/open.js +1 -1
  247. package/dist/cli/commands/theme/package.js +1 -1
  248. package/dist/cli/commands/theme/preview.js +1 -1
  249. package/dist/cli/commands/theme/profile.js +1 -1
  250. package/dist/cli/commands/theme/publish.js +1 -1
  251. package/dist/cli/commands/theme/pull.js +1 -1
  252. package/dist/cli/commands/theme/push.js +1 -1
  253. package/dist/cli/commands/theme/rename.js +1 -1
  254. package/dist/cli/commands/theme/share.js +1 -1
  255. package/dist/cli/commands/upgrade.js +1 -1
  256. package/dist/cli/commands/version.js +1 -1
  257. package/dist/command-registry.js +1 -1
  258. package/dist/{conf-store-QQ4DOFI3.js → conf-store-K65PEQF6.js} +1 -1
  259. package/dist/configs/all.yml +60 -0
  260. package/dist/configs/recommended.yml +60 -0
  261. package/dist/data/filters.json +31 -2
  262. package/dist/data/setting.json +129 -4
  263. package/dist/data/shopify_system_translations.json +154 -13
  264. package/dist/{deprecations-43ZQ5RCE.js → deprecations-2SG4PB2W.js} +1 -1
  265. package/dist/dist-L4A3SGNF.js +1 -0
  266. package/dist/dist-XXCZFNRC.js +1 -0
  267. package/dist/environments-B4OWPMPR.js +1 -0
  268. package/dist/{error-26WTDNKZ.js → error-5YQYW3V2.js} +1 -1
  269. package/dist/error-handler-3PBXTHYY.js +1 -0
  270. package/dist/{fs-Y7I3Y5IR.js → fs-FM6YDE2U.js} +1 -1
  271. package/dist/hooks/did-you-mean.js +1 -1
  272. package/dist/hooks/hydrogen-init.js +1 -1
  273. package/dist/hooks/postrun.js +1 -1
  274. package/dist/hooks/prerun.js +1 -1
  275. package/dist/hooks/public-metadata.js +1 -1
  276. package/dist/hooks/sensitive-metadata.js +1 -1
  277. package/dist/hooks/tunnel-provider.js +1 -1
  278. package/dist/hooks/tunnel-start.js +1 -1
  279. package/dist/index.js +14 -16
  280. package/dist/{is-global-WBIBPIVZ.js → is-global-3FFDTC2G.js} +1 -1
  281. package/dist/{local-HF4T3FFE.js → local-W73VIWHZ.js} +1 -1
  282. package/dist/{metadata-CSQPNQP2.js → metadata-OGQEI47Y.js} +1 -1
  283. package/dist/{node-package-manager-CVEU22N7.js → node-package-manager-GSHLPD5X.js} +1 -1
  284. package/dist/notifications-system-HQNQUKLF.js +1 -0
  285. package/dist/os-6HP4QG7V.js +1 -0
  286. package/dist/{output-E6OGPGXL.js → output-MG7RJ37P.js} +1 -1
  287. package/dist/{prettier-RVUAAWC7.js → prettier-EGVCP5CY.js} +1 -1
  288. package/dist/{system-ZETSJRKS.js → system-3HTWCGQH.js} +1 -1
  289. package/dist/tsconfig.tsbuildinfo +1 -1
  290. package/dist/{ui-7TVGGEWJ.js → ui-T22J7MQF.js} +1 -1
  291. package/dist/upgrade-FZ35KTBW.js +1 -0
  292. package/dist/{version-DL4Y6DRX.js → version-KWF3XRSN.js} +1 -1
  293. package/dist/version-LJOGYA5H.js +1 -0
  294. package/dist/{workerd-EHI5ZCEV.js → workerd-RB5ZS43X.js} +1 -1
  295. package/oclif.manifest.json +903 -133
  296. package/package.json +9 -8
  297. package/dist/analytics-5SII3GTA.js +0 -1
  298. package/dist/analytics-F56E2NGH.js +0 -1
  299. package/dist/chunk-4I7TUB3K.js +0 -1
  300. package/dist/chunk-4NXLDIW5.js +0 -1
  301. package/dist/chunk-5QZHJCZM.js +0 -1
  302. package/dist/chunk-6AV6GX5W.js +0 -2
  303. package/dist/chunk-6SM4RY3I.js +0 -5
  304. package/dist/chunk-76NEIDP5.js +0 -1
  305. package/dist/chunk-BI7LE6CZ.js +0 -1
  306. package/dist/chunk-DEMZRLX5.js +0 -7
  307. package/dist/chunk-ESPT6CGE.js +0 -1
  308. package/dist/chunk-FAXNGDWI.js +0 -11
  309. package/dist/chunk-FQQXU5IN.js +0 -2
  310. package/dist/chunk-GXOFJIKQ.js +0 -559
  311. package/dist/chunk-M5Q74UZM.js +0 -3
  312. package/dist/chunk-OQWMCJLY.js +0 -3
  313. package/dist/chunk-SPE2D366.js +0 -16
  314. package/dist/chunk-TP4Z5OZT.js +0 -1382
  315. package/dist/chunk-VI5FF6SW.js +0 -1
  316. package/dist/dist-E7EGYE4D.js +0 -1
  317. package/dist/dist-WRUROUNV.js +0 -1
  318. package/dist/environments-RG64VB5R.js +0 -1
  319. package/dist/error-handler-XFH47Y75.js +0 -1
  320. package/dist/notifications-system-L3FMN6EX.js +0 -1
  321. package/dist/os-VLZLRAHR.js +0 -1
  322. package/dist/upgrade-F77O4ZDT.js +0 -1
  323. package/dist/version-3L3ANUTL.js +0 -1
  324. /package/dist/{chunk-NJPL5BTN.js → chunk-YLQ3LNNY.js} +0 -0
  325. /package/dist/{morph-77RHJICZ.js → morph-BMYYMQNX.js} +0 -0
@@ -1,4 +1,4 @@
1
- import{a as Q,b as X,c as H}from"./chunk-U3F6GPCE.js";import{a as L,c as M,e as f,f as P,h as T,i as q,m as V,p as U,q as F,r as j,s as z,u as _}from"./chunk-SGIMJQEM.js";import{a as W}from"./chunk-ESPT6CGE.js";import{a as G,b as J}from"./chunk-RA3WWB2S.js";import{b as N}from"./chunk-IX4IGE5H.js";import{A as v,B as E,I as D,a as $,y as g,z as u}from"./chunk-WSCSFFLH.js";import{h as m,k as R}from"./chunk-BI7LE6CZ.js";import{Ta as I,ma as C,qb as r,sb as s,ua as S,wb as x}from"./chunk-HQUWYKSJ.js";import{g as c}from"./chunk-VKWPEFWQ.js";c();c();async function te(t,e){if(t)return t.join(`
1
+ import{a as Q,b as X,c as H}from"./chunk-6JC2PM43.js";import{a as L,c as M,e as f,f as P,h as T,i as q,m as V,p as U,q as F,r as j,s as z,u as _}from"./chunk-RNFZJQVV.js";import{a as W}from"./chunk-3NVQXPTU.js";import{a as G,b as J}from"./chunk-36OXWMXZ.js";import{b as N}from"./chunk-WJEVB67Y.js";import{A as v,B as E,I as D,a as $,y as g,z as u}from"./chunk-LIH7CQO7.js";import{h as m,k as R}from"./chunk-PSUNX2YX.js";import{Ta as I,ma as C,qb as r,sb as s,ua as S,wb as x}from"./chunk-GYFRTLML.js";import{g as c}from"./chunk-VKWPEFWQ.js";c();c();async function te(t,e){if(t)return t.join(`
2
2
  `);if(e){if(!await I(e))throw new m(s`Variable file not found at ${r.path(e)}. Please check the path and try again.`);return C(e,{encoding:"utf8"})}else return}async function Y(t){let{organization:e,remoteApp:i,store:n,query:o,variables:d,variableFile:b,outputFile:O,watch:Z=!1,version:ee}=t,{adminSession:p,version:k}=await D({title:s`Authenticating`,task:async()=>{let a=await Q(i,n.shopDomain),l=await P({adminSession:a,userSpecifiedVersion:ee,minimumDefaultVersion:L});return{adminSession:a,version:l}},renderOptions:{stdout:process.stderr}}),B=await te(d,b);ae(o,B),H(o,n),g({headline:"Starting bulk operation.",body:[{list:{items:X({organization:e,remoteApp:i,storeFqdn:n.shopDomain,version:k})}}]});let w=f(o)?await q({adminSession:p,query:o,variablesJsonl:B,version:k}):await T({adminSession:p,query:o,version:k});if(w?.userErrors?.length){E({headline:"Error creating bulk operation.",body:{list:{items:w.userErrors.map(a=>a.field?`${a.field.join(".")}: ${a.message}`:a.message)}}});return}let y=w?.bulkOperation;if(y)if(Z){let a=new $,l=await F(p,y.id,a.signal,()=>a.abort());a.signal.aborted?g({headline:`Bulk operation ${l.id} is still running in the background.`,body:h(l.id)}):await K(l,O)}else{let a=await U(p,y.id);["FAILED","CANCELED","EXPIRED"].includes(a.status)?await K(a,O):u({headline:"Bulk operation is running.",body:h(a.id),customSections:[{body:[{list:{items:[s`ID: ${r.cyan(a.id)}`.value]}}]}]})}else throw v({headline:"Bulk operation not created successfully.",body:"This is an unexpected error. Please try again later."}),new R("Bulk operation response returned null with no error message.")}async function K(t,e){let i=V(t).value,o=[{body:[{list:{items:[s`ID: ${r.cyan(t.id)}`.value,s`Status: ${r.yellow(t.status)}`.value,s`Created at: ${r.gray(String(t.createdAt))}`.value,...t.completedAt?[s`Completed at: ${r.gray(String(t.completedAt))}`.value]:[]]}}]}];switch(t.status){case"CREATED":u({headline:"Bulk operation started.",body:h(t.id),customSections:o});break;case"RUNNING":u({headline:"Bulk operation is running.",body:h(t.id),customSections:o});break;case"COMPLETED":if(t.url){let d=await j(t.url),b=z(d);e?await S(e,d):x(d),b?v({headline:"Bulk operation completed with errors.",body:e?`Results written to ${e}. Check file for error details.`:"Check results for error details.",customSections:o}):u({headline:i,body:e?[`Results written to ${e}`]:void 0,customSections:o})}else u({headline:i,customSections:o});break;case"CANCELED":case"CANCELING":case"EXPIRED":case"FAILED":E({headline:i,customSections:o});break}}function ae(t,e){if(f(t)&&!e)throw new m(s`Bulk mutations require variables. Provide a JSONL file with ${r.yellow("--variable-file")} or individual JSON objects with ${r.yellow("--variables")}.`);if(!f(t)&&e)throw new m(s`The ${r.yellow("--variables")} and ${r.yellow("--variable-file")} flags can only be used with mutations, not queries.`)}function h(t){return[`Monitor its progress with:
3
3
  `,{command:`shopify app bulk status --id=${M(t)}`}]}var A=class t extends W{static summary="Execute bulk operations.";static descriptionWithMarkdown=`Executes an Admin API GraphQL query or mutation on the specified store, as a bulk operation. Mutations are only allowed on dev stores.
4
4
 
@@ -0,0 +1,2 @@
1
+ import{a as V,b as F}from"./chunk-4QBJ5JBX.js";import{h as v}from"./chunk-PSUNX2YX.js";import{Ta as I,ma as _,ua as l}from"./chunk-GYFRTLML.js";import{a as T,c as k,e as $,g as h}from"./chunk-VKWPEFWQ.js";var L=k((z,a)=>{h();var S={};S.__wbindgen_placeholder__=a.exports;var s,{TextEncoder:q,TextDecoder:U}=T("util");function A(e){return e==null}var f=null;function g(){return(f===null||f.buffer.detached===!0||f.buffer.detached===void 0&&f.buffer!==s.memory.buffer)&&(f=new DataView(s.memory.buffer)),f}var w=0,b=null;function p(){return(b===null||b.byteLength===0)&&(b=new Uint8Array(s.memory.buffer)),b}var m=new q("utf-8"),C=typeof m.encodeInto=="function"?function(e,t){return m.encodeInto(e,t)}:function(e,t){let r=m.encode(e);return t.set(r),{read:e.length,written:r.length}};function M(e,t,r){if(r===void 0){let i=m.encode(e),u=t(i.length,1)>>>0;return p().subarray(u,u+i.length).set(i),w=i.length,u}let n=e.length,o=t(n,1)>>>0,d=p(),c=0;for(;c<n;c++){let i=e.charCodeAt(c);if(i>127)break;d[o+c]=i}if(c!==n){c!==0&&(e=e.slice(c)),o=r(o,n,n=c+e.length*3,1)>>>0;let i=p().subarray(o+c,o+n),u=C(e,i);c+=u.written,o=r(o,n,c,1)>>>0}return w=c,o}var j=new U("utf-8",{ignoreBOM:!0,fatal:!0});j.decode();function y(e,t){return e=e>>>0,j.decode(p().subarray(e,e+t))}function D(e){let t=s.__wbindgen_export_0.get(e);return s.__externref_table_dealloc(e),t}a.exports.echoToml=function(e){let t,r;try{let d=M(e,s.__wbindgen_malloc,s.__wbindgen_realloc),c=w,i=s.echoToml(d,c);var n=i[0],o=i[1];if(i[3])throw n=0,o=0,D(i[2]);return t=n,r=o,y(n,o)}finally{s.__wbindgen_free(t,r,1)}};a.exports.updateTomlValues=function(e,t){let r,n;try{let c=M(e,s.__wbindgen_malloc,s.__wbindgen_realloc),i=w,u=s.updateTomlValues(c,i,t);var o=u[0],d=u[1];if(u[3])throw o=0,d=0,D(u[2]);return r=o,n=d,y(o,d)}finally{s.__wbindgen_free(r,n,1)}};a.exports.__wbg_from_2a5d3e218e67aa85=function(e){return Array.from(e)};a.exports.__wbg_get_b9b93047fe3cf45b=function(e,t){return e[t>>>0]};a.exports.__wbg_length_e2d2a49132c1b256=function(e){return e.length};a.exports.__wbindgen_boolean_get=function(e){let t=e;return typeof t=="boolean"?t?1:0:2};a.exports.__wbindgen_init_externref_table=function(){let e=s.__wbindgen_export_0,t=e.grow(4);e.set(0,void 0),e.set(t+0,void 0),e.set(t+1,null),e.set(t+2,!0),e.set(t+3,!1)};a.exports.__wbindgen_is_array=function(e){return Array.isArray(e)};a.exports.__wbindgen_is_undefined=function(e){return e===void 0};a.exports.__wbindgen_number_get=function(e,t){let r=t,n=typeof r=="number"?r:void 0;g().setFloat64(e+8,A(n)?0:n,!0),g().setInt32(e+0,!A(n),!0)};a.exports.__wbindgen_string_get=function(e,t){let r=t,n=typeof r=="string"?r:void 0;var o=A(n)?0:M(n,s.__wbindgen_malloc,s.__wbindgen_realloc),d=w;g().setInt32(e+4,d,!0),g().setInt32(e+0,o,!0)};a.exports.__wbindgen_string_new=function(e,t){return y(e,t)};a.exports.__wbindgen_throw=function(e,t){throw new Error(y(e,t))};var N=T("path").join(__dirname,"toml_patch_bg.wasm"),R=T("fs").readFileSync(N),B=new WebAssembly.Module(R),P=new WebAssembly.Instance(B,S);s=P.exports;a.exports.__wasm=s;s.__wbindgen_start()});h();var E=$(L(),1),x=class extends v{path;constructor(t,r){super(r),this.name="TomlFileError",this.path=t}},O=class e{static async read(t){if(!await I(t))throw new x(t,`TOML file not found: ${t}`);let r=await _(t),n=new e(t,{});return n.content=n.decode(r),n}path;content;errors=[];constructor(t,r){this.path=t,this.content=r}async patch(t){let r=W(t),n=await _(this.path),o=(0,E.updateTomlValues)(n,r),d=this.decode(o);await l(this.path,o),this.content=d}async remove(t){let r=t.split("."),n=await _(this.path),o=(0,E.updateTomlValues)(n,[[r,void 0]]),d=this.decode(o);await l(this.path,o),this.content=d}async replace(t){let r=F(t);this.decode(r),await l(this.path,r),this.content=t}async transformRaw(t){let r=await _(this.path),n=t(r),o=this.decode(n);await l(this.path,n),this.content=o}decode(t){try{return V(t)}catch(r){let n=r;if(n.line!==void 0&&n.col!==void 0){let o=String(n.message).split(`
2
+ `)[0]??"Invalid TOML";throw new x(this.path,`${o} at row ${n.line}, col ${n.col}`)}throw r}}};function W(e,t=[]){return Object.entries(e).flatMap(([r,n])=>{let o=[...t,r];return n!==null&&typeof n=="object"&&!Array.isArray(n)?W(n,o):[[o,n]]})}export{L as a,x as b,O as c};
@@ -1 +1 @@
1
- import{a as o}from"./chunk-JNVCCE6M.js";import{b as a}from"./chunk-3WV7DQMM.js";import{g as s}from"./chunk-VKWPEFWQ.js";s();var t=class extends a{static description="View the UI kit components that process async tasks";static hidden=!0;async run(){await o()}};export{t as a};
1
+ import{a as o}from"./chunk-T74ECTO7.js";import{b as a}from"./chunk-HEWKCSY7.js";import{g as s}from"./chunk-VKWPEFWQ.js";s();var t=class extends a{static description="View the UI kit components that process async tasks";static hidden=!0;async run(){await o()}};export{t as a};
@@ -1,4 +1,4 @@
1
- import{c as w}from"./chunk-N4KDWHT2.js";import{c as F,e as x}from"./chunk-OQWMCJLY.js";import{B as h,m as S,t as L,u as P,v as f,z as N}from"./chunk-GW4JHUIA.js";import{q as $,s as m}from"./chunk-AFT6ABDE.js";import{S as V,W as y,z as R}from"./chunk-WSCSFFLH.js";import{a as c}from"./chunk-76NEIDP5.js";import{Ab as l,Bb as E,gb as A,jb as U,kb as D,qb as u,sb as p,xb as d}from"./chunk-HQUWYKSJ.js";import{c as _}from"./chunk-4VJ6YK7U.js";import{p as C,q as b,r as I}from"./chunk-773TIA5M.js";import{g as v}from"./chunk-VKWPEFWQ.js";v();function M(){let e=U();if(!(!e||e==="unknown"))return e==="homebrew"?"brew upgrade shopify-cli":e==="yarn"?`${e} global add @shopify/cli@latest`:`${e} ${e==="pnpm"?"add":"install"} -g @shopify/cli@latest`}async function re(e={}){let n=I()??b(),o=D(n),t=A();if(_()){d("Skipping upgrade in development mode.");return}if(!(e.autoupgrade&&!t))if(t){let a=M();if(!a)throw new Error("Could not determine the package manager");let[r,...i]=a.split(" ");if(!r)throw new Error("Could not determine the command to run");let s=f("@shopify/cli",c),T=s?`\u2728 New version of Shopify CLI available! (${c} \u2192 ${s})`:"\u2728 New version of Shopify CLI available!";d(p`${T}
1
+ import{c as w}from"./chunk-5U4UTFA4.js";import{c as F,e as x}from"./chunk-ZJ6DWT36.js";import{B as h,m as S,t as L,u as P,v as f,z as N}from"./chunk-JLR6X5NA.js";import{S as V,W as y,z as R}from"./chunk-LIH7CQO7.js";import{a as c}from"./chunk-4IG7WG6V.js";import{q as $,s as m}from"./chunk-Y6DYQWQK.js";import{Ab as l,Bb as E,gb as A,jb as U,kb as D,qb as u,sb as p,xb as d}from"./chunk-GYFRTLML.js";import{c as _}from"./chunk-VFQW2QL2.js";import{p as C,q as b,r as I}from"./chunk-773TIA5M.js";import{g as v}from"./chunk-VKWPEFWQ.js";v();function M(){let e=U();if(!(!e||e==="unknown"))return e==="homebrew"?"brew upgrade shopify-cli":e==="yarn"?`${e} global add @shopify/cli@latest`:`${e} ${e==="pnpm"?"add":"install"} -g @shopify/cli@latest`}async function re(e={}){let n=I()??b(),o=D(n),t=A();if(_()){d("Skipping upgrade in development mode.");return}if(!(e.autoupgrade&&!t))if(t){let a=M();if(!a)throw new Error("Could not determine the package manager");let[r,...i]=a.split(" ");if(!r)throw new Error("Could not determine the command to run");let s=f("@shopify/cli",c),T=s?`\u2728 New version of Shopify CLI available! (${c} \u2192 ${s})`:"\u2728 New version of Shopify CLI available!";d(p`${T}
2
2
  Now upgrading by running: ${u.genericShellCommand(a)}...`),await V(r,i,{stdio:"inherit"}),R({headline:"Shopify CLI upgraded.",body:s?`You're now on version ${s}.`:"You're now on the latest version."})}else if(o)await Y(o,c);else throw new Error("Could not determine the local project directory")}function ie(){let e=c,n=f("@shopify/cli",e);if(!n){l("Auto-upgrade: No newer version available.");return}if(process.env.SHOPIFY_CLI_FORCE_AUTO_UPGRADE==="1")return l("Auto-upgrade: Forcing auto-upgrade because of SHOPIFY_CLI_FORCE_AUTO_UPGRADE."),n;if(!m()){l("Auto-upgrade: Skipping because auto-upgrade is not enabled.");return}if(y()){l("Auto-upgrade: Skipping auto-upgrade in CI.");return}if(w(e)){l("Auto-upgrade: Skipping auto-upgrade for pre-release version.");return}return n}async function se(){try{let{notifications:e}=await F();return x(e,"",["autoupgrade"]).some(o=>o.type==="error")}catch{return!1}}async function ce(){if(y()||w(c)||m())return;let e=f("@shopify/cli",c);e&&await $("warn-on-available-upgrade",{days:1},async()=>{E(G(e))})}function G(e,n=!1){let o=M(),t=o?p`💡 Version ${e} available! Run ${u.genericShellCommand(o)}`.value:p`💡 Version ${e} available!`.value;if(n){let a=`https://github.com/Shopify/cli/releases/tag/${e}`,r=p`⚠️ This is a major version — review breaking changes before upgrading:\n ${u.link(a,a)}`.value;return`${t}
3
3
 
4
4
  ${r}`}return t}async function Y(e,n){let o=(await h(e)).content,t=o.dependencies??{},a=o.devDependencies??{},i={...t,...a}[await k()];if(!i){l("Auto-upgrade: CLI dependency not found in project dependencies, skipping local upgrade.");return}i.slice(0,1).match(/[\^~]/)&&(i=n);let s=await P(await k(),i);s?q(i,s):W(i),await J("prod",t,e),await J("dev",a,e)}async function J(e,n,o){let t=[await k(),...await j()].filter(r=>!!n[r]).map(r=>({name:r,version:"latest"})),a=await L(o);t.length>0&&await N(t,{packageManager:await S(o),type:e,directory:o,stdout:process.stdout,stderr:process.stderr,addToRootDirectory:a})}async function k(){return(await O()).name}async function j(){return(await O())?.oclif?.plugins??[]}var g;async function O(){if(!g){let e=await h(C(import.meta.url));g=g??e.content}return g}function W(e){d(p`You're on the latest version, ${u.yellow(e)}, no need to upgrade!`)}function q(e,n){d(p`Upgrading CLI from ${u.yellow(e)} to ${u.yellow(n)}...`)}export{M as a,re as b,ie as c,se as d,ce as e,G as f};
@@ -1,2 +1,2 @@
1
- import{a as N,b as $,c as w}from"./chunk-MK7MOLLI.js";import{q as T}from"./chunk-PK73ZSND.js";import{S as P,T as k,a as F}from"./chunk-WSCSFFLH.js";import{a as D,b}from"./chunk-WMZS3Y4Z.js";import{k as A}from"./chunk-BI7LE6CZ.js";import{Ab as u,Ia as U,La as I,N as x,Pa as O,Ua as p,xa as y,za as _}from"./chunk-HQUWYKSJ.js";import{f as h}from"./chunk-4VJ6YK7U.js";import{d as m,i as l,j as S}from"./chunk-773TIA5M.js";import{g as f}from"./chunk-VKWPEFWQ.js";f();f();import{fileURLToPath as q}from"url";import Y from"util";import{pipeline as j}from"stream";import{execSync as z,execFileSync as B}from"child_process";var H="2024.8.2",W=`https://github.com/cloudflare/cloudflared/releases/download/${H}/`,G={arm64:"cloudflared-linux-arm64",arm:"cloudflared-linux-arm",x64:"cloudflared-linux-amd64",ia32:"cloudflared-linux-386"},V={arm64:"cloudflared-darwin-arm64.tgz",x64:"cloudflared-darwin-amd64.tgz"},X={x64:"cloudflared-windows-amd64.exe",ia32:"cloudflared-windows-386.exe",arm64:"cloudflared-windows-amd64.exe"},v={linux:G,darwin:V,win32:X};function Z(r=process.platform,t=process.arch){if(!Object.keys(v).includes(r))throw new Error(`Unsupported system platform: ${r}`);let n=v[r][t];if(n===void 0)throw new Error(`Unsupported system arch: ${t}`);return W+n}function J(r=process.env,t=process.platform){return r.SHOPIFY_CLI_CLOUDFLARED_PATH?r.SHOPIFY_CLI_CLOUDFLARED_PATH:m(l(q(import.meta.url)),"..","bin",t==="win32"?"cloudflared.exe":"cloudflared")}async function g(r=process.env,t=process.platform,e=process.arch){if(r.SHOPIFY_CLI_IGNORE_CLOUDFLARED){u("Skipping cloudflared installation because SHOPIFY_CLI_IGNORE_CLOUDFLARED is set");return}let n=Z(t,e),o=J(r,t);if(p(o))try{let i=B(o,["--version"],{encoding:"utf8"}).split(" "),a=i.length>2?i[2]:"0.0.0";if(!K(H,a)){u("cloudflared already installed, skipping");return}}catch{u("version check failed, reinstalling")}if(t==="linux")await Q(n,o);else if(t==="darwin")await rt(n,o);else if(t==="win32")await tt(n,o);else throw new Error(`Unsupported platform: ${t}`)}function K(r,t){let[e,n,o]=r.split(".").map(Number),[i,a,c]=t.split(".").map(Number);return e!==i?(e??0)>(i??0):n!==a?(n??0)>(a??0):(o??0)>(c??0)}async function Q(r,t){await C(r,t),await O(t,"755")}async function tt(r,t){await C(r,t)}async function rt(r,t){await C(r,`${t}.tgz`);let e=S(`${t}.tgz`);z(`tar -xzf ${e}`,{cwd:l(t)}),U(`${t}.tgz`),await _(`${l(t)}/cloudflared`,t)}async function C(r,t){p(l(t))||y(l(t));let e=Y.promisify(j),n=await T(r,{redirect:"follow"},"slow-request");if(!n.ok||!n.body)throw new Error(`Couldn't download file ${r} (${n.status} ${n.statusText})`);let o=I(t);return await e(n.body,o),t}import{Writable as et}from"stream";import{fileURLToPath as nt}from"url";var $t=$({provider:w,action:it}),ot=h()?.2:40,st=5;async function it(r){try{let t=new R(r);return await t.startTunnel(),D(t)}catch(t){let e=new N("unknown",t.message);return b(e)}}var R=class{port;provider=w;currentStatus={status:"not-started"};abortController=void 0;constructor(t){this.port=t}async startTunnel(){try{await g(),this.tunnel()}catch(t){this.currentStatus={status:"error",message:t.message,tryMessage:d()}}}getTunnelStatus(){return this.currentStatus}stopTunnel(){this.abortController?.abort()}tunnel(t=0){this.abortController=new F;let e=!1;if(t>=st){e=!0,this.currentStatus={status:"error",message:"Could not start Cloudflare tunnel: max retries reached.",tryMessage:d()};return}let n=["tunnel","--url",`http://localhost:${this.port}`,"--no-autoupdate"],o=[],i=!1,a;this.currentStatus={status:"starting"},setTimeout(()=>{if(!e){e=!0;let s=x(o).slice(-5).join(`
1
+ import{a as N,b as $,c as w}from"./chunk-WVQZOLZJ.js";import{r as T}from"./chunk-AINDVTMY.js";import{S as P,T as k,a as F}from"./chunk-LIH7CQO7.js";import{a as D,b}from"./chunk-PVZE65R7.js";import{k as A}from"./chunk-PSUNX2YX.js";import{Ab as u,Ia as U,La as I,N as x,Pa as O,Ua as p,xa as y,za as _}from"./chunk-GYFRTLML.js";import{f as h}from"./chunk-VFQW2QL2.js";import{d as m,i as l,j as S}from"./chunk-773TIA5M.js";import{g as f}from"./chunk-VKWPEFWQ.js";f();f();import{fileURLToPath as q}from"url";import Y from"util";import{pipeline as j}from"stream";import{execSync as z,execFileSync as B}from"child_process";var H="2024.8.2",W=`https://github.com/cloudflare/cloudflared/releases/download/${H}/`,G={arm64:"cloudflared-linux-arm64",arm:"cloudflared-linux-arm",x64:"cloudflared-linux-amd64",ia32:"cloudflared-linux-386"},V={arm64:"cloudflared-darwin-arm64.tgz",x64:"cloudflared-darwin-amd64.tgz"},X={x64:"cloudflared-windows-amd64.exe",ia32:"cloudflared-windows-386.exe",arm64:"cloudflared-windows-amd64.exe"},v={linux:G,darwin:V,win32:X};function Z(r=process.platform,t=process.arch){if(!Object.keys(v).includes(r))throw new Error(`Unsupported system platform: ${r}`);let n=v[r][t];if(n===void 0)throw new Error(`Unsupported system arch: ${t}`);return W+n}function J(r=process.env,t=process.platform){return r.SHOPIFY_CLI_CLOUDFLARED_PATH?r.SHOPIFY_CLI_CLOUDFLARED_PATH:m(l(q(import.meta.url)),"..","bin",t==="win32"?"cloudflared.exe":"cloudflared")}async function g(r=process.env,t=process.platform,e=process.arch){if(r.SHOPIFY_CLI_IGNORE_CLOUDFLARED){u("Skipping cloudflared installation because SHOPIFY_CLI_IGNORE_CLOUDFLARED is set");return}let n=Z(t,e),o=J(r,t);if(p(o))try{let i=B(o,["--version"],{encoding:"utf8"}).split(" "),a=i.length>2?i[2]:"0.0.0";if(!K(H,a)){u("cloudflared already installed, skipping");return}}catch{u("version check failed, reinstalling")}if(t==="linux")await Q(n,o);else if(t==="darwin")await rt(n,o);else if(t==="win32")await tt(n,o);else throw new Error(`Unsupported platform: ${t}`)}function K(r,t){let[e,n,o]=r.split(".").map(Number),[i,a,c]=t.split(".").map(Number);return e!==i?(e??0)>(i??0):n!==a?(n??0)>(a??0):(o??0)>(c??0)}async function Q(r,t){await C(r,t),await O(t,"755")}async function tt(r,t){await C(r,t)}async function rt(r,t){await C(r,`${t}.tgz`);let e=S(`${t}.tgz`);z(`tar -xzf ${e}`,{cwd:l(t)}),U(`${t}.tgz`),await _(`${l(t)}/cloudflared`,t)}async function C(r,t){p(l(t))||y(l(t));let e=Y.promisify(j),n=await T(r,{redirect:"follow"},"slow-request");if(!n.ok||!n.body)throw new Error(`Couldn't download file ${r} (${n.status} ${n.statusText})`);let o=I(t);return await e(n.body,o),t}import{Writable as et}from"stream";import{fileURLToPath as nt}from"url";var $t=$({provider:w,action:it}),ot=h()?.2:40,st=5;async function it(r){try{let t=new R(r);return await t.startTunnel(),D(t)}catch(t){let e=new N("unknown",t.message);return b(e)}}var R=class{port;provider=w;currentStatus={status:"not-started"};abortController=void 0;constructor(t){this.port=t}async startTunnel(){try{await g(),this.tunnel()}catch(t){this.currentStatus={status:"error",message:t.message,tryMessage:d()}}}getTunnelStatus(){return this.currentStatus}stopTunnel(){this.abortController?.abort()}tunnel(t=0){this.abortController=new F;let e=!1;if(t>=st){e=!0,this.currentStatus={status:"error",message:"Could not start Cloudflare tunnel: max retries reached.",tryMessage:d()};return}let n=["tunnel","--url",`http://localhost:${this.port}`,"--no-autoupdate"],o=[],i=!1,a;this.currentStatus={status:"starting"},setTimeout(()=>{if(!e){e=!0;let s=x(o).slice(-5).join(`
2
2
  `);s===""?this.currentStatus={status:"error",message:"Could not start Cloudflare tunnel: unknown error.",tryMessage:d()}:this.currentStatus={status:"error",message:s,tryMessage:d()},this.abortController?.abort()}},ot*1e3);let c=this,E=new et({write(s,mt,M){if(u(s.toString()),e)return;a??=at(s),ct(s)&&(i=!0),i&&(a?(e=!0,c.currentStatus={status:"connected",url:a}):c.currentStatus={status:"error",message:"Could not start Cloudflare tunnel: URL not found."});let L=lt(s);L&&o.push(L),M()}});P(dt(),n,{stdout:E,stderr:E,signal:this.abortController.signal,externalErrorHandler:async s=>{if(e)throw new A(`Could not start Cloudflare tunnel: process crashed after stablishing a connection: ${s.message}`,d());u(`Cloudflare tunnel crashed: ${s.message}, restarting...`),h()||await k(1),this.tunnel(t+1)}})}};function d(){return["You can run the command again, or try networking with Shopify via",{command:"--use-localhost"},"or",{command:"--tunnel-url <custom tunnel>"},".",{link:{label:"See documentation for details.",url:"https://shopify.dev/docs/apps/build/cli-for-apps/networking-options"}}]}function at(r){let t=new RegExp(`(https:\\/\\/[^\\s]+\\.${ft()})`),e=r.toString().match(t)??void 0;return e&&e[1]}function lt(r){if([/failed to request quick Tunnel/,/failed to unmarshal quick Tunnel/,/failed to parse quick Tunnel ID/,/failed to provision routing/,/ERR Couldn't start tunnel/,/ERR Failed to serve quic connection/,/ERR Failed to create new quic connection error/].some(n=>n.test(r.toString())))return`Could not start Cloudflare tunnel: ${ut(r.toString())}`}function ut(r){let t=/^[0-9TZ:-]+ (ERR )?/g,e=/connIndex.*/g;return r.replace(t,"").replace(e,"")}function ct(r){let t=r.toString().match(/(INF Registered tunnel connection|INF Connection)/)??void 0;return t&&t[0]}function dt(){return process.env.SHOPIFY_CLI_CLOUDFLARED_PATH?process.env.SHOPIFY_CLI_CLOUDFLARED_PATH:m(l(nt(import.meta.url)),"..","bin",process.platform==="win32"?"cloudflared.exe":"cloudflared")}function ft(){return process.env.SHOPIFY_CLI_CLOUDFLARED_DOMAIN??"trycloudflare.com"}export{$t as a};
@@ -1,3 +1,3 @@
1
- import{b as g}from"./chunk-IX4IGE5H.js";import{b as y}from"./chunk-3WV7DQMM.js";import{q as u}from"./chunk-PK73ZSND.js";import{h as r}from"./chunk-BI7LE6CZ.js";import{a as R}from"./chunk-CTNBSUVU.js";import{ua as l,wa as m,wb as v,xb as w}from"./chunk-HQUWYKSJ.js";import{f as p,i as h}from"./chunk-773TIA5M.js";import{e as A,g as s}from"./chunk-VKWPEFWQ.js";s();s();var U="text/markdown",L="X-Shopify-Surface",E="cli",F=["shopify.dev"];async function S(t,e){let c;try{c=new URL(t)}catch{throw new r(`Invalid URL: ${t}`)}let{hostname:d}=c;if(!F.some(o=>d===o||d.endsWith(`.${o}`)))throw new r(`Only documents from the following hosts can be fetched: ${F.join(", ")}.`);let i=await u(t,{headers:{Accept:U,[L]:E}});if(!i.ok)throw new r(`Failed to fetch ${t}: ${i.status} ${i.statusText}`);let f=await i.text();if(e){let o=p(e);await m(h(o)),await l(o,f),w(`Saved ${t} to ${o}`);return}v(f)}var n=A(R(),1),a=class t extends y{static description="Download a complete document from shopify.dev. Every page on shopify.dev has a Markdown version, and that is what this tool returns. Use this to pull an entire document verbatim \u2014 for example, a set of instructions an agent follows like a centrally-served skill. For finding the relevant pieces of content across shopify.dev instead, use `doc search`.";static examples=[`# fetch the Markdown version of a Shopify.dev page
1
+ import{b as g}from"./chunk-WJEVB67Y.js";import{b as y}from"./chunk-HEWKCSY7.js";import{r as u}from"./chunk-AINDVTMY.js";import{h as r}from"./chunk-PSUNX2YX.js";import{a as R}from"./chunk-CTNBSUVU.js";import{ua as l,wa as m,wb as v,xb as w}from"./chunk-GYFRTLML.js";import{f as p,i as h}from"./chunk-773TIA5M.js";import{e as A,g as s}from"./chunk-VKWPEFWQ.js";s();s();var U="text/markdown",L="X-Shopify-Surface",E="cli",F=["shopify.dev"];async function S(t,e){let c;try{c=new URL(t)}catch{throw new r(`Invalid URL: ${t}`)}let{hostname:d}=c;if(!F.some(o=>d===o||d.endsWith(`.${o}`)))throw new r(`Only documents from the following hosts can be fetched: ${F.join(", ")}.`);let i=await u(t,{headers:{Accept:U,[L]:E}});if(!i.ok)throw new r(`Failed to fetch ${t}: ${i.status} ${i.statusText}`);let f=await i.text();if(e){let o=p(e);await m(h(o)),await l(o,f),w(`Saved ${t} to ${o}`);return}v(f)}var n=A(R(),1),a=class t extends y{static description="Download a complete document from shopify.dev. Every page on shopify.dev has a Markdown version, and that is what this tool returns. Use this to pull an entire document verbatim \u2014 for example, a set of instructions an agent follows like a centrally-served skill. For finding the relevant pieces of content across shopify.dev instead, use `doc search`.";static examples=[`# fetch the Markdown version of a Shopify.dev page
2
2
  shopify doc fetch --url https://shopify.dev/docs/api/shopify-cli`,`# save the document to a file instead of printing it
3
3
  shopify doc fetch --url https://shopify.dev/docs/api/shopify-cli --output docs/shopify-cli.md`];static flags={...g,url:n.Flags.string({description:"The shopify.dev URL to fetch.",env:"SHOPIFY_FLAG_URL",required:!0}),output:n.Flags.string({description:"Write the document to this file path instead of printing it to stdout.",env:"SHOPIFY_FLAG_OUTPUT"})};async run(){let{flags:e}=await this.parse(t);await S(e.url,e.output)}};export{a};
@@ -1 +1 @@
1
- import{X as B}from"./chunk-PK73ZSND.js";import{u as O}from"./chunk-WSCSFFLH.js";import{F as w,f as m}from"./chunk-HQUWYKSJ.js";import{c as g,e as s,g as o}from"./chunk-VKWPEFWQ.js";var f=g((Q,c)=>{o();function j(r,e,t,n){for(var a=-1,i=r==null?0:r.length;++a<i;){var u=r[a];e(n,u,t(u),r)}return n}c.exports=j});var A=g((S,h)=>{o();var l=O();function E(r,e,t,n){return l(r,function(a,i,u){e(n,a,t(a),u)}),n}h.exports=E});var p=g((U,q)=>{o();var G=f(),I=A(),V=w(),C=m();function D(r,e){return function(t,n){var a=C(t)?G:I,i=e?e():{};return a(t,r,V(n,2),i)}}q.exports=D});var x=g((X,v)=>{o();var F=B(),H=p(),J=Object.prototype,K=J.hasOwnProperty,L=H(function(r,e,t){K.call(r,t)?r[t].push(e):F(r,t,[e])});v.exports=L});var y=g((Z,b)=>{o();var M=p(),N=M(function(r,e,t){r[t?0:1].push(e)},function(){return[[],[]]});b.exports=N});o();var P=s(x()),d=s(y());function $(r,e){return(0,P.default)(r,e)}function k(r,e){return(0,d.default)(r,e)}export{$ as a,k as b};
1
+ import{Y as B}from"./chunk-AINDVTMY.js";import{u as O}from"./chunk-LIH7CQO7.js";import{F as w,f as m}from"./chunk-GYFRTLML.js";import{c as g,e as s,g as o}from"./chunk-VKWPEFWQ.js";var f=g((Q,c)=>{o();function j(r,e,t,n){for(var a=-1,i=r==null?0:r.length;++a<i;){var u=r[a];e(n,u,t(u),r)}return n}c.exports=j});var A=g((S,h)=>{o();var l=O();function E(r,e,t,n){return l(r,function(a,i,u){e(n,a,t(a),u)}),n}h.exports=E});var p=g((U,q)=>{o();var G=f(),I=A(),V=w(),C=m();function D(r,e){return function(t,n){var a=C(t)?G:I,i=e?e():{};return a(t,r,V(n,2),i)}}q.exports=D});var x=g((X,v)=>{o();var F=B(),H=p(),J=Object.prototype,K=J.hasOwnProperty,L=H(function(r,e,t){K.call(r,t)?r[t].push(e):F(r,t,[e])});v.exports=L});var y=g((Z,b)=>{o();var M=p(),N=M(function(r,e,t){r[t?0:1].push(e)},function(){return[[],[]]});b.exports=N});o();var P=s(x()),d=s(y());function $(r,e){return(0,P.default)(r,e)}function k(r,e){return(0,d.default)(r,e)}export{$ as a,k as b};
@@ -1 +1 @@
1
- import{b as c}from"./chunk-3WV7DQMM.js";import{U as r}from"./chunk-PK73ZSND.js";import{yb as a}from"./chunk-HQUWYKSJ.js";import{g as t}from"./chunk-VKWPEFWQ.js";t();var o=class extends c{static description="Logs you out of the Shopify account or Partner account and store.";async run(){await r(),a("Logged out from all the accounts")}};export{o as a};
1
+ import{b as c}from"./chunk-HEWKCSY7.js";import{V as r}from"./chunk-AINDVTMY.js";import{yb as a}from"./chunk-GYFRTLML.js";import{g as t}from"./chunk-VKWPEFWQ.js";t();var o=class extends c{static description="Logs you out of the Shopify account or Partner account and store.";async run(){await r(),a("Logged out from all the accounts")}};export{o as a};
@@ -1,4 +1,4 @@
1
- import{a as C}from"./chunk-K3VLFPPI.js";import{b as ne,c as re}from"./chunk-OF6CV5R4.js";import{c as ee,d as te}from"./chunk-XMQFQUUK.js";import{A as M}from"./chunk-YXDIHVPY.js";import{a as Z}from"./chunk-ESPT6CGE.js";import{a as Q}from"./chunk-RA3WWB2S.js";import{sa as X}from"./chunk-GFWXVO72.js";import{b as z,c as Y,f as V}from"./chunk-IX4IGE5H.js";import{F as K,a as b,d as v,e as l,f as s,g as j,h as G,i as H,l as J,m as q,n as x,t as R}from"./chunk-WSCSFFLH.js";import{h as O}from"./chunk-BI7LE6CZ.js";import{a as ye}from"./chunk-CTNBSUVU.js";import{a as B}from"./chunk-LBREJXT6.js";import{ma as N}from"./chunk-HQUWYKSJ.js";import{f as U}from"./chunk-4VJ6YK7U.js";import{d as I}from"./chunk-773TIA5M.js";import{e as S,g as c}from"./chunk-VKWPEFWQ.js";c();c();c();c();c();var h=S(v(),1);import{Writable as oe}from"stream";function ie({selectedRun:e,abortController:t,app:o,extension:r,appWatcher:i}){let a={type:"functionRun",input:e.payload.input,output:e.payload.output,logs:e.payload.logs,name:e.source,size:0,memory_usage:0,instructions:e.payload.fuelConsumed},[u,f]=(0,h.useState)([]),[p,m]=(0,h.useState)([a,a]),[y,d]=(0,h.useState)(void 0),{input:w,export:_}=e.payload,[fe,k]=(0,h.useState)(`Watching for changes to ${e.source}...`);return(0,h.useEffect)(()=>{let A=new b;t.signal.addEventListener("abort",()=>{A.abort()});let $=async()=>{let E=await we(r,JSON.stringify(w),_);m(g=>[E,g[0]]),k(`Watching for changes to ${e.source}...`),f(g=>[...g,E])},de=async()=>{k("Replaying log with local function..."),await $()},ge=async()=>{i.onEvent(async g=>{let F=g.extensionEvents.find(L=>L.extension.handle===r.handle);if(!(!F||F.type!==ee.Updated)){if(F.buildResult?.status==="error"){d(`Error while reloading and building extension: ${F.buildResult?.error}`);return}d(void 0),k("Re-running with latest changes..."),await $()}});let E=new oe({write(g,F,L){f(he=>[...he,{type:"systemMessage",message:g.toString()}]),L()}});await i.start({stdout:E,stderr:E,signal:A.signal},!1)};return de().then(()=>{ge()}),()=>{A.abort()}},[w,_,o,r]),R(t.signal,async()=>{setTimeout(()=>{U()||B(process.pid,"SIGINT",!1,()=>{process.exit(0)})},2e3)}),{logs:u,statusMessage:fe,recentFunctionRuns:p,error:y}}async function we(e,t,o){let r="",i=new oe({write(u,f,p){r+=u,p()}});return await C({functionExtension:e,input:t,export:o,stdout:i,json:!0}),{...JSON.parse(r),type:"functionRun"}}var n=S(v(),1);var ae=({selectedRun:e,abortController:t,app:o,extension:r})=>{let{isAborted:i}=R(t.signal),{isRawModeSupported:a}=G(),u=new te(o),{logs:f,statusMessage:p,recentFunctionRuns:m,error:y}=ie({selectedRun:e,abortController:t,app:o,extension:r,appWatcher:u});return H((d,w)=>{q(d,w,()=>t.abort()),d==="q"&&t.abort()},{isActive:!!a}),n.default.createElement(n.default.Fragment,null,n.default.createElement(j,{items:f},(d,w)=>n.default.createElement(l,{key:`replayOutputScrollerLog${w}`,flexDirection:"column"},n.default.createElement(Re,{log:d}))),i?null:n.default.createElement(l,{marginY:1,paddingTop:1,flexDirection:"column",flexGrow:1,borderStyle:"single",borderBottom:!1,borderLeft:!1,borderRight:!1,borderTop:!0},a?n.default.createElement(l,{flexDirection:"column"},n.default.createElement(l,{flexDirection:"row"},n.default.createElement(s,null,x.pointerSmall," ",p)),n.default.createElement(be,{recentFunctionRuns:m}),n.default.createElement(s,null,x.pointerSmall," Press ",n.default.createElement(s,{bold:!0},"q")," ",x.lineVertical," quit")):null,y?n.default.createElement(s,{color:"red"},y):null))};function D({title:e,backgroundColor:t}){let o=Math.max(Math.round((28-e.length)/2),0),r=" ".repeat(o);return n.default.createElement(s,{backgroundColor:t,color:"black"},`
1
+ import{a as C}from"./chunk-KEUMU5TQ.js";import{b as ne,c as re}from"./chunk-H6HILX7D.js";import{c as ee,d as te}from"./chunk-3NYK63U4.js";import{A as M}from"./chunk-XSUX2XAW.js";import{a as Z}from"./chunk-3NVQXPTU.js";import{a as Q}from"./chunk-36OXWMXZ.js";import{wa as X}from"./chunk-YAA7OGRM.js";import{b as z,c as Y,f as V}from"./chunk-WJEVB67Y.js";import{F as K,a as b,d as v,e as l,f as s,g as j,h as G,i as H,l as J,m as q,n as x,t as R}from"./chunk-LIH7CQO7.js";import{h as O}from"./chunk-PSUNX2YX.js";import{a as ye}from"./chunk-CTNBSUVU.js";import{a as B}from"./chunk-RAOMLN5A.js";import{ma as N}from"./chunk-GYFRTLML.js";import{f as U}from"./chunk-VFQW2QL2.js";import{d as I}from"./chunk-773TIA5M.js";import{e as S,g as c}from"./chunk-VKWPEFWQ.js";c();c();c();c();c();var h=S(v(),1);import{Writable as oe}from"stream";function ie({selectedRun:e,abortController:t,app:o,extension:r,appWatcher:i}){let a={type:"functionRun",input:e.payload.input,output:e.payload.output,logs:e.payload.logs,name:e.source,size:0,memory_usage:0,instructions:e.payload.fuelConsumed},[u,f]=(0,h.useState)([]),[p,m]=(0,h.useState)([a,a]),[y,d]=(0,h.useState)(void 0),{input:w,export:_}=e.payload,[fe,k]=(0,h.useState)(`Watching for changes to ${e.source}...`);return(0,h.useEffect)(()=>{let A=new b;t.signal.addEventListener("abort",()=>{A.abort()});let $=async()=>{let E=await we(r,JSON.stringify(w),_);m(g=>[E,g[0]]),k(`Watching for changes to ${e.source}...`),f(g=>[...g,E])},de=async()=>{k("Replaying log with local function..."),await $()},ge=async()=>{i.onEvent(async g=>{let F=g.extensionEvents.find(L=>L.extension.handle===r.handle);if(!(!F||F.type!==ee.Updated)){if(F.buildResult?.status==="error"){d(`Error while reloading and building extension: ${F.buildResult?.error}`);return}d(void 0),k("Re-running with latest changes..."),await $()}});let E=new oe({write(g,F,L){f(he=>[...he,{type:"systemMessage",message:g.toString()}]),L()}});await i.start({stdout:E,stderr:E,signal:A.signal},!1)};return de().then(()=>{ge()}),()=>{A.abort()}},[w,_,o,r]),R(t.signal,async()=>{setTimeout(()=>{U()||B(process.pid,"SIGINT",!1,()=>{process.exit(0)})},2e3)}),{logs:u,statusMessage:fe,recentFunctionRuns:p,error:y}}async function we(e,t,o){let r="",i=new oe({write(u,f,p){r+=u,p()}});return await C({functionExtension:e,input:t,export:o,stdout:i,json:!0}),{...JSON.parse(r),type:"functionRun"}}var n=S(v(),1);var ae=({selectedRun:e,abortController:t,app:o,extension:r})=>{let{isAborted:i}=R(t.signal),{isRawModeSupported:a}=G(),u=new te(o),{logs:f,statusMessage:p,recentFunctionRuns:m,error:y}=ie({selectedRun:e,abortController:t,app:o,extension:r,appWatcher:u});return H((d,w)=>{q(d,w,()=>t.abort()),d==="q"&&t.abort()},{isActive:!!a}),n.default.createElement(n.default.Fragment,null,n.default.createElement(j,{items:f},(d,w)=>n.default.createElement(l,{key:`replayOutputScrollerLog${w}`,flexDirection:"column"},n.default.createElement(Re,{log:d}))),i?null:n.default.createElement(l,{marginY:1,paddingTop:1,flexDirection:"column",flexGrow:1,borderStyle:"single",borderBottom:!1,borderLeft:!1,borderRight:!1,borderTop:!0},a?n.default.createElement(l,{flexDirection:"column"},n.default.createElement(l,{flexDirection:"row"},n.default.createElement(s,null,x.pointerSmall," ",p)),n.default.createElement(be,{recentFunctionRuns:m}),n.default.createElement(s,null,x.pointerSmall," Press ",n.default.createElement(s,{bold:!0},"q")," ",x.lineVertical," quit")):null,y?n.default.createElement(s,{color:"red"},y):null))};function D({title:e,backgroundColor:t}){let o=Math.max(Math.round((28-e.length)/2),0),r=" ".repeat(o);return n.default.createElement(s,{backgroundColor:t,color:"black"},`
2
2
 
3
3
  `,r,e,r,`
4
4
  `)}function Ee({input:e}){return n.default.createElement(l,{flexDirection:"column"},n.default.createElement(D,{title:"Input",backgroundColor:"yellow"}),n.default.createElement(s,null,M(e)))}function Fe({logs:e}){return n.default.createElement(l,{flexDirection:"column"},n.default.createElement(D,{title:"Logs",backgroundColor:"blueBright"}),n.default.createElement(s,null,e))}function xe({output:e}){return n.default.createElement(l,{flexDirection:"column"},n.default.createElement(D,{title:"Output",backgroundColor:"greenBright"}),n.default.createElement(s,null,M(e)))}function Se({functionRun:e}){return n.default.createElement(l,{flexDirection:"column"},n.default.createElement(D,{title:"Benchmark Results",backgroundColor:"green"}),n.default.createElement(s,null,"Name: ",e.name),n.default.createElement(s,null,"Linear Memory Usage: ",e.memory_usage,"KB"),n.default.createElement(s,null,"Instructions: ",e.instructions/1e3,"K"),n.default.createElement(s,null,"Size: ",e.size,"KB"))}function be({recentFunctionRuns:e}){let t=e[0].instructions-e[1].instructions;return n.default.createElement(l,{flexDirection:"column"},n.default.createElement(s,null,x.pointerSmall," Instruction count change: ",t>0?"+":"",t))}function Re({log:e}){switch(e.type){case"functionRun":return n.default.createElement(l,{flexDirection:"column"},n.default.createElement(Ee,{input:e.input}),n.default.createElement(Fe,{logs:e.logs}),n.default.createElement(xe,{output:e.output}),n.default.createElement(Se,{functionRun:e}),n.default.createElement(s,null,"\xA0"));case"systemMessage":return n.default.createElement(s,null,e.message);default:return null}}var se=S(v(),1);async function ce({selectedRun:e,abortController:t,app:o,extension:r}){return J(se.default.createElement(ae,{selectedRun:e,abortController:t,app:o,extension:r}),{exitOnCtrlC:!1})}c();async function le(e){if(e.length===0)return;let t=i=>({label:`${i.logTimestamp} (${i.status}) - ${i.identifier}`,value:i}),o=e.map(t);return await K({message:"Which function run would you like to replay locally?",choices:o})}import{existsSync as Ce,readdirSync as De}from"fs";var T=100;async function ue(e){let{watch:t,extension:o,app:r}=e,i=new b;try{let a=r.getLogsDir(),u=e.log?await ke(a,o.handle,e.log):await Le(a,o.handle),{input:f,export:p}=u.payload;t?await ce({selectedRun:u,abortController:i,app:r,extension:o}):await C({functionExtension:o,json:e.json,input:JSON.stringify(f),export:p})}catch(a){throw i.abort(),a}}async function ke(e,t,o){let r=await Ae(e,t,o);if(r===void 0)throw new O(`No log found for '${o}'.
@@ -1 +1 @@
1
- import{d as i,i as r,p as s}from"./chunk-773TIA5M.js";import{g as c}from"./chunk-VKWPEFWQ.js";c();import{existsSync as f,readFileSync as u}from"fs";import{fileURLToPath as p,pathToFileURL as g}from"url";var a;function h(){if(!a){let n=i(s(import.meta.url),"..","oclif.manifest.json");a=JSON.parse(u(n,"utf8")).commands}return a}var m=new Map;function y(n){let t=m.get(n);if(!t){for(t=r(p(import.meta.resolve(n)));t!==r(t);){try{if(JSON.parse(u(i(t,"package.json"),"utf8")).name===n)break}catch(o){if(o instanceof SyntaxError){t=r(t);continue}if(o.code==="ENOENT"){t=r(t);continue}throw o}t=r(t)}m.set(n,t)}return t}var P={"app:logs:sources":"dist/cli/commands/app/app-logs/sources.js","demo:watcher":"dist/cli/commands/app/demo/watcher.js","kitchen-sink":"dist/cli/commands/kitchen-sink/index.js","doctor-release":"dist/cli/commands/doctor-release/doctor-release.js","doctor-release:theme":"dist/cli/commands/doctor-release/theme/index.js"};function l(n){return P[n]??`dist/cli/commands/${n.replace(/:/g,"/")}.js`}var C=new Set(["@shopify/cli","@shopify/app","@shopify/theme"]);async function D(n){let o=h()[n];if(!o)return;let e=o.customPluginName??o.pluginName;if(e)return C.has(e)?j(n,e):k(n,e)}var d=i(s(import.meta.url),"..");function w(n,t){let o=l(n),e=i(d,o);return f(e)?d:y(t)}async function j(n,t){let o=l(n),e=w(n,t);return(await import(g(i(e,o)).href)).default}async function k(n,t){if(t==="@shopify/cli-hydrogen"){let{COMMANDS:o}=await import("./dist-WRUROUNV.js");return o?.[n]}if(t==="@oclif/plugin-commands"){let{commands:o}=await import("./lib-M72BVWQ3.js");return o[n]}if(t==="@oclif/plugin-plugins"){let{commands:o}=await import("./lib-P3APEIHY.js");return o[n]}if(t==="@shopify/plugin-did-you-mean"){let{DidYouMeanCommands:o}=await import("./dist-E7EGYE4D.js");return o[n]}}export{D as a};
1
+ import{d as i,i as r,p as s}from"./chunk-773TIA5M.js";import{g as c}from"./chunk-VKWPEFWQ.js";c();import{existsSync as f,readFileSync as u}from"fs";import{fileURLToPath as p,pathToFileURL as g}from"url";var a;function h(){if(!a){let n=i(s(import.meta.url),"..","oclif.manifest.json");a=JSON.parse(u(n,"utf8")).commands}return a}var m=new Map;function y(n){let t=m.get(n);if(!t){for(t=r(p(import.meta.resolve(n)));t!==r(t);){try{if(JSON.parse(u(i(t,"package.json"),"utf8")).name===n)break}catch(o){if(o instanceof SyntaxError){t=r(t);continue}if(o.code==="ENOENT"){t=r(t);continue}throw o}t=r(t)}m.set(n,t)}return t}var P={"app:logs:sources":"dist/cli/commands/app/app-logs/sources.js","demo:watcher":"dist/cli/commands/app/demo/watcher.js","kitchen-sink":"dist/cli/commands/kitchen-sink/index.js","doctor-release":"dist/cli/commands/doctor-release/doctor-release.js","doctor-release:theme":"dist/cli/commands/doctor-release/theme/index.js"};function l(n){return P[n]??`dist/cli/commands/${n.replace(/:/g,"/")}.js`}var C=new Set(["@shopify/cli","@shopify/app","@shopify/theme"]);async function D(n){let o=h()[n];if(!o)return;let e=o.customPluginName??o.pluginName;if(e)return C.has(e)?j(n,e):k(n,e)}var d=i(s(import.meta.url),"..");function w(n,t){let o=l(n),e=i(d,o);return f(e)?d:y(t)}async function j(n,t){let o=l(n),e=w(n,t);return(await import(g(i(e,o)).href)).default}async function k(n,t){if(t==="@shopify/cli-hydrogen"){let{COMMANDS:o}=await import("./dist-L4A3SGNF.js");return o?.[n]}if(t==="@oclif/plugin-commands"){let{commands:o}=await import("./lib-M72BVWQ3.js");return o[n]}if(t==="@oclif/plugin-plugins"){let{commands:o}=await import("./lib-P3APEIHY.js");return o[n]}if(t==="@shopify/plugin-did-you-mean"){let{DidYouMeanCommands:o}=await import("./dist-XXCZFNRC.js");return o[n]}}export{D as a};
@@ -1 +1 @@
1
- import{b as u,c as d}from"./chunk-OF6CV5R4.js";import{a as c}from"./chunk-4NXLDIW5.js";import{a as e}from"./chunk-RA3WWB2S.js";import{e as n,ta as p}from"./chunk-GFWXVO72.js";import{b as i}from"./chunk-IX4IGE5H.js";import{z as s}from"./chunk-WSCSFFLH.js";import{g as a}from"./chunk-VKWPEFWQ.js";a();var r=class f extends c{static summary="Generate GraphQL types for a function.";static descriptionWithMarkdown="Creates GraphQL types based on your [input query](https://shopify.dev/docs/apps/functions/input-output#input) for a function. Supports JavaScript functions out of the box, or any language via the `build.typegen_command` configuration.";static description=this.descriptionWithoutMarkdown();static flags={...i,...e,...u};async run(){let{flags:t}=await this.parse(f),{app:o}=await p({directory:t.path,userProvidedConfigName:t.config}),m=await d(o,t.path);return await n(m,{stdout:process.stdout,stderr:process.stderr,app:o}),s({headline:"GraphQL types generated successfully."}),{app:o}}};export{r as a};
1
+ import{b as u,c as d}from"./chunk-H6HILX7D.js";import{a as c}from"./chunk-MA6QRENS.js";import{a as e}from"./chunk-36OXWMXZ.js";import{e as n,xa as p}from"./chunk-YAA7OGRM.js";import{b as i}from"./chunk-WJEVB67Y.js";import{z as s}from"./chunk-LIH7CQO7.js";import{g as a}from"./chunk-VKWPEFWQ.js";a();var r=class f extends c{static summary="Generate GraphQL types for a function.";static descriptionWithMarkdown="Creates GraphQL types based on your [input query](https://shopify.dev/docs/apps/functions/input-output#input) for a function. Supports JavaScript functions out of the box, or any language via the `build.typegen_command` configuration.";static description=this.descriptionWithoutMarkdown();static flags={...i,...e,...u};async run(){let{flags:t}=await this.parse(f),{app:o}=await p({directory:t.path,userProvidedConfigName:t.config}),m=await d(o,t.path);return await n(m,{stdout:process.stdout,stderr:process.stderr,app:o}),s({headline:"GraphQL types generated successfully."}),{app:o}}};export{r as a};
@@ -0,0 +1 @@
1
+ import{c as l}from"./chunk-H7IQZNKR.js";import{e as u,j as m}from"./chunk-EDHR546O.js";import{a as d}from"./chunk-3NVQXPTU.js";import{wa as p}from"./chunk-YAA7OGRM.js";import{g as r}from"./chunk-VKWPEFWQ.js";r();r();var a=class extends Error{operationId;constructor(t){super(`Migration cancellation for ${t} returned neither an operation nor user errors`),this.name="MigrationCancellationProtocolError",this.operationId=t}};async function f({clientId:i,operationIds:t,cancelOperation:n=m}){return{outcomes:await Promise.all(t.map(async o=>{let e=await n({clientId:i,operationId:o});if(e.userErrors.length>0)return{status:"failed",operationId:o,operation:e.operation,userErrors:e.userErrors};if(!e.operation)throw new a(o);return{status:"success",operationId:o,operation:e.operation}}))}}var s=class i extends d{static hidden=!0;static summary="Cancels app subscription migration operations.";static descriptionWithMarkdown="Cancels app subscription migration operations.\n\nCanceling stops additional unprocessed shops, but does not undo shops that have already been scheduled or migrated. Use `unschedule` for reversible schedules.\n\nRepeat `--id` to cancel every operation GID returned by a multi-batch submission. Use `--json` to output the resulting operation states and per-shop results as structured JSON.\n\nRun the command from an app project. By default, it uses the Client ID from the active app configuration. Use `--path` to select an app directory or `--config` to select a configuration. Pass `--client-id` to select a different app within the project. Use `--reset` to relink the app.";static description=this.descriptionWithoutMarkdown();static examples=["<%= config.bin %> <%= command.id %> --id <operation-id>","<%= config.bin %> <%= command.id %> --path ../my-app --config staging --id <operation-id-1> --id <operation-id-2>","<%= config.bin %> <%= command.id %> --client-id <client-id> --id <operation-id> --json"];static flags={...u};async run(){let{flags:t}=await this.parse(i),{app:n,remoteApp:c}=await p({directory:t.path,clientId:t["client-id"],forceRelink:t.reset,userProvidedConfigName:t.config}),o=await f({clientId:c.apiKey,operationIds:t.id}),e=l(o,{json:t.json});return e!==0&&(process.exitCode=e),{app:n}}};export{s as a};
@@ -0,0 +1 @@
1
+ import{b as e}from"./chunk-HEWKCSY7.js";import{va as r}from"./chunk-AINDVTMY.js";import{g as o}from"./chunk-VKWPEFWQ.js";o();var t=class extends e{static hidden=!0;async run(){await r()}};export{t as a};
@@ -1 +1 @@
1
- import{a as h,b as w}from"./chunk-IA3XNJ56.js";import{q as f}from"./chunk-PK73ZSND.js";import{T as d}from"./chunk-WSCSFFLH.js";import{h as i}from"./chunk-BI7LE6CZ.js";import{Ga as m,na as p}from"./chunk-HQUWYKSJ.js";import{d as u}from"./chunk-773TIA5M.js";import{g as l}from"./chunk-VKWPEFWQ.js";l();import{writeFile as g}from"fs/promises";var S=1024*1024,y=100,U=y*S,E=3,_=new Set([408,429,500,502,503,504]);async function j(o,e){let t=u(e,"manifest.json");await g(t,JSON.stringify(o,null,2))}var A=["!**/*.js.map","!**/*.metafile.json"];async function k(o,e,t){let n=t??["**/*",...A];e.endsWith(".br")?await w({inputDirectory:o,outputPath:e,matchFilePattern:n}):await h({inputDirectory:o,outputZipPath:e,matchFilePattern:n})}async function C(o,e){let t=await m(e);if(t>U){let s=`${(Math.ceil(t/S*100)/100).toFixed(2)} MB`;throw new i(`Your app bundle exceeds the ${y} MB upload limit (it is ${s}).`,"Check the asset paths in your extension configuration \u2014 a misconfigured source can pull in much more than intended. Exclude large files or directories from your bundle, then try again.")}let n=p(e),r;for(let s=1;s<=E;s++){if(r=await f(o,{method:"put",body:n},"slow-request"),r.ok)return;let T=s===E;if(_.has(r.status)&&!T){await r.text().catch(()=>{}),await d(2**s*.1);continue}break}let a=r?.status,c=(await r?.text().catch(()=>""))?.trim();throw new i(`Failed to upload your app bundle to storage${a?` (HTTP ${a})`:""}.`,"This is usually transient. Please try again, and check your network connection if it persists.",c?[`Storage responded with: ${c.slice(0,300)}`]:void 0)}async function D(o,e){let t=await o.generateSignedUploadUrl(e);if(!t.assetUrl||t.userErrors?.length>0){let n=t.userErrors.map(r=>r.message).join(", ");throw new i(n)}return t.assetUrl}export{j as a,A as b,k as c,C as d,D as e};
1
+ import{a as h,b as w}from"./chunk-XH66VYZA.js";import{r as f}from"./chunk-AINDVTMY.js";import{T as d}from"./chunk-LIH7CQO7.js";import{h as i}from"./chunk-PSUNX2YX.js";import{Ga as m,na as p}from"./chunk-GYFRTLML.js";import{d as u}from"./chunk-773TIA5M.js";import{g as l}from"./chunk-VKWPEFWQ.js";l();import{writeFile as g}from"fs/promises";var S=1024*1024,y=100,U=y*S,E=3,_=new Set([408,429,500,502,503,504]);async function j(o,e){let t=u(e,"manifest.json");await g(t,JSON.stringify(o,null,2))}var A=["!**/*.js.map","!**/*.metafile.json"];async function k(o,e,t){let n=t??["**/*",...A];e.endsWith(".br")?await w({inputDirectory:o,outputPath:e,matchFilePattern:n}):await h({inputDirectory:o,outputZipPath:e,matchFilePattern:n})}async function C(o,e){let t=await m(e);if(t>U){let s=`${(Math.ceil(t/S*100)/100).toFixed(2)} MB`;throw new i(`Your app bundle exceeds the ${y} MB upload limit (it is ${s}).`,"Check the asset paths in your extension configuration \u2014 a misconfigured source can pull in much more than intended. Exclude large files or directories from your bundle, then try again.")}let n=p(e),r;for(let s=1;s<=E;s++){if(r=await f(o,{method:"put",body:n},"slow-request"),r.ok)return;let T=s===E;if(_.has(r.status)&&!T){await r.text().catch(()=>{}),await d(2**s*.1);continue}break}let a=r?.status,c=(await r?.text().catch(()=>""))?.trim();throw new i(`Failed to upload your app bundle to storage${a?` (HTTP ${a})`:""}.`,"This is usually transient. Please try again, and check your network connection if it persists.",c?[`Storage responded with: ${c.slice(0,300)}`]:void 0)}async function D(o,e){let t=await o.generateSignedUploadUrl(e);if(!t.assetUrl||t.userErrors?.length>0){let n=t.userErrors.map(r=>r.message).join(", ");throw new i(n)}return t.assetUrl}export{j as a,A as b,k as c,C as d,D as e};
@@ -0,0 +1,97 @@
1
+ import{a as d}from"./chunk-36OXWMXZ.js";import{T as a}from"./chunk-YAA7OGRM.js";import{b as l,c as g,f as S}from"./chunk-WJEVB67Y.js";import{n as o}from"./chunk-AINDVTMY.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
+ query MigratableAppSubscriptions(
3
+ $apiKey: String!
4
+ $first: Int!
5
+ $after: String
6
+ $status: AppSubscriptionMigrationStatus
7
+ ) {
8
+ migratableAppSubscriptions(apiKey: $apiKey, first: $first, after: $after, status: $status) {
9
+ edges {
10
+ cursor
11
+ node {
12
+ shopId
13
+ status
14
+ manualSubscriptionName
15
+ manualSubscriptionPrice {
16
+ amount
17
+ currencyCode
18
+ }
19
+ manualSubscriptionInterval
20
+ targetPlanHandle
21
+ notification {
22
+ kind
23
+ optOutDeadline
24
+ sentAt
25
+ }
26
+ priceBehavior
27
+ effectiveDate
28
+ lastFailureReason
29
+ }
30
+ }
31
+ pageInfo {
32
+ hasNextPage
33
+ endCursor
34
+ }
35
+ }
36
+ }
37
+ `,b=o`
38
+ mutation AppSubscriptionMigrationOperationCreate($input: AppSubscriptionMigrationOperationCreateInput!) {
39
+ appSubscriptionMigrationOperationCreate(input: $input) {
40
+ operation {
41
+ id
42
+ status
43
+ total
44
+ results(first: 250) {
45
+ edges {
46
+ node {
47
+ shopId
48
+ code
49
+ }
50
+ }
51
+ }
52
+ }
53
+ userErrors {
54
+ message
55
+ field
56
+ }
57
+ }
58
+ }
59
+ `,m=o`
60
+ query AppSubscriptionMigrationOperation($apiKey: String!, $id: ID!) {
61
+ appSubscriptionMigrationOperation(apiKey: $apiKey, id: $id) {
62
+ id
63
+ status
64
+ total
65
+ results(first: 250) {
66
+ edges {
67
+ node {
68
+ shopId
69
+ code
70
+ }
71
+ }
72
+ }
73
+ }
74
+ }
75
+ `,O=o`
76
+ mutation AppSubscriptionMigrationOperationCancel($input: AppSubscriptionMigrationOperationCancelInput!) {
77
+ appSubscriptionMigrationOperationCancel(input: $input) {
78
+ operation {
79
+ id
80
+ status
81
+ total
82
+ results(first: 250) {
83
+ edges {
84
+ node {
85
+ shopId
86
+ code
87
+ }
88
+ }
89
+ }
90
+ }
91
+ userErrors {
92
+ message
93
+ field
94
+ }
95
+ }
96
+ }
97
+ `;function A(t){return t===null?null:{...t,results:{edges:t.results?.edges?.filter(i=>i!==null)??[]}}}function M(t){return{operation:A(t.operation),userErrors:t.userErrors??[]}}async function Q({clientId:t,first:i,after:n,status:s}){let p=(await a.getInstance().request(I,{apiKey:t,first:i,after:n,status:s})).migratableAppSubscriptions;return p===null?null:{subscriptions:p.edges?.flatMap(c=>c===null?[]:[c.node])??[],pageInfo:p.pageInfo}}async function W({clientId:t,idempotencyKey:i,migrations:n}){let s=await a.getInstance().request(b,{input:{apiKey:t,idempotencyKey:i,migrations:n}});return M(s.appSubscriptionMigrationOperationCreate)}async function k({clientId:t,operationId:i}){let n=await a.getInstance().request(m,{apiKey:t,id:i});return A(n.appSubscriptionMigrationOperation)}async function z({clientId:t,operationId:i}){let n=await a.getInstance().request(O,{input:{apiKey:t,id:i}});return M(n.appSubscriptionMigrationOperationCancel)}export{P as a,T as b,R as c,L as d,_ as e,v as f,Q as g,W as h,k as i,z as j};
@@ -1 +1 @@
1
- import{b as m,c as u}from"./chunk-OF6CV5R4.js";import{a as p}from"./chunk-4NXLDIW5.js";import{a as e}from"./chunk-RA3WWB2S.js";import{o as a,ta as c}from"./chunk-GFWXVO72.js";import{b as n}from"./chunk-IX4IGE5H.js";import{z as i}from"./chunk-WSCSFFLH.js";import{g as r}from"./chunk-VKWPEFWQ.js";r();var s=class d extends p{static summary="Compile a function to wasm.";static descriptionWithMarkdown="Compiles the function in your current directory to WebAssembly (Wasm) for testing purposes.";static description=this.descriptionWithoutMarkdown();static flags={...n,...e,...m};async run(){let{flags:t}=await this.parse(d),{app:o}=await c({directory:t.path,userProvidedConfigName:t.config}),l=await u(o,t.path);return await a(l,{app:o,stdout:process.stdout,stderr:process.stderr,useTasks:!0,environment:"production"}),i({headline:"Function built successfully."}),{app:o}}};export{s as a};
1
+ import{b as m,c as u}from"./chunk-H6HILX7D.js";import{a as p}from"./chunk-MA6QRENS.js";import{a as e}from"./chunk-36OXWMXZ.js";import{o as a,xa as c}from"./chunk-YAA7OGRM.js";import{b as n}from"./chunk-WJEVB67Y.js";import{z as i}from"./chunk-LIH7CQO7.js";import{g as r}from"./chunk-VKWPEFWQ.js";r();var s=class d extends p{static summary="Compile a function to wasm.";static descriptionWithMarkdown="Compiles the function in your current directory to WebAssembly (Wasm) for testing purposes.";static description=this.descriptionWithoutMarkdown();static flags={...n,...e,...m};async run(){let{flags:t}=await this.parse(d),{app:o}=await c({directory:t.path,userProvidedConfigName:t.config}),l=await u(o,t.path);return await a(l,{app:o,stdout:process.stdout,stderr:process.stderr,useTasks:!0,environment:"production"}),i({headline:"Function built successfully."}),{app:o}}};export{s as a};
@@ -1,4 +1,4 @@
1
- import{a as i}from"./chunk-GCN4O7HM.js";import{b as r}from"./chunk-3WV7DQMM.js";import{t}from"./chunk-AFT6ABDE.js";import{y as e}from"./chunk-WSCSFFLH.js";import{g as a}from"./chunk-VKWPEFWQ.js";a();var o=class extends r{static summary="Enable automatic upgrades for Shopify CLI.";static descriptionWithMarkdown=`Enable automatic upgrades for Shopify CLI.
1
+ import{a as i}from"./chunk-GCN4O7HM.js";import{b as r}from"./chunk-HEWKCSY7.js";import{y as e}from"./chunk-LIH7CQO7.js";import{t}from"./chunk-Y6DYQWQK.js";import{g as a}from"./chunk-VKWPEFWQ.js";a();var o=class extends r{static summary="Enable automatic upgrades for Shopify CLI.";static descriptionWithMarkdown=`Enable automatic upgrades for Shopify CLI.
2
2
 
3
3
  When auto-upgrade is enabled, Shopify CLI automatically updates to the latest version once per day. Major version upgrades are skipped and must be done manually.
4
4
 
@@ -1 +1 @@
1
- import{q as R}from"./chunk-PK73ZSND.js";import{f as G}from"./chunk-6K3AJTNO.js";import{a as T,b as k}from"./chunk-WMZS3Y4Z.js";import{h as l}from"./chunk-BI7LE6CZ.js";import{Ab as f,Oa as y,Pa as x,ka as $,qb as u,sb as h,ua as b,wa as g}from"./chunk-HQUWYKSJ.js";import{d,i as w}from"./chunk-773TIA5M.js";import{g as m}from"./chunk-VKWPEFWQ.js";m();function U(a){let t=/^(?:(?:https:\/\/)?([^:/]+\.[^:/]+)\/|git@([^:/]+)[:/]|([^/]+):)?([^/\s]+)\/([^/\s#]+)(?:((?:\/[^/\s#]+)+))?(?:\/)?(?:#(.+))?/.exec(a);if(!t){let v=["github:user/repo","user/repo/subdirectory","git@github.com:user/repo","user/repo#dev","https://github.com/user/repo"];return k(new Error(`Parsing the url ${a} failed. Supported formats are ${v.join(", ")}.`))}let e=t[1]??t[2]??t[3]??"github.com",r=e==="github"?"github.com":e,s=t[4],i=t[5].replace(/\.git$/,""),n=t[6]?.slice(1),o=t[7],p=o?`#${o}`:"",c=`git@${r}:${s}/${i}`,H=`https://${r}/${s}/${i}`,P=["https:/",r,s,i,n].join("/").concat(p);return T({full:P,site:r,user:s,name:i,ref:o,subDirectory:n,ssh:c,http:H})}function A(a){let t=new URL(a),e=t.hash?t.hash.slice(1):void 0,[r,s,i,...n]=t.pathname.split("/"),o=n.length>0?n.join("/"):void 0;return{baseURL:`${t.origin}/${s}/${i}`,branch:e,filePath:o}}async function B(a,t,e,r){let s=`https://github.com/${a}/releases/download/${t}/${e}`;return G("cmd_all_timing_network_ms")(async()=>{f(h`Downloading ${u.link(e,s)}`),await $(async i=>{let n=d(i,e),o;try{if(o=await R(s,void 0,"slow-request"),!o.ok)throw new l(`Failed to download ${e}: ${o.statusText}`)}catch(c){throw new l(`Failed to download ${e}: ${c instanceof Error?c.message:"unknown error"}`)}let p=await o.arrayBuffer();await b(n,Buffer.from(p)),await x(n,493),await g(w(r)),await y(n,r)}),f(h`${u.successIcon()} Successfully downloaded ${u.path(r)}`)})}export{U as a,A as b,B as c};
1
+ import{r as R}from"./chunk-AINDVTMY.js";import{f as G}from"./chunk-VRO6QBVN.js";import{a as T,b as k}from"./chunk-PVZE65R7.js";import{h as l}from"./chunk-PSUNX2YX.js";import{Ab as f,Oa as y,Pa as x,ka as $,qb as u,sb as h,ua as b,wa as g}from"./chunk-GYFRTLML.js";import{d,i as w}from"./chunk-773TIA5M.js";import{g as m}from"./chunk-VKWPEFWQ.js";m();function U(a){let t=/^(?:(?:https:\/\/)?([^:/]+\.[^:/]+)\/|git@([^:/]+)[:/]|([^/]+):)?([^/\s]+)\/([^/\s#]+)(?:((?:\/[^/\s#]+)+))?(?:\/)?(?:#(.+))?/.exec(a);if(!t){let v=["github:user/repo","user/repo/subdirectory","git@github.com:user/repo","user/repo#dev","https://github.com/user/repo"];return k(new Error(`Parsing the url ${a} failed. Supported formats are ${v.join(", ")}.`))}let e=t[1]??t[2]??t[3]??"github.com",r=e==="github"?"github.com":e,s=t[4],i=t[5].replace(/\.git$/,""),n=t[6]?.slice(1),o=t[7],p=o?`#${o}`:"",c=`git@${r}:${s}/${i}`,H=`https://${r}/${s}/${i}`,P=["https:/",r,s,i,n].join("/").concat(p);return T({full:P,site:r,user:s,name:i,ref:o,subDirectory:n,ssh:c,http:H})}function A(a){let t=new URL(a),e=t.hash?t.hash.slice(1):void 0,[r,s,i,...n]=t.pathname.split("/"),o=n.length>0?n.join("/"):void 0;return{baseURL:`${t.origin}/${s}/${i}`,branch:e,filePath:o}}async function B(a,t,e,r){let s=`https://github.com/${a}/releases/download/${t}/${e}`;return G("cmd_all_timing_network_ms")(async()=>{f(h`Downloading ${u.link(e,s)}`),await $(async i=>{let n=d(i,e),o;try{if(o=await R(s,void 0,"slow-request"),!o.ok)throw new l(`Failed to download ${e}: ${o.statusText}`)}catch(c){throw new l(`Failed to download ${e}: ${c instanceof Error?c.message:"unknown error"}`)}let p=await o.arrayBuffer();await b(n,Buffer.from(p)),await x(n,493),await g(w(r)),await y(n,r)}),f(h`${u.successIcon()} Successfully downloaded ${u.path(r)}`)})}export{U as a,A as b,B as c};
@@ -1,4 +1,4 @@
1
- import{a as U,b as xt}from"./chunk-JLGA3B7P.js";import{a as ht,b as ft,f as Ie,g as ae,h as A,i as ce,k as Et,n as Tt}from"./chunk-5JW4JQWZ.js";import{a as M,l as gt,m as yt}from"./chunk-K63FW7Q7.js";import{s as ie,t as W}from"./chunk-3KM2GKXH.js";import{a as O,b as N,e as nt,g as rt,i as ot,j as it,k as at,n as ct,p as lt,q as dt,r as oe,s as $,u as ut,w as pt}from"./chunk-Q7BOSHWX.js";import{aa as mt}from"./chunk-TP4Z5OZT.js";import{b as Ke,xa as L,za as H}from"./chunk-PK73ZSND.js";import{A as I,B as te,C as tt,T as st,y as et}from"./chunk-WSCSFFLH.js";import{h as se}from"./chunk-BI7LE6CZ.js";import{Ab as F,Bb as D,O as Xe,Ta as P,Wa as C,Z as $e,bb as ke,ma as k,qb as j,sb as ne,ua as be,wa as Ze,xb as re,ya as Qe}from"./chunk-HQUWYKSJ.js";import{d as E,g as V,j as Ve,k as q}from"./chunk-773TIA5M.js";import{e as Ge,g as h}from"./chunk-VKWPEFWQ.js";h();h();h();var rs=".shopifyignore",Rt=/templates\/\*(\.(json|liquid))?$/,St=new Set;function Le(e,t={}){let s=t.ignoreFromFile??[],n=t.ignore??[],r=t.only??[],[o=[],i=[]]=_e(s),[a=[],p=[]]=_e(n),[m=[],c=[]]=_e(r),l=e.filter(B(o,".shopifyignore"));return l=l.filter(B(a,"--ignore")),l=l.filter(B(m,"--only",!0)),i.length>0&&(l=l.concat(e.filter(B(i,".shopifyignore",!0)))),p.length>0&&(l=l.concat(e.filter(B(p,"--ignore",!0)))),c.length>0&&(l=l.filter(B(c,"--only"))),Xe(l,f=>f.key)}function B(e,t,s=!1){return({key:n})=>{if(e.length===0)return!0;let r=e.some(i=>os(n,i)||cs(i)&&as(n,ls(i)));return(s?!r:r)?(F(`Ignoring theme file ${n} via ${t}...`),!1):!0}}async function wt(e){let t=E(e,rs);return await P(t)?(await k(t,{encoding:"utf8"})).split(/(\r\n|\r|\n)/).map(r=>r.trim()).filter(r=>r&&!r.startsWith("#")):[]}function _e(e){let t=e.filter(n=>n.startsWith("!")).map(n=>n.slice(1));return[e.filter(n=>!n.startsWith("!")),t]}function os(e,t){let s={matchBase:!0,noglobstar:!0};return ke(e,t,s)?!0:(!t.includes("*")&&t.endsWith("/")&&!St.has(t)&&(St.add(t),I({headline:"Directory pattern may be misleading.",body:`For more reliable matching, consider using "${t}*" or "${t}*.<file_extension>" instead.`})),is(t)?ke(e,t.replace(Rt,"templates/**/*$1"),s):!1)}function is(e){return Rt.test(e)}function as(e,t){return t.test(e)}function cs(e){return e.startsWith("/")&&e.endsWith("/")}function ls(e){return new RegExp(e.slice(1,-1))}h();import Ft from"fs/promises";var le=class{notifyPath;isValidUrl;constructor(t){this.notifyPath=t,this.isValidUrl=this.validateUrl(t),this.notifyPath===""&&D("Notification skipped: notifyPath is an empty string")}async notify(t){if(this.notifyPath!=="")try{F(`Notifying filechange listener at ${this.notifyPath}...`),this.isValidUrl?await this.notifyUrl(t):await this.notifyFile(t)}catch(s){L(s);let n=`Failed to notify filechange listener at ${this.notifyPath}`;s instanceof Error&&(n=n.concat(`: ${s.message}`)),D(n)}}async notifyUrl(t){let s=await fetch(this.notifyPath,{method:"POST",body:JSON.stringify({files:[t]}),headers:{"Content-Type":"application/json"}});if(!s.ok)throw new Error(s.statusText)}async notifyFile(t){await Ft.writeFile(this.notifyPath,t),await Ft.utimes(this.notifyPath,new Date,new Date)}validateUrl(t){try{let s=new URL(t);return s.protocol==="http:"||s.protocol==="https:"}catch{return!1}}};h();h();h();import ds from"node:events";var Pt=["assets/**/*.*","locales/**/*.json","blocks/**/*.liquid","snippets/**/*.liquid"];function vt(e){let t=new Map,s=new Set,n=new ds,r=(c,l)=>{n.emit(c,l)},o=async c=>{let l=await ue(e,c),u=de(c,l),f=typeof l=="string"?l:"",T=Buffer.isBuffer(l)?l.toString("base64"):"";return t.set(c,M({key:c,checksum:u,value:f,attachment:T})),l},i=C(Pt,{cwd:e,deep:3,ignore:W}).then(c=>Promise.all(c.map(o))),a=(c,l)=>{let u=V(e,l),f=o(u).then(()=>{let T=t.get(u);return s.add(T.key),T.value??T.attachment??""});st(5).then(()=>{s.delete(u)}).catch(()=>{}),r(c,{fileKey:u,onContent:T=>{f.then(v=>{v&&T(v)}).catch(()=>{})},onSync:T=>{}})},p=c=>{let l=V(e,c);s.delete(l),t.delete(l),r("unlink",{fileKey:l,onSync:u=>u()})},m=new Set(Pt.map(c=>E(e,c.split("/").shift()??"")));return{root:e,files:t,unsyncedFileKeys:s,ready:async()=>i.then(()=>{}),delete:async c=>{t.delete(c)},write:async c=>{t.set(c.key,c)},read:o,addEventListener:(c,l)=>{n.on(c,l)},startWatcher:async()=>{let{default:c}=await import("./chokidar-5RWEYTNQ.js");c.watch([...m],{ignored:W,persistent:!process.env.SHOPIFY_UNIT_TEST,ignoreInitial:!0}).on("add",a.bind(null,"add")).on("change",a.bind(null,"change")).on("unlink",p.bind(null))}}}h();h();var us="https://unpkg.com/@shopify/polaris@13.9.2/build/esm/styles.css";function $t(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function bt(e){return(0,String.raw)`<!DOCTYPE html>
1
+ import{a as U,b as xt}from"./chunk-JLGA3B7P.js";import{a as ht,b as ft,f as Ie,g as ae,h as A,i as ce,k as Et,n as Tt}from"./chunk-GCTCRKET.js";import{a as M,l as gt,m as yt}from"./chunk-ZYEGQSF5.js";import{s as ie,t as W}from"./chunk-7DJNASBC.js";import{a as D,b as O,e as nt,g as rt,i as ot,j as it,k as at,n as ct,p as lt,q as dt,r as oe,s as b,u as ut,w as pt}from"./chunk-Q7BOSHWX.js";import{aa as mt}from"./chunk-NQRSFMS7.js";import{Aa as H,c as Ke,ya as L}from"./chunk-AINDVTMY.js";import{A as I,B as te,C as tt,T as st,y as et}from"./chunk-LIH7CQO7.js";import{h as se}from"./chunk-PSUNX2YX.js";import{Ab as P,Bb as N,O as Xe,Ta as $,Wa as C,Z as $e,bb as ke,ma as k,qb as j,sb as ne,ua as be,wa as Ze,xb as re,ya as Qe}from"./chunk-GYFRTLML.js";import{d as T,g as V,j as Ve,k as q}from"./chunk-773TIA5M.js";import{e as Ye,g as h}from"./chunk-VKWPEFWQ.js";h();h();h();var rs=".shopifyignore",Rt=/templates\/\*(\.(json|liquid))?$/,St=new Set;function Le(e,t={}){let s=t.ignoreFromFile??[],n=t.ignore??[],r=t.only??[],[o=[],i=[]]=_e(s),[a=[],u=[]]=_e(n),[p=[],c=[]]=_e(r),l=e.filter(B(o,".shopifyignore"));return l=l.filter(B(a,"--ignore")),l=l.filter(B(p,"--only",!0)),i.length>0&&(l=l.concat(e.filter(B(i,".shopifyignore",!0)))),u.length>0&&(l=l.concat(e.filter(B(u,"--ignore",!0)))),c.length>0&&(l=l.filter(B(c,"--only"))),Xe(l,x=>x.key)}function B(e,t,s=!1){return({key:n})=>{if(e.length===0)return!0;let r=e.some(i=>os(n,i)||cs(i)&&as(n,ls(i)));return(s?!r:r)?(P(`Ignoring theme file ${n} via ${t}...`),!1):!0}}async function wt(e){let t=T(e,rs);return await $(t)?(await k(t,{encoding:"utf8"})).split(/(\r\n|\r|\n)/).map(r=>r.trim()).filter(r=>r&&!r.startsWith("#")):[]}function _e(e){let t=e.filter(n=>n.startsWith("!")).map(n=>n.slice(1));return[e.filter(n=>!n.startsWith("!")),t]}function os(e,t){let s={matchBase:!0,noglobstar:!0};return ke(e,t,s)?!0:(!t.includes("*")&&t.endsWith("/")&&!St.has(t)&&(St.add(t),I({headline:"Directory pattern may be misleading.",body:`For more reliable matching, consider using "${t}*" or "${t}*.<file_extension>" instead.`})),is(t)?ke(e,t.replace(Rt,"templates/**/*$1"),s):!1)}function is(e){return Rt.test(e)}function as(e,t){return t.test(e)}function cs(e){return e.startsWith("/")&&e.endsWith("/")}function ls(e){return new RegExp(e.slice(1,-1))}h();import Ft from"fs/promises";var le=class{notifyPath;isValidUrl;constructor(t){this.notifyPath=t,this.isValidUrl=this.validateUrl(t),this.notifyPath===""&&N("Notification skipped: notifyPath is an empty string")}async notify(t){if(this.notifyPath!=="")try{P(`Notifying filechange listener at ${this.notifyPath}...`),this.isValidUrl?await this.notifyUrl(t):await this.notifyFile(t)}catch(s){L(s);let n=`Failed to notify filechange listener at ${this.notifyPath}`;s instanceof Error&&(n=n.concat(`: ${s.message}`)),N(n)}}async notifyUrl(t){let s=await fetch(this.notifyPath,{method:"POST",body:JSON.stringify({files:[t]}),headers:{"Content-Type":"application/json"}});if(!s.ok)throw new Error(s.statusText)}async notifyFile(t){await Ft.writeFile(this.notifyPath,t),await Ft.utimes(this.notifyPath,new Date,new Date)}validateUrl(t){try{let s=new URL(t);return s.protocol==="http:"||s.protocol==="https:"}catch{return!1}}};h();h();h();import ds from"node:events";var Pt=["assets/**/*.*","locales/**/*.json","blocks/**/*.liquid","snippets/**/*.liquid"];function vt(e){let t=new Map,s=new Set,n=new ds,r=(c,l)=>{n.emit(c,l)},o=async c=>{let l=await ue(e,c),m=de(c,l),x=typeof l=="string"?l:"",f=Buffer.isBuffer(l)?l.toString("base64"):"";return t.set(c,M({key:c,checksum:m,value:x,attachment:f})),l},i=C(Pt,{cwd:e,deep:3,ignore:W}).then(c=>Promise.all(c.map(o))),a=(c,l)=>{let m=V(e,l),x=o(m).then(()=>{let f=t.get(m);return s.add(f.key),f.value??f.attachment??""});st(5).then(()=>{s.delete(m)}).catch(()=>{}),r(c,{fileKey:m,onContent:f=>{x.then(g=>{g&&f(g)}).catch(()=>{})},onSync:f=>{}})},u=c=>{let l=V(e,c);s.delete(l),t.delete(l),r("unlink",{fileKey:l,onSync:m=>m()})},p=new Set(Pt.map(c=>T(e,c.split("/").shift()??"")));return{root:e,files:t,unsyncedFileKeys:s,ready:async()=>i.then(()=>{}),delete:async c=>{t.delete(c)},write:async c=>{t.set(c.key,c)},read:o,addEventListener:(c,l)=>{n.on(c,l)},startWatcher:async()=>{let{default:c}=await import("./chokidar-5RWEYTNQ.js");c.watch([...p],{ignored:W,persistent:!process.env.SHOPIFY_UNIT_TEST,ignoreInitial:!0}).on("add",a.bind(null,"add")).on("change",a.bind(null,"change")).on("unlink",u.bind(null))}}}h();h();var us="https://unpkg.com/@shopify/polaris@13.9.2/build/esm/styles.css";function $t(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}function bt(e){return(0,String.raw)`<!DOCTYPE html>
2
2
  <html>
3
3
  <head>
4
4
  <title>${e.title}</title>
@@ -66,12 +66,12 @@ import{a as U,b as xt}from"./chunk-JLGA3B7P.js";import{a as ht,b as ft,f as Ie,g
66
66
  </div>
67
67
  </div>
68
68
  </body>
69
- </html>`}h();h();var ps=/<head(\s[^>]*)?>/i,qe="https://cdn.shopify.com/storefront",ms=`${qe}/standard-events.js`,hs=`${qe}/standard-events.dev.js`,kt=`${qe}/standard-events-inspector.js`,It="shopify-cli-standard-events-inspector",fs=new RegExp(`<script\\b[^>]*(?:\\bid=["']${je(It)}["']|\\bsrc=["']${je(kt)}["'])[^>]*>`,"i"),gs=new RegExp(je(ms),"g");function pe(e){return fs.test(e)?e:e.replace(ps,t=>`${t}<script id="${It}" src="${kt}" defer></script>`)}function _t(e){return e.replace(gs,hs)}function je(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}h();var Lt=80;function X(e,t,s){if(!ys(e)||s.type==="theme-extension")return;let n=e.path.length>Lt?`${e.path.substring(0,Lt)}...`:e.path,o=t.headers.get("server-timing")?.match(/cfRequestDuration;dur=([\d.]+)/)?.[1],i=o?`${Math.round(Number(o))}ms`:"",a=Es(t.status),p=e.method.padStart(6);re(ne`• ${ie.format(new Date)} Request ${j.raw("\xBB")} ${p} ${a(String(t.status))} ${n} ${j.gray(i)}`)}function ys(e){let t=[z,J,"/checkouts","/payments"],s=[".js",".css",".json",".map"];if(t.some(o=>e.path.startsWith(o)))return!1;let[n]=e.path.split("?"),r=q(n);return!s.includes(r)}function Es(e){return e<300?j.green:e<400?j.yellow:j.errorText}var J="/cdn/",z="/ext/cdn/",Ce="/api/collect",Ts=/^\/cart\//,xs=/^\/cart(\/|\.js|\.json|$)/,Ae=/^\/checkouts\/(?!internal\/)/,jt=/^\/account(\/login\/multipass(\/[^/]+)?|\/logout)?\/?$/,Ss=new RegExp(`^${J}`),Rs=new RegExp(`^${z}`),ws=/^\/api\/(unstable|\d{4}-\d{2})\/graphql\.json/,Fs=["/.well-known","/shopify/monorail","/mini-profiler-resources","/web-pixels-manager","/web-pixels@","/wpm","/services/",Ce,"/cdn-cgi/challenge-platform"],qt="_shopify_essential",Ps=new RegExp(`${qt}=([^;]*)(;|$)`);function Ct(e,t){return $(async s=>{if(Fs.some(n=>s.path.startsWith(n)))return null;if(vs(s)){let n=s.path.split("?")[0]??"";return De(s,t).then(async r=>{if(X(s,r,t),r.ok){let o=n.split("/").at(-1)??"";if(t.localThemeFileSystem.files.has(`assets/${o}.liquid`)){let i=Z(await r.text(),t);return new Response(i,r)}}return r}).catch(async r=>{let{status:o,statusText:i,...a}=A(r,`Failed to proxy request to ${n}`);return o>=500&&!n.endsWith(".js.map")&&I(a),new Response(r.message,{status:o,statusText:i})})}})}function vs(e){if(e.method!=="GET"||e.path.match(Ts)||e.path.match(Ae)||e.path.match(jt)||e.path.match(Ss)||e.path.match(Rs))return!0;let[t]=e.path.split("?"),s=q(t),n=e.headers.get("accept")??"*/*";return s===".html"||n.includes("text/html")?!1:!!s||n!=="*/*"}function $s(e){let[t]=e.split("?");return!(xs.test(t)||Ae.test(t)||jt.test(t))}function me(e){return e.session.storeFqdn.replace(/\\/g,"\\\\").replace(/\./g,"\\.")}function bs(e){return ws.test(e.path)}function Z(e,t){let s=e,n=`(data-shs-beacon-endpoint=["'])https://${me(t)}${Ce}`,r=new RegExp(n,"g");s=s.replace(r,`$1${Ce}`);let o=new RegExp(`(https?:)?//${me(t)}${J}`,"g");s=s.replace(o,J);let i=/(?:https?:)?\/\/cdn\.shopify\.com\/(.*?\/(assets\/[^?#"'`>\s]+))/g,a=c=>c.startsWith("assets/"),p=new Set([...t.localThemeFileSystem.files.keys()].filter(a)),m=new Set([...t.localThemeExtensionFileSystem.files.keys()].filter(a));return s=s.replace(i,(c,l,u)=>{let f=u&&p.has(u),T=u&&m.has(u)&&l.startsWith("extensions/");return U(u).startsWith("image/")?c:T?`${z}${l}`:f?`${J}${l}`:c}),t.options.standardEventsDevBundle&&(s=_t(s)),s}function ks(e,t){let s=`http://${t.options.host}:${t.options.port}`,n=new RegExp(`data-base-url=["']((?:https?:)?//${me(t)})[^"']*?["']`,"g");return e.replace(n,(r,o)=>r.replace(o,s))}function Is(e,t){let s=new RegExp(`Domain=${me(t)};\\s*`,"gi");return e.map(n=>n.replace(s,""))}async function Q(e,t,s){let n=Ht(e,t);if(n.status>=300&&n.status<400)return n;t.headers.get("content-type")?.includes("application/json")||n.headers.set("content-type","text/html; charset=utf-8");let i=await n.text();return i=Z(i,e),i=ks(i,e),e.options.standardEventsInspector&&(i=pe(i)),s&&(i=s(i)??i),new Response(i,n)}var At=["connection","keep-alive","proxy-authenticate","proxy-authorization","te","trailer","transfer-encoding","upgrade","expect","content-security-policy","host"];function Ht(e,t){let s=new Response(t.body,t);s.headers.delete("content-length"),s.headers.delete("content-encoding");for(let i of At)s.headers.delete(i);s.headers.delete("access-control-allow-origin"),s.headers.delete("access-control-allow-credentials"),s.headers.delete("access-control-allow-methods"),s.headers.delete("access-control-allow-headers"),s.headers.delete("access-control-expose-headers"),s.headers.delete("access-control-max-age");let n=s.headers.get("Link");n&&s.headers.set("Link",Z(n,e));let r=s.headers.get("Location");if(r){let i=new URL(r,"https://shopify.dev");Ae.test(i.pathname)||(i.searchParams.delete("_fd"),i.searchParams.delete("pb"),s.headers.set("Location",i.href.replace(i.origin,"")))}let o=s.headers.getSetCookie();if(o?.length){s.headers.set("Set-Cookie",Is(o,e).join(","));let i=o.join(",").match(Ps)?.[1];i&&(e.session.sessionCookies[qt]=i)}return s}function He(e){let t=nt(e);for(let n of At)delete t[n];delete t["upgrade-insecure-requests"];let s=rt(e);return s&&(t["X-Forwarded-For"]=s),t}function De(e,t){let s=e.path.replace(new RegExp(z,"g"),"/"),n=e.path.startsWith(z)?"cdn.shopify.com":t.session.storeFqdn,r=new URL(s,`https://${n}`);if(r.hostname!==n)return Promise.reject(new Error(`Request failed: Hostname mismatch. Expected host: ${n}. Resulting URL hostname: ${r.hostname}`));let o=ot(e),i=He(e);return bs(e)||(/\/assets\/[^/]+\.(css|js)$/.test(r.pathname)&&/\?\d+$/.test(r.search)&&(r.search=`?v=${Date.now()}`),r.searchParams.set("_fd","0"),r.searchParams.set("pb","0"),i=ft({...i,...ht(),...n===t.session.storeFqdn?t.session.crawlerSignatureHeaders:{},referer:r.origin,Cookie:Et(t.session,{headers:i}),...t.type==="theme"&&$s(e.path)?{Authorization:`Bearer ${t.session.storefrontToken}`}:{}})),fetch(r,{method:e.method,body:o,duplex:o?"half":void 0,redirect:"manual",headers:i}).then(a=>Ht(t,a)).catch(a=>{throw ae(L(a),r)})}var Oe=0,_s=5;function Ot(e,t){return $(s=>{let[n="/",r=""]=s.path.split("?");return js(s)&&(t.lastRequestedPath=s.path),t.options.errorOverlay!=="silent"&&t.localThemeFileSystem.uploadErrors.size>0?Dt(t,{status:500,statusText:"Internal Server Error"},{title:"Failed to Upload Theme Files",header:"Upload Errors",errors:Array.from(t.localThemeFileSystem.uploadErrors.entries()).map(([i,a])=>({message:i,code:a.join(`
70
- `)}))}):ce(t.session,{method:s.method,path:n,query:[...new URLSearchParams(r)],themeId:String(e.id),sectionId:"",headers:He(s),replaceExtensionTemplates:fe(t),replaceTemplates:Ne(t,n,it(s,"localization")?.toLowerCase())}).then(async i=>{if(i.status>=400&&i.status<500&&!Ls(s)){let a=await qs(s,t,i);if(a)return X(s,a,t),a}return X(s,i,t),Q(t,i,a=>(Cs(i,a,String(e.id)),Oe=0,We(a,t)))}).catch(async i=>{if(i instanceof he&&(F(`Theme ID mismatch: expected ${i.getExpectedThemeId()} but got ${i.getActualThemeId()}; refreshing session...`),H("theme-service:error-page:theme-id-mismatch"),t.session.refresh)){Oe++,Oe>_s&&(tt(new se(i.getMessage())),process.exit(1)),await t.session.refresh();let f=new URLSearchParams(r),T=new URLSearchParams([...f].filter(([Pe])=>!Pe.startsWith("__sfr"))),v=n+(T.toString()?`?${T}`:"");return new Response(null,{status:302,headers:{Location:v}})}let{status:a,statusText:p,cause:m,...c}=A(i,"Failed to render storefront"),[l,...u]=c.headline.split(`
71
- `);return te(c),Dt(t,{status:a,statusText:p},{title:l,header:l,errors:[{message:[...u,m.message].join("<br>"),code:m.stack?.replace(`${m.message}
72
- `,"")??""}]})})})}function Dt(e,t,s){let n=We(bt(s),e);return e.options.standardEventsInspector&&(n=pe(n)),H("theme-service:error-page:rendered"),new Response(n,{...t,headers:t.headers??{"Content-Type":"text/html; charset=utf-8"}})}function Ls(e){let t=new URLSearchParams(e.path.split("?")[1]);return["section_id","sections","app_block_id"].some(s=>t.has(s))}function js(e){return e.headers.get("sec-fetch-mode")==="navigate"}async function qs(e,t,s){F(`Render failed for ${e.path} with ${s.status} (x-request-id: ${s.headers.get("x-request-id")}), trying proxy...`);let n=await De(e,t).catch(r=>new Response(null,A(r)));if(n.status<400)return F(`Proxy status: ${n.status}. Returning proxy response.`),t.options.standardEventsInspector&&(n.headers.get("content-type")??"").includes("text/html")?Q(t,n):n;F(`Proxy status: ${n.status}. Returning render error.`)}function Cs(e,t,s){let n=t.match(/Shopify\.theme\s*=\s*{[^}]+?"id":\s*"?(\d+)"?(}|,)/)?.[1];if(n&&n!==s)throw new he(s,n,e)}var he=class extends Error{response;expectedThemeId;actualThemeId;constructor(t,s,n){super([`Theme ID mismatch: expected ${t} but got ${s}.`,`Request ID: ${n.headers.get("x-request-id")}`,`URL: ${n.url}`,"This is likely related to an issue in upstream Shopify APIs.","Please try again in a few minutes and report this issue:","https://community.shopify.dev/c/shopify-cli-libraries/14"].join(`
73
- `)),this.response=n,this.expectedThemeId=t,this.actualThemeId=s}getMessage(){return this.message}getResponse(){return this.response}getExpectedThemeId(){return this.expectedThemeId}getActualThemeId(){return this.actualThemeId}};h();h();function ge(e,t){let s=new RegExp(`{%-?\\s*${t}\\s*-?%}`),n=new RegExp(`{%-?\\s*end${t}\\s*-?%}`),r=s.exec(e);if(!r)return;let o=r.index+r[0].length;n.lastIndex=o;let i=n.exec(e);if(!i)return;let a=i.index;return e.slice(o,a)}h();function ye(e){let{pathname:t,search:s,searchParams:n}=new URL(e.path,"http://e.c");return{pathname:t,search:s,searchParams:n}}var As={stylesheet:new Map,javascript:new Map};function Nt(e,t){return $(async s=>{if(s.method!=="GET")return;if(Ns(s,t))return Ws(s,t);let{file:n,fileKey:r,isUnsynced:o}=Os(s,t);if(!r)return;let i=U(r);if(i.startsWith("image/")&&s.path.includes("&")&&!o)return;if(ct(s,"X-Local-Asset","true"),!n){o&&N(s,O({statusCode:404,statusMessage:"Not found"}));return}let a=n.value?Buffer.from(Z(n.value,t)):Buffer.from(n.attachment??"","base64");return oe(s,{getContents:()=>a,getMeta:()=>({type:i,size:a.length,mtime:n.stats?.mtime})})})}var Hs=/^(?:\/cdn\/(?!extensions\/).*?)?\/assets\/([^?]+)/,Ds=/^(?:\/(?:ext\/)?cdn\/extensions\/.*?)?\/assets\/([^?]+)/;function Os(e,t){let s=(n,r)=>{let o=e.path.match(n)?.[1];if(o){let i=E("assets",o),a=r.files.get(i),p=r.unsyncedFileKeys.has(i);if(a||p)return{file:a,isUnsynced:p,fileKey:i}}};return s(Hs,t.localThemeFileSystem)??s(Ds,t.localThemeExtensionFileSystem)??{isUnsynced:!1,fileKey:void 0,file:void 0}}function Ns(e,t){return t.type==="theme"&&e.path.includes("/compiled_assets")}function Ws(e,t){switch(ye(e).pathname.split("/").at(-1)){case"styles.css":return Ms(t,e);case"block-scripts.js":return Me(t,e,"block");case"snippet-scripts.js":return Me(t,e,"snippet");case"scripts.js":return Me(t,e,"section");case void 0:break;default:break}}function Ms(e,t){let s=Ee(e,"section"),n=Ee(e,"block"),r=Ee(e,"snippet"),o=[`/*** GENERATED LOCALLY ***/
74
- `];for(let[,a]of[...s,...n,...r]){let p=Wt(a,"stylesheet");p&&o.push(p)}let i=o.join(`
69
+ </html>`}h();h();var ps=/<head(\s[^>]*)?>/i,qe="https://cdn.shopify.com/storefront",ms=`${qe}/standard-events.js`,hs=`${qe}/standard-events.dev.js`,kt=`${qe}/standard-events-inspector.js`,It="shopify-cli-standard-events-inspector",fs=new RegExp(`<script\\b[^>]*(?:\\bid=["']${je(It)}["']|\\bsrc=["']${je(kt)}["'])[^>]*>`,"i"),gs=new RegExp(je(ms),"g");function pe(e){return fs.test(e)?e:e.replace(ps,t=>`${t}<script id="${It}" src="${kt}" defer></script>`)}function _t(e){return e.replace(gs,hs)}function je(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}h();var Lt=80;function X(e,t,s){if(!ys(e)||s.type==="theme-extension")return;let n=e.path.length>Lt?`${e.path.substring(0,Lt)}...`:e.path,o=t.headers.get("server-timing")?.match(/cfRequestDuration;dur=([\d.]+)/)?.[1],i=o?`${Math.round(Number(o))}ms`:"",a=Es(t.status),u=e.method.padStart(6);re(ne`• ${ie.format(new Date)} Request ${j.raw("\xBB")} ${u} ${a(String(t.status))} ${n} ${j.gray(i)}`)}function ys(e){let t=[z,J,"/checkouts","/payments"],s=[".js",".css",".json",".map"];if(t.some(o=>e.path.startsWith(o)))return!1;let[n]=e.path.split("?"),r=q(n);return!s.includes(r)}function Es(e){return e<300?j.green:e<400?j.yellow:j.errorText}var J="/cdn/",z="/ext/cdn/",Ce="/api/collect",Ts=/^\/cart\//,xs=/^\/cart(\/|\.js|\.json|$)/,Ae=/^\/checkouts\/(?!internal\/)/,jt=/^\/account(\/login\/multipass(\/[^/]+)?|\/logout)?\/?$/,Ss=new RegExp(`^${J}`),Rs=new RegExp(`^${z}`),ws=/^\/api\/(unstable|\d{4}-\d{2})\/graphql\.json/,Fs=["/.well-known","/shopify/monorail","/mini-profiler-resources","/web-pixels-manager","/web-pixels@","/wpm","/services/",Ce,"/cdn-cgi/challenge-platform"],qt="_shopify_essential",Ps=new RegExp(`${qt}=([^;]*)(;|$)`);function Ct(e,t){return b(async s=>{if(Fs.some(n=>s.path.startsWith(n)))return null;if(vs(s)){let n=s.path.split("?")[0]??"";return Ne(s,t).then(async r=>{if(X(s,r,t),r.ok){let o=n.split("/").at(-1)??"";if(t.localThemeFileSystem.files.has(`assets/${o}.liquid`)){let i=Z(await r.text(),t);return new Response(i,r)}}return r}).catch(async r=>{let{status:o,statusText:i,...a}=A(r,`Failed to proxy request to ${n}`);return o>=500&&!n.endsWith(".js.map")&&I(a),new Response(r.message,{status:o,statusText:i})})}})}function vs(e){if(e.method!=="GET"||e.path.match(Ts)||e.path.match(Ae)||e.path.match(jt)||e.path.match(Ss)||e.path.match(Rs))return!0;let[t]=e.path.split("?"),s=q(t),n=e.headers.get("accept")??"*/*";return s===".html"||n.includes("text/html")?!1:!!s||n!=="*/*"}function $s(e){let[t]=e.split("?");return!(xs.test(t)||Ae.test(t)||jt.test(t))}function me(e){return e.session.storeFqdn.replace(/\\/g,"\\\\").replace(/\./g,"\\.")}function bs(e){return ws.test(e.path)}function Z(e,t){let s=e,n=`(data-shs-beacon-endpoint=["'])https://${me(t)}${Ce}`,r=new RegExp(n,"g");s=s.replace(r,`$1${Ce}`);let o=new RegExp(`(https?:)?//${me(t)}${J}`,"g");s=s.replace(o,J);let i=/(?:https?:)?\/\/cdn\.shopify\.com\/(.*?\/(assets\/[^?#"'`>\s]+))/g,a=c=>c.startsWith("assets/"),u=new Set([...t.localThemeFileSystem.files.keys()].filter(a)),p=new Set([...t.localThemeExtensionFileSystem.files.keys()].filter(a));return s=s.replace(i,(c,l,m)=>{let x=m&&u.has(m),f=m&&p.has(m)&&l.startsWith("extensions/");return U(m).startsWith("image/")?c:f?`${z}${l}`:x?`${J}${l}`:c}),t.options.standardEventsDevBundle&&(s=_t(s)),s}function ks(e,t){let s=`http://${t.options.host}:${t.options.port}`,n=new RegExp(`data-base-url=["']((?:https?:)?//${me(t)})[^"']*?["']`,"g");return e.replace(n,(r,o)=>r.replace(o,s))}function Is(e,t){let s=new RegExp(`Domain=${me(t)};\\s*`,"gi");return e.map(n=>n.replace(s,""))}async function Q(e,t,s){let n=Ht(e,t);if(n.status>=300&&n.status<400)return n;t.headers.get("content-type")?.includes("application/json")||n.headers.set("content-type","text/html; charset=utf-8");let i=await n.text();return i=Z(i,e),i=ks(i,e),e.options.standardEventsInspector&&(i=pe(i)),s&&(i=s(i)??i),new Response(i,n)}var At=["connection","keep-alive","proxy-authenticate","proxy-authorization","te","trailer","transfer-encoding","upgrade","expect","content-security-policy","host"];function Ht(e,t){let s=new Response(t.body,t);s.headers.delete("content-length"),s.headers.delete("content-encoding");for(let i of At)s.headers.delete(i);s.headers.delete("access-control-allow-origin"),s.headers.delete("access-control-allow-credentials"),s.headers.delete("access-control-allow-methods"),s.headers.delete("access-control-allow-headers"),s.headers.delete("access-control-expose-headers"),s.headers.delete("access-control-max-age");let n=s.headers.get("Link");n&&s.headers.set("Link",Z(n,e));let r=s.headers.get("Location");if(r){let i=new URL(r,"https://shopify.dev");Ae.test(i.pathname)||(i.searchParams.delete("_fd"),i.searchParams.delete("pb"),s.headers.set("Location",i.href.replace(i.origin,"")))}let o=s.headers.getSetCookie();if(o?.length){s.headers.set("Set-Cookie",Is(o,e).join(","));let i=o.join(",").match(Ps)?.[1];i&&(e.session.sessionCookies[qt]=i)}return s}function He(e){let t=nt(e);for(let n of At)delete t[n];delete t["upgrade-insecure-requests"];let s=rt(e);return s&&(t["X-Forwarded-For"]=s),t}function Ne(e,t){let s=e.path.replace(new RegExp(z,"g"),"/"),n=e.path.startsWith(z)?"cdn.shopify.com":t.session.storeFqdn,r=new URL(s,`https://${n}`);if(r.hostname!==n)return Promise.reject(new Error(`Request failed: Hostname mismatch. Expected host: ${n}. Resulting URL hostname: ${r.hostname}`));let o=ot(e),i=He(e);return bs(e)||(/\/assets\/[^/]+\.(css|js)$/.test(r.pathname)&&/\?\d+$/.test(r.search)&&(r.search=`?v=${Date.now()}`),r.searchParams.set("_fd","0"),r.searchParams.set("pb","0"),i=ft({...i,...ht(),...n===t.session.storeFqdn?t.session.crawlerSignatureHeaders:{},referer:r.origin,Cookie:Et(t.session,{headers:i}),...t.type==="theme"&&$s(e.path)?{Authorization:`Bearer ${t.session.storefrontToken}`}:{}})),fetch(r,{method:e.method,body:o,duplex:o?"half":void 0,redirect:"manual",headers:i}).then(a=>Ht(t,a)).catch(a=>{throw ae(L(a),r)})}var De=0,_s=5;function Dt(e,t){return b(s=>{let[n="/",r=""]=s.path.split("?");return js(s)&&(t.lastRequestedPath=s.path),t.options.errorOverlay!=="silent"&&t.localThemeFileSystem.uploadErrors.size>0?Nt(t,{status:500,statusText:"Internal Server Error"},{title:"Failed to Upload Theme Files",header:"Upload Errors",errors:Array.from(t.localThemeFileSystem.uploadErrors.entries()).map(([i,a])=>({message:i,code:a.join(`
70
+ `)}))}):ce(t.session,{method:s.method,path:n,query:[...new URLSearchParams(r)],themeId:String(e.id),sectionId:"",headers:He(s),replaceExtensionTemplates:fe(t),replaceTemplates:Oe(t,n,it(s,"localization")?.toLowerCase())}).then(async i=>{if(i.status>=400&&i.status<500&&!Ls(s)){let a=await qs(s,t,i);if(a)return X(s,a,t),a}return X(s,i,t),Q(t,i,a=>(Cs(i,a,String(e.id)),De=0,We(a,t)))}).catch(async i=>{if(i instanceof he&&(P(`Theme ID mismatch: expected ${i.getExpectedThemeId()} but got ${i.getActualThemeId()}; refreshing session...`),H("theme-service:error-page:theme-id-mismatch"),t.session.refresh)){De++,De>_s&&(tt(new se(i.getMessage())),process.exit(1)),await t.session.refresh();let x=new URLSearchParams(r),f=new URLSearchParams([...x].filter(([Pe])=>!Pe.startsWith("__sfr"))),g=n+(f.toString()?`?${f}`:"");return new Response(null,{status:302,headers:{Location:g}})}let{status:a,statusText:u,cause:p,...c}=A(i,"Failed to render storefront"),[l,...m]=c.headline.split(`
71
+ `);return te(c),Nt(t,{status:a,statusText:u},{title:l,header:l,errors:[{message:[...m,p.message].join("<br>"),code:p.stack?.replace(`${p.message}
72
+ `,"")??""}]})})})}function Nt(e,t,s){let n=We(bt(s),e);return e.options.standardEventsInspector&&(n=pe(n)),H("theme-service:error-page:rendered"),new Response(n,{...t,headers:t.headers??{"Content-Type":"text/html; charset=utf-8"}})}function Ls(e){let t=new URLSearchParams(e.path.split("?")[1]);return["section_id","sections","app_block_id"].some(s=>t.has(s))}function js(e){return e.headers.get("sec-fetch-mode")==="navigate"}async function qs(e,t,s){P(`Render failed for ${e.path} with ${s.status} (x-request-id: ${s.headers.get("x-request-id")}), trying proxy...`);let n=await Ne(e,t).catch(r=>new Response(null,A(r)));if(n.status<400)return P(`Proxy status: ${n.status}. Returning proxy response.`),t.options.standardEventsInspector&&(n.headers.get("content-type")??"").includes("text/html")?Q(t,n):n;P(`Proxy status: ${n.status}. Returning render error.`)}function Cs(e,t,s){let n=t.match(/Shopify\.theme\s*=\s*{[^}]+?"id":\s*"?(\d+)"?(}|,)/)?.[1];if(n&&n!==s)throw new he(s,n,e)}var he=class extends Error{response;expectedThemeId;actualThemeId;constructor(t,s,n){super([`Theme ID mismatch: expected ${t} but got ${s}.`,`Request ID: ${n.headers.get("x-request-id")}`,`URL: ${n.url}`,"This is likely related to an issue in upstream Shopify APIs.","Please try again in a few minutes and report this issue:","https://community.shopify.dev/c/shopify-cli-libraries/14"].join(`
73
+ `)),this.response=n,this.expectedThemeId=t,this.actualThemeId=s}getMessage(){return this.message}getResponse(){return this.response}getExpectedThemeId(){return this.expectedThemeId}getActualThemeId(){return this.actualThemeId}};h();h();function ge(e,t){let s=new RegExp(`{%-?\\s*${t}\\s*-?%}`),n=new RegExp(`{%-?\\s*end${t}\\s*-?%}`),r=s.exec(e);if(!r)return;let o=r.index+r[0].length;n.lastIndex=o;let i=n.exec(e);if(!i)return;let a=i.index;return e.slice(o,a)}h();function ye(e){let{pathname:t,search:s,searchParams:n}=new URL(e.path,"http://e.c");return{pathname:t,search:s,searchParams:n}}var As={stylesheet:new Map,javascript:new Map};function Ot(e,t){return b(async s=>{if(s.method!=="GET")return;if(Os(s,t))return Ws(s,t);let{file:n,fileKey:r,isUnsynced:o}=Ds(s,t);if(!r)return;let i=U(r);if(i.startsWith("image/")&&s.path.includes("&")&&!o)return;if(ct(s,"X-Local-Asset","true"),!n){o&&O(s,D({statusCode:404,statusMessage:"Not found"}));return}let a=n.value?Buffer.from(Z(n.value,t)):Buffer.from(n.attachment??"","base64");return oe(s,{getContents:()=>a,getMeta:()=>({type:i,size:a.length,mtime:n.stats?.mtime})})})}var Hs=/^(?:\/cdn\/(?!extensions\/).*?)?\/assets\/([^?]+)/,Ns=/^(?:\/(?:ext\/)?cdn\/extensions\/.*?)?\/assets\/([^?]+)/;function Ds(e,t){let s=(n,r)=>{let o=e.path.match(n)?.[1];if(o){let i=T("assets",o),a=r.files.get(i),u=r.unsyncedFileKeys.has(i);if(a||u)return{file:a,isUnsynced:u,fileKey:i}}};return s(Hs,t.localThemeFileSystem)??s(Ns,t.localThemeExtensionFileSystem)??{isUnsynced:!1,fileKey:void 0,file:void 0}}function Os(e,t){return t.type==="theme"&&e.path.includes("/compiled_assets")}function Ws(e,t){switch(ye(e).pathname.split("/").at(-1)){case"styles.css":return Ms(t,e);case"block-scripts.js":return Me(t,e,"block");case"snippet-scripts.js":return Me(t,e,"snippet");case"scripts.js":return Me(t,e,"section");case void 0:break;default:break}}function Ms(e,t){let s=Ee(e,"section"),n=Ee(e,"block"),r=Ee(e,"snippet"),o=[`/*** GENERATED LOCALLY ***/
74
+ `];for(let[,a]of[...s,...n,...r]){let u=Wt(a,"stylesheet");u&&o.push(u)}let i=o.join(`
75
75
  `);return oe(t,{getContents:()=>i,getMeta:()=>({type:"text/css",size:Buffer.byteLength(i),mtime:new Date})})}function Me(e,t,s){let n=Ee(e,s),r=`${s}s`,o=[`
76
76
  /*** GENERATED LOCALLY ***/
77
77
 
@@ -86,9 +86,9 @@ import{a as U,b as xt}from"./chunk-JLGA3B7P.js";import{a as ht,b as ft,f as Ie,g
86
86
  for (var i = 0; i < ${r}.length; i++) {
87
87
  __${r}__[${r}[i]] = true;
88
88
  }
89
- })();`];for(let[a,p]of n){let m=a.split("/").pop()?.replace(".liquid",""),c=Wt(p,"javascript")??"";m&&c&&o.push(`
89
+ })();`];for(let[a,u]of n){let p=a.split("/").pop()?.replace(".liquid",""),c=Wt(u,"javascript")??"";p&&c&&o.push(`
90
90
  (function () {
91
- if (!__${r}__["${m}"] && !Shopify.designMode) return;
91
+ if (!__${r}__["${p}"] && !Shopify.designMode) return;
92
92
  try {
93
93
  ${c}
94
94
  } catch (e) {
@@ -96,8 +96,8 @@ import{a as U,b as xt}from"./chunk-JLGA3B7P.js";import{a as ht,b as ft,f as Ie,g
96
96
  }
97
97
  })();`)}o.push("})();");let i=o.join(`
98
98
  `);return oe(t,{getContents:()=>i,getMeta:()=>({type:"text/javascript",size:Buffer.byteLength(i),mtime:new Date})})}function Ee(e,t){return[...e.localThemeFileSystem.files.entries()].filter(([s])=>s.endsWith(".liquid")&&s.startsWith(`${t}s/`)).sort(([s],[n])=>s.localeCompare(n))}function Wt(e,t){let s=As[t],n=s.get(e.key);if(n?.checksum===e.checksum)return n.content;if(s.delete(e.key),!e.value)return;let r=[`/* ${e.key} */`],o=ge(e.value??"",t)?.trimEnd();if(o&&r.push(o),r.length>1){let i=r.join(`
99
- `);return s.set(e.key,{checksum:e.checksum,content:i}),i}}h();import*as Mt from"node:os";function Us(e,t){let s=new Set,n=`:${t}`,r=e.toLowerCase().trim();if(s.add(`${r}${n}`),["localhost","127.0.0.1","::1","0.0.0.0"].includes(r)&&(s.add(`localhost${n}`),s.add(`127.0.0.1${n}`),s.add(`[::1]${n}`)),r==="0.0.0.0"||r==="::")for(let i of Object.values(Mt.networkInterfaces()))for(let a of i??[]){let p=a.address.toLowerCase().split("%")[0],c=a.family==="IPv6"?`[${p}]`:p;s.add(`${c}${n}`)}return s}function Bs(e){if(e)return e.toLowerCase().replace(/\.(?=:\d|$)/,"")}function Ut(e,t){let s=Us(e,t);return $(n=>{let r=n.node.req.headers.host,o=Bs(r);if(!o||!s.has(o))return N(n,O({statusCode:400,statusMessage:"Bad Request",message:"Invalid Host header"}))})}h();function Bt(){return Jt()}function Cr(){return Jt()}function Jt(){return{root:"",files:new Map,unsyncedFileKeys:new Set,uploadErrors:new Map,ready:()=>Promise.resolve(),delete:async e=>{},read:async e=>"",write:async e=>{},stat:async e=>({mtime:new Date,size:1}),addEventListener:()=>{},startWatcher:async()=>{}}}import{createServer as Js}from"node:http";async function Gr(e,t){let s=await Ys(e,t);return await Gs(e,s),zs(e,s)}function zs(e,t){let s=ut();s.use(Ut(t.options.host,t.options.port)),s.use(zt(e,t)),s.use(Nt(e,t)),s.use(Ct(e,t)),s.use(Ot(e,t));let n=Js(pt(s));return{dispatch:s.handler.bind(s),start:async()=>new Promise(r=>n.listen({port:t.options.port,host:t.options.host},()=>r({close:async()=>{await Promise.all([new Promise(o=>{n.closeAllConnections(),n.close(o)})])}})))}}async function Ys(e,t){let{adminSession:s,storefrontPassword:n,themeExtensionPort:r,themeExtensionDirectory:o,crawlerSignatureHeaders:i}=t,a="127.0.0.1",p=r??9293,m=Bt(),c=vt(o);return await c.ready(),{session:await Tt(e.id.toString(),s,void 0,n,i),localThemeFileSystem:m,localThemeExtensionFileSystem:c,directory:o,type:"theme-extension",lastRequestedPath:"",options:{themeEditorSync:!1,noDelete:!1,ignore:[],only:[],host:a,port:p,liveReload:"hot-reload",standardEventsDevBundle:!1,standardEventsInspector:!1,open:!1,errorOverlay:"default"}}}async function Gs(e,t){let s=t.localThemeExtensionFileSystem,n=({fileKey:r,onContent:o,onSync:i})=>{o(()=>{Te(e,t,i,{type:"update",key:r,payload:{isThemeExtension:!0}})})};return s.addEventListener("add",n),s.addEventListener("change",n),s.ready().then(async()=>s.startWatcher())}function fe(e){let t={},s=e.localThemeExtensionFileSystem;for(let n of s.unsyncedFileKeys){let r=s.files.get(n),o=r?.value??r?.attachment;o&&(t[n]=o)}return t}var Re=Ge(mt(),1);import Vs from"node:events";var Ue=new Map,K=new Map;function Yt(e,t){let s=(0,Re.parseJSON)(t,null,!0);if(!s)return;let n=s?.sections;n&&!e.startsWith("locales/")?K.set(e,Object.entries(n||{}).map(([r,{type:o}])=>[o,r])):K.delete(e)}function Be(e){return!e.startsWith("assets/")&&[".liquid",".json"].includes(q(e))}function Ne(e,t,s){let n={},r=/^templates\/.+\.json$/,o=t?`${E("templates",t.replace(/^\//,"").replace(/\.html$/,"")||"index")}.json`:"",i=!!t&&e.localThemeFileSystem.files.has(o),a=/^locales\/.+\.json$/,p=!!s&&(e.localThemeFileSystem.files.has(`locales/${s}.json`)||e.localThemeFileSystem.files.has(`locales/${s}.default.json`));for(let m of e.localThemeFileSystem.unsyncedFileKeys)if(Be(m)){if(i&&r.test(m)){if(m!==o)continue}else if(a.test(m)){if(p){if(!m.startsWith(`locales/${s}.`))continue}else if(!m.includes(".default."))continue}n[m]=e.localThemeFileSystem.files.get(m)?.value??""}return n}function uo(e,t){let s=({fileKey:r,onContent:o,onSync:i})=>{let a=q(r);o(p=>{!en(r)&&Be(r)&&a===".json"&&Yt(r,p),Te(e,t,i,{type:"update",key:r,payload:Qs(r,t)})})},n=({fileKey:r,onSync:o})=>{K.delete(r),Te(e,t,o,{type:"delete",key:r})};return t.localThemeFileSystem.addEventListener("add",s),t.localThemeFileSystem.addEventListener("change",s),t.localThemeFileSystem.addEventListener("unlink",n),t.localThemeFileSystem.ready().then(async()=>{let r=[...t.localThemeFileSystem.files];return Promise.allSettled(r.map(async([o,i])=>{if(o.endsWith(".json")){let a=i.value??await t.localThemeFileSystem.read(o);a&&typeof a=="string"&&Yt(o,a)}else o.endsWith(".liquid")&&Zt(i)}))})}var Xs="1",Vt=new Vs;function Se(e){Vt.emit("hot-reload",{...e,version:Xs})}function zt(e,t){return $(s=>{let n=s.headers.get("accept")==="text/event-stream",r=ye(s).searchParams;if(n){let o=dt(s);return Vt.on("hot-reload",i=>{o.push(JSON.stringify(i)).catch(a=>{I({headline:"Failed to send HotReload event.",body:a.stack})})}),Se({type:"open",pid:String(process.pid),themeId:String(e.id)}),o.send().then(()=>o.flush())}if(r.has("hr-log")){let o=(0,Re.parseJSON)(r.get("hr-log")??"",null);return o&&(o.headline=`[HotReload] ${o.headline}`,o.type==="error"?te(o):o.type==="warn"?I(o):o.type==="info"?et(o):I({headline:`Unknown HotReload log type: ${o.type}`})),null}if(s.path===Xt)return k(we()).then(o=>at(s,o,"application/javascript")).catch(o=>N(s,O({cause:o})));if(r.has("section_id")||r.has("app_block_id")){let o=r.get("section_key")??"",i=r.get("section_id")??"",a=r.get("app_block_id")??"",p=s.path.split("?")[0]??"",m=new URLSearchParams(r);if(m.delete("section_key"),m.delete("section_id"),m.delete("app_block_id"),m.delete("_fd"),m.delete("pb"),i===""&&a==="")return;let c={};if(i){let l=t.localThemeFileSystem.unsyncedFileKeys;if(l.has(o)){let u=t.localThemeFileSystem.files.get(o)?.value;if(!u)return"";c[o]=u}for(let u of l)if(u.endsWith(".json")){for(let[f,T]of K.get(u)??[])if(i.endsWith(`__${T}`)){let v=t.localThemeFileSystem.files.get(u)?.value;v&&(c[u]=v);continue}}}return ce(t.session,{method:s.method,path:p??"/",query:[...m.entries()],themeId:String(e.id),sectionId:i,appBlockId:a,replaceTemplates:c,headers:lt(s),replaceExtensionTemplates:fe(t)}).then(async l=>{if(!l.ok)throw H("theme-service:hot-reload:section:render-failed"),ae(l);return Q(t,l)}).catch(async l=>{let{status:u,statusText:f,...T}=A(L(l),"Failed to render section on Hot Reload");return H("theme-service:hot-reload:section:render-error"),a||I(T),new Response(null,{status:u,statusText:f})})}})}var ee=(e,t)=>Se({themeId:String(e),type:"full",key:t});function Te(e,t,s,n){let r=()=>ee(e.id,n.key);if(t.options.liveReload==="off")return;if(t.options.liveReload==="full-page"){s(r);return}let o=String(e.id);Se({sync:"local",themeId:o,...n}),s(()=>Se({sync:"remote",themeId:o,...n}),r)}function Zs(e,t){let s=new Set;if(e.endsWith(".json")){let n=t.localThemeFileSystem.files.get(e)?.value;if(n){let r=(0,Re.parseJSON)(n,null,!0)?.sections;for(let o of Object.keys(r??{}))s.add(o)}}else{let n=e.match(/^sections\/(.+)\.liquid$/)?.[1];if(n)for(let[r,o]of K)for(let[i,a]of o)i===n&&s.add(a)}return[...s]}function Qs(e,t){let[s]=e.split("/"),n=t.localThemeFileSystem.files.get(e);return{sectionNames:s==="sections"?Zs(e,t):[],replaceTemplates:Be(e)?Ne(t):{},updatedFileParts:n&&Zt(n)}}var xe="hot-reload-client",Ks="/cdn/shopifycloud/theme-hot-reload/theme-hot-reload.js",Gt=new RegExp(`<script id="${xe}"[^>]*>[^<]*</script>`),Xt="/@shopify/theme-hot-reload";function We(e,t){return t.options.liveReload==="off"?e.replace(Gt,""):process.env.SHOPIFY_CLI_LOCAL_HOT_RELOAD?e.replace(Gt,"").replace(/<\/head>/,`<script id="${xe}" src="${Xt}" defer></script></head>`):e.includes(`<script id="${xe}"`)?e:e.replace(/<\/head>/,`<script id="${xe}" src="${Ks}" defer></script></head>`)}function en(e){return e.startsWith("assets/")}function Zt(e){if(!(["sections/","snippets/","blocks/"].some(c=>e.key.startsWith(c))&&e.key.endsWith(".liquid")))return;let n={stylesheetTag:!1,javascriptTag:!1,schemaTag:!1,liquid:!1},r={checksum:e.checksum,liquid:"",stylesheetTag:"",javascriptTag:"",schemaTag:""},o=Ue.get(e.key);if(o?.checksum===e.checksum||(Ue.delete(e.key),!e.value))return n;let i=["stylesheet","javascript","schema"],a=c=>c?.replace(/\s+/g," ").trim(),p=e.value,m=(c,l)=>{p=p.replace(l,"");let u=a(l),f=`${c}Tag`;n[f]=!o||u!==o[f],r[f]=u};for(let c of i){let l=ge(e.value??"",c);l&&m(c,l)}return p=a(p.replace(/<!--[\s\S]*?-->/g,"").replace(/{%\s*comment\s*%}[\s\S]*?{%\s*endcomment\s*%}/g,"").replace(/{%\s*doc\s*%}[\s\S]*?{%\s*enddoc\s*%}/g,"")),r.liquid=p,n.liquid=!o||p!==o.liquid,Ue.set(e.key,r),n}h();var Qt=Ge(mt(),1);function tn(e){return(e.startsWith("templates/")||e.startsWith("sections/"))&&e.endsWith(".json")}async function Kt(e,t,s){if(tn(s)){let n=E(e,"listings",t,s);if(await P(n))return n}}async function es(e,t){let s=E(e,"config","settings_data.json"),n=await k(s,{encoding:"utf8"}),r=(0,Qt.parseJSON)(n,null,!0);return r?(r.current=$e(t),JSON.stringify(r,null,2)):n}async function Eo(e,t){let s=E(e,"listings"),n=E(s,t);if(await P(n))return;let o=[];await P(s)&&(o=await C("*",{cwd:s,onlyDirectories:!0,deep:1}));let i=o.length>0?`Available presets: ${o.map(a=>`"${$e(a)}"`).join(", ")}`:'No presets found under "listings/"';throw new se(`Listing preset "${t}" was not found. ${i}.`,`Add the preset to config/settings_data.json and its corresponding "listings/${t}" folder, or remove the --listing flag to use the default theme settings.`)}import sn from"node:events";import{fileURLToPath as nn}from"node:url";var rn=250,ts=["assets/**/*.*","config/**/*.json","layout/**/*.liquid","locales/**/*.json","sections/**/*.{liquid,json}","blocks/**/*.liquid","snippets/**/*.liquid","templates/**/*.{liquid,json}","templates/customers/**/*.{liquid,json}"],b={layoutLiquidRegex:/^layout\/.+\.liquid$/,sectionLiquidRegex:/^sections\/.+\.liquid$/,blockLiquidRegex:/^blocks\/.+\.liquid$/,configSchemaRegex:/^config\/settings_schema\.json$/,configDataRegex:/^config\/settings_data\.json$/,sectionJsonRegex:/^sections\/.+\.json$/,templateJsonRegex:/^templates\/.+\.json$/,jsonRegex:/^(?!config\/).*\.json$/,contextualizedJsonRegex:/\.context\.[^.]+\.json$/i,staticAssetRegex:/^assets\/(?!.*\.liquid$)/};function Ho(e,t){let s=new Map,n=new Map,r=new Set,o={ignoreFromFile:[],ignore:t?.filters?.ignore??[],only:t?.filters?.only??[]},i=new sn,a=(d,g)=>{i.emit(d,g)},p=t?.notify?new le(t.notify):void 0,m=async d=>{let g=t?.listing?await an(e,d,t.listing):await ue(e,d),y=de(d,g);return s.set(d,M({key:d,checksum:y,value:typeof g=="string"?g:"",attachment:Buffer.isBuffer(g)?g.toString("base64"):""})),g},c=C(ts,{cwd:e,deep:3,ignore:W}).then(d=>Promise.all([wt(e),...d.map(m)])).then(([d])=>{Array.isArray(d)&&o.ignoreFromFile.push(...d)}),l=d=>V(e,d),u=d=>Le([{key:d}],o).length===0;function f(d,g,y,x){if(process.env.SHOPIFY_CLI_LOCAL_HOT_RELOAD&&x===we()){ee(g,x);return}let R=l(x);if(t?.listing&&R.startsWith(`listings/${t.listing}/`)){let S=R.replace(`listings/${t.listing}/`,"");if(S.startsWith("templates/")||S.startsWith("sections/"))R=S;else return}T(R).then(()=>{switch(d){case"add":case"change":return v(d,g,y,R);case"unlink":return Pe(g,y,R,n)}}).catch(S=>{D(`Error handling file event for ${R}: ${S}`)})}function T(d){return p?.notify(d)??Promise.resolve()}let v=(d,g,y,x)=>{if(u(x))return;let R=s.get(x)?.checksum,S=m(x).then(async()=>{let w=s.get(x);if(w)return w.checksum!==R&&r.add(x),{value:w.value||void 0,attachment:w.attachment}}),_=S.then(w=>{if(w)return on(r,n,x,g,y)(w)}).catch(Ie(x,"upload"));a(d,{fileKey:x,onContent:w=>{S.then(Y=>{r.has(x)&&w(Y?.value??Y?.attachment??"")}).catch(()=>{})},onSync:(w,Y)=>{_.then(G=>{G?w():Y?.()}).catch(()=>{})}})},Pe=(d,g,y,x)=>{if(u(y))return;x.delete(y),s.delete(y),r.add(y);let R=t?.noDelete?Promise.resolve():gt(Number(d),[y],g).then(async S=>{if(!S[0]?.success)throw new Error(`Failed to delete file "${y}" from remote theme.`);return r.delete(y),ss("delete",y),!0}).catch(S=>(Ie(y,"delete")(S),!1));a("unlink",{fileKey:y,onSync:S=>{R.then(_=>{_&&S()}).catch(()=>{})}})},ve=new Set(ts.map(d=>E(e,d.split("/").shift()??"")));return t?.listing&&ve.add(E(e,"listings",t.listing)),process.env.SHOPIFY_CLI_LOCAL_HOT_RELOAD&&ve.add(we()),{root:e,files:s,unsyncedFileKeys:r,uploadErrors:n,ready:()=>c,delete:async d=>{s.delete(d),await cn(e,d)},write:async d=>{let g=(d.key.startsWith("templates/")||d.key.startsWith("sections/"))&&d.key.endsWith(".json");if(t?.listing&&g){let y=E("listings",t.listing,d.key),x=E(e,y),R=await P(x);s.set(d.key,M({key:d.key,checksum:d.checksum,value:d.value??"",attachment:d.attachment??""})),R?await Je(e,{...d,key:y}):await Je(e,d);return}s.set(d.key,M({key:d.key,checksum:d.checksum,value:d.value??"",attachment:d.attachment??""})),await Je(e,d)},read:m,applyIgnoreFilters:d=>Le(d,o),addEventListener:(d,g)=>{i.on(d,g)},startWatcher:async(d,g)=>{let{default:y}=await import("./chokidar-5RWEYTNQ.js"),x=y.watch([...ve],{ignored:W,persistent:!process.env.SHOPIFY_UNIT_TEST,ignoreInitial:!0}),R=new Map,S=(_,w)=>{let G=`${l(w)}:${_}`,Ye=R.get(G);Ye&&clearTimeout(Ye);let ns=setTimeout(()=>{R.delete(G),f(_,d,g,w)},rn);R.set(G,ns)};x.on("add",S.bind(null,"add")).on("change",S.bind(null,"change")).on("unlink",S.bind(null,"unlink")).on("error",_=>{D(`File watcher error: ${_}`),L("theme-service:file-watcher:error")})}}}function on(e,t,s,n,r){return async o=>{if(!e.has(s))return!1;let[i]=await yt(Number(n),[{key:s,...o}],r);if(!i?.success){let a=i?.errors?.asset??["Response was not successful."];throw t.set(s,a),ee(n,s),new Error(a.join(`
100
- `))}return t.delete(s)&&ee(n,s),e.delete(s),ss("update",s),!0}}async function Je(e,{key:t,attachment:s,value:n}){let r=E(e,t);if(await ln(r),s){let o=Buffer.from(s,"base64");await be(r,o,{encoding:"base64"})}else await be(r,n??"")}async function ue(e,t){let s=Fe(t)?{encoding:"utf8"}:{},n=E(e,t);if(!await P(n)){F(`File ${n} can't be read because it doesn't exist...`);return}return k(n,s)}async function an(e,t,s){if(t==="config/settings_data.json")return es(e,s);let n=await Kt(e,s,t);if(n){let r=Fe(t)?{encoding:"utf8"}:{};return k(n,r)}return ue(e,t)}async function cn(e,t){let s=E(e,t);if(!await P(s)){F(`File ${s} can't be removed because it doesn't exist...`);return}await Qe(s)}function Do(e){let t=[],s=[],n=[],r=[],o=[],i=[],a=[],p=[],m=[],c=[],l=[];return e.forEach(u=>{let f=u.key;f.endsWith(".liquid")?b.sectionLiquidRegex.test(f)?t.push(u):b.blockLiquidRegex.test(f)?c.push(u):b.layoutLiquidRegex.test(f)?l.push(u):s.push(u):b.configSchemaRegex.test(f)?a.push(u):b.configDataRegex.test(f)?p.push(u):b.jsonRegex.test(f)?b.contextualizedJsonRegex.test(f)?i.push(u):b.sectionJsonRegex.test(f)?n.push(u):b.templateJsonRegex.test(f)?r.push(u):o.push(u):b.staticAssetRegex.test(f)&&m.push(u)}),{sectionLiquidFiles:t,otherLiquidFiles:s,sectionJsonFiles:n,templateJsonFiles:r,contextualizedJsonFiles:i,otherJsonFiles:o,configSchemaFile:a,configDataFile:p,staticAssetFiles:m,blockLiquidFiles:c,layoutFiles:l}}function Fe(e){return xt({liquid:"application/liquid",sass:"text/x-sass",scss:"text/x-scss"}),["application/javascript","application/json","application/liquid","text/css","text/x-sass","text/x-scss","image/svg+xml"].includes(U(e))}async function Oo(e){let t=new Set(await C("*",{cwd:e,deep:1,onlyDirectories:!0}));return["config","layout","templates"].every(n=>t.has(n))}async function ln(e){let t=dn(e);await P(t)||await Ze(t)}function dn(e){let t=Ve(e),s=e.lastIndexOf(t);return e.substring(0,s)}function ss(e,t){re(ne`• ${ie.format(new Date)} Synced ${j.raw("\xBB")} ${e} ${t}`)}function we(){let e=process.env.SHOPIFY_CLI_LOCAL_HOT_RELOAD;return!e||e==="true"?E(nn(import.meta.url.split("/cli/")[0]??""),"theme-hot-reload/dist/theme-hot-reload.js"):e}function de(e,t){return t?Buffer.isBuffer(t)?ze(t):hn(e)?un(t):pn(e,t):""}function un(e){let t=e;return t=t.replace(/\r\n/g,`
99
+ `);return s.set(e.key,{checksum:e.checksum,content:i}),i}}h();import*as Mt from"node:os";function Us(e,t){let s=new Set,n=`:${t}`,r=e.toLowerCase().trim();if(s.add(`${r}${n}`),["localhost","127.0.0.1","::1","0.0.0.0"].includes(r)&&(s.add(`localhost${n}`),s.add(`127.0.0.1${n}`),s.add(`[::1]${n}`)),r==="0.0.0.0"||r==="::")for(let i of Object.values(Mt.networkInterfaces()))for(let a of i??[]){let u=a.address.toLowerCase().split("%")[0],c=a.family==="IPv6"?`[${u}]`:u;s.add(`${c}${n}`)}return s}function Bs(e){if(e)return e.toLowerCase().replace(/\.(?=:\d|$)/,"")}function Ut(e,t){let s=Us(e,t);return b(n=>{let r=n.node.req.headers.host,o=Bs(r);if(!o||!s.has(o))return O(n,D({statusCode:400,statusMessage:"Bad Request",message:"Invalid Host header"}))})}h();function Bt(){return Jt()}function Cr(){return Jt()}function Jt(){return{root:"",files:new Map,unsyncedFileKeys:new Set,uploadErrors:new Map,ready:()=>Promise.resolve(),delete:async e=>{},read:async e=>"",write:async e=>{},stat:async e=>({mtime:new Date,size:1}),addEventListener:()=>{},startWatcher:async()=>{}}}import{createServer as Js}from"node:http";async function Yr(e,t){let s=await Gs(e,t);return await Ys(e,s),zs(e,s)}function zs(e,t){let s=ut();s.use(Ut(t.options.host,t.options.port)),s.use(zt(e,t)),s.use(Ot(e,t)),s.use(Ct(e,t)),s.use(Dt(e,t));let n=Js(pt(s));return{dispatch:s.handler.bind(s),start:async()=>new Promise(r=>n.listen({port:t.options.port,host:t.options.host},()=>r({close:async()=>{await Promise.all([new Promise(o=>{n.closeAllConnections(),n.close(o)})])}})))}}async function Gs(e,t){let{adminSession:s,storefrontPassword:n,themeExtensionPort:r,themeExtensionDirectory:o,crawlerSignatureHeaders:i}=t,a="127.0.0.1",u=r??9293,p=Bt(),c=vt(o);return await c.ready(),{session:await Tt(e.id.toString(),s,void 0,n,i),localThemeFileSystem:p,localThemeExtensionFileSystem:c,directory:o,type:"theme-extension",lastRequestedPath:"",options:{themeEditorSync:!1,noDelete:!1,ignore:[],only:[],host:a,port:u,liveReload:"hot-reload",standardEventsDevBundle:!1,standardEventsInspector:!1,open:!1,errorOverlay:"default"}}}async function Ys(e,t){let s=t.localThemeExtensionFileSystem,n=({fileKey:r,onContent:o,onSync:i})=>{o(()=>{Te(e,t,i,{type:"update",key:r,payload:{isThemeExtension:!0}})})};return s.addEventListener("add",n),s.addEventListener("change",n),s.ready().then(async()=>s.startWatcher())}function fe(e){let t={},s=e.localThemeExtensionFileSystem;for(let n of s.unsyncedFileKeys){let r=s.files.get(n),o=r?.value??r?.attachment;o&&(t[n]=o)}return t}var Re=Ye(mt(),1);import Vs from"node:events";var Ue=new Map,K=new Map;function Gt(e,t){let s=(0,Re.parseJSON)(t,null,!0);if(!s)return;let n=s?.sections;n&&!e.startsWith("locales/")?K.set(e,Object.entries(n||{}).map(([r,{type:o}])=>[o,r])):K.delete(e)}function Be(e){return!e.startsWith("assets/")&&[".liquid",".json"].includes(q(e))}function Oe(e,t,s){let n={},r=/^templates\/.+\.json$/,o=t?`${T("templates",t.replace(/^\//,"").replace(/\.html$/,"")||"index")}.json`:"",i=!!t&&e.localThemeFileSystem.files.has(o),a=/^locales\/.+\.json$/,u=!!s&&(e.localThemeFileSystem.files.has(`locales/${s}.json`)||e.localThemeFileSystem.files.has(`locales/${s}.default.json`));for(let p of e.localThemeFileSystem.unsyncedFileKeys)if(Be(p)){if(i&&r.test(p)){if(p!==o)continue}else if(a.test(p)){if(u){if(!p.startsWith(`locales/${s}.`))continue}else if(!p.includes(".default."))continue}n[p]=e.localThemeFileSystem.files.get(p)?.value??""}return n}function uo(e,t){let s=({fileKey:r,onContent:o,onSync:i})=>{let a=q(r);o(u=>{!en(r)&&Be(r)&&a===".json"&&Gt(r,u),Te(e,t,i,{type:"update",key:r,payload:Qs(r,t)})})},n=({fileKey:r,onSync:o})=>{K.delete(r),Te(e,t,o,{type:"delete",key:r})};return t.localThemeFileSystem.addEventListener("add",s),t.localThemeFileSystem.addEventListener("change",s),t.localThemeFileSystem.addEventListener("unlink",n),t.localThemeFileSystem.ready().then(async()=>{let r=[...t.localThemeFileSystem.files];return Promise.allSettled(r.map(async([o,i])=>{if(o.endsWith(".json")){let a=i.value??await t.localThemeFileSystem.read(o);a&&typeof a=="string"&&Gt(o,a)}else o.endsWith(".liquid")&&Zt(i)}))})}var Xs="1",Vt=new Vs;function Se(e){Vt.emit("hot-reload",{...e,version:Xs})}function zt(e,t){return b(s=>{let n=s.headers.get("accept")==="text/event-stream",r=ye(s).searchParams;if(n){let o=dt(s);return Vt.on("hot-reload",i=>{o.push(JSON.stringify(i)).catch(a=>{I({headline:"Failed to send HotReload event.",body:a.stack})})}),Se({type:"open",pid:String(process.pid),themeId:String(e.id)}),o.send().then(()=>o.flush())}if(r.has("hr-log")){let o=(0,Re.parseJSON)(r.get("hr-log")??"",null);return o&&(o.headline=`[HotReload] ${o.headline}`,o.type==="error"?te(o):o.type==="warn"?I(o):o.type==="info"?et(o):I({headline:`Unknown HotReload log type: ${o.type}`})),null}if(s.path===Xt)return k(we()).then(o=>at(s,o,"application/javascript")).catch(o=>O(s,D({cause:o})));if(r.has("section_id")||r.has("app_block_id")){let o=r.get("section_key")??"",i=r.get("section_id")??"",a=r.get("app_block_id")??"",u=s.path.split("?")[0]??"",p=new URLSearchParams(r);if(p.delete("section_key"),p.delete("section_id"),p.delete("app_block_id"),p.delete("_fd"),p.delete("pb"),i===""&&a==="")return;let c={};if(i){let l=t.localThemeFileSystem.unsyncedFileKeys;if(l.has(o)){let m=t.localThemeFileSystem.files.get(o)?.value;if(!m)return"";c[o]=m}for(let m of l)if(m.endsWith(".json")){for(let[x,f]of K.get(m)??[])if(i.endsWith(`__${f}`)){let g=t.localThemeFileSystem.files.get(m)?.value;g&&(c[m]=g);continue}}}return ce(t.session,{method:s.method,path:u??"/",query:[...p.entries()],themeId:String(e.id),sectionId:i,appBlockId:a,replaceTemplates:c,headers:lt(s),replaceExtensionTemplates:fe(t)}).then(async l=>{if(!l.ok)throw H("theme-service:hot-reload:section:render-failed"),ae(l);return Q(t,l)}).catch(async l=>{let{status:m,statusText:x,...f}=A(L(l),"Failed to render section on Hot Reload");return H("theme-service:hot-reload:section:render-error"),a||I(f),new Response(null,{status:m,statusText:x})})}})}var ee=(e,t)=>Se({themeId:String(e),type:"full",key:t});function Te(e,t,s,n){let r=()=>ee(e.id,n.key);if(t.options.liveReload==="off")return;if(t.options.liveReload==="full-page"){s(r);return}let o=String(e.id);Se({sync:"local",themeId:o,...n}),s(()=>Se({sync:"remote",themeId:o,...n}),r)}function Zs(e,t){let s=new Set;if(e.endsWith(".json")){let n=t.localThemeFileSystem.files.get(e)?.value;if(n){let r=(0,Re.parseJSON)(n,null,!0)?.sections;for(let o of Object.keys(r??{}))s.add(o)}}else{let n=e.match(/^sections\/(.+)\.liquid$/)?.[1];if(n)for(let[r,o]of K)for(let[i,a]of o)i===n&&s.add(a)}return[...s]}function Qs(e,t){let[s]=e.split("/"),n=t.localThemeFileSystem.files.get(e);return{sectionNames:s==="sections"?Zs(e,t):[],replaceTemplates:Be(e)?Oe(t):{},updatedFileParts:n&&Zt(n)}}var xe="hot-reload-client",Ks="/cdn/shopifycloud/theme-hot-reload/theme-hot-reload.js",Yt=new RegExp(`<script id="${xe}"[^>]*>[^<]*</script>`),Xt="/@shopify/theme-hot-reload";function We(e,t){return t.options.liveReload==="off"?e.replace(Yt,""):process.env.SHOPIFY_CLI_LOCAL_HOT_RELOAD?e.replace(Yt,"").replace(/<\/head>/,`<script id="${xe}" src="${Xt}" defer></script></head>`):e.includes(`<script id="${xe}"`)?e:e.replace(/<\/head>/,`<script id="${xe}" src="${Ks}" defer></script></head>`)}function en(e){return e.startsWith("assets/")}function Zt(e){if(!(["sections/","snippets/","blocks/"].some(c=>e.key.startsWith(c))&&e.key.endsWith(".liquid")))return;let n={stylesheetTag:!1,javascriptTag:!1,schemaTag:!1,liquid:!1},r={checksum:e.checksum,liquid:"",stylesheetTag:"",javascriptTag:"",schemaTag:""},o=Ue.get(e.key);if(o?.checksum===e.checksum||(Ue.delete(e.key),!e.value))return n;let i=["stylesheet","javascript","schema"],a=c=>c?.replace(/\s+/g," ").trim(),u=e.value,p=(c,l)=>{u=u.replace(l,"");let m=a(l),x=`${c}Tag`;n[x]=!o||m!==o[x],r[x]=m};for(let c of i){let l=ge(e.value??"",c);l&&p(c,l)}return u=a(u.replace(/<!--[\s\S]*?-->/g,"").replace(/{%\s*comment\s*%}[\s\S]*?{%\s*endcomment\s*%}/g,"").replace(/{%\s*doc\s*%}[\s\S]*?{%\s*enddoc\s*%}/g,"")),r.liquid=u,n.liquid=!o||u!==o.liquid,Ue.set(e.key,r),n}h();var Qt=Ye(mt(),1);function tn(e){return(e.startsWith("templates/")||e.startsWith("sections/"))&&e.endsWith(".json")}async function Kt(e,t,s){if(tn(s)){let n=T(e,"listings",t,s);if(await $(n))return n}}async function es(e,t){let s=T(e,"config","settings_data.json"),n=await k(s,{encoding:"utf8"}),r=(0,Qt.parseJSON)(n,null,!0);return r?(r.current=$e(t),JSON.stringify(r,null,2)):n}async function Eo(e,t){let s=T(e,"listings"),n=T(s,t);if(await $(n))return;let o=[];await $(s)&&(o=await C("*",{cwd:s,onlyDirectories:!0,deep:1}));let i=o.length>0?`Available presets: ${o.map(a=>`"${$e(a)}"`).join(", ")}`:'No presets found under "listings/"';throw new se(`Listing preset "${t}" was not found. ${i}.`,`Add the preset to config/settings_data.json and its corresponding "listings/${t}" folder, or remove the --listing flag to use the default theme settings.`)}import sn from"node:events";import{fileURLToPath as nn}from"node:url";var rn=250,ts=["AGENTS.md","DESIGN.md","assets/**/*.*","config/**/*.json","config/styles.css","layout/**/*.liquid","locales/**/*.json","sections/**/*.{liquid,json}","blocks/**/*.liquid","snippets/**/*.liquid","templates/**/*.{liquid,json}","templates/customers/**/*.{liquid,json}"],v={documentationFilesRegex:/^(AGENTS|DESIGN)\.md$/,layoutLiquidRegex:/^layout\/.+\.liquid$/,sectionLiquidRegex:/^sections\/.+\.liquid$/,blockLiquidRegex:/^blocks\/.+\.liquid$/,configSchemaRegex:/^config\/settings_schema\.json$/,configDataRegex:/^config\/settings_data\.json$/,configStylesheetRegex:/^config\/styles\.css$/,sectionJsonRegex:/^sections\/.+\.json$/,templateJsonRegex:/^templates\/.+\.json$/,jsonRegex:/^(?!config\/).*\.json$/,contextualizedJsonRegex:/\.context\.[^.]+\.json$/i,staticAssetRegex:/^assets\/(?!.*\.liquid$)/};function Ho(e,t){let s=new Map,n=new Map,r=new Set,o={ignoreFromFile:[],ignore:t?.filters?.ignore??[],only:t?.filters?.only??[]},i=new sn,a=(d,y)=>{i.emit(d,y)},u=t?.notify?new le(t.notify):void 0,p=async d=>{let y=t?.listing?await an(e,d,t.listing):await ue(e,d),E=de(d,y);return s.set(d,M({key:d,checksum:E,value:typeof y=="string"?y:"",attachment:Buffer.isBuffer(y)?y.toString("base64"):""})),y},c=C(ts,{cwd:e,deep:3,ignore:W}).then(d=>Promise.all([wt(e),...d.map(p)])).then(([d])=>{Array.isArray(d)&&o.ignoreFromFile.push(...d)}),l=d=>V(e,d),m=d=>Le([{key:d}],o).length===0;function x(d,y,E,S){if(process.env.SHOPIFY_CLI_LOCAL_HOT_RELOAD&&S===we()){ee(y,S);return}let w=l(S);if(t?.listing&&w.startsWith(`listings/${t.listing}/`)){let R=w.replace(`listings/${t.listing}/`,"");if(R.startsWith("templates/")||R.startsWith("sections/"))w=R;else return}f(w).then(()=>{switch(d){case"add":case"change":return g(d,y,E,w);case"unlink":return Pe(y,E,w,n)}}).catch(R=>{N(`Error handling file event for ${w}: ${R}`)})}function f(d){return u?.notify(d)??Promise.resolve()}let g=(d,y,E,S)=>{if(m(S))return;let w=s.get(S)?.checksum,R=p(S).then(async()=>{let F=s.get(S);if(F)return F.checksum!==w&&r.add(S),{value:F.value||void 0,attachment:F.attachment}}),_=R.then(F=>{if(F)return on(r,n,S,y,E)(F)}).catch(Ie(S,"upload"));a(d,{fileKey:S,onContent:F=>{R.then(G=>{r.has(S)&&F(G?.value??G?.attachment??"")}).catch(()=>{})},onSync:(F,G)=>{_.then(Y=>{Y?F():G?.()}).catch(()=>{})}})},Pe=(d,y,E,S)=>{if(m(E))return;S.delete(E),s.delete(E),r.add(E);let w=t?.noDelete?Promise.resolve():gt(Number(d),[E],y).then(async R=>{if(!R[0]?.success)throw new Error(`Failed to delete file "${E}" from remote theme.`);return r.delete(E),ss("delete",E),!0}).catch(R=>(Ie(E,"delete")(R),!1));a("unlink",{fileKey:E,onSync:R=>{w.then(_=>{_&&R()}).catch(()=>{})}})},ve=new Set(ts.map(d=>T(e,d.split("/").shift()??"")));return t?.listing&&ve.add(T(e,"listings",t.listing)),process.env.SHOPIFY_CLI_LOCAL_HOT_RELOAD&&ve.add(we()),{root:e,files:s,unsyncedFileKeys:r,uploadErrors:n,ready:()=>c,delete:async d=>{s.delete(d),await cn(e,d)},write:async d=>{let y=(d.key.startsWith("templates/")||d.key.startsWith("sections/"))&&d.key.endsWith(".json");if(t?.listing&&y){let E=T("listings",t.listing,d.key),S=T(e,E),w=await $(S);s.set(d.key,M({key:d.key,checksum:d.checksum,value:d.value??"",attachment:d.attachment??""})),w?await Je(e,{...d,key:E}):await Je(e,d);return}s.set(d.key,M({key:d.key,checksum:d.checksum,value:d.value??"",attachment:d.attachment??""})),await Je(e,d)},read:p,applyIgnoreFilters:d=>Le(d,o),addEventListener:(d,y)=>{i.on(d,y)},startWatcher:async(d,y)=>{let{default:E}=await import("./chokidar-5RWEYTNQ.js"),S=E.watch([...ve],{ignored:W,persistent:!process.env.SHOPIFY_UNIT_TEST,ignoreInitial:!0}),w=new Map,R=(_,F)=>{let Y=`${l(F)}:${_}`,Ge=w.get(Y);Ge&&clearTimeout(Ge);let ns=setTimeout(()=>{w.delete(Y),x(_,d,y,F)},rn);w.set(Y,ns)};S.on("add",R.bind(null,"add")).on("change",R.bind(null,"change")).on("unlink",R.bind(null,"unlink")).on("error",_=>{N(`File watcher error: ${_}`),L("theme-service:file-watcher:error")})}}}function on(e,t,s,n,r){return async o=>{if(!e.has(s))return!1;let[i]=await yt(Number(n),[{key:s,...o}],r);if(!i?.success){let a=i?.errors?.asset??["Response was not successful."];throw t.set(s,a),ee(n,s),new Error(a.join(`
100
+ `))}return t.delete(s)&&ee(n,s),e.delete(s),ss("update",s),!0}}async function Je(e,{key:t,attachment:s,value:n}){let r=T(e,t);if(await ln(r),s){let o=Buffer.from(s,"base64");await be(r,o,{encoding:"base64"})}else await be(r,n??"")}async function ue(e,t){let s=Fe(t)?{encoding:"utf8"}:{},n=T(e,t);if(!await $(n)){P(`File ${n} can't be read because it doesn't exist...`);return}return k(n,s)}async function an(e,t,s){if(t==="config/settings_data.json")return es(e,s);let n=await Kt(e,s,t);if(n){let r=Fe(t)?{encoding:"utf8"}:{};return k(n,r)}return ue(e,t)}async function cn(e,t){let s=T(e,t);if(!await $(s)){P(`File ${s} can't be removed because it doesn't exist...`);return}await Qe(s)}function No(e){let t=[],s=[],n=[],r=[],o=[],i=[],a=[],u=[],p=[],c=[],l=[],m=[],x=[];return e.forEach(f=>{let g=f.key;v.documentationFilesRegex.test(g)?x.push(f):g.endsWith(".liquid")?v.sectionLiquidRegex.test(g)?t.push(f):v.blockLiquidRegex.test(g)?l.push(f):v.layoutLiquidRegex.test(g)?m.push(f):s.push(f):v.configSchemaRegex.test(g)?a.push(f):v.configDataRegex.test(g)?u.push(f):v.configStylesheetRegex.test(g)?p.push(f):v.jsonRegex.test(g)?v.contextualizedJsonRegex.test(g)?i.push(f):v.sectionJsonRegex.test(g)?n.push(f):v.templateJsonRegex.test(g)?r.push(f):o.push(f):v.staticAssetRegex.test(g)&&c.push(f)}),{sectionLiquidFiles:t,otherLiquidFiles:s,sectionJsonFiles:n,templateJsonFiles:r,contextualizedJsonFiles:i,otherJsonFiles:o,configSchemaFile:a,configDataFile:u,configStylesheetFiles:p,staticAssetFiles:c,blockLiquidFiles:l,layoutFiles:m,documentationFiles:x}}function Fe(e){return xt({liquid:"application/liquid",sass:"text/x-sass",scss:"text/x-scss"}),["application/javascript","application/json","application/liquid","text/css","text/x-sass","text/x-scss","image/svg+xml","text/markdown"].includes(U(e))}async function Do(e){let t=new Set(await C("*",{cwd:e,deep:1,onlyDirectories:!0}));return["config","layout","templates"].every(n=>t.has(n))}async function ln(e){let t=dn(e);await $(t)||await Ze(t)}function dn(e){let t=Ve(e),s=e.lastIndexOf(t);return e.substring(0,s)}function ss(e,t){re(ne`• ${ie.format(new Date)} Synced ${j.raw("\xBB")} ${e} ${t}`)}function we(){let e=process.env.SHOPIFY_CLI_LOCAL_HOT_RELOAD;return!e||e==="true"?T(nn(import.meta.url.split("/cli/")[0]??""),"theme-hot-reload/dist/theme-hot-reload.js"):e}function de(e,t){return t?Buffer.isBuffer(t)?ze(t):hn(e)?un(t):pn(e,t):""}function un(e){let t=e;return t=t.replace(/\r\n/g,`
101
101
  `),t=t.replace(/\/\*[\s\S]*?\*\//,""),t=mn(t),ze(t)}function pn(e,t){let s=t;return Fe(e)&&(s=s.replace(/\r\n/g,`
102
102
  `)),ze(s)}function mn(e){let t=!1,s=!1,n="";for(let r of e)r==='"'&&!s&&(t=!t),!(!t&&(r===" "||r===`
103
- `))&&(n+=r,s=r==="\\"&&!s);return n}function ze(e){let t=Buffer.isBuffer(e)?e:Buffer.from(e);return Ke(t)}function Bo(e){let t=new Set(e.filter(({key:s})=>s.startsWith("assets/")&&s.endsWith(".liquid")).map(({key:s})=>s));return e.filter(({key:s})=>s.startsWith("assets/")?!t.has(`${s}.liquid`):!0)}function hn(e){return e.endsWith("/settings_data.json")}export{Bo as a,Ct as b,Ot as c,Nt as d,Ut as e,Cr as f,Gr as g,uo as h,zt as i,ee as j,Eo as k,Ho as l,Do as m,Oo as n};
103
+ `))&&(n+=r,s=r==="\\"&&!s);return n}function ze(e){let t=Buffer.isBuffer(e)?e:Buffer.from(e);return Ke(t)}function Bo(e){let t=new Set(e.filter(({key:s})=>s.startsWith("assets/")&&s.endsWith(".liquid")).map(({key:s})=>s));return e.filter(({key:s})=>s.startsWith("assets/")?!t.has(`${s}.liquid`):!0)}function hn(e){return e.endsWith("/settings_data.json")}export{Bo as a,Ct as b,Dt as c,Ot as d,Ut as e,Cr as f,Yr as g,uo as h,zt as i,ee as j,Eo as k,Ho as l,No as m,Do as n};
@@ -1,3 +1,3 @@
1
- import{a as E}from"./chunk-P5WLH64A.js";import{e as R}from"./chunk-WEWLPJK2.js";import{a as j}from"./chunk-EWS2RNM6.js";import{c as O,i as k,o as x}from"./chunk-5JW4JQWZ.js";import{p as v,v as A}from"./chunk-3KM2GKXH.js";import{b as F,c as L}from"./chunk-IX4IGE5H.js";import{N as y}from"./chunk-WSCSFFLH.js";import{h as T}from"./chunk-BI7LE6CZ.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-HQUWYKSJ.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-SIVRBIKH.js";import{c as O,i as k,o as x}from"./chunk-GCTCRKET.js";import{a as E}from"./chunk-SEGZQCXZ.js";import{e as R}from"./chunk-UXL2A5UK.js";import{p as v,v as A}from"./chunk-7DJNASBC.js";import{b as F,c as L}from"./chunk-WJEVB67Y.js";import{N as y}from"./chunk-LIH7CQO7.js";import{h as T}from"./chunk-PSUNX2YX.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-GYFRTLML.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,2 +1,2 @@
1
- import{a as B,b as E}from"./chunk-U3F6GPCE.js";import{b as y,c as A,l as C,n as F,o as S,t as x}from"./chunk-SGIMJQEM.js";import{a as D}from"./chunk-ESPT6CGE.js";import{a as w}from"./chunk-RA3WWB2S.js";import{b as O}from"./chunk-IX4IGE5H.js";import{C as f}from"./chunk-PK73ZSND.js";import{A as b,B as g,y as c,z as k}from"./chunk-WSCSFFLH.js";import{a as v}from"./chunk-CTNBSUVU.js";import{qb as h,sb as I}from"./chunk-HQUWYKSJ.js";import{e as z,g as a}from"./chunk-VKWPEFWQ.js";a();a();async function T(i){let{organization:e,storeFqdn:o,operationId:t,remoteApp:u}=i;c({headline:"Canceling bulk operation.",body:[{list:{items:[`ID: ${t}`,...E({organization:e,remoteApp:u,storeFqdn:o})]}}]});let q=await B(u,o),s=await C({adminSession:q,operationId:t});if(s?.userErrors?.length){F(s.userErrors,"Failed to cancel bulk operation.");return}let n=s?.bulkOperation;if(n){let r=S(n),d=n.status==="CANCELING"?[`This may take a few moments. Check the status with:
1
+ import{a as B,b as E}from"./chunk-6JC2PM43.js";import{b as y,c as A,l as C,n as F,o as S,t as x}from"./chunk-RNFZJQVV.js";import{a as D}from"./chunk-3NVQXPTU.js";import{a as w}from"./chunk-36OXWMXZ.js";import{b as O}from"./chunk-WJEVB67Y.js";import{D as f}from"./chunk-AINDVTMY.js";import{A as b,B as g,y as c,z as k}from"./chunk-LIH7CQO7.js";import{a as v}from"./chunk-CTNBSUVU.js";import{qb as h,sb as I}from"./chunk-GYFRTLML.js";import{e as z,g as a}from"./chunk-VKWPEFWQ.js";a();a();async function T(i){let{organization:e,storeFqdn:o,operationId:t,remoteApp:u}=i;c({headline:"Canceling bulk operation.",body:[{list:{items:[`ID: ${t}`,...E({organization:e,remoteApp:u,storeFqdn:o})]}}]});let q=await B(u,o),s=await C({adminSession:q,operationId:t});if(s?.userErrors?.length){F(s.userErrors,"Failed to cancel bulk operation.");return}let n=s?.bulkOperation;if(n){let r=S(n),d=n.status==="CANCELING"?[`This may take a few moments. Check the status with:
2
2
  `,{command:`shopify app bulk status --id=${A(n.id)}`}]:r.body,p={headline:r.headline,...d&&{body:d},...r.customSections&&{customSections:r.customSections}};switch(r.renderType){case"success":k(p);break;case"warning":b(p);break;case"info":c(p);break}}else g({headline:"Bulk operation not found or could not be canceled.",body:I`ID: ${h.yellow(t)}`.value})}var l=z(v(),1);var m=class i extends D{static summary="Cancel a bulk operation.";static description="Cancels a running bulk operation by ID.";static flags={...O,...w,id:l.Flags.string({description:"The bulk operation ID to cancel (numeric ID or full GID).",env:"SHOPIFY_FLAG_ID",required:!0}),store:l.Flags.string({char:"s",description:"The store domain. Must be an existing dev store.",env:"SHOPIFY_FLAG_STORE",parse:async e=>f(e)})};async run(){let{flags:e}=await this.parse(i),{appContextResult:o,store:t}=await x(e);return await T({organization:o.organization,storeFqdn:t.shopDomain,operationId:y(e.id),remoteApp:o.remoteApp}),{app:o.app}}};export{m as a};