shopify 4.3.0 → 4.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (337) hide show
  1. package/dist/analytics-DMUNCDGT.js +1 -0
  2. package/dist/analytics-GAPN4I6R.js +1 -0
  3. package/dist/assets/hydrogen/routes/locale-check.ts +3 -3
  4. package/dist/assets/hydrogen/starter/CHANGELOG.md +106 -0
  5. package/dist/assets/hydrogen/starter/app/components/Aside.tsx +4 -2
  6. package/dist/assets/hydrogen/starter/app/components/CartMain.tsx +8 -5
  7. package/dist/assets/hydrogen/starter/app/components/CartSummary.tsx +117 -23
  8. package/dist/assets/hydrogen/starter/app/components/Header.tsx +3 -3
  9. package/dist/assets/hydrogen/starter/app/components/PaginatedResourceSection.tsx +24 -4
  10. package/dist/assets/hydrogen/starter/app/components/ProductPrice.tsx +1 -1
  11. package/dist/assets/hydrogen/starter/app/lib/context.ts +5 -0
  12. package/dist/assets/hydrogen/starter/app/routes/[robots.txt].tsx +14 -53
  13. package/dist/assets/hydrogen/starter/app/routes/_index.tsx +11 -4
  14. package/dist/assets/hydrogen/starter/app/routes/account.$.tsx +1 -1
  15. package/dist/assets/hydrogen/starter/app/routes/account.addresses.tsx +2 -2
  16. package/dist/assets/hydrogen/starter/app/routes/account.profile.tsx +1 -1
  17. package/dist/assets/hydrogen/starter/package.json +9 -10
  18. package/dist/assets/hydrogen/starter/storefrontapi.generated.d.ts +0 -11
  19. package/dist/assets/hydrogen/starter/vite.config.ts +10 -4
  20. package/dist/assets/hydrogen/vite/package.json +1 -2
  21. package/dist/assets/hydrogen/vite/vite.config.js +4 -3
  22. package/dist/bootstrap.js +1 -1
  23. package/dist/{chunk-3YDYZ232.js → chunk-235JVI2J.js} +8 -8
  24. package/dist/{chunk-2K7FGAT6.js → chunk-24RF5KN3.js} +1 -1
  25. package/dist/{chunk-GWHV62YT.js → chunk-2IPVQRMI.js} +1 -1
  26. package/dist/{chunk-QDVJJKLB.js → chunk-2MDFREEW.js} +1 -1
  27. package/dist/{chunk-JSOGPMWB.js → chunk-2MZACB7V.js} +1 -1
  28. package/dist/{chunk-LCZDC6EE.js → chunk-2ROG5NK3.js} +1 -1
  29. package/dist/{chunk-WVRGCNBZ.js → chunk-2VUG6LRN.js} +1 -1
  30. package/dist/{chunk-S22NCNAJ.js → chunk-32KQKGSY.js} +1 -1
  31. package/dist/chunk-3EQY5B4S.js +836 -0
  32. package/dist/{chunk-VRJTLVG3.js → chunk-3JAC5SI7.js} +1 -1
  33. package/dist/{chunk-G3JJLXPH.js → chunk-3JZKWK2V.js} +1 -1
  34. package/dist/chunk-3NMVMCOM.js +3 -0
  35. package/dist/chunk-3OE5HXHO.js +1 -0
  36. package/dist/{chunk-2RBIR3NM.js → chunk-4EYTWWYF.js} +1 -1
  37. package/dist/{chunk-G2OHWAY2.js → chunk-4LML2QWN.js} +1 -1
  38. package/dist/{chunk-UYSF234H.js → chunk-4Q54UDO3.js} +1 -1
  39. package/dist/{chunk-7572RLUP.js → chunk-4U3NC3UU.js} +1 -1
  40. package/dist/chunk-52H2R2FU.js +1 -0
  41. package/dist/{chunk-PMS4MNHB.js → chunk-57IRHKV3.js} +1 -1
  42. package/dist/{chunk-3AOQKI4B.js → chunk-5A7EMVAP.js} +1 -1
  43. package/dist/{chunk-T3ERXB7F.js → chunk-5EVFLUUA.js} +1 -1
  44. package/dist/{chunk-DYNH5SKT.js → chunk-5O7PY44R.js} +1 -1
  45. package/dist/chunk-63NFEXJR.js +275 -0
  46. package/dist/{chunk-PXHY753L.js → chunk-663TS34D.js} +1 -1
  47. package/dist/{chunk-JAWKLBOB.js → chunk-6I3FNLT3.js} +1 -1
  48. package/dist/{chunk-WA3YC5W4.js → chunk-6LTJMYUD.js} +2 -2
  49. package/dist/{chunk-5BKCIDMS.js → chunk-6V37CHBZ.js} +1 -1
  50. package/dist/{chunk-HOSFU6UP.js → chunk-74IG3ZE3.js} +3 -3
  51. package/dist/{chunk-4J32OHLY.js → chunk-7BVXGS44.js} +1 -1
  52. package/dist/{chunk-MRS6LAY7.js → chunk-7DYZVU7H.js} +1 -1
  53. package/dist/{chunk-YSIBRY6C.js → chunk-7EOQVQND.js} +1 -1
  54. package/dist/{chunk-3SPDFV5D.js → chunk-7HZG7FBK.js} +1 -1
  55. package/dist/{chunk-MIDYZPO4.js → chunk-7KHYEIA7.js} +1 -1
  56. package/dist/{chunk-5XDQ76DQ.js → chunk-7ZIO3X22.js} +1 -1
  57. package/dist/{chunk-6JKGUQRD.js → chunk-A2O3MBPH.js} +1 -1
  58. package/dist/{chunk-Q77MM2N2.js → chunk-ABCU552E.js} +1 -1
  59. package/dist/{chunk-N3CNWCC2.js → chunk-AP6FNGTA.js} +1 -1
  60. package/dist/chunk-AUZCENYI.js +1 -0
  61. package/dist/chunk-AYKRKE6O.js +2 -0
  62. package/dist/{chunk-PFGYC53K.js → chunk-AYSS2ERL.js} +1 -1
  63. package/dist/chunk-B367FOQA.js +7 -0
  64. package/dist/{chunk-PCCK4YTE.js → chunk-BBATKR3B.js} +1 -1
  65. package/dist/chunk-BCEWCYZD.js +1 -0
  66. package/dist/{chunk-2GU7OY3H.js → chunk-BH34ZLZ4.js} +1 -1
  67. package/dist/{chunk-ZM75DSIW.js → chunk-BLI7DUNV.js} +1 -1
  68. package/dist/{chunk-E7DHELFH.js → chunk-BNX4MZMV.js} +1 -1
  69. package/dist/{chunk-N5LVGFDS.js → chunk-BU7R7NFL.js} +1 -1
  70. package/dist/{chunk-NILXAUUT.js → chunk-BVHBMOIB.js} +1 -1
  71. package/dist/{chunk-7FQFEB33.js → chunk-BXDZX3BS.js} +34 -34
  72. package/dist/{chunk-MMIHHCMW.js → chunk-CVRAATZ5.js} +1 -1
  73. package/dist/{chunk-G3RWLAOG.js → chunk-DBBU6OVN.js} +1 -1
  74. package/dist/{chunk-G2LVUM7N.js → chunk-DKVU7LYY.js} +1 -1
  75. package/dist/{chunk-L2PC4MUV.js → chunk-DLZPP33V.js} +1 -1
  76. package/dist/{chunk-JEZ3PGVC.js → chunk-DQOS54HN.js} +1 -1
  77. package/dist/{chunk-OZBY45KT.js → chunk-E4GW6OXT.js} +1 -1
  78. package/dist/chunk-E64BQS4D.js +1 -0
  79. package/dist/chunk-F447QKVX.js +1 -0
  80. package/dist/{chunk-57PPQKJT.js → chunk-FA25RL4G.js} +1 -1
  81. package/dist/{chunk-TRYWVIVJ.js → chunk-FJOEHMXM.js} +1 -1
  82. package/dist/{chunk-NWXDOCL5.js → chunk-G6YOP2SJ.js} +1 -1
  83. package/dist/{chunk-YIRFEW5M.js → chunk-GOAKZ2IL.js} +1 -1
  84. package/dist/{chunk-AU5EZQW7.js → chunk-H2JU5BGK.js} +1 -1
  85. package/dist/{chunk-VJ6KDRZI.js → chunk-H3V6Y5JO.js} +1 -1
  86. package/dist/{chunk-GJXINXSU.js → chunk-HHA322FT.js} +46 -46
  87. package/dist/{chunk-HCTZN7L4.js → chunk-HP3NDE7S.js} +1 -1
  88. package/dist/{chunk-ANBOLDON.js → chunk-HX3TALXV.js} +1 -1
  89. package/dist/{chunk-OU3M32A2.js → chunk-I3Y6XTKN.js} +1 -1
  90. package/dist/{chunk-DCLUZFT7.js → chunk-ICHNVDFU.js} +1 -1
  91. package/dist/{chunk-RSRYC5ZF.js → chunk-ICXHUPP5.js} +1 -1
  92. package/dist/chunk-IE4SSSXU.js +593 -0
  93. package/dist/{chunk-5FVB7JHP.js → chunk-IFVYCKX5.js} +1 -1
  94. package/dist/{chunk-JUYJZUYU.js → chunk-J2ZES5K5.js} +1 -1
  95. package/dist/{chunk-JCIN73BE.js → chunk-J5U2FUIX.js} +1 -1
  96. package/dist/chunk-JC3PRJJS.js +1 -0
  97. package/dist/chunk-JGN7YG5X.js +3 -0
  98. package/dist/{chunk-ZGJ3DFTQ.js → chunk-JZVNNQWE.js} +1 -1
  99. package/dist/{chunk-CV5EQGES.js → chunk-K2CIMJJW.js} +1 -1
  100. package/dist/{chunk-T4NS63K4.js → chunk-K7I5BGFC.js} +1 -1
  101. package/dist/{chunk-33OHQUHZ.js → chunk-KESQOMEW.js} +1 -1
  102. package/dist/{chunk-4QTEPWEJ.js → chunk-KJQAJUDU.js} +4 -4
  103. package/dist/{chunk-TP7E54WN.js → chunk-KNEF6NAG.js} +1 -1
  104. package/dist/{chunk-S6B2ADVR.js → chunk-KUKYAIOR.js} +1 -1
  105. package/dist/{chunk-MEIEEENL.js → chunk-KZDI2BXR.js} +1 -1
  106. package/dist/chunk-LKZ7ARYS.js +18 -0
  107. package/dist/{chunk-W7DDV2EY.js → chunk-LMPD55L6.js} +1 -1
  108. package/dist/{chunk-YVQXEPHY.js → chunk-LXZM6Z4F.js} +1 -1
  109. package/dist/{chunk-S5IFJ737.js → chunk-MGPLKG23.js} +1 -1
  110. package/dist/chunk-MSJDZLZT.js +1 -0
  111. package/dist/{chunk-N3NE4MVN.js → chunk-N4LCWB56.js} +1 -1
  112. package/dist/{chunk-VI34CKV6.js → chunk-N5U5Q2MG.js} +1 -1
  113. package/dist/{chunk-JK3NIHTX.js → chunk-N5YIZJ4S.js} +1 -1
  114. package/dist/{chunk-CEHXOWA6.js → chunk-N625VE5T.js} +1 -1
  115. package/dist/{chunk-A5HKAMAC.js → chunk-NJLSZS27.js} +1 -1
  116. package/dist/{chunk-WHNWE7P2.js → chunk-O7OQK2OC.js} +1 -1
  117. package/dist/{chunk-5O43334U.js → chunk-P375IGKT.js} +1 -1
  118. package/dist/chunk-P3RGC53U.js +5 -0
  119. package/dist/{chunk-4FFPTEKD.js → chunk-P4243GCY.js} +1 -1
  120. package/dist/{chunk-FIYAECXH.js → chunk-PFEC2NUB.js} +1 -1
  121. package/dist/{chunk-JJ6RM54S.js → chunk-PH7F4BMG.js} +1 -1
  122. package/dist/chunk-PK6NOLT5.js +2 -0
  123. package/dist/chunk-PLHJQQVZ.js +1 -0
  124. package/dist/{chunk-AO3RFGNV.js → chunk-PVD544NN.js} +1 -1
  125. package/dist/chunk-Q3WOWDUU.js +1 -0
  126. package/dist/chunk-Q7BOSHWX.js +7 -0
  127. package/dist/{chunk-2XZBQZ5R.js → chunk-QAM7VCLV.js} +1 -1
  128. package/dist/{chunk-FOFJBRSL.js → chunk-QCBAFI6Z.js} +1 -1
  129. package/dist/{chunk-SSCYLDSX.js → chunk-QHWF3S7U.js} +1 -1
  130. package/dist/{chunk-EVZA2TCI.js → chunk-QJL3SXYA.js} +1 -1
  131. package/dist/{chunk-UB26DGTR.js → chunk-QRETBFXI.js} +1 -1
  132. package/dist/chunk-RBOYWA2D.js +1 -0
  133. package/dist/{chunk-N3YTDGFY.js → chunk-ROQXPIEZ.js} +1 -1
  134. package/dist/{chunk-ATSMK66C.js → chunk-RUKK4KXX.js} +1 -1
  135. package/dist/{chunk-PNP5OKNZ.js → chunk-RY2ESY3P.js} +1 -1
  136. package/dist/{chunk-HIQHYPLU.js → chunk-RY5CY3ZW.js} +1 -1
  137. package/dist/{chunk-Q73GEVSJ.js → chunk-S442LGHR.js} +1 -1
  138. package/dist/{chunk-OXJBYKMX.js → chunk-S5JJL3BP.js} +1 -1
  139. package/dist/{chunk-UU5P2IYU.js → chunk-SF53RKMO.js} +1 -1
  140. package/dist/{chunk-JAWOP4HJ.js → chunk-SY2AH7C2.js} +1 -1
  141. package/dist/{chunk-J5BRKYGE.js → chunk-TC3JOEMA.js} +1 -1
  142. package/dist/{chunk-M7YFD4EV.js → chunk-TEXYUUTD.js} +5 -5
  143. package/dist/chunk-TGM7L6RV.js +1 -0
  144. package/dist/{chunk-5H3VTG77.js → chunk-TKW3Z7XL.js} +1 -1
  145. package/dist/{chunk-HDC5V7RY.js → chunk-TM534QSE.js} +1 -1
  146. package/dist/{chunk-5FFHQTRC.js → chunk-U44HRKSU.js} +1 -1
  147. package/dist/{chunk-UTO4Z6P6.js → chunk-UEC23KAO.js} +1 -1
  148. package/dist/{chunk-RKDZGK5K.js → chunk-UFGDNIYX.js} +1 -1
  149. package/dist/{chunk-Q7C44DX5.js → chunk-UGGFSV7N.js} +1 -1
  150. package/dist/{chunk-USLYL5AC.js → chunk-UJVYIWUI.js} +1 -1
  151. package/dist/{chunk-OU4SKQTC.js → chunk-UP7H24B3.js} +2 -2
  152. package/dist/{chunk-YPBCSDFQ.js → chunk-UQZ7HZ47.js} +1 -1
  153. package/dist/{chunk-2EHBJWC6.js → chunk-UTLRP527.js} +1 -1
  154. package/dist/chunk-UTPJAU5S.js +1 -0
  155. package/dist/{chunk-DNXYKGV2.js → chunk-V66IHWQO.js} +1 -1
  156. package/dist/{chunk-YL3TYQGT.js → chunk-V774I3FW.js} +1 -1
  157. package/dist/{chunk-6KETAPWL.js → chunk-VKFDDZD3.js} +1 -1
  158. package/dist/{chunk-ZUKLGZOU.js → chunk-VNYKNAT5.js} +1 -1
  159. package/dist/{chunk-AERKD4TO.js → chunk-VUACOGOX.js} +1 -1
  160. package/dist/{chunk-KRQGLK2Q.js → chunk-WFB3FHKV.js} +1 -1
  161. package/dist/chunk-WPITBIL5.js +21 -0
  162. package/dist/{chunk-J3HX6ZGD.js → chunk-WTYH2O47.js} +1 -1
  163. package/dist/chunk-WU6GIY22.js +4 -0
  164. package/dist/{chunk-UC7KMA6W.js → chunk-XA5JA7DK.js} +1 -1
  165. package/dist/{chunk-2TMQG2UT.js → chunk-XSXX75VV.js} +1 -1
  166. package/dist/{chunk-7D45IAMQ.js → chunk-XXUWTD7A.js} +1 -1
  167. package/dist/chunk-XZWAX4FI.js +46 -0
  168. package/dist/{chunk-FQ5ZZX2G.js → chunk-YF4HKJB5.js} +1 -1
  169. package/dist/chunk-YJAX22JK.js +7 -0
  170. package/dist/{chunk-BL46CZ2M.js → chunk-YT3NPMWK.js} +1 -1
  171. package/dist/{chunk-NTRAWIEJ.js → chunk-YYLEWVO6.js} +3 -3
  172. package/dist/chunk-Z2Y6G2QF.js +1 -0
  173. package/dist/{chunk-M2YINBHF.js → chunk-Z66NZ2HC.js} +1 -1
  174. package/dist/{chunk-6LWOWDF4.js → chunk-ZFOWAMFK.js} +1 -1
  175. package/dist/{chunk-25HJX3L2.js → chunk-ZKBWEHIY.js} +1 -1
  176. package/dist/{chunk-2GAFKG64.js → chunk-ZZ3SMI2A.js} +1 -1
  177. package/dist/{chunk-TY6BZTG3.js → chunk-ZZWSMRKT.js} +1 -1
  178. package/dist/cli/commands/app/app-logs/sources.js +1 -1
  179. package/dist/cli/commands/app/build.js +1 -1
  180. package/dist/cli/commands/app/bulk/cancel.js +1 -1
  181. package/dist/cli/commands/app/bulk/execute.js +1 -1
  182. package/dist/cli/commands/app/bulk/status.js +1 -1
  183. package/dist/cli/commands/app/config/link.js +1 -1
  184. package/dist/cli/commands/app/config/pull.js +1 -1
  185. package/dist/cli/commands/app/config/use.js +1 -1
  186. package/dist/cli/commands/app/config/validate.js +1 -1
  187. package/dist/cli/commands/app/demo/watcher.js +1 -1
  188. package/dist/cli/commands/app/deploy.js +1 -1
  189. package/dist/cli/commands/app/dev/clean.js +1 -1
  190. package/dist/cli/commands/app/dev.js +1 -1
  191. package/dist/cli/commands/app/env/pull.js +1 -1
  192. package/dist/cli/commands/app/env/show.js +1 -1
  193. package/dist/cli/commands/app/execute.js +1 -1
  194. package/dist/cli/commands/app/function/build.js +1 -1
  195. package/dist/cli/commands/app/function/info.js +1 -1
  196. package/dist/cli/commands/app/function/replay.js +1 -1
  197. package/dist/cli/commands/app/function/run.js +1 -1
  198. package/dist/cli/commands/app/function/schema.js +1 -1
  199. package/dist/cli/commands/app/function/typegen.js +1 -1
  200. package/dist/cli/commands/app/generate/extension.js +1 -1
  201. package/dist/cli/commands/app/graphiql.js +1 -0
  202. package/dist/cli/commands/app/import-custom-data-definitions.js +1 -1
  203. package/dist/cli/commands/app/import-extensions.js +1 -1
  204. package/dist/cli/commands/app/info.js +1 -1
  205. package/dist/cli/commands/app/init.js +1 -1
  206. package/dist/cli/commands/app/logs.js +1 -1
  207. package/dist/cli/commands/app/release.js +1 -1
  208. package/dist/cli/commands/app/versions/list.js +1 -1
  209. package/dist/cli/commands/app/webhook/trigger.js +1 -1
  210. package/dist/cli/commands/auth/login.js +1 -1
  211. package/dist/cli/commands/auth/logout.js +1 -1
  212. package/dist/cli/commands/cache/clear.js +1 -1
  213. package/dist/cli/commands/config/autoupgrade/off.js +1 -1
  214. package/dist/cli/commands/config/autoupgrade/on.js +1 -1
  215. package/dist/cli/commands/config/autoupgrade/status.js +1 -1
  216. package/dist/cli/commands/debug/command-flags.js +1 -1
  217. package/dist/cli/commands/doc/fetch.js +1 -1
  218. package/dist/cli/commands/doc/search.js +1 -1
  219. package/dist/cli/commands/docs/generate.js +1 -1
  220. package/dist/cli/commands/doctor-release/doctor-release.js +1 -1
  221. package/dist/cli/commands/doctor-release/theme/index.js +1 -1
  222. package/dist/cli/commands/help.js +1 -1
  223. package/dist/cli/commands/kitchen-sink/async.js +1 -1
  224. package/dist/cli/commands/kitchen-sink/index.js +1 -1
  225. package/dist/cli/commands/kitchen-sink/prompts.js +1 -1
  226. package/dist/cli/commands/kitchen-sink/static.js +1 -1
  227. package/dist/cli/commands/notifications/generate.js +1 -1
  228. package/dist/cli/commands/notifications/list.js +1 -1
  229. package/dist/cli/commands/organization/list.js +1 -1
  230. package/dist/cli/commands/search.js +1 -1
  231. package/dist/cli/commands/theme/check.js +1 -1
  232. package/dist/cli/commands/theme/console.js +1 -1
  233. package/dist/cli/commands/theme/delete.js +1 -1
  234. package/dist/cli/commands/theme/dev.js +1 -1
  235. package/dist/cli/commands/theme/duplicate.js +1 -1
  236. package/dist/cli/commands/theme/info.js +1 -1
  237. package/dist/cli/commands/theme/init.js +1 -1
  238. package/dist/cli/commands/theme/language-server.js +1 -1
  239. package/dist/cli/commands/theme/list.js +1 -1
  240. package/dist/cli/commands/theme/metafields/pull.js +1 -1
  241. package/dist/cli/commands/theme/open.js +1 -1
  242. package/dist/cli/commands/theme/package.js +1 -1
  243. package/dist/cli/commands/theme/preview.js +1 -1
  244. package/dist/cli/commands/theme/profile.js +1 -1
  245. package/dist/cli/commands/theme/publish.js +1 -1
  246. package/dist/cli/commands/theme/pull.js +1 -1
  247. package/dist/cli/commands/theme/push.js +1 -1
  248. package/dist/cli/commands/theme/rename.js +1 -1
  249. package/dist/cli/commands/theme/share.js +1 -1
  250. package/dist/cli/commands/upgrade.js +1 -1
  251. package/dist/cli/commands/version.js +1 -1
  252. package/dist/cli/help.d.ts +38 -0
  253. package/dist/cli/help.js +2 -0
  254. package/dist/command-registry.js +1 -1
  255. package/dist/{conf-store-UY3MDGGA.js → conf-store-V6ILVUUO.js} +1 -1
  256. package/dist/{deprecations-KNUMDRIU.js → deprecations-MOEFN6OW.js} +1 -1
  257. package/dist/dist-2BL5GGMG.js +1 -0
  258. package/dist/dist-E6QKEULH.js +1 -0
  259. package/dist/environments-5KA3OBIZ.js +1 -0
  260. package/dist/error-NYYI6HVX.js +1 -0
  261. package/dist/error-handler-BOESDKZA.js +1 -0
  262. package/dist/{fs-LJWVNO4H.js → fs-XE6SBVBF.js} +1 -1
  263. package/dist/hooks/app-init.js +1 -1
  264. package/dist/hooks/did-you-mean.js +1 -1
  265. package/dist/hooks/hydrogen-init.js +1 -1
  266. package/dist/hooks/plugin-plugins.js +1 -1
  267. package/dist/hooks/postrun.js +1 -1
  268. package/dist/hooks/prerun.js +1 -1
  269. package/dist/hooks/public-metadata.js +1 -1
  270. package/dist/hooks/sensitive-metadata.js +1 -1
  271. package/dist/hooks/tunnel-provider.js +1 -1
  272. package/dist/hooks/tunnel-start.js +1 -1
  273. package/dist/index.js +23 -10
  274. package/dist/{is-global-W6ALVC5L.js → is-global-JOHCPSKZ.js} +1 -1
  275. package/dist/lib-NOROGV6N.js +1 -0
  276. package/dist/lib-UCG2DNMS.js +1 -0
  277. package/dist/{local-GKEWZAIV.js → local-BTQDUX72.js} +1 -1
  278. package/dist/local-storage-WUSIVDTQ.js +1 -0
  279. package/dist/{metadata-UEUN64TK.js → metadata-APVOKTBV.js} +1 -1
  280. package/dist/{morph-CGOZEPPZ.js → morph-CG6HEMCQ.js} +4 -4
  281. package/dist/{node-package-manager-4ASQQIIF.js → node-package-manager-AC34ZJZD.js} +1 -1
  282. package/dist/notifications-system-4ODOESG2.js +1 -0
  283. package/dist/{output-S6E37GJQ.js → output-EAPQ7OWD.js} +1 -1
  284. package/dist/{prettier-EGVCP5CY.js → prettier-6ZMB2MMO.js} +1 -1
  285. package/dist/system-D7CH26HU.js +1 -0
  286. package/dist/tsconfig.tsbuildinfo +1 -1
  287. package/dist/ui-AXZBGWIQ.js +1 -0
  288. package/dist/upgrade-SLPJF6LD.js +1 -0
  289. package/dist/version-3IYH4V5U.js +1 -0
  290. package/dist/version-FAU37PQN.js +1 -0
  291. package/dist/{workerd-QOTT6UCO.js → workerd-XXPWKQOM.js} +1 -1
  292. package/oclif.manifest.json +712 -124
  293. package/package.json +15 -8
  294. package/dist/analytics-JH64XI2J.js +0 -1
  295. package/dist/analytics-MEGKKFGF.js +0 -1
  296. package/dist/assets/hydrogen/starter/app/routes/api.$version.[graphql.json].tsx +0 -14
  297. package/dist/chunk-762JWOWJ.js +0 -5
  298. package/dist/chunk-7LV55VWE.js +0 -1
  299. package/dist/chunk-A27NZMWB.js +0 -1
  300. package/dist/chunk-AVD3INWF.js +0 -1
  301. package/dist/chunk-AWEB5AQM.js +0 -1
  302. package/dist/chunk-AXNAGI32.js +0 -1
  303. package/dist/chunk-BQWK3C47.js +0 -278
  304. package/dist/chunk-CFOXXOO2.js +0 -1
  305. package/dist/chunk-DTIWUT2T.js +0 -18
  306. package/dist/chunk-DZQYG32N.js +0 -2
  307. package/dist/chunk-EH7ZTFS4.js +0 -613
  308. package/dist/chunk-EKVTNWHM.js +0 -1
  309. package/dist/chunk-G4OQABDT.js +0 -836
  310. package/dist/chunk-I22ZTRKK.js +0 -3
  311. package/dist/chunk-I4R7TML2.js +0 -7
  312. package/dist/chunk-J3H4LPN6.js +0 -18
  313. package/dist/chunk-JLE4NBMT.js +0 -1
  314. package/dist/chunk-LXVORHCQ.js +0 -1
  315. package/dist/chunk-MINZGZ4N.js +0 -1
  316. package/dist/chunk-S7F5KFQP.js +0 -1
  317. package/dist/chunk-T4IV643Z.js +0 -9
  318. package/dist/chunk-TPCG6DCA.js +0 -1
  319. package/dist/chunk-TUNUEOHO.js +0 -3
  320. package/dist/chunk-VPPWSKOY.js +0 -1
  321. package/dist/chunk-XVUHUA36.js +0 -1
  322. package/dist/chunk-YMAWEIUR.js +0 -1
  323. package/dist/dist-C5IV2YDQ.js +0 -1
  324. package/dist/dist-VL4KZWV2.js +0 -1
  325. package/dist/environments-YPRVO2CF.js +0 -1
  326. package/dist/error-XRBQTNFM.js +0 -1
  327. package/dist/error-handler-NI7D6GSY.js +0 -1
  328. package/dist/lib-AIKYSHWL.js +0 -1
  329. package/dist/lib-Q4PWEMFD.js +0 -1
  330. package/dist/local-storage-ZOZMA22B.js +0 -1
  331. package/dist/notifications-system-HLXJCAMG.js +0 -1
  332. package/dist/system-YQZNGSWB.js +0 -1
  333. package/dist/ui-D2FFWRK7.js +0 -1
  334. package/dist/upgrade-TVTCFMXM.js +0 -1
  335. package/dist/version-J6MDN7BZ.js +0 -1
  336. package/dist/version-RIRW5EXQ.js +0 -1
  337. /package/dist/{chunk-YLQ3LNNY.js → chunk-VDN6MEYI.js} +0 -0
@@ -1 +1 @@
1
- import{b as c}from"./chunk-CFOXXOO2.js";import{h as E,ua as T,va as u,xa as s}from"./chunk-G4OQABDT.js";import{F as w}from"./chunk-NTRAWIEJ.js";import{d as N}from"./chunk-TPCG6DCA.js";import{Pb as V,T as _}from"./chunk-7FQFEB33.js";import{g as l}from"./chunk-VKWPEFWQ.js";l();var j=/gid:\/\/shopify\/\w*\/(\d+)/,g="development",ne="live",ie="unpublished";function ae(e){return e.role===g}async function te(e){let n=await _("creative");return w({message:e,defaultValue:n})}function S(e){return`gid://shopify/OnlineStoreTheme/${e}`}function f(e){let n=j.exec(e);if(n&&n[1]!==void 0)return parseInt(n[1],10);throw new Error(`Invalid GID: ${e}`)}l();l();var F;(function(e){e.Delete="DELETE",e.Upload="UPLOAD"})(F||(F={}));l();function y(e){if(!e)return;e.processing??(e.processing=!1),e.createdAtRuntime??(e.createdAtRuntime=!1);let{id:n,name:a,role:i,processing:t,createdAtRuntime:d}=e;return{id:n,name:a,processing:t,createdAtRuntime:d,role:i==="main"?"live":i}}function re(e){if(!e)return;let{key:n,checksum:a,attachment:i,value:t}=e,d={size:(t||i||"").length,mtime:Date.now()};return{key:n,checksum:a,attachment:i,value:t,stats:d}}l();var A={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themeUpdate"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"OnlineStoreThemeInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themeUpdate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}},{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"theme"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"field"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var x={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themeDelete"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themeDelete"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"deletedThemeId"}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"field"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var I={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themeDuplicate"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"name"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themeDuplicate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}},{kind:"Argument",name:{kind:"Name",value:"name"},value:{kind:"Variable",name:{kind:"Name",value:"name"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"newTheme"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"field"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var O={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themePublish"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themePublish"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"theme"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"field"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var B={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themeCreate"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"name"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"source"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"URL"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"role"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ThemeRole"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themeCreate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"name"},value:{kind:"Variable",name:{kind:"Name",value:"name"}}},{kind:"Argument",name:{kind:"Name",value:"source"},value:{kind:"Variable",name:{kind:"Name",value:"source"}}},{kind:"Argument",name:{kind:"Name",value:"role"},value:{kind:"Variable",name:{kind:"Name",value:"role"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"theme"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"field"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var C={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"getThemeFileBodies"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"filenames"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"theme"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"files"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"250"}},{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}},{kind:"Argument",name:{kind:"Name",value:"filenames"},value:{kind:"Variable",name:{kind:"Name",value:"filenames"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"size"}},{kind:"Field",name:{kind:"Name",value:"checksumMd5"}},{kind:"Field",name:{kind:"Name",value:"body"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"OnlineStoreThemeFileBodyText"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"content"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"OnlineStoreThemeFileBodyBase64"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"contentBase64"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"OnlineStoreThemeFileBodyUrl"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"code"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"pageInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hasNextPage"}},{kind:"Field",name:{kind:"Name",value:"endCursor"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var q={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"getThemeFileChecksums"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"theme"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"files"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"250"}},{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"size"}},{kind:"Field",name:{kind:"Name",value:"checksumMd5"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"code"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"pageInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hasNextPage"}},{kind:"Field",name:{kind:"Name",value:"endCursor"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var P={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themeFilesUpsert"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"files"}},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"OnlineStoreThemeFilesUpsertFileInput"}}}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"themeId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themeFilesUpsert"},arguments:[{kind:"Argument",name:{kind:"Name",value:"files"},value:{kind:"Variable",name:{kind:"Name",value:"files"}}},{kind:"Argument",name:{kind:"Name",value:"themeId"},value:{kind:"Variable",name:{kind:"Name",value:"themeId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"upsertedThemeFiles"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var U={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themeFilesDelete"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"themeId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"files"}},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themeFilesDelete"},arguments:[{kind:"Argument",name:{kind:"Name",value:"themeId"},value:{kind:"Variable",name:{kind:"Name",value:"themeId"}}},{kind:"Argument",name:{kind:"Name",value:"files"},value:{kind:"Variable",name:{kind:"Name",value:"files"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"deletedThemeFiles"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"code"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var L={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"metafieldDefinitionsByOwnerType"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"ownerType"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"MetafieldOwnerType"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"metafieldDefinitions"},arguments:[{kind:"Argument",name:{kind:"Name",value:"ownerType"},value:{kind:"Variable",name:{kind:"Name",value:"ownerType"}}},{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"250"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"key"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"namespace"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"type"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"category"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var R={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"getThemes"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themes"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"50"}},{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"processing"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"pageInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hasNextPage"}},{kind:"Field",name:{kind:"Name",value:"endCursor"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var M={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"getTheme"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"theme"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"processing"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var G={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"findDevelopmentThemeByName"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"name"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themes"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"2"}},{kind:"Argument",name:{kind:"Name",value:"names"},value:{kind:"ListValue",values:[{kind:"Variable",name:{kind:"Name",value:"name"}}]}},{kind:"Argument",name:{kind:"Name",value:"roles"},value:{kind:"ListValue",values:[{kind:"EnumValue",value:"DEVELOPMENT"}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"processing"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var $={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"OnlineStorePasswordProtection"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"onlineStore"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"passwordProtection"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"enabled"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};var Q="https://cdn.shopify.com/static/online-store/theme-skeleton.zip",p={useNetworkLevelRetry:!0,useAbortSignal:!1,maxRetryTimeMs:90*1e3,recordCommandRetries:!0},z="the required theme access scope";async function rn(e,n){let a=S(e);s("theme-api:fetch-theme");try{let{theme:i}=await c({query:M,session:n,variables:{id:a},responseOptions:{handleErrors:!1},preferredBehaviour:p});if(i)return y({id:f(i.id),processing:i.processing,role:i.role.toLowerCase(),name:i.name})}catch(i){H(i),u(i),V(`Error fetching theme with ID: ${e}`)}}async function sn(e){let n=[],a=null;for(s("theme-api:fetch-themes");;){let i=await b({query:R,session:e,variables:{after:a},responseOptions:{handleErrors:!1},preferredBehaviour:p});i.themes||r("Failed to fetch themes");let{nodes:t,pageInfo:d}=i.themes;if(t.forEach(m=>{let o=y({id:f(m.id),processing:m.processing,role:m.role.toLowerCase(),name:m.name});o&&n.push(o)}),!d.hasNextPage)return n;a=d.endCursor}}async function kn(e,n){s("theme-api:find-development-theme-by-name");let{themes:a}=await b({query:G,session:n,variables:{name:e},responseOptions:{handleErrors:!1},preferredBehaviour:p});if(a||r("Failed to fetch themes"),a.nodes.length>1)throw u(new N(`More than one development theme is named "${e}"`));if(a.nodes.length===1){let{id:i,processing:t,role:d,name:m}=a.nodes[0];return y({id:f(i),processing:t,role:d.toLowerCase(),name:m})}}async function un(e,n){let a=e.src??Q;s("theme-api:create-theme");let{themeCreate:i}=await c({query:B,session:n,variables:{name:e.name??"",source:a,role:(e.role??g).toUpperCase()},responseOptions:{handleErrors:!1},preferredBehaviour:p});i||r("Failed to create theme");let{theme:t,userErrors:d}=i;if(d.length){let m=i.userErrors.map(o=>o.message).join(", ");throw u(new N(m))}return t||r("Failed to create theme"),y({id:f(t.id),name:t.name,role:t.role.toLowerCase()})}async function cn(e,n,a){let i=[],t=null;for(s("theme-api:fetch-assets");;){let d=await b({query:C,session:a,variables:{id:D(e),filenames:n,after:t},responseOptions:{handleErrors:!1},preferredBehaviour:p});if(!d.theme?.files?.nodes||!d.theme?.files?.pageInfo){let k=d.theme?.files?.userErrors.map(h=>h.filename).join(", ");r(`Error fetching assets: ${k}`)}let{nodes:m,pageInfo:o}=d.theme.files;if(i.push(...await Promise.all(m.map(async k=>{let{attachment:h,value:v}=await Z(k.body);return{attachment:h,key:k.filename,checksum:k.checksumMd5,value:v}}))),!o.hasNextPage)return i;t=o.endCursor}}async function pn(e,n,a){let t=[];s("theme-api:delete-assets");for(let d=0;d<n.length;d+=50){let m=n.slice(d,d+50),{themeFilesDelete:o}=await c({query:U,session:a,variables:{themeId:S(e),files:m},preferredBehaviour:p});o||r("Failed to delete theme assets");let{deletedThemeFiles:k,userErrors:h}=o;k&&k.forEach(v=>{t.push({key:v.filename,success:!0,operation:F.Delete})}),h.length>0&&h.forEach(v=>{v.filename?(u(`Asset deletion failed for ${v.filename}: ${v.message}`),t.push({key:v.filename,success:!1,operation:F.Delete,errors:{asset:[v.message]}})):r(`Failed to delete theme assets: ${v.message}`)})}return t}async function vn(e,n,a){let i=[];s("theme-api:bulk-upload-assets");for(let t=0;t<n.length;t+=50){let d=n.slice(t,t+50),m=X(d);T("theme-api:upload-files");let o=await K(e,m,a);T("theme-api:upload-files"),i.push(...W(o))}return i}function X(e){return e.map(n=>n.attachment?{filename:n.key,body:{type:"BASE64",value:n.attachment}}:{filename:n.key,body:{type:"TEXT",value:n.value??""}})}async function K(e,n,a){return c({query:P,session:a,variables:{themeId:D(e),files:n},preferredBehaviour:p})}function W(e){let{themeFilesUpsert:n}=e;n||r("Failed to upload theme files");let{upsertedThemeFiles:a,userErrors:i}=n,t=[];return a?.forEach(d=>{t.push({key:d.filename,success:!0,operation:F.Upload})}),i.forEach(d=>{d.filename||r(`Error uploading theme files: ${d.message}`),u(`Asset upload failed for ${d.filename}: ${d.message}`),t.push({key:d.filename,success:!1,operation:F.Upload,errors:{asset:[d.message]}})}),t}async function Nn(e,n){let a=[],i=null;for(s("theme-api:fetch-checksums");;){let t=await b({query:q,session:n,variables:{id:D(e),after:i},responseOptions:{handleErrors:!1},preferredBehaviour:p});if(!t?.theme?.files?.nodes||!t?.theme?.files?.pageInfo){let o=t.theme?.files?.userErrors.map(k=>k.filename).join(", ");throw u(new N(`Failed to fetch checksums for: ${o}`))}let{nodes:d,pageInfo:m}=t.theme.files;if(a.push(...d.map(o=>({key:o.filename,checksum:o.checksumMd5}))),!m.hasNextPage)return a;i=m.endCursor}}async function hn(e,n,a){let i=n.name,t={};i&&(t.name=i),s("theme-api:update-theme");let{themeUpdate:d}=await c({query:A,session:a,variables:{id:S(e),input:t},preferredBehaviour:p});d||r("Failed to update theme");let{theme:m,userErrors:o}=d;if(o.length){let k=d.userErrors.map(h=>h.message).join(", ");throw u(new N(k))}return m||r("Failed to update theme"),y({id:f(m.id),name:m.name,role:m.role.toLowerCase()})}async function fn(e,n){s("theme-api:publish-theme");let{themePublish:a}=await c({query:O,session:n,variables:{id:S(e)},preferredBehaviour:p});a||r("Failed to update theme");let{theme:i,userErrors:t}=a;if(t.length){let d=a.userErrors.map(m=>m.message).join(", ");throw u(new N(d))}return i||r("Failed to update theme"),y({id:f(i.id),name:i.name,role:i.role.toLowerCase()})}async function yn(e,n){s("theme-api:delete-theme");let{themeDelete:a}=await c({query:x,session:n,variables:{id:S(e)},preferredBehaviour:p});a||r("Failed to update theme");let{deletedThemeId:i,userErrors:t}=a;if(t.length){let d=a.userErrors.map(m=>m.message).join(", ");throw u(new N(d))}return i||r("Failed to update theme"),!0}async function Sn(e,n,a){let i;s("theme-api:duplicate-theme");let{themeDuplicate:t}=await c({query:I,session:a,variables:{id:S(e),name:n},preferredBehaviour:p,responseOptions:{onResponse:k=>{i=k.headers.get("x-request-id")??void 0}}});if(!t)return u("Failed to duplicate theme"),{theme:void 0,userErrors:[{message:"Failed to duplicate theme"}],requestId:i};let{newTheme:d,userErrors:m}=t;return m.length>0?{theme:void 0,userErrors:m,requestId:i}:d?{theme:y({id:f(d.id),name:d.name,role:d.role.toLowerCase()}),userErrors:[],requestId:i}:{theme:void 0,userErrors:[{message:"Failed to duplicate theme"}],requestId:i}}async function Fn(e,n){s("theme-api:fetch-metafield-definitions");let{metafieldDefinitions:a}=await c({query:L,session:n,variables:{ownerType:e}});return a.nodes.map(i=>({key:i.key,namespace:i.namespace,name:i.name,description:i.description,type:{name:i.type.name,category:i.type.category}}))}async function bn(e){s("theme-api:check-password-protection");let{onlineStore:n}=await c({query:$,session:e});n||r("Unable to get details about the storefront's password protection");let{passwordProtection:a}=n;return a.enabled}function r(e){throw u(new N(e))}async function b(e){try{return await c(e)}catch(n){throw H(n),n}}function H(e){if(!(e instanceof E))return;let n=Y(e);if(!n)return;let a=[["If you authenticated with an Admin API access token, update the app or integration that issued the token to include the required theme access scopes, then reauthorize it or generate a new token."],["For",{command:"theme pull"},{char:","},{command:"theme list"},{char:","},"and",{command:"theme info"},{char:","},"add the",{command:"read_themes"},"scope",{char:"."}],["For",{command:"theme push"},"and",{command:"theme dev"},{char:","},"add both the",{command:"read_themes"},"and",{command:"write_themes"},"scopes",{char:"."}],["If you authenticated with your Shopify account, make sure your staff or collaborator account can access Online Store themes, then run",{command:"shopify auth logout"},"and try again",{char:"."}],["See",{link:{label:"Shopify access scopes",url:"https://shopify.dev/api/usage/access-scopes"}},{char:"."}]];throw u(new N(`The authenticated account or access token is missing ${n}.`,void 0,a))}function Y(e){let n=e.response.errors;if(!Array.isArray(n))return;let a=n.find(t=>t.extensions?.code==="ACCESS_DENIED");if(!a)return;let i=a.extensions?.requiredAccess;return typeof i!="string"?z:i.trim().replace(/\.$/,"")||z}function D(e){return`gid://shopify/OnlineStoreTheme/${e}`}async function Z(e){switch(e.__typename){case"OnlineStoreThemeFileBodyText":return{value:e.content};case"OnlineStoreThemeFileBodyBase64":return{attachment:e.contentBase64};case"OnlineStoreThemeFileBodyUrl":try{let a=await(await fetch(e.url)).arrayBuffer();return{attachment:Buffer.from(a).toString("base64")}}catch{throw u(new N(`Error downloading content from URL: ${e.url}`))}}}export{re as a,g as b,ne as c,ie as d,ae as e,te as f,rn as g,sn as h,kn as i,un as j,cn as k,pn as l,vn as m,Nn as n,hn as o,fn as p,yn as q,Sn as r,Fn as s,bn as t};
1
+ import{b as c}from"./chunk-TGM7L6RV.js";import{h as E,ua as T,va as u,xa as s}from"./chunk-3EQY5B4S.js";import{F as w}from"./chunk-YYLEWVO6.js";import{d as N}from"./chunk-AUZCENYI.js";import{Pb as V,T as _}from"./chunk-BXDZX3BS.js";import{g as l}from"./chunk-VKWPEFWQ.js";l();var j=/gid:\/\/shopify\/\w*\/(\d+)/,g="development",ne="live",ie="unpublished";function ae(e){return e.role===g}async function te(e){let n=await _("creative");return w({message:e,defaultValue:n})}function S(e){return`gid://shopify/OnlineStoreTheme/${e}`}function f(e){let n=j.exec(e);if(n&&n[1]!==void 0)return parseInt(n[1],10);throw new Error(`Invalid GID: ${e}`)}l();l();var F;(function(e){e.Delete="DELETE",e.Upload="UPLOAD"})(F||(F={}));l();function y(e){if(!e)return;e.processing??(e.processing=!1),e.createdAtRuntime??(e.createdAtRuntime=!1);let{id:n,name:a,role:i,processing:t,createdAtRuntime:d}=e;return{id:n,name:a,processing:t,createdAtRuntime:d,role:i==="main"?"live":i}}function re(e){if(!e)return;let{key:n,checksum:a,attachment:i,value:t}=e,d={size:(t||i||"").length,mtime:Date.now()};return{key:n,checksum:a,attachment:i,value:t,stats:d}}l();var A={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themeUpdate"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"input"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"OnlineStoreThemeInput"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themeUpdate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}},{kind:"Argument",name:{kind:"Name",value:"input"},value:{kind:"Variable",name:{kind:"Name",value:"input"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"theme"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"field"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var x={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themeDelete"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themeDelete"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"deletedThemeId"}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"field"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var I={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themeDuplicate"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"name"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themeDuplicate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}},{kind:"Argument",name:{kind:"Name",value:"name"},value:{kind:"Variable",name:{kind:"Name",value:"name"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"newTheme"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"field"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var O={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themePublish"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themePublish"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"theme"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"field"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var B={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themeCreate"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"name"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"source"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"URL"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"role"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ThemeRole"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themeCreate"},arguments:[{kind:"Argument",name:{kind:"Name",value:"name"},value:{kind:"Variable",name:{kind:"Name",value:"name"}}},{kind:"Argument",name:{kind:"Name",value:"source"},value:{kind:"Variable",name:{kind:"Name",value:"source"}}},{kind:"Argument",name:{kind:"Name",value:"role"},value:{kind:"Variable",name:{kind:"Name",value:"role"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"theme"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"field"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var C={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"getThemeFileBodies"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"filenames"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"theme"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"files"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"250"}},{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}},{kind:"Argument",name:{kind:"Name",value:"filenames"},value:{kind:"Variable",name:{kind:"Name",value:"filenames"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"size"}},{kind:"Field",name:{kind:"Name",value:"checksumMd5"}},{kind:"Field",name:{kind:"Name",value:"body"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename"}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"OnlineStoreThemeFileBodyText"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"content"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"OnlineStoreThemeFileBodyBase64"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"contentBase64"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:"OnlineStoreThemeFileBodyUrl"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"url"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"code"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"pageInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hasNextPage"}},{kind:"Field",name:{kind:"Name",value:"endCursor"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var q={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"getThemeFileChecksums"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"theme"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"files"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"250"}},{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"size"}},{kind:"Field",name:{kind:"Name",value:"checksumMd5"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"code"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"pageInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hasNextPage"}},{kind:"Field",name:{kind:"Name",value:"endCursor"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var P={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themeFilesUpsert"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"files"}},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"OnlineStoreThemeFilesUpsertFileInput"}}}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"themeId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themeFilesUpsert"},arguments:[{kind:"Argument",name:{kind:"Name",value:"files"},value:{kind:"Variable",name:{kind:"Name",value:"files"}}},{kind:"Argument",name:{kind:"Name",value:"themeId"},value:{kind:"Variable",name:{kind:"Name",value:"themeId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"upsertedThemeFiles"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var U={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"themeFilesDelete"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"themeId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"files"}},type:{kind:"NonNullType",type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themeFilesDelete"},arguments:[{kind:"Argument",name:{kind:"Name",value:"themeId"},value:{kind:"Variable",name:{kind:"Name",value:"themeId"}}},{kind:"Argument",name:{kind:"Name",value:"files"},value:{kind:"Variable",name:{kind:"Name",value:"files"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"deletedThemeFiles"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"userErrors"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"filename"}},{kind:"Field",name:{kind:"Name",value:"code"}},{kind:"Field",name:{kind:"Name",value:"message"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var L={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"metafieldDefinitionsByOwnerType"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"ownerType"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"MetafieldOwnerType"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"metafieldDefinitions"},arguments:[{kind:"Argument",name:{kind:"Name",value:"ownerType"},value:{kind:"Variable",name:{kind:"Name",value:"ownerType"}}},{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"250"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"key"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"namespace"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"type"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"category"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var R={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"getThemes"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"after"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themes"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"50"}},{kind:"Argument",name:{kind:"Name",value:"after"},value:{kind:"Variable",name:{kind:"Name",value:"after"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"processing"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"pageInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"hasNextPage"}},{kind:"Field",name:{kind:"Name",value:"endCursor"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var M={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"getTheme"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"theme"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"processing"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var G={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"findDevelopmentThemeByName"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"name"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"themes"},arguments:[{kind:"Argument",name:{kind:"Name",value:"first"},value:{kind:"IntValue",value:"2"}},{kind:"Argument",name:{kind:"Name",value:"names"},value:{kind:"ListValue",values:[{kind:"Variable",name:{kind:"Name",value:"name"}}]}},{kind:"Argument",name:{kind:"Name",value:"roles"},value:{kind:"ListValue",values:[{kind:"EnumValue",value:"DEVELOPMENT"}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"nodes"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"role"}},{kind:"Field",name:{kind:"Name",value:"processing"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};l();var $={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"OnlineStorePasswordProtection"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"onlineStore"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"passwordProtection"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"enabled"}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}},{kind:"Field",name:{kind:"Name",value:"__typename"}}]}}]}}]};var Q="https://cdn.shopify.com/static/online-store/theme-skeleton.zip",p={useNetworkLevelRetry:!0,useAbortSignal:!1,maxRetryTimeMs:90*1e3,recordCommandRetries:!0},z="the required theme access scope";async function rn(e,n){let a=S(e);s("theme-api:fetch-theme");try{let{theme:i}=await c({query:M,session:n,variables:{id:a},responseOptions:{handleErrors:!1},preferredBehaviour:p});if(i)return y({id:f(i.id),processing:i.processing,role:i.role.toLowerCase(),name:i.name})}catch(i){H(i),u(i),V(`Error fetching theme with ID: ${e}`)}}async function sn(e){let n=[],a=null;for(s("theme-api:fetch-themes");;){let i=await b({query:R,session:e,variables:{after:a},responseOptions:{handleErrors:!1},preferredBehaviour:p});i.themes||r("Failed to fetch themes");let{nodes:t,pageInfo:d}=i.themes;if(t.forEach(m=>{let o=y({id:f(m.id),processing:m.processing,role:m.role.toLowerCase(),name:m.name});o&&n.push(o)}),!d.hasNextPage)return n;a=d.endCursor}}async function kn(e,n){s("theme-api:find-development-theme-by-name");let{themes:a}=await b({query:G,session:n,variables:{name:e},responseOptions:{handleErrors:!1},preferredBehaviour:p});if(a||r("Failed to fetch themes"),a.nodes.length>1)throw u(new N(`More than one development theme is named "${e}"`));if(a.nodes.length===1){let{id:i,processing:t,role:d,name:m}=a.nodes[0];return y({id:f(i),processing:t,role:d.toLowerCase(),name:m})}}async function un(e,n){let a=e.src??Q;s("theme-api:create-theme");let{themeCreate:i}=await c({query:B,session:n,variables:{name:e.name??"",source:a,role:(e.role??g).toUpperCase()},responseOptions:{handleErrors:!1},preferredBehaviour:p});i||r("Failed to create theme");let{theme:t,userErrors:d}=i;if(d.length){let m=i.userErrors.map(o=>o.message).join(", ");throw u(new N(m))}return t||r("Failed to create theme"),y({id:f(t.id),name:t.name,role:t.role.toLowerCase()})}async function cn(e,n,a){let i=[],t=null;for(s("theme-api:fetch-assets");;){let d=await b({query:C,session:a,variables:{id:D(e),filenames:n,after:t},responseOptions:{handleErrors:!1},preferredBehaviour:p});if(!d.theme?.files?.nodes||!d.theme?.files?.pageInfo){let k=d.theme?.files?.userErrors.map(h=>h.filename).join(", ");r(`Error fetching assets: ${k}`)}let{nodes:m,pageInfo:o}=d.theme.files;if(i.push(...await Promise.all(m.map(async k=>{let{attachment:h,value:v}=await Z(k.body);return{attachment:h,key:k.filename,checksum:k.checksumMd5,value:v}}))),!o.hasNextPage)return i;t=o.endCursor}}async function pn(e,n,a){let t=[];s("theme-api:delete-assets");for(let d=0;d<n.length;d+=50){let m=n.slice(d,d+50),{themeFilesDelete:o}=await c({query:U,session:a,variables:{themeId:S(e),files:m},preferredBehaviour:p});o||r("Failed to delete theme assets");let{deletedThemeFiles:k,userErrors:h}=o;k&&k.forEach(v=>{t.push({key:v.filename,success:!0,operation:F.Delete})}),h.length>0&&h.forEach(v=>{v.filename?(u(`Asset deletion failed for ${v.filename}: ${v.message}`),t.push({key:v.filename,success:!1,operation:F.Delete,errors:{asset:[v.message]}})):r(`Failed to delete theme assets: ${v.message}`)})}return t}async function vn(e,n,a){let i=[];s("theme-api:bulk-upload-assets");for(let t=0;t<n.length;t+=50){let d=n.slice(t,t+50),m=X(d);T("theme-api:upload-files");let o=await K(e,m,a);T("theme-api:upload-files"),i.push(...W(o))}return i}function X(e){return e.map(n=>n.attachment?{filename:n.key,body:{type:"BASE64",value:n.attachment}}:{filename:n.key,body:{type:"TEXT",value:n.value??""}})}async function K(e,n,a){return c({query:P,session:a,variables:{themeId:D(e),files:n},preferredBehaviour:p})}function W(e){let{themeFilesUpsert:n}=e;n||r("Failed to upload theme files");let{upsertedThemeFiles:a,userErrors:i}=n,t=[];return a?.forEach(d=>{t.push({key:d.filename,success:!0,operation:F.Upload})}),i.forEach(d=>{d.filename||r(`Error uploading theme files: ${d.message}`),u(`Asset upload failed for ${d.filename}: ${d.message}`),t.push({key:d.filename,success:!1,operation:F.Upload,errors:{asset:[d.message]}})}),t}async function Nn(e,n){let a=[],i=null;for(s("theme-api:fetch-checksums");;){let t=await b({query:q,session:n,variables:{id:D(e),after:i},responseOptions:{handleErrors:!1},preferredBehaviour:p});if(!t?.theme?.files?.nodes||!t?.theme?.files?.pageInfo){let o=t.theme?.files?.userErrors.map(k=>k.filename).join(", ");throw u(new N(`Failed to fetch checksums for: ${o}`))}let{nodes:d,pageInfo:m}=t.theme.files;if(a.push(...d.map(o=>({key:o.filename,checksum:o.checksumMd5}))),!m.hasNextPage)return a;i=m.endCursor}}async function hn(e,n,a){let i=n.name,t={};i&&(t.name=i),s("theme-api:update-theme");let{themeUpdate:d}=await c({query:A,session:a,variables:{id:S(e),input:t},preferredBehaviour:p});d||r("Failed to update theme");let{theme:m,userErrors:o}=d;if(o.length){let k=d.userErrors.map(h=>h.message).join(", ");throw u(new N(k))}return m||r("Failed to update theme"),y({id:f(m.id),name:m.name,role:m.role.toLowerCase()})}async function fn(e,n){s("theme-api:publish-theme");let{themePublish:a}=await c({query:O,session:n,variables:{id:S(e)},preferredBehaviour:p});a||r("Failed to update theme");let{theme:i,userErrors:t}=a;if(t.length){let d=a.userErrors.map(m=>m.message).join(", ");throw u(new N(d))}return i||r("Failed to update theme"),y({id:f(i.id),name:i.name,role:i.role.toLowerCase()})}async function yn(e,n){s("theme-api:delete-theme");let{themeDelete:a}=await c({query:x,session:n,variables:{id:S(e)},preferredBehaviour:p});a||r("Failed to update theme");let{deletedThemeId:i,userErrors:t}=a;if(t.length){let d=a.userErrors.map(m=>m.message).join(", ");throw u(new N(d))}return i||r("Failed to update theme"),!0}async function Sn(e,n,a){let i;s("theme-api:duplicate-theme");let{themeDuplicate:t}=await c({query:I,session:a,variables:{id:S(e),name:n},preferredBehaviour:p,responseOptions:{onResponse:k=>{i=k.headers.get("x-request-id")??void 0}}});if(!t)return u("Failed to duplicate theme"),{theme:void 0,userErrors:[{message:"Failed to duplicate theme"}],requestId:i};let{newTheme:d,userErrors:m}=t;return m.length>0?{theme:void 0,userErrors:m,requestId:i}:d?{theme:y({id:f(d.id),name:d.name,role:d.role.toLowerCase()}),userErrors:[],requestId:i}:{theme:void 0,userErrors:[{message:"Failed to duplicate theme"}],requestId:i}}async function Fn(e,n){s("theme-api:fetch-metafield-definitions");let{metafieldDefinitions:a}=await c({query:L,session:n,variables:{ownerType:e}});return a.nodes.map(i=>({key:i.key,namespace:i.namespace,name:i.name,description:i.description,type:{name:i.type.name,category:i.type.category}}))}async function bn(e){s("theme-api:check-password-protection");let{onlineStore:n}=await c({query:$,session:e});n||r("Unable to get details about the storefront's password protection");let{passwordProtection:a}=n;return a.enabled}function r(e){throw u(new N(e))}async function b(e){try{return await c(e)}catch(n){throw H(n),n}}function H(e){if(!(e instanceof E))return;let n=Y(e);if(!n)return;let a=[["If you authenticated with an Admin API access token, update the app or integration that issued the token to include the required theme access scopes, then reauthorize it or generate a new token."],["For",{command:"theme pull"},{char:","},{command:"theme list"},{char:","},"and",{command:"theme info"},{char:","},"add the",{command:"read_themes"},"scope",{char:"."}],["For",{command:"theme push"},"and",{command:"theme dev"},{char:","},"add both the",{command:"read_themes"},"and",{command:"write_themes"},"scopes",{char:"."}],["If you authenticated with your Shopify account, make sure your staff or collaborator account can access Online Store themes, then run",{command:"shopify auth logout"},"and try again",{char:"."}],["See",{link:{label:"Shopify access scopes",url:"https://shopify.dev/api/usage/access-scopes"}},{char:"."}]];throw u(new N(`The authenticated account or access token is missing ${n}.`,void 0,a))}function Y(e){let n=e.response.errors;if(!Array.isArray(n))return;let a=n.find(t=>t.extensions?.code==="ACCESS_DENIED");if(!a)return;let i=a.extensions?.requiredAccess;return typeof i!="string"?z:i.trim().replace(/\.$/,"")||z}function D(e){return`gid://shopify/OnlineStoreTheme/${e}`}async function Z(e){switch(e.__typename){case"OnlineStoreThemeFileBodyText":return{value:e.content};case"OnlineStoreThemeFileBodyBase64":return{attachment:e.contentBase64};case"OnlineStoreThemeFileBodyUrl":try{let a=await(await fetch(e.url)).arrayBuffer();return{attachment:Buffer.from(a).toString("base64")}}catch{throw u(new N(`Error downloading content from URL: ${e.url}`))}}}export{re as a,g as b,ne as c,ie as d,ae as e,te as f,rn as g,sn as h,kn as i,un as j,cn as k,pn as l,vn as m,Nn as n,hn as o,fn as p,yn as q,Sn as r,Fn as s,bn as t};
@@ -1 +1 @@
1
- import{a}from"./chunk-QDVJJKLB.js";import{g as t}from"./chunk-VKWPEFWQ.js";t();var e=async()=>a.getAllSensitiveMetadata(),i=e;export{i as a};
1
+ import{a}from"./chunk-2MDFREEW.js";import{g as t}from"./chunk-VKWPEFWQ.js";t();var e=async()=>a.getAllSensitiveMetadata(),i=e;export{i as a};
@@ -1 +1 @@
1
- import{b as e}from"./chunk-HOSFU6UP.js";import{r}from"./chunk-T6CC5WUU.js";import{e as c,g as t}from"./chunk-VKWPEFWQ.js";t();var s=c(r(),1);var a=class o extends e{static{this.args={command:s.Args.string({description:"Command to show help for.",required:!1})}}static{this.description="Display help for Shopify CLI"}static{this.usage="help [command] [flags]"}static{this.flags={"nested-commands":s.Flags.boolean({char:"n",description:"Include all nested commands in the output.",env:"SHOPIFY_FLAG_CLI_NESTED_COMMANDS",default:!1})}}static{this.strict=!1}async run(){let{argv:i,flags:n}=await this.parse(o),l=await(0,s.loadHelpClass)(this.config);await new l(this.config,{all:n["nested-commands"]}).showHelp(i)}};export{a};
1
+ import{b as e}from"./chunk-74IG3ZE3.js";import{r}from"./chunk-T6CC5WUU.js";import{e as c,g as t}from"./chunk-VKWPEFWQ.js";t();var s=c(r(),1);var a=class o extends e{static{this.args={command:s.Args.string({description:"Command to show help for.",required:!1})}}static{this.description="Display help for Shopify CLI"}static{this.usage="help [command] [flags]"}static{this.flags={"nested-commands":s.Flags.boolean({char:"n",description:"Include all nested commands in the output.",env:"SHOPIFY_FLAG_CLI_NESTED_COMMANDS",default:!1})}}static{this.strict=!1}async run(){let{argv:i,flags:n}=await this.parse(o),l=await(0,s.loadHelpClass)(this.config);await new l(this.config,{all:n["nested-commands"]}).showHelp(i)}};export{a};
@@ -1,4 +1,4 @@
1
- import{k as S,q as E}from"./chunk-TUNUEOHO.js";import{$ as re,aa as G}from"./chunk-4J32OHLY.js";import{r as C}from"./chunk-ANBOLDON.js";import{b as $}from"./chunk-OXJBYKMX.js";import{u as w,v as N}from"./chunk-NTRAWIEJ.js";import{r as oe}from"./chunk-T6CC5WUU.js";import{$a as A,Lb as l,Mb as P,N as x,Nb as T,Pb as L,Ta as b,na as R,ua as _}from"./chunk-7FQFEB33.js";import{d as F,p as I}from"./chunk-773TIA5M.js";import{e as O,g as k}from"./chunk-VKWPEFWQ.js";k();k();var i=O(G(),1),y=O(re(),1);function ie(t){switch(t){case"error":return i.Severity.ERROR;case"suggestion":case"warning":return i.Severity.WARNING;case"style":case"info":return i.Severity.INFO;case"crash":return}}function j(t){switch(t){case i.Severity.ERROR:return"error";case i.Severity.WARNING:return"warning";case i.Severity.INFO:return"info"}}function se(t,e,n){let o=i.path.fsPath(t),c=R(o).toString().split(`
1
+ import{p as S,v as E}from"./chunk-JGN7YG5X.js";import{$ as re,aa as G}from"./chunk-7BVXGS44.js";import{r as C}from"./chunk-HX3TALXV.js";import{b as $}from"./chunk-S5JJL3BP.js";import{u as w,v as N}from"./chunk-YYLEWVO6.js";import{$a as A,Lb as l,Mb as P,N as x,Nb as T,Pb as L,Ta as b,na as R,ua as _}from"./chunk-BXDZX3BS.js";import{d as F,p as I}from"./chunk-773TIA5M.js";import{r as oe}from"./chunk-T6CC5WUU.js";import{e as O,g as k}from"./chunk-VKWPEFWQ.js";k();k();var i=O(G(),1),y=O(re(),1);function ie(t){switch(t){case"error":return i.Severity.ERROR;case"suggestion":case"warning":return i.Severity.WARNING;case"style":case"info":return i.Severity.INFO;case"crash":return}}function j(t){switch(t){case i.Severity.ERROR:return"error";case i.Severity.WARNING:return"warning";case i.Severity.INFO:return"info"}}function se(t,e,n){let o=i.path.fsPath(t),c=R(o).toString().split(`
2
2
  `).slice(e,n+1),a=c.length===1;return c.map((u,h)=>{let f=e+h+1,d=a?u.trim():u;return`${f} ${d}`}).join(`
3
3
  `)}function ce(t){switch(t){case i.Severity.ERROR:return{error:`
4
4
  [error]:`};case i.Severity.WARNING:return{warn:`
@@ -0,0 +1 @@
1
+ import{Eb as x,Sb as P,vb as w}from"./chunk-BXDZX3BS.js";import{e as g}from"./chunk-773TIA5M.js";import{r as T}from"./chunk-T6CC5WUU.js";import{c as h,e as O,g as u}from"./chunk-VKWPEFWQ.js";var M=h(a=>{"use strict";u();a.__esModule=void 0;a.__esModule=!0;var B=typeof Object.setPrototypeOf=="function",R=typeof Object.getPrototypeOf=="function",U=typeof Object.defineProperty=="function",q=typeof Object.create=="function",z=typeof Object.prototype.hasOwnProperty=="function",H=function(e,r){B?Object.setPrototypeOf(e,r):e.__proto__=r};a.setPrototypeOf=H;var L=function(e){return R?Object.getPrototypeOf(e):e.__proto__||e.prototype};a.getPrototypeOf=L;var j=!1,Y=function t(e,r,n){if(U&&!j)try{Object.defineProperty(e,r,n)}catch{j=!0,t(e,r,n)}else e[r]=n.value};a.defineProperty=Y;var k=function(e,r){return z?e.hasOwnProperty(e,r):e[r]===void 0};a.hasOwnProperty=k;var D=function(e,r){if(q)return Object.create(e,r);var n=function(){};n.prototype=e;var s=new n;if(typeof r>"u")return s;if(typeof r=="null")throw new Error("PropertyDescriptors must not be null.");if(typeof r=="object")for(var o in r)k(r,o)&&(s[o]=r[o].value);return s};a.objectCreate=D});var S=h(f=>{"use strict";u();f.__esModule=void 0;f.__esModule=!0;var b=M(),G=b.setPrototypeOf,Z=b.getPrototypeOf,v=b.defineProperty,J=b.objectCreate,K=new Error().toString()==="[object Error]",m="";function p(t){var e=this.constructor,r=e.name||(function(){var y=e.toString().match(/^function\s*([^\s(]+)/);return y===null?m||"Error":y[1]})(),n=r==="Error",s=n?m:r,o=Error.apply(this,arguments);if(G(o,Z(this)),!(o instanceof e)||!(o instanceof p)){var o=this;Error.apply(this,arguments),v(o,"message",{configurable:!0,enumerable:!1,value:t,writable:!0})}if(v(o,"name",{configurable:!0,enumerable:!1,value:s,writable:!0}),Error.captureStackTrace&&Error.captureStackTrace(o,n?p:e),o.stack===void 0){var c=new Error(t);c.name=o.name,o.stack=c.stack}return K&&v(o,"toString",{configurable:!0,enumerable:!1,value:function(){return(this.name||"Error")+(typeof this.message>"u"?"":": "+this.message)},writable:!0}),o}m=p.name||"ExtendableError";p.prototype=J(Error.prototype,{constructor:{value:Error,enumerable:!1,writable:!0,configurable:!0}});f.ExtendableError=p;f.default=f.ExtendableError});u();var A=O(T()),V=O(S()),i;(function(t){t[t.Abort=0]="Abort",t[t.AbortSilent=1]="AbortSilent",t[t.Bug=2]="Bug"})(i||(i={}));var _=class extends Error{},l=class extends Error{constructor(e,r,n=null,s,o){let c=typeof e=="string"||"value"in e;super(c?P(e):w(e)),n?n instanceof x?this.tryMessage=P(n):this.tryMessage=n:this.tryMessage=null,this.type=r,this.nextSteps=s,this.customSections=o,this.skipOclifErrorHandling=!0,c||(this.formattedMessage=e)}},E=class extends l{constructor(e,r=null,n,s){super(e,i.Abort,r,n,s)}},I=class extends l{constructor(e,r,n,s=null){super(e,i.Abort,s),this.command=r,this.args=n}},C=class extends l{constructor(){super("",i.AbortSilent)}},d=class extends l{constructor(e,r=null){super(e,i.Bug,r)}};async function ne(t){let e;if(N(t))e=t;else if(typeof t=="string")e=new d(t);else if(t instanceof Error)e=new d(t.message),e.stack=t.stack;else{let n=t;e=new d(n?.message??"Unknown error"),n?.stack&&(e.stack=n?.stack)}let{renderFatalError:r}=await import("./ui-AXZBGWIQ.js");return r(e),Promise.resolve(t)}function oe(t){if(t instanceof A.Errors.CLIError){let e=new E(t.message);return e.stack=t.stack,Promise.resolve(e)}else return Promise.resolve(t)}function N(t){try{return Object.prototype.hasOwnProperty.call(t,"type")}catch{return!1}}function se(t){if(!N(t)){if(t instanceof Error){let e=t.message;return!Q(e)}return!0}return t.type===i.Bug}function ae(t){return g(t).replace("file:/","/").replace(/^\/?[A-Z]:/,"")}function Q(t){return["EPERM: operation not permitted, scandir","EPERM: operation not permitted, rename","EACCES: permission denied","EPERM: operation not permitted, symlink","This version of npm supports the following node versions","EBUSY: resource busy or locked","ENOTEMPTY: directory not empty","getaddrinfo ENOTFOUND","Client network socket disconnected before secure TLS connection was established","spawn EPERM","socket hang up","The user aborted a request.","write EPIPE","Unsupported platform"].some(n=>t.includes(n))}export{i as a,_ as b,l as c,E as d,I as e,C as f,d as g,ne as h,oe as i,se as j,ae as k,V as l};
@@ -0,0 +1,2 @@
1
+ import{a as B,b as E}from"./chunk-3OE5HXHO.js";import{b as y,c as A,l as C,n as F,o as S,t as x}from"./chunk-WU6GIY22.js";import{a as D}from"./chunk-PLHJQQVZ.js";import{a as w}from"./chunk-6V37CHBZ.js";import{z as f}from"./chunk-3EQY5B4S.js";import{b as O}from"./chunk-S5JJL3BP.js";import{u as l,v as k,w as b,x as g}from"./chunk-YYLEWVO6.js";import{Fb as h,Hb as I}from"./chunk-BXDZX3BS.js";import{r as _}from"./chunk-T6CC5WUU.js";import{e as z,g as s}from"./chunk-VKWPEFWQ.js";s();s();async function T(n){let{organization:a,storeFqdn:o,operationId:r,remoteApp:u}=n;l({headline:"Canceling bulk operation.",body:[{list:{items:[`ID: ${r}`,...E({organization:a,remoteApp:u,storeFqdn:o})]}}]});let v=await B(u,o),p=await C({adminSession:v,operationId:r});if(p?.userErrors?.length){F(p.userErrors,"Failed to cancel bulk operation.");return}let i=p?.bulkOperation;if(i){let t=S(i),d=i.status==="CANCELING"?[`This may take a few moments. Check the status with:
2
+ `,{command:`shopify app bulk status --id=${A(i.id)}`}]:t.body,c={headline:t.headline,...d&&{body:d},...t.customSections&&{customSections:t.customSections}};switch(t.renderType){case"success":k(c);break;case"warning":b(c);break;case"info":l(c);break}}else g({headline:"Bulk operation not found or could not be canceled.",body:I`ID: ${h.yellow(r)}`.value})}var m=z(_(),1);var q,e=class extends D{async run(){let{flags:a}=await this.parse(q),{appContextResult:o,store:r}=await x(a);return await T({organization:o.organization,storeFqdn:r.shopDomain,operationId:y(a.id),remoteApp:o.remoteApp}),{app:o.app}}};q=e;e.summary="Cancel a bulk operation.";e.description="Cancels a running bulk operation by ID.";e.flags={...O,...w,id:m.Flags.string({description:"The bulk operation ID to cancel (numeric ID or full GID).",env:"SHOPIFY_FLAG_ID",required:!0}),store:m.Flags.string({char:"s",description:"The store domain. Must be an existing dev store.",env:"SHOPIFY_FLAG_STORE",parse:async n=>f(n)})};var K=e;export{K as a};
@@ -1,4 +1,4 @@
1
- import{a as i}from"./chunk-GCN4O7HM.js";import{r as t}from"./chunk-HDC5V7RY.js";import{b as r}from"./chunk-HOSFU6UP.js";import{u as e}from"./chunk-NTRAWIEJ.js";import{g as a}from"./chunk-VKWPEFWQ.js";a();var o=class extends r{static{this.summary="Enable automatic upgrades for Shopify CLI."}static{this.descriptionWithMarkdown=`Enable automatic upgrades for Shopify CLI.
1
+ import{a as i}from"./chunk-GCN4O7HM.js";import{r as t}from"./chunk-TM534QSE.js";import{b as r}from"./chunk-74IG3ZE3.js";import{u as e}from"./chunk-YYLEWVO6.js";import{g as a}from"./chunk-VKWPEFWQ.js";a();var o=class extends r{static{this.summary="Enable automatic upgrades for Shopify CLI."}static{this.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
 
@@ -0,0 +1,7 @@
1
+ import{p,v as d}from"./chunk-JGN7YG5X.js";import{a as u}from"./chunk-ZFOWAMFK.js";import{aa as P}from"./chunk-7BVXGS44.js";import{b as l}from"./chunk-S5JJL3BP.js";import{v as f}from"./chunk-YYLEWVO6.js";import{d as i}from"./chunk-AUZCENYI.js";import{Ta as c,ma as h}from"./chunk-BXDZX3BS.js";import{f as r,n as m}from"./chunk-773TIA5M.js";import{e as w,g as n}from"./chunk-VKWPEFWQ.js";n();n();var g=w(P(),1),k=["assets/**","blocks/**","config/**","layout/**","listings/**/*","locales/**","sections/**","snippets/**","templates/**","templates/customers/**","release-notes.md","update_extension.json"].join("|");async function y(e){let t=await v(e),o=`${e}/${t}`,a=`${e}/(${k})`;await u({inputDirectory:e,outputZipPath:o,matchFilePattern:a}),f({body:["Your local theme was packaged in",{filePath:m(o)}]})}async function v(e){let t=r(e,"config/settings_schema.json");if(!await c(t))throw new i("Provide a config/settings_schema.json to package your theme.");let o=await j(t);if(o===void 0||o.theme_name===void 0)throw new i("Provide a theme_info.theme_name configuration in config/settings_schema.json.");return`${[o.theme_name,o.theme_version].filter(Boolean).join("-")}.zip`}async function j(e){let t=(0,g.parseJSON)(await h(e),null,!0);if(!t)throw new i("The file config/settings_schema.json contains an error. Please check if the file is valid JSON and includes the theme_info.theme_name configuration.");return t.find(o=>o.name==="theme_info")}var _,s=class extends d{async command(t){await y(t.path)}};_=s;s.summary="Package your theme into a .zip file, ready to upload to the Online Store.";s.descriptionWithMarkdown=`Packages your local theme files into a ZIP file that can be uploaded to Shopify.
2
+
3
+ Only folders that match the [default Shopify theme folder structure](https://shopify.dev/docs/storefronts/themes/tools/cli#directory-structure) are included in the package.
4
+
5
+ The package includes the \`listings\` directory if present (required for multi-preset themes per [Theme Store requirements](https://shopify.dev/docs/storefronts/themes/store/requirements#adding-presets-to-your-theme-zip-submission)).
6
+
7
+ The ZIP file uses the name \`theme_name-theme_version.zip\`, based on parameters in your [settings_schema.json](https://shopify.dev/docs/storefronts/themes/architecture/config/settings-schema-json) file.`;s.description=_.descriptionWithoutMarkdown();s.flags={...l,path:p.path};s.multiEnvironmentsFlags=null;var E=s;export{E as a};
@@ -1 +1 @@
1
- import{a as u}from"./chunk-3SPDFV5D.js";import{g as d}from"./chunk-VKWPEFWQ.js";d();var m=!1;function v(){return m}function y(){let t=0,e=!1,i=setInterval(()=>{if(!e){if(v()||t>=12e4){e=!0,clearInterval(i),u(process.pid,"SIGINT",!1,()=>{process.exit(0)});return}t+=100}},100)}var k=async({config:a,Command:o})=>{await I(o);let t=await import("./metadata-UEUN64TK.js"),{commandStartOptions:e}=t.getAllSensitiveMetadata();e&&await t.addSensitiveMetadata(()=>({commandStartOptions:{...e,endTime:new Date().getTime()}}));let{postrun:i}=await import("./deprecations-KNUMDRIU.js");i(o);let{outputDebug:n}=await import("./output-S6E37GJQ.js"),r=o.id.replace(/:/g," ");n(`Completed command ${r}`),!r.includes("notifications")&&!r.includes("upgrade")&&await M();let{reportAnalyticsEvent:p}=await import("./analytics-JH64XI2J.js");await p({config:a,exitMode:"ok"}),m=!0};async function M(){let{versionToAutoUpgrade:a,warnIfUpgradeAvailable:o}=await import("./upgrade-TVTCFMXM.js"),t=a();if(!t){await o();return}if(process.env.SHOPIFY_CLI_FORCE_AUTO_UPGRADE==="1")await l(t);else{let{runAtMinimumInterval:i}=await import("./conf-store-UY3MDGGA.js");await i("auto-upgrade",{days:1},async()=>{await l(t)})}}async function l(a){let[{CLI_KIT_VERSION:o},{isMajorVersionChange:t},{outputWarn:e,outputDebug:i},{getOutputUpdateCLIReminder:n,runCLIUpgrade:r,hasBlockingAutoUpgradeNotification:p},s]=await Promise.all([import("./version-RIRW5EXQ.js"),import("./version-J6MDN7BZ.js"),import("./output-S6E37GJQ.js"),import("./upgrade-TVTCFMXM.js"),import("./metadata-UEUN64TK.js")]);if(t(o,a)){e(n(a,!0)),await s.addPublicMetadata(()=>({env_auto_upgrade_skipped_reason:"major_version"}));return}if(await p()){await s.addPublicMetadata(()=>({env_auto_upgrade_skipped_reason:"blocked_by_notification"}));return}try{await r({autoupgrade:!0}),await s.addPublicMetadata(()=>({env_auto_upgrade_success:!0}))}catch(f){let c=`Auto-upgrade failed: ${f}`;i(c),e(n(a)),await s.addPublicMetadata(()=>({env_auto_upgrade_success:!1}));let[{sendErrorToBugsnag:g},{inferPackageManagerForGlobalCLI:w}]=await Promise.all([import("./error-handler-NI7D6GSY.js"),import("./is-global-W6ALVC5L.js")]),_=Object.assign(new Error(c),{packageManager:w(),platform:process.platform,cliVersion:o});await g(_,"expected_error")}}async function I(a){let o=new Date().getTime();if(a&&"analyticsStopCommand"in a&&typeof a.analyticsStopCommand=="function"){let t=a.analyticsStopCommand();if(t){let e=await import("./metadata-UEUN64TK.js"),{commandStartOptions:i}=e.getAllSensitiveMetadata();if(!i)return;await e.addSensitiveMetadata(()=>({commandStartOptions:{...i,startTime:o,startCommand:t}}))}}}export{y as a,k as b};
1
+ import{a as u}from"./chunk-7HZG7FBK.js";import{g as d}from"./chunk-VKWPEFWQ.js";d();var m=!1;function v(){return m}function y(){let t=0,e=!1,i=setInterval(()=>{if(!e){if(v()||t>=12e4){e=!0,clearInterval(i),u(process.pid,"SIGINT",!1,()=>{process.exit(0)});return}t+=100}},100)}var k=async({config:a,Command:o})=>{await I(o);let t=await import("./metadata-APVOKTBV.js"),{commandStartOptions:e}=t.getAllSensitiveMetadata();e&&await t.addSensitiveMetadata(()=>({commandStartOptions:{...e,endTime:new Date().getTime()}}));let{postrun:i}=await import("./deprecations-MOEFN6OW.js");i(o);let{outputDebug:n}=await import("./output-EAPQ7OWD.js"),r=o.id.replace(/:/g," ");n(`Completed command ${r}`),!r.includes("notifications")&&!r.includes("upgrade")&&await M();let{reportAnalyticsEvent:p}=await import("./analytics-DMUNCDGT.js");await p({config:a,exitMode:"ok"}),m=!0};async function M(){let{versionToAutoUpgrade:a,warnIfUpgradeAvailable:o}=await import("./upgrade-SLPJF6LD.js"),t=a();if(!t){await o();return}if(process.env.SHOPIFY_CLI_FORCE_AUTO_UPGRADE==="1")await l(t);else{let{runAtMinimumInterval:i}=await import("./conf-store-V6ILVUUO.js");await i("auto-upgrade",{days:1},async()=>{await l(t)})}}async function l(a){let[{CLI_KIT_VERSION:o},{isMajorVersionChange:t},{outputWarn:e,outputDebug:i},{getOutputUpdateCLIReminder:n,runCLIUpgrade:r,hasBlockingAutoUpgradeNotification:p},s]=await Promise.all([import("./version-3IYH4V5U.js"),import("./version-FAU37PQN.js"),import("./output-EAPQ7OWD.js"),import("./upgrade-SLPJF6LD.js"),import("./metadata-APVOKTBV.js")]);if(t(o,a)){e(n(a,!0)),await s.addPublicMetadata(()=>({env_auto_upgrade_skipped_reason:"major_version"}));return}if(await p()){await s.addPublicMetadata(()=>({env_auto_upgrade_skipped_reason:"blocked_by_notification"}));return}try{await r({autoupgrade:!0}),await s.addPublicMetadata(()=>({env_auto_upgrade_success:!0}))}catch(f){let c=`Auto-upgrade failed: ${f}`;i(c),e(n(a)),await s.addPublicMetadata(()=>({env_auto_upgrade_success:!1}));let[{sendErrorToBugsnag:g},{inferPackageManagerForGlobalCLI:w}]=await Promise.all([import("./error-handler-BOESDKZA.js"),import("./is-global-JOHCPSKZ.js")]),_=Object.assign(new Error(c),{packageManager:w(),platform:process.platform,cliVersion:o});await g(_,"expected_error")}}async function I(a){let o=new Date().getTime();if(a&&"analyticsStopCommand"in a&&typeof a.analyticsStopCommand=="function"){let t=a.analyticsStopCommand();if(t){let e=await import("./metadata-APVOKTBV.js"),{commandStartOptions:i}=e.getAllSensitiveMetadata();if(!i)return;await e.addSensitiveMetadata(()=>({commandStartOptions:{...i,startTime:o,startCommand:t}}))}}}export{y as a,k as b};
@@ -0,0 +1 @@
1
+ import{P as m}from"./chunk-YYLEWVO6.js";import{d as c}from"./chunk-AUZCENYI.js";import{Fb as l,Hb as n,Pb as a}from"./chunk-BXDZX3BS.js";import{g as s}from"./chunk-VKWPEFWQ.js";s();import{createServer as d}from"net";var u=new Set;async function P(o,t){if(o&&await g(o))return a(n`Port ${o.toString()} is free`),o;a(n`Getting a random port...`);let r=await w(()=>f(),t?.maxTries,t?.waitTimeInSeconds);for(let e=0;e<(t?.maxTries??5)&&u.has(r);e++)r=await w(()=>f(),t?.maxTries,t?.waitTimeInSeconds);return a(n`Random port obtained: ${l.raw(`${r}`)}`),u.add(r),r}async function g(o){return new Promise(t=>{let r=d();r.unref(),r.once("error",()=>t(!1));try{r.listen(o,"localhost",()=>{r.close(()=>t(!0))})}catch(e){if(!(e instanceof RangeError))throw e;t(!1)}})}function f(){return new Promise((o,t)=>{let r=d();r.unref(),r.once("error",t),r.listen(0,"localhost",()=>{let e=r.address();if(e&&typeof e=="object"){let i=e.port;r.close(()=>o(i))}else r.close(()=>t(new Error("Unable to determine assigned port")))})})}async function w(o,t=5,r=1){let e=1;for(;;)try{return await o()}catch(i){if(e++<t)a(n`Unknown problem getting a random port: ${i.message}`),await m(r);else throw new c(i.message)}}export{P as a,g as b};
@@ -1 +1 @@
1
- import{a as b}from"./chunk-EKVTNWHM.js";import{a as k}from"./chunk-5BKCIDMS.js";import{Fa as N,ga as x}from"./chunk-4QTEPWEJ.js";import{b as C,c as R}from"./chunk-OXJBYKMX.js";import{C as y}from"./chunk-NTRAWIEJ.js";import{d as v}from"./chunk-TPCG6DCA.js";import{Fb as w,Hb as E,Lb as L,Mb as m,Vb as T,ca as h}from"./chunk-7FQFEB33.js";import{u as A}from"./chunk-A4SBXDZB.js";import{j as u}from"./chunk-773TIA5M.js";import{g as l}from"./chunk-VKWPEFWQ.js";l();l();var M=12;async function S(p,t,o){let n=await p.appVersions(t);if(!n.app)throw new v(`Invalid API Key: ${t.apiKey}`);let a=n.app.appVersions.nodes.map(e=>{let r=e.message??"";return{...e,status:e.status==="active"&&!o?A.green(`\u2605 ${e.status}`):e.status,createdBy:e.createdBy?.displayName??"",createdAt:h(new Date(e.createdAt)),message:r}});if(!o){let e=(process.stdout.columns??75)-M,r=e;a.forEach(s=>{let f=s.message.length+(s.versionTag?.length??0)+T(s.status).length+s.createdAt.length+s.createdBy.length;if(f>e){let I=f-s.message.length,g=Math.max(e-I,10);g<r&&(r=g)}}),a.forEach(s=>{s.message.length>r&&(s.message=`${s.message.slice(0,r-3)}...`)})}return{appVersions:a,totalResults:n.app.appVersions.pageInfo.totalResults,app:n.app}}async function c(p){let{remoteApp:t,developerPlatformClient:o,organization:n}=p,{appVersions:a,totalResults:e}=await S(o,t,p.json);if(p.json)return L(JSON.stringify(a,null,2));if(x({org:n.businessName,appName:t.title,configFile:u(p.app.configPath)}),a.length===0){m("No app versions found for this app");return}y({rows:a,columns:{versionTag:{header:"VERSION"},status:{header:"STATUS"},message:{header:"MESSAGE"},createdAt:{header:"DATE CREATED"},createdBy:{header:"CREATED BY"}}});let r=w.link(o.webUiName,[await o.appDeepLink(t),"versions"].join("/"));m(E`\nView all ${String(e)} app versions in the ${r}`)}var d,i=class extends b{async run(){let{flags:t}=await this.parse(d),{app:o,remoteApp:n,developerPlatformClient:a,organization:e}=await N({directory:t.path,clientId:t["client-id"],forceRelink:t.reset,userProvidedConfigName:t.config});return await c({app:o,remoteApp:n,organization:e,developerPlatformClient:a,json:t.json}),{app:o}}};d=i;i.summary="List deployed versions of your app.";i.descriptionWithMarkdown="Lists the deployed app versions. An app version is a snapshot of your app extensions.";i.description=d.descriptionWithoutMarkdown();i.flags={...C,...k,...R};var J=i;export{J as a};
1
+ import{a as b}from"./chunk-PLHJQQVZ.js";import{a as k}from"./chunk-6V37CHBZ.js";import{Fa as N,ga as x}from"./chunk-KJQAJUDU.js";import{b as C,c as R}from"./chunk-S5JJL3BP.js";import{C as y}from"./chunk-YYLEWVO6.js";import{d as v}from"./chunk-AUZCENYI.js";import{Fb as w,Hb as E,Lb as L,Mb as m,Vb as T,ca as h}from"./chunk-BXDZX3BS.js";import{u as A}from"./chunk-A4SBXDZB.js";import{j as u}from"./chunk-773TIA5M.js";import{g as l}from"./chunk-VKWPEFWQ.js";l();l();var M=12;async function S(p,t,o){let n=await p.appVersions(t);if(!n.app)throw new v(`Invalid API Key: ${t.apiKey}`);let a=n.app.appVersions.nodes.map(e=>{let r=e.message??"";return{...e,status:e.status==="active"&&!o?A.green(`\u2605 ${e.status}`):e.status,createdBy:e.createdBy?.displayName??"",createdAt:h(new Date(e.createdAt)),message:r}});if(!o){let e=(process.stdout.columns??75)-M,r=e;a.forEach(s=>{let f=s.message.length+(s.versionTag?.length??0)+T(s.status).length+s.createdAt.length+s.createdBy.length;if(f>e){let I=f-s.message.length,g=Math.max(e-I,10);g<r&&(r=g)}}),a.forEach(s=>{s.message.length>r&&(s.message=`${s.message.slice(0,r-3)}...`)})}return{appVersions:a,totalResults:n.app.appVersions.pageInfo.totalResults,app:n.app}}async function c(p){let{remoteApp:t,developerPlatformClient:o,organization:n}=p,{appVersions:a,totalResults:e}=await S(o,t,p.json);if(p.json)return L(JSON.stringify(a,null,2));if(x({org:n.businessName,appName:t.title,configFile:u(p.app.configPath)}),a.length===0){m("No app versions found for this app");return}y({rows:a,columns:{versionTag:{header:"VERSION"},status:{header:"STATUS"},message:{header:"MESSAGE"},createdAt:{header:"DATE CREATED"},createdBy:{header:"CREATED BY"}}});let r=w.link(o.webUiName,[await o.appDeepLink(t),"versions"].join("/"));m(E`\nView all ${String(e)} app versions in the ${r}`)}var d,i=class extends b{async run(){let{flags:t}=await this.parse(d),{app:o,remoteApp:n,developerPlatformClient:a,organization:e}=await N({directory:t.path,clientId:t["client-id"],forceRelink:t.reset,userProvidedConfigName:t.config});return await c({app:o,remoteApp:n,organization:e,developerPlatformClient:a,json:t.json}),{app:o}}};d=i;i.summary="List deployed versions of your app.";i.descriptionWithMarkdown="Lists the deployed app versions. An app version is a snapshot of your app extensions.";i.description=d.descriptionWithoutMarkdown();i.flags={...C,...k,...R};var J=i;export{J as a};
@@ -1 +1 @@
1
- import{a as d}from"./chunk-MMIHHCMW.js";import{a as m}from"./chunk-EKVTNWHM.js";import{a as p}from"./chunk-5BKCIDMS.js";import{Fa as s}from"./chunk-4QTEPWEJ.js";import{b as n}from"./chunk-OXJBYKMX.js";import{Lb as r}from"./chunk-7FQFEB33.js";import{g as i}from"./chunk-VKWPEFWQ.js";i();var o,t=class extends m{async run(){let{flags:a}=await this.parse(o),{app:e,remoteApp:l,organization:c}=await s({directory:a.path,clientId:a["client-id"],forceRelink:a.reset,userProvidedConfigName:a.config});return r(await d(e,l,c)),{app:e}}};o=t;t.summary="Display app and extensions environment variables.";t.descriptionWithMarkdown="Displays environment variables that can be used to deploy apps and app extensions.";t.description=o.descriptionWithoutMarkdown();t.flags={...n,...p};var w=t;export{w as a};
1
+ import{a as d}from"./chunk-CVRAATZ5.js";import{a as m}from"./chunk-PLHJQQVZ.js";import{a as p}from"./chunk-6V37CHBZ.js";import{Fa as s}from"./chunk-KJQAJUDU.js";import{b as n}from"./chunk-S5JJL3BP.js";import{Lb as r}from"./chunk-BXDZX3BS.js";import{g as i}from"./chunk-VKWPEFWQ.js";i();var o,t=class extends m{async run(){let{flags:a}=await this.parse(o),{app:e,remoteApp:l,organization:c}=await s({directory:a.path,clientId:a["client-id"],forceRelink:a.reset,userProvidedConfigName:a.config});return r(await d(e,l,c)),{app:e}}};o=t;t.summary="Display app and extensions environment variables.";t.descriptionWithMarkdown="Displays environment variables that can be used to deploy apps and app extensions.";t.description=o.descriptionWithoutMarkdown();t.flags={...n,...p};var w=t;export{w as a};
@@ -1,3 +1,3 @@
1
- import{d as w,n as y,r as n}from"./chunk-G4OQABDT.js";import{w as l}from"./chunk-ANBOLDON.js";import{k as u,l as m}from"./chunk-HDC5V7RY.js";import{a as h}from"./chunk-VPPWSKOY.js";import{a as x}from"./chunk-WW7TENNA.js";import{O as S,u as d,w as g,x as N}from"./chunk-NTRAWIEJ.js";import{f as _}from"./chunk-TPCG6DCA.js";import{Pb as a}from"./chunk-7FQFEB33.js";import{a as f}from"./chunk-NNOSZ447.js";import{g as p}from"./chunk-VKWPEFWQ.js";p();var $="https://cdn.shopify.com/static/cli/notifications.json",D="Cache is empty",C=["notifications:list","notifications:generate","init","app:init","theme:init","hydrogen:init","cache:clear"];function c(){return process.env.SHOPIFY_CLI_NOTIFICATIONS_URL??$}var E=n.object({id:n.string(),message:n.string(),type:n.enum(["info","warning","error"]),frequency:n.enum(["always","once","once_a_day","once_a_week"]),ownerChannel:n.string(),cta:n.object({label:n.string(),url:n.string().url()}).optional(),title:n.string().optional(),minVersion:n.string().optional(),maxVersion:n.string().optional(),minDate:n.string().optional(),maxDate:n.string().optional(),commands:n.array(n.string()).optional(),surface:n.string().optional()}),I=n.object({notifications:n.array(E)});async function Q(e,t=process.env){try{let r=x();if(b(r,t)||w(t))return;let o=await k(),s=v(o.notifications,r,e);a(`Notifications to show: ${s.length}`),await V(s)}catch(r){if(r.message===D){a("Notifications to show: 0 (Cache is empty)");return}if(r.message==="abort")throw new _;let o=`Error showing notifications: ${r.message}`;a(o);let{sendErrorToBugsnag:s}=await import("./error-handler-NI7D6GSY.js");await s(o,"unexpected_error")}}function b(e,t=process.env){return f(t.CI)||f(t.SHOPIFY_UNIT_TEST)||C.includes(e)}async function V(e){e.slice(0,2).forEach(t=>{let r={headline:t.title,body:t.message.replace(/\\n/g,`
1
+ import{d as w,n as y,r as n}from"./chunk-3EQY5B4S.js";import{w as l}from"./chunk-HX3TALXV.js";import{k as u,l as m}from"./chunk-TM534QSE.js";import{a as h}from"./chunk-Q3WOWDUU.js";import{a as x}from"./chunk-WW7TENNA.js";import{O as S,u as d,w as g,x as N}from"./chunk-YYLEWVO6.js";import{f as _}from"./chunk-AUZCENYI.js";import{Pb as a}from"./chunk-BXDZX3BS.js";import{a as f}from"./chunk-NNOSZ447.js";import{g as p}from"./chunk-VKWPEFWQ.js";p();var $="https://cdn.shopify.com/static/cli/notifications.json",D="Cache is empty",C=["notifications:list","notifications:generate","init","app:init","theme:init","hydrogen:init","cache:clear"];function c(){return process.env.SHOPIFY_CLI_NOTIFICATIONS_URL??$}var E=n.object({id:n.string(),message:n.string(),type:n.enum(["info","warning","error"]),frequency:n.enum(["always","once","once_a_day","once_a_week"]),ownerChannel:n.string(),cta:n.object({label:n.string(),url:n.string().url()}).optional(),title:n.string().optional(),minVersion:n.string().optional(),maxVersion:n.string().optional(),minDate:n.string().optional(),maxDate:n.string().optional(),commands:n.array(n.string()).optional(),surface:n.string().optional()}),I=n.object({notifications:n.array(E)});async function Q(e,t=process.env){try{let r=x();if(b(r,t)||w(t))return;let o=await k(),s=v(o.notifications,r,e);a(`Notifications to show: ${s.length}`),await V(s)}catch(r){if(r.message===D){a("Notifications to show: 0 (Cache is empty)");return}if(r.message==="abort")throw new _;let o=`Error showing notifications: ${r.message}`;a(o);let{sendErrorToBugsnag:s}=await import("./error-handler-BOESDKZA.js");await s(o,"unexpected_error")}}function b(e,t=process.env){return f(t.CI)||f(t.SHOPIFY_UNIT_TEST)||C.includes(e)}async function V(e){e.slice(0,2).forEach(t=>{let r={headline:t.title,body:t.message.replace(/\\n/g,`
2
2
  `),link:t.cta};switch(t.type){case"info":{d(r);break}case"warning":{g(r);break}case"error":throw N(r),new Error("abort")}u(`notification-${t.id}`,new Date().getTime().toString())})}async function k(){let e=`notifications-${c()}`,t=m(e)?.value;if(!t)throw new Error(D);let r=JSON.parse(t);return I.parse(r)}async function X(){a("Fetching notifications...");let e=await y(c(),void 0,{useNetworkLevelRetry:!1,useAbortSignal:!0,timeoutMs:3*1e3});if(e.status!==200)throw new Error(`Failed to fetch notifications: ${e.statusText}`);let t=await e.text(),r=JSON.parse(t),o=I.parse(r);return await O(t),o}async function O(e){u(`notifications-${c()}`,e),a(`Notifications from ${c()} stored in the cache`)}function Z(e,t=process.argv,r=process.env){if(b(e,r)||!t[0]||!t[1])return;let o=t[0],i=[t[1],"notifications","list","--ignore-errors"];S(o,i,{background:!0,env:{...process.env,SHOPIFY_CLI_NO_ANALYTICS:"1"},externalErrorHandler:async T=>{a(`Failed to fetch notifications in background: ${T.message}`)}})}function v(e,t,r,o=new Date(new Date().setUTCHours(0,0,0,0)),s=h){return e.filter(i=>B(i,s)).filter(i=>F(i,o)).filter(i=>A(i,t)).filter(i=>j(i,t,r)).filter(i=>q(i))}function B(e,t){let r=!e.minVersion||l(t,`>=${e.minVersion}`),o=!e.maxVersion||l(t,`<=${e.maxVersion}`);return r&&o}function F(e,t){let r=!e.minDate||new Date(e.minDate)<=t,o=!e.maxDate||new Date(e.maxDate)>=t;return r&&o}function A(e,t){return t===""?!0:!e.commands||e.commands.includes(t)}function j(e,t,r){let o=t.split(":")[0]??"all",s=e.surface??"all";return r?r.includes(s):s===o||s==="all"}function q(e){if(!e.frequency)return!0;let t=`notification-${e.id}`,r=m(t)?.value;if(!r)return!0;switch(e.frequency){case"always":return!0;case"once":return!1;case"once_a_day":return new Date().getTime()-Number(r)>24*3600*1e3;case"once_a_week":return new Date().getTime()-Number(r)>168*3600*1e3}}function ee(e){let t=[];return e.minDate&&t.push(`from ${e.minDate}`),e.maxDate&&t.push(`to ${e.maxDate}`),e.minVersion&&t.push(`from v${e.minVersion}`),e.maxVersion&&t.push(`to v${e.maxVersion}`),e.frequency==="once"&&t.push("show only once"),e.frequency==="once_a_day"&&t.push("show once a day"),e.frequency==="once_a_week"&&t.push("show once a week"),e.surface&&t.push(`surface = ${e.surface}`),e.commands&&t.push(`commands = ${e.commands.join(", ")}`),t.join(`
3
3
  `)}export{Q as a,k as b,X as c,Z as d,v as e,ee as f};
@@ -1,4 +1,4 @@
1
- import{a as ri}from"./chunk-RJ5VF3QY.js";import{d as si,g as ni}from"./chunk-TPCG6DCA.js";import{a as mc}from"./chunk-CX5CC6P5.js";import{Ra as Jr,Sa as sr}from"./chunk-7FQFEB33.js";import{b as ti}from"./chunk-NNOSZ447.js";import{i as rr}from"./chunk-773TIA5M.js";import{c as g,e as Wr,g as u}from"./chunk-VKWPEFWQ.js";var Nt=g(q=>{"use strict";u();Object.defineProperty(q,"__esModule",{value:!0});q.regexpCode=q.getEsmExportName=q.getProperty=q.safeStringify=q.stringify=q.strConcat=q.addCodeArg=q.str=q._=q.nil=q._Code=q.Name=q.IDENTIFIER=q._CodeOrName=void 0;var bt=class{};q._CodeOrName=bt;q.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Ve=class extends bt{constructor(e){if(super(),!q.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};q.Name=Ve;var se=class extends bt{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,s)=>`${r}${s}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,s)=>(s instanceof Ve&&(r[s.str]=(r[s.str]||0)+1),r),{})}};q._Code=se;q.nil=new se("");function bi(t,...e){let r=[t[0]],s=0;for(;s<e.length;)os(r,e[s]),r.push(t[++s]);return new se(r)}q._=bi;var is=new se("+");function Pi(t,...e){let r=[Pt(t[0])],s=0;for(;s<e.length;)r.push(is),os(r,e[s]),r.push(is,Pt(t[++s]));return Nc(r),new se(r)}q.str=Pi;function os(t,e){e instanceof se?t.push(...e._items):e instanceof Ve?t.push(e):t.push(Ic(e))}q.addCodeArg=os;function Nc(t){let e=1;for(;e<t.length-1;){if(t[e]===is){let r=Oc(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function Oc(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof Ve||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof Ve))return`"${t}${e.slice(1)}`}function Tc(t,e){return e.emptyStr()?t:t.emptyStr()?e:Pi`${t}${e}`}q.strConcat=Tc;function Ic(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:Pt(Array.isArray(t)?t.join(","):t)}function kc(t){return new se(Pt(t))}q.stringify=kc;function Pt(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}q.safeStringify=Pt;function Rc(t){return typeof t=="string"&&q.IDENTIFIER.test(t)?new se(`.${t}`):bi`[${t}]`}q.getProperty=Rc;function jc(t){if(typeof t=="string"&&q.IDENTIFIER.test(t))return new se(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}q.getEsmExportName=jc;function qc(t){return new se(t.toString())}q.regexpCode=qc});var us=g(Q=>{"use strict";u();Object.defineProperty(Q,"__esModule",{value:!0});Q.ValueScope=Q.ValueScopeName=Q.Scope=Q.varKinds=Q.UsedValueState=void 0;var Z=Nt(),as=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},ar;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(ar||(Q.UsedValueState=ar={}));Q.varKinds={const:new Z.Name("const"),let:new Z.Name("let"),var:new Z.Name("var")};var cr=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof Z.Name?e:this.name(e)}name(e){return new Z.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,s;if(!((s=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||s===void 0)&&s.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};Q.Scope=cr;var ur=class extends Z.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:s}){this.value=e,this.scopePath=(0,Z._)`.${new Z.Name(r)}[${s}]`}};Q.ValueScopeName=ur;var Ac=(0,Z._)`\n`,cs=class extends cr{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?Ac:Z.nil}}get(){return this._scope}name(e){return new ur(e,this._newName(e))}value(e,r){var s;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let n=this.toName(e),{prefix:i}=n,o=(s=r.key)!==null&&s!==void 0?s:r.ref,a=this._values[i];if(a){let d=a.get(o);if(d)return d}else a=this._values[i]=new Map;a.set(o,n);let c=this._scope[i]||(this._scope[i]=[]),l=c.length;return c[l]=r.ref,n.setValue(r,{property:i,itemIndex:l}),n}getValue(e,r){let s=this._values[e];if(s)return s.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,s=>{if(s.scopePath===void 0)throw new Error(`CodeGen: name "${s}" has no value`);return(0,Z._)`${e}${s.scopePath}`})}scopeCode(e=this._values,r,s){return this._reduceValues(e,n=>{if(n.value===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return n.value.code},r,s)}_reduceValues(e,r,s={},n){let i=Z.nil;for(let o in e){let a=e[o];if(!a)continue;let c=s[o]=s[o]||new Map;a.forEach(l=>{if(c.has(l))return;c.set(l,ar.Started);let d=r(l);if(d){let f=this.opts.es5?Q.varKinds.var:Q.varKinds.const;i=(0,Z._)`${i}${f} ${l} = ${d};${this.opts._n}`}else if(d=n?.(l))i=(0,Z._)`${i}${d}${this.opts._n}`;else throw new as(l);c.set(l,ar.Completed)})}return i}};Q.ValueScope=cs});var b=g(P=>{"use strict";u();Object.defineProperty(P,"__esModule",{value:!0});P.or=P.and=P.not=P.CodeGen=P.operators=P.varKinds=P.ValueScopeName=P.ValueScope=P.Scope=P.Name=P.regexpCode=P.stringify=P.getProperty=P.nil=P.strConcat=P.str=P._=void 0;var T=Nt(),ue=us(),Ie=Nt();Object.defineProperty(P,"_",{enumerable:!0,get:function(){return Ie._}});Object.defineProperty(P,"str",{enumerable:!0,get:function(){return Ie.str}});Object.defineProperty(P,"strConcat",{enumerable:!0,get:function(){return Ie.strConcat}});Object.defineProperty(P,"nil",{enumerable:!0,get:function(){return Ie.nil}});Object.defineProperty(P,"getProperty",{enumerable:!0,get:function(){return Ie.getProperty}});Object.defineProperty(P,"stringify",{enumerable:!0,get:function(){return Ie.stringify}});Object.defineProperty(P,"regexpCode",{enumerable:!0,get:function(){return Ie.regexpCode}});Object.defineProperty(P,"Name",{enumerable:!0,get:function(){return Ie.Name}});var hr=us();Object.defineProperty(P,"Scope",{enumerable:!0,get:function(){return hr.Scope}});Object.defineProperty(P,"ValueScope",{enumerable:!0,get:function(){return hr.ValueScope}});Object.defineProperty(P,"ValueScopeName",{enumerable:!0,get:function(){return hr.ValueScopeName}});Object.defineProperty(P,"varKinds",{enumerable:!0,get:function(){return hr.varKinds}});P.operators={GT:new T._Code(">"),GTE:new T._Code(">="),LT:new T._Code("<"),LTE:new T._Code("<="),EQ:new T._Code("==="),NEQ:new T._Code("!=="),NOT:new T._Code("!"),OR:new T._Code("||"),AND:new T._Code("&&"),ADD:new T._Code("+")};var be=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},ls=class extends be{constructor(e,r,s){super(),this.varKind=e,this.name=r,this.rhs=s}render({es5:e,_n:r}){let s=e?ue.varKinds.var:this.varKind,n=this.rhs===void 0?"":` = ${this.rhs}`;return`${s} ${this.name}${n};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=rt(this.rhs,e,r)),this}get names(){return this.rhs instanceof T._CodeOrName?this.rhs.names:{}}},lr=class extends be{constructor(e,r,s){super(),this.lhs=e,this.rhs=r,this.sideEffects=s}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof T.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=rt(this.rhs,e,r),this}get names(){let e=this.lhs instanceof T.Name?{}:{...this.lhs.names};return fr(e,this.rhs)}},ds=class extends lr{constructor(e,r,s,n){super(e,s,n),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},fs=class extends be{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},hs=class extends be{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},ps=class extends be{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},ms=class extends be{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=rt(this.code,e,r),this}get names(){return this.code instanceof T._CodeOrName?this.code.names:{}}},Ot=class extends be{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,s)=>r+s.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let s=e[r].optimizeNodes();Array.isArray(s)?e.splice(r,1,...s):s?e[r]=s:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:s}=this,n=s.length;for(;n--;){let i=s[n];i.optimizeNames(e,r)||(Cc(e,i.names),s.splice(n,1))}return s.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>Ke(e,r.names),{})}},Pe=class extends Ot{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},ys=class extends Ot{},tt=class extends Pe{};tt.kind="else";var Ue=class t extends Pe{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let s=r.optimizeNodes();r=this.else=Array.isArray(s)?new tt(s):s}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(Ni(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var s;if(this.else=(s=this.else)===null||s===void 0?void 0:s.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=rt(this.condition,e,r),this}get names(){let e=super.names;return fr(e,this.condition),this.else&&Ke(e,this.else.names),e}};Ue.kind="if";var Le=class extends Pe{};Le.kind="for";var _s=class extends Le{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=rt(this.iteration,e,r),this}get names(){return Ke(super.names,this.iteration.names)}},gs=class extends Le{constructor(e,r,s,n){super(),this.varKind=e,this.name=r,this.from=s,this.to=n}render(e){let r=e.es5?ue.varKinds.var:this.varKind,{name:s,from:n,to:i}=this;return`for(${r} ${s}=${n}; ${s}<${i}; ${s}++)`+super.render(e)}get names(){let e=fr(super.names,this.from);return fr(e,this.to)}},dr=class extends Le{constructor(e,r,s,n){super(),this.loop=e,this.varKind=r,this.name=s,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=rt(this.iterable,e,r),this}get names(){return Ke(super.names,this.iterable.names)}},Tt=class extends Pe{constructor(e,r,s){super(),this.name=e,this.args=r,this.async=s}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};Tt.kind="func";var It=class extends Ot{render(e){return"return "+super.render(e)}};It.kind="return";var $s=class extends Pe{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var s,n;return super.optimizeNames(e,r),(s=this.catch)===null||s===void 0||s.optimizeNames(e,r),(n=this.finally)===null||n===void 0||n.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&Ke(e,this.catch.names),this.finally&&Ke(e,this.finally.names),e}},kt=class extends Pe{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};kt.kind="catch";var Rt=class extends Pe{render(e){return"finally"+super.render(e)}};Rt.kind="finally";var vs=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
1
+ import{a as ri}from"./chunk-RJ5VF3QY.js";import{d as si,g as ni}from"./chunk-AUZCENYI.js";import{Ra as Jr,Sa as sr}from"./chunk-BXDZX3BS.js";import{b as ti}from"./chunk-NNOSZ447.js";import{i as rr}from"./chunk-773TIA5M.js";import{a as mc}from"./chunk-CX5CC6P5.js";import{c as g,e as Wr,g as u}from"./chunk-VKWPEFWQ.js";var Nt=g(q=>{"use strict";u();Object.defineProperty(q,"__esModule",{value:!0});q.regexpCode=q.getEsmExportName=q.getProperty=q.safeStringify=q.stringify=q.strConcat=q.addCodeArg=q.str=q._=q.nil=q._Code=q.Name=q.IDENTIFIER=q._CodeOrName=void 0;var bt=class{};q._CodeOrName=bt;q.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Ve=class extends bt{constructor(e){if(super(),!q.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};q.Name=Ve;var se=class extends bt{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,s)=>`${r}${s}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,s)=>(s instanceof Ve&&(r[s.str]=(r[s.str]||0)+1),r),{})}};q._Code=se;q.nil=new se("");function bi(t,...e){let r=[t[0]],s=0;for(;s<e.length;)os(r,e[s]),r.push(t[++s]);return new se(r)}q._=bi;var is=new se("+");function Pi(t,...e){let r=[Pt(t[0])],s=0;for(;s<e.length;)r.push(is),os(r,e[s]),r.push(is,Pt(t[++s]));return Nc(r),new se(r)}q.str=Pi;function os(t,e){e instanceof se?t.push(...e._items):e instanceof Ve?t.push(e):t.push(Ic(e))}q.addCodeArg=os;function Nc(t){let e=1;for(;e<t.length-1;){if(t[e]===is){let r=Oc(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function Oc(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof Ve||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof Ve))return`"${t}${e.slice(1)}`}function Tc(t,e){return e.emptyStr()?t:t.emptyStr()?e:Pi`${t}${e}`}q.strConcat=Tc;function Ic(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:Pt(Array.isArray(t)?t.join(","):t)}function kc(t){return new se(Pt(t))}q.stringify=kc;function Pt(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}q.safeStringify=Pt;function Rc(t){return typeof t=="string"&&q.IDENTIFIER.test(t)?new se(`.${t}`):bi`[${t}]`}q.getProperty=Rc;function jc(t){if(typeof t=="string"&&q.IDENTIFIER.test(t))return new se(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}q.getEsmExportName=jc;function qc(t){return new se(t.toString())}q.regexpCode=qc});var us=g(Q=>{"use strict";u();Object.defineProperty(Q,"__esModule",{value:!0});Q.ValueScope=Q.ValueScopeName=Q.Scope=Q.varKinds=Q.UsedValueState=void 0;var Z=Nt(),as=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},ar;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(ar||(Q.UsedValueState=ar={}));Q.varKinds={const:new Z.Name("const"),let:new Z.Name("let"),var:new Z.Name("var")};var cr=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof Z.Name?e:this.name(e)}name(e){return new Z.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,s;if(!((s=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||s===void 0)&&s.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};Q.Scope=cr;var ur=class extends Z.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:s}){this.value=e,this.scopePath=(0,Z._)`.${new Z.Name(r)}[${s}]`}};Q.ValueScopeName=ur;var Ac=(0,Z._)`\n`,cs=class extends cr{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?Ac:Z.nil}}get(){return this._scope}name(e){return new ur(e,this._newName(e))}value(e,r){var s;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let n=this.toName(e),{prefix:i}=n,o=(s=r.key)!==null&&s!==void 0?s:r.ref,a=this._values[i];if(a){let d=a.get(o);if(d)return d}else a=this._values[i]=new Map;a.set(o,n);let c=this._scope[i]||(this._scope[i]=[]),l=c.length;return c[l]=r.ref,n.setValue(r,{property:i,itemIndex:l}),n}getValue(e,r){let s=this._values[e];if(s)return s.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,s=>{if(s.scopePath===void 0)throw new Error(`CodeGen: name "${s}" has no value`);return(0,Z._)`${e}${s.scopePath}`})}scopeCode(e=this._values,r,s){return this._reduceValues(e,n=>{if(n.value===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return n.value.code},r,s)}_reduceValues(e,r,s={},n){let i=Z.nil;for(let o in e){let a=e[o];if(!a)continue;let c=s[o]=s[o]||new Map;a.forEach(l=>{if(c.has(l))return;c.set(l,ar.Started);let d=r(l);if(d){let f=this.opts.es5?Q.varKinds.var:Q.varKinds.const;i=(0,Z._)`${i}${f} ${l} = ${d};${this.opts._n}`}else if(d=n?.(l))i=(0,Z._)`${i}${d}${this.opts._n}`;else throw new as(l);c.set(l,ar.Completed)})}return i}};Q.ValueScope=cs});var b=g(P=>{"use strict";u();Object.defineProperty(P,"__esModule",{value:!0});P.or=P.and=P.not=P.CodeGen=P.operators=P.varKinds=P.ValueScopeName=P.ValueScope=P.Scope=P.Name=P.regexpCode=P.stringify=P.getProperty=P.nil=P.strConcat=P.str=P._=void 0;var T=Nt(),ue=us(),Ie=Nt();Object.defineProperty(P,"_",{enumerable:!0,get:function(){return Ie._}});Object.defineProperty(P,"str",{enumerable:!0,get:function(){return Ie.str}});Object.defineProperty(P,"strConcat",{enumerable:!0,get:function(){return Ie.strConcat}});Object.defineProperty(P,"nil",{enumerable:!0,get:function(){return Ie.nil}});Object.defineProperty(P,"getProperty",{enumerable:!0,get:function(){return Ie.getProperty}});Object.defineProperty(P,"stringify",{enumerable:!0,get:function(){return Ie.stringify}});Object.defineProperty(P,"regexpCode",{enumerable:!0,get:function(){return Ie.regexpCode}});Object.defineProperty(P,"Name",{enumerable:!0,get:function(){return Ie.Name}});var hr=us();Object.defineProperty(P,"Scope",{enumerable:!0,get:function(){return hr.Scope}});Object.defineProperty(P,"ValueScope",{enumerable:!0,get:function(){return hr.ValueScope}});Object.defineProperty(P,"ValueScopeName",{enumerable:!0,get:function(){return hr.ValueScopeName}});Object.defineProperty(P,"varKinds",{enumerable:!0,get:function(){return hr.varKinds}});P.operators={GT:new T._Code(">"),GTE:new T._Code(">="),LT:new T._Code("<"),LTE:new T._Code("<="),EQ:new T._Code("==="),NEQ:new T._Code("!=="),NOT:new T._Code("!"),OR:new T._Code("||"),AND:new T._Code("&&"),ADD:new T._Code("+")};var be=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},ls=class extends be{constructor(e,r,s){super(),this.varKind=e,this.name=r,this.rhs=s}render({es5:e,_n:r}){let s=e?ue.varKinds.var:this.varKind,n=this.rhs===void 0?"":` = ${this.rhs}`;return`${s} ${this.name}${n};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=rt(this.rhs,e,r)),this}get names(){return this.rhs instanceof T._CodeOrName?this.rhs.names:{}}},lr=class extends be{constructor(e,r,s){super(),this.lhs=e,this.rhs=r,this.sideEffects=s}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof T.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=rt(this.rhs,e,r),this}get names(){let e=this.lhs instanceof T.Name?{}:{...this.lhs.names};return fr(e,this.rhs)}},ds=class extends lr{constructor(e,r,s,n){super(e,s,n),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},fs=class extends be{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},hs=class extends be{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},ps=class extends be{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},ms=class extends be{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=rt(this.code,e,r),this}get names(){return this.code instanceof T._CodeOrName?this.code.names:{}}},Ot=class extends be{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,s)=>r+s.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let s=e[r].optimizeNodes();Array.isArray(s)?e.splice(r,1,...s):s?e[r]=s:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:s}=this,n=s.length;for(;n--;){let i=s[n];i.optimizeNames(e,r)||(Cc(e,i.names),s.splice(n,1))}return s.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>Ke(e,r.names),{})}},Pe=class extends Ot{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},ys=class extends Ot{},tt=class extends Pe{};tt.kind="else";var Ue=class t extends Pe{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let s=r.optimizeNodes();r=this.else=Array.isArray(s)?new tt(s):s}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(Ni(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var s;if(this.else=(s=this.else)===null||s===void 0?void 0:s.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=rt(this.condition,e,r),this}get names(){let e=super.names;return fr(e,this.condition),this.else&&Ke(e,this.else.names),e}};Ue.kind="if";var Le=class extends Pe{};Le.kind="for";var _s=class extends Le{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=rt(this.iteration,e,r),this}get names(){return Ke(super.names,this.iteration.names)}},gs=class extends Le{constructor(e,r,s,n){super(),this.varKind=e,this.name=r,this.from=s,this.to=n}render(e){let r=e.es5?ue.varKinds.var:this.varKind,{name:s,from:n,to:i}=this;return`for(${r} ${s}=${n}; ${s}<${i}; ${s}++)`+super.render(e)}get names(){let e=fr(super.names,this.from);return fr(e,this.to)}},dr=class extends Le{constructor(e,r,s,n){super(),this.loop=e,this.varKind=r,this.name=s,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=rt(this.iterable,e,r),this}get names(){return Ke(super.names,this.iterable.names)}},Tt=class extends Pe{constructor(e,r,s){super(),this.name=e,this.args=r,this.async=s}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};Tt.kind="func";var It=class extends Ot{render(e){return"return "+super.render(e)}};It.kind="return";var $s=class extends Pe{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var s,n;return super.optimizeNames(e,r),(s=this.catch)===null||s===void 0||s.optimizeNames(e,r),(n=this.finally)===null||n===void 0||n.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&Ke(e,this.catch.names),this.finally&&Ke(e,this.finally.names),e}},kt=class extends Pe{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};kt.kind="catch";var Rt=class extends Pe{render(e){return"finally"+super.render(e)}};Rt.kind="finally";var vs=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
2
2
  `:""},this._extScope=e,this._scope=new ue.Scope({parent:e}),this._nodes=[new ys]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let s=this._extScope.value(e,r);return(this._values[s.prefix]||(this._values[s.prefix]=new Set)).add(s),s}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,s,n){let i=this._scope.toName(r);return s!==void 0&&n&&(this._constants[i.str]=s),this._leafNode(new ls(e,i,s)),i}const(e,r,s){return this._def(ue.varKinds.const,e,r,s)}let(e,r,s){return this._def(ue.varKinds.let,e,r,s)}var(e,r,s){return this._def(ue.varKinds.var,e,r,s)}assign(e,r,s){return this._leafNode(new lr(e,r,s))}add(e,r){return this._leafNode(new ds(e,P.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==T.nil&&this._leafNode(new ms(e)),this}object(...e){let r=["{"];for(let[s,n]of e)r.length>1&&r.push(","),r.push(s),(s!==n||this.opts.es5)&&(r.push(":"),(0,T.addCodeArg)(r,n));return r.push("}"),new T._Code(r)}if(e,r,s){if(this._blockNode(new Ue(e)),r&&s)this.code(r).else().code(s).endIf();else if(r)this.code(r).endIf();else if(s)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new Ue(e))}else(){return this._elseNode(new tt)}endIf(){return this._endBlockNode(Ue,tt)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new _s(e),r)}forRange(e,r,s,n,i=this.opts.es5?ue.varKinds.var:ue.varKinds.let){let o=this._scope.toName(e);return this._for(new gs(i,o,r,s),()=>n(o))}forOf(e,r,s,n=ue.varKinds.const){let i=this._scope.toName(e);if(this.opts.es5){let o=r instanceof T.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,T._)`${o}.length`,a=>{this.var(i,(0,T._)`${o}[${a}]`),s(i)})}return this._for(new dr("of",n,i,r),()=>s(i))}forIn(e,r,s,n=this.opts.es5?ue.varKinds.var:ue.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,T._)`Object.keys(${r})`,s);let i=this._scope.toName(e);return this._for(new dr("in",n,i,r),()=>s(i))}endFor(){return this._endBlockNode(Le)}label(e){return this._leafNode(new fs(e))}break(e){return this._leafNode(new hs(e))}return(e){let r=new It;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(It)}try(e,r,s){if(!r&&!s)throw new Error('CodeGen: "try" without "catch" and "finally"');let n=new $s;if(this._blockNode(n),this.code(e),r){let i=this.name("e");this._currNode=n.catch=new kt(i),r(i)}return s&&(this._currNode=n.finally=new Rt,this.code(s)),this._endBlockNode(kt,Rt)}throw(e){return this._leafNode(new ps(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let s=this._nodes.length-r;if(s<0||e!==void 0&&s!==e)throw new Error(`CodeGen: wrong number of nodes: ${s} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=T.nil,s,n){return this._blockNode(new Tt(e,r,s)),n&&this.code(n).endFunc(),this}endFunc(){return this._endBlockNode(Tt)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,r){let s=this._currNode;if(s instanceof e||r&&s instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof Ue))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};P.CodeGen=vs;function Ke(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function fr(t,e){return e instanceof T._CodeOrName?Ke(t,e.names):t}function rt(t,e,r){if(t instanceof T.Name)return s(t);if(!n(t))return t;return new T._Code(t._items.reduce((i,o)=>(o instanceof T.Name&&(o=s(o)),o instanceof T._Code?i.push(...o._items):i.push(o),i),[]));function s(i){let o=r[i.str];return o===void 0||e[i.str]!==1?i:(delete e[i.str],o)}function n(i){return i instanceof T._Code&&i._items.some(o=>o instanceof T.Name&&e[o.str]===1&&r[o.str]!==void 0)}}function Cc(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function Ni(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,T._)`!${ws(t)}`}P.not=Ni;var Mc=Oi(P.operators.AND);function Dc(...t){return t.reduce(Mc)}P.and=Dc;var xc=Oi(P.operators.OR);function zc(...t){return t.reduce(xc)}P.or=zc;function Oi(t){return(e,r)=>e===T.nil?r:r===T.nil?e:(0,T._)`${ws(e)} ${t} ${ws(r)}`}function ws(t){return t instanceof T.Name?t:(0,T._)`(${t})`}});var k=g(N=>{"use strict";u();Object.defineProperty(N,"__esModule",{value:!0});N.checkStrictMode=N.getErrorPath=N.Type=N.useFunc=N.setEvaluated=N.evaluatedPropsToName=N.mergeEvaluated=N.eachItem=N.unescapeJsonPointer=N.escapeJsonPointer=N.escapeFragment=N.unescapeFragment=N.schemaRefOrVal=N.schemaHasRulesButRef=N.schemaHasRules=N.checkUnknownRules=N.alwaysValidSchema=N.toHash=void 0;var C=b(),Fc=Nt();function Vc(t){let e={};for(let r of t)e[r]=!0;return e}N.toHash=Vc;function Uc(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(ki(t,e),!Ri(e,t.self.RULES.all))}N.alwaysValidSchema=Uc;function ki(t,e=t.schema){let{opts:r,self:s}=t;if(!r.strictSchema||typeof e=="boolean")return;let n=s.RULES.keywords;for(let i in e)n[i]||Ai(t,`unknown keyword: "${i}"`)}N.checkUnknownRules=ki;function Ri(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}N.schemaHasRules=Ri;function Lc(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}N.schemaHasRulesButRef=Lc;function Kc({topSchemaRef:t,schemaPath:e},r,s,n){if(!n){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,C._)`${r}`}return(0,C._)`${t}${e}${(0,C.getProperty)(s)}`}N.schemaRefOrVal=Kc;function Gc(t){return ji(decodeURIComponent(t))}N.unescapeFragment=Gc;function Hc(t){return encodeURIComponent(Ss(t))}N.escapeFragment=Hc;function Ss(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}N.escapeJsonPointer=Ss;function ji(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}N.unescapeJsonPointer=ji;function Wc(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}N.eachItem=Wc;function Ti({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:s}){return(n,i,o,a)=>{let c=o===void 0?i:o instanceof C.Name?(i instanceof C.Name?t(n,i,o):e(n,i,o),o):i instanceof C.Name?(e(n,o,i),i):r(i,o);return a===C.Name&&!(c instanceof C.Name)?s(n,c):c}}N.mergeEvaluated={props:Ti({mergeNames:(t,e,r)=>t.if((0,C._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,C._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,C._)`${r} || {}`).code((0,C._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,C._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,C._)`${r} || {}`),bs(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:qi}),items:Ti({mergeNames:(t,e,r)=>t.if((0,C._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,C._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,C._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,C._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function qi(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,C._)`{}`);return e!==void 0&&bs(t,r,e),r}N.evaluatedPropsToName=qi;function bs(t,e,r){Object.keys(r).forEach(s=>t.assign((0,C._)`${e}${(0,C.getProperty)(s)}`,!0))}N.setEvaluated=bs;var Ii={};function Jc(t,e){return t.scopeValue("func",{ref:e,code:Ii[e.code]||(Ii[e.code]=new Fc._Code(e.code))})}N.useFunc=Jc;var Es;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(Es||(N.Type=Es={}));function Yc(t,e,r){if(t instanceof C.Name){let s=e===Es.Num;return r?s?(0,C._)`"[" + ${t} + "]"`:(0,C._)`"['" + ${t} + "']"`:s?(0,C._)`"/" + ${t}`:(0,C._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,C.getProperty)(t).toString():"/"+Ss(t)}N.getErrorPath=Yc;function Ai(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}N.checkStrictMode=Ai});var Ne=g(Ps=>{"use strict";u();Object.defineProperty(Ps,"__esModule",{value:!0});var H=b(),Bc={data:new H.Name("data"),valCxt:new H.Name("valCxt"),instancePath:new H.Name("instancePath"),parentData:new H.Name("parentData"),parentDataProperty:new H.Name("parentDataProperty"),rootData:new H.Name("rootData"),dynamicAnchors:new H.Name("dynamicAnchors"),vErrors:new H.Name("vErrors"),errors:new H.Name("errors"),this:new H.Name("this"),self:new H.Name("self"),scope:new H.Name("scope"),json:new H.Name("json"),jsonPos:new H.Name("jsonPos"),jsonLen:new H.Name("jsonLen"),jsonPart:new H.Name("jsonPart")};Ps.default=Bc});var jt=g(W=>{"use strict";u();Object.defineProperty(W,"__esModule",{value:!0});W.extendErrors=W.resetErrorsCount=W.reportExtraError=W.reportError=W.keyword$DataError=W.keywordError=void 0;var R=b(),pr=k(),Y=Ne();W.keywordError={message:({keyword:t})=>(0,R.str)`must pass "${t}" keyword validation`};W.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,R.str)`"${t}" keyword must be ${e} ($data)`:(0,R.str)`"${t}" keyword is invalid ($data)`};function Xc(t,e=W.keywordError,r,s){let{it:n}=t,{gen:i,compositeRule:o,allErrors:a}=n,c=Di(t,e,r);s??(o||a)?Ci(i,c):Mi(n,(0,R._)`[${c}]`)}W.reportError=Xc;function Zc(t,e=W.keywordError,r){let{it:s}=t,{gen:n,compositeRule:i,allErrors:o}=s,a=Di(t,e,r);Ci(n,a),i||o||Mi(s,Y.default.vErrors)}W.reportExtraError=Zc;function Qc(t,e){t.assign(Y.default.errors,e),t.if((0,R._)`${Y.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,R._)`${Y.default.vErrors}.length`,e),()=>t.assign(Y.default.vErrors,null)))}W.resetErrorsCount=Qc;function eu({gen:t,keyword:e,schemaValue:r,data:s,errsCount:n,it:i}){if(n===void 0)throw new Error("ajv implementation error");let o=t.name("err");t.forRange("i",n,Y.default.errors,a=>{t.const(o,(0,R._)`${Y.default.vErrors}[${a}]`),t.if((0,R._)`${o}.instancePath === undefined`,()=>t.assign((0,R._)`${o}.instancePath`,(0,R.strConcat)(Y.default.instancePath,i.errorPath))),t.assign((0,R._)`${o}.schemaPath`,(0,R.str)`${i.errSchemaPath}/${e}`),i.opts.verbose&&(t.assign((0,R._)`${o}.schema`,r),t.assign((0,R._)`${o}.data`,s))})}W.extendErrors=eu;function Ci(t,e){let r=t.const("err",e);t.if((0,R._)`${Y.default.vErrors} === null`,()=>t.assign(Y.default.vErrors,(0,R._)`[${r}]`),(0,R._)`${Y.default.vErrors}.push(${r})`),t.code((0,R._)`${Y.default.errors}++`)}function Mi(t,e){let{gen:r,validateName:s,schemaEnv:n}=t;n.$async?r.throw((0,R._)`new ${t.ValidationError}(${e})`):(r.assign((0,R._)`${s}.errors`,e),r.return(!1))}var Ge={keyword:new R.Name("keyword"),schemaPath:new R.Name("schemaPath"),params:new R.Name("params"),propertyName:new R.Name("propertyName"),message:new R.Name("message"),schema:new R.Name("schema"),parentSchema:new R.Name("parentSchema")};function Di(t,e,r){let{createErrors:s}=t.it;return s===!1?(0,R._)`{}`:tu(t,e,r)}function tu(t,e,r={}){let{gen:s,it:n}=t,i=[ru(n,r),su(t,r)];return nu(t,e,i),s.object(...i)}function ru({errorPath:t},{instancePath:e}){let r=e?(0,R.str)`${t}${(0,pr.getErrorPath)(e,pr.Type.Str)}`:t;return[Y.default.instancePath,(0,R.strConcat)(Y.default.instancePath,r)]}function su({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:s}){let n=s?e:(0,R.str)`${e}/${t}`;return r&&(n=(0,R.str)`${n}${(0,pr.getErrorPath)(r,pr.Type.Str)}`),[Ge.schemaPath,n]}function nu(t,{params:e,message:r},s){let{keyword:n,data:i,schemaValue:o,it:a}=t,{opts:c,propertyName:l,topSchemaRef:d,schemaPath:f}=a;s.push([Ge.keyword,n],[Ge.params,typeof e=="function"?e(t):e||(0,R._)`{}`]),c.messages&&s.push([Ge.message,typeof r=="function"?r(t):r]),c.verbose&&s.push([Ge.schema,o],[Ge.parentSchema,(0,R._)`${d}${f}`],[Y.default.data,i]),l&&s.push([Ge.propertyName,l])}});var zi=g(st=>{"use strict";u();Object.defineProperty(st,"__esModule",{value:!0});st.boolOrEmptySchema=st.topBoolOrEmptySchema=void 0;var iu=jt(),ou=b(),au=Ne(),cu={message:"boolean schema is false"};function uu(t){let{gen:e,schema:r,validateName:s}=t;r===!1?xi(t,!1):typeof r=="object"&&r.$async===!0?e.return(au.default.data):(e.assign((0,ou._)`${s}.errors`,null),e.return(!0))}st.topBoolOrEmptySchema=uu;function lu(t,e){let{gen:r,schema:s}=t;s===!1?(r.var(e,!1),xi(t)):r.var(e,!0)}st.boolOrEmptySchema=lu;function xi(t,e){let{gen:r,data:s}=t,n={gen:r,keyword:"false schema",data:s,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,iu.reportError)(n,cu,void 0,e)}});var Ns=g(nt=>{"use strict";u();Object.defineProperty(nt,"__esModule",{value:!0});nt.getRules=nt.isJSONType=void 0;var du=["string","number","integer","boolean","null","object","array"],fu=new Set(du);function hu(t){return typeof t=="string"&&fu.has(t)}nt.isJSONType=hu;function pu(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}nt.getRules=pu});var Os=g(ke=>{"use strict";u();Object.defineProperty(ke,"__esModule",{value:!0});ke.shouldUseRule=ke.shouldUseGroup=ke.schemaHasRulesForType=void 0;function mu({schema:t,self:e},r){let s=e.RULES.types[r];return s&&s!==!0&&Fi(t,s)}ke.schemaHasRulesForType=mu;function Fi(t,e){return e.rules.some(r=>Vi(t,r))}ke.shouldUseGroup=Fi;function Vi(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(s=>t[s]!==void 0))}ke.shouldUseRule=Vi});var qt=g(J=>{"use strict";u();Object.defineProperty(J,"__esModule",{value:!0});J.reportTypeError=J.checkDataTypes=J.checkDataType=J.coerceAndCheckDataType=J.getJSONTypes=J.getSchemaTypes=J.DataType=void 0;var yu=Ns(),_u=Os(),gu=jt(),S=b(),Ui=k(),it;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(it||(J.DataType=it={}));function $u(t){let e=Li(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}J.getSchemaTypes=$u;function Li(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(yu.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}J.getJSONTypes=Li;function vu(t,e){let{gen:r,data:s,opts:n}=t,i=wu(e,n.coerceTypes),o=e.length>0&&!(i.length===0&&e.length===1&&(0,_u.schemaHasRulesForType)(t,e[0]));if(o){let a=Is(e,s,n.strictNumbers,it.Wrong);r.if(a,()=>{i.length?Eu(t,e,i):ks(t)})}return o}J.coerceAndCheckDataType=vu;var Ki=new Set(["string","number","integer","boolean","null"]);function wu(t,e){return e?t.filter(r=>Ki.has(r)||e==="array"&&r==="array"):[]}function Eu(t,e,r){let{gen:s,data:n,opts:i}=t,o=s.let("dataType",(0,S._)`typeof ${n}`),a=s.let("coerced",(0,S._)`undefined`);i.coerceTypes==="array"&&s.if((0,S._)`${o} == 'object' && Array.isArray(${n}) && ${n}.length == 1`,()=>s.assign(n,(0,S._)`${n}[0]`).assign(o,(0,S._)`typeof ${n}`).if(Is(e,n,i.strictNumbers),()=>s.assign(a,n))),s.if((0,S._)`${a} !== undefined`);for(let l of r)(Ki.has(l)||l==="array"&&i.coerceTypes==="array")&&c(l);s.else(),ks(t),s.endIf(),s.if((0,S._)`${a} !== undefined`,()=>{s.assign(n,a),Su(t,a)});function c(l){switch(l){case"string":s.elseIf((0,S._)`${o} == "number" || ${o} == "boolean"`).assign(a,(0,S._)`"" + ${n}`).elseIf((0,S._)`${n} === null`).assign(a,(0,S._)`""`);return;case"number":s.elseIf((0,S._)`${o} == "boolean" || ${n} === null
3
3
  || (${o} == "string" && ${n} && ${n} == +${n})`).assign(a,(0,S._)`+${n}`);return;case"integer":s.elseIf((0,S._)`${o} === "boolean" || ${n} === null
4
4
  || (${o} === "string" && ${n} && ${n} == +${n} && !(${n} % 1))`).assign(a,(0,S._)`+${n}`);return;case"boolean":s.elseIf((0,S._)`${n} === "false" || ${n} === 0 || ${n} === null`).assign(a,!1).elseIf((0,S._)`${n} === "true" || ${n} === 1`).assign(a,!0);return;case"null":s.elseIf((0,S._)`${n} === "" || ${n} === 0 || ${n} === false`),s.assign(a,null);return;case"array":s.elseIf((0,S._)`${o} === "string" || ${o} === "number"
@@ -1 +1 @@
1
- import{K as i}from"./chunk-NTRAWIEJ.js";import{a as l}from"./chunk-7UNQOKZW.js";import{a as p}from"./chunk-CX5CC6P5.js";import{e as u,g as a}from"./chunk-VKWPEFWQ.js";a();var f=u(l(),1),o=u(p(),1);async function h(t){try{return(await i("npm",["list","@shopify/cli"],{cwd:t})).match(/@shopify\/cli@([\w.-]*)/)?.[1]}catch{return}}async function d(){try{let t={...process.env,SHOPIFY_CLI_NO_ANALYTICS:"1"},e=f.default.sync("shopify",{all:!0}).filter(r=>!r.includes("node_modules"));if(!e[0])return;let n=(await i(e[0],[],{env:t})).match(/@shopify\/cli\/([^\s]+)/);if(n&&n[1]){let r=n[1];if((0,o.satisfies)(r,">=3.59.0")||s(r))return r}return}catch{return}}function s(t){return t.startsWith("0.0.0")}function y(t,e){if(s(t)||s(e))return!1;let c=new o.SemVer(t),n=new o.SemVer(e);return c.major!==n.major}export{h as a,d as b,s as c,y as d};
1
+ import{K as i}from"./chunk-YYLEWVO6.js";import{a as l}from"./chunk-7UNQOKZW.js";import{a as p}from"./chunk-CX5CC6P5.js";import{e as u,g as a}from"./chunk-VKWPEFWQ.js";a();var f=u(l(),1),o=u(p(),1);async function h(t){try{return(await i("npm",["list","@shopify/cli"],{cwd:t})).match(/@shopify\/cli@([\w.-]*)/)?.[1]}catch{return}}async function d(){try{let t={...process.env,SHOPIFY_CLI_NO_ANALYTICS:"1"},e=f.default.sync("shopify",{all:!0}).filter(r=>!r.includes("node_modules"));if(!e[0])return;let n=(await i(e[0],[],{env:t})).match(/@shopify\/cli\/([^\s]+)/);if(n&&n[1]){let r=n[1];if((0,o.satisfies)(r,">=3.59.0")||s(r))return r}return}catch{return}}function s(t){return t.startsWith("0.0.0")}function y(t,e){if(s(t)||s(e))return!1;let c=new o.SemVer(t),n=new o.SemVer(e);return c.major!==n.major}export{h as a,d as b,s as c,y as d};