@shopify/cli 4.2.0 → 4.3.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 (392) hide show
  1. package/dist/{acorn-QBS5IYTX.js → acorn-7M27BPGP.js} +1 -1
  2. package/dist/analytics-JH64XI2J.js +1 -0
  3. package/dist/analytics-MEGKKFGF.js +1 -0
  4. package/dist/{angular-UTTM4Y4S.js → angular-DW5TQVCM.js} +1 -1
  5. package/dist/{babel-JS32NLHY.js → babel-I2RLWM7N.js} +1 -1
  6. package/dist/bootstrap.js +1 -1
  7. package/dist/{chokidar-G4ONJSK4.js → chokidar-VDIVGBZH.js} +1 -1
  8. package/dist/{chunk-NBYS6YQ2.js → chunk-25HJX3L2.js} +1 -1
  9. package/dist/{chunk-ZZYFG22L.js → chunk-2EHBJWC6.js} +1 -1
  10. package/dist/{chunk-INFBVFMU.js → chunk-2GAFKG64.js} +1 -1
  11. package/dist/{chunk-F6T3UBBL.js → chunk-2GU7OY3H.js} +1 -1
  12. package/dist/{chunk-MIO2CV3Q.js → chunk-2K7FGAT6.js} +1 -1
  13. package/dist/{chunk-PRVQAHWI.js → chunk-2O22LZKV.js} +1 -1
  14. package/dist/{chunk-MKE434RB.js → chunk-2RBIR3NM.js} +1 -1
  15. package/dist/{chunk-4Z2WYNTE.js → chunk-2TMQG2UT.js} +1 -1
  16. package/dist/{chunk-FTN7Y6HD.js → chunk-2XZBQZ5R.js} +1 -1
  17. package/dist/{chunk-J6VTZEE2.js → chunk-33OHQUHZ.js} +1 -1
  18. package/dist/chunk-3AOQKI4B.js +1 -0
  19. package/dist/{chunk-4EXYYBQ6.js → chunk-3SPDFV5D.js} +1 -1
  20. package/dist/{chunk-X2TC7S57.js → chunk-3YDYZ232.js} +2 -2
  21. package/dist/{chunk-FFYYJKF7.js → chunk-4FFPTEKD.js} +1 -1
  22. package/dist/{chunk-IWCPQD7X.js → chunk-4J32OHLY.js} +1 -1
  23. package/dist/chunk-4QTEPWEJ.js +283 -0
  24. package/dist/{chunk-QLQGHMVU.js → chunk-57PPQKJT.js} +1 -1
  25. package/dist/{chunk-DCK2FX6J.js → chunk-5BKCIDMS.js} +1 -1
  26. package/dist/{chunk-JUVAGMIH.js → chunk-5C7HDTHJ.js} +1 -1
  27. package/dist/{chunk-A6X2IVGT.js → chunk-5FFHQTRC.js} +1 -1
  28. package/dist/{chunk-UCLSPAVX.js → chunk-5FVB7JHP.js} +1 -1
  29. package/dist/{chunk-HD5TYIDZ.js → chunk-5H3VTG77.js} +1 -1
  30. package/dist/{chunk-6TEXPRI2.js → chunk-5O43334U.js} +1 -1
  31. package/dist/{chunk-MZJRNFAU.js → chunk-5XDQ76DQ.js} +1 -1
  32. package/dist/{chunk-PD5ZHJWI.js → chunk-636CTEW7.js} +1 -1
  33. package/dist/chunk-6JKGUQRD.js +1 -0
  34. package/dist/chunk-6KETAPWL.js +1 -0
  35. package/dist/{chunk-UOQQNAHX.js → chunk-6LWOWDF4.js} +1 -1
  36. package/dist/{chunk-CE6FKJFS.js → chunk-7572RLUP.js} +1 -1
  37. package/dist/{chunk-XFKCDWXB.js → chunk-762JWOWJ.js} +1 -1
  38. package/dist/{chunk-IU2ZQ6TE.js → chunk-773TIA5M.js} +1 -1
  39. package/dist/{chunk-23AMFHXC.js → chunk-7D45IAMQ.js} +1 -1
  40. package/dist/{chunk-VPL2NDH6.js → chunk-7FQFEB33.js} +5 -5
  41. package/dist/{chunk-BPVZ7E63.js → chunk-7LV55VWE.js} +1 -1
  42. package/dist/{chunk-QUTQDXSL.js → chunk-7UNQOKZW.js} +1 -1
  43. package/dist/{chunk-IWE4RUI7.js → chunk-A27NZMWB.js} +1 -1
  44. package/dist/{chunk-7JESXDF2.js → chunk-A4SBXDZB.js} +1 -1
  45. package/dist/{chunk-AP3RFOPL.js → chunk-A5HKAMAC.js} +1 -1
  46. package/dist/{chunk-Z35BTAM6.js → chunk-AAK376RT.js} +1 -1
  47. package/dist/{chunk-DNLOSMHL.js → chunk-AERKD4TO.js} +1 -1
  48. package/dist/{chunk-WUK5NQSX.js → chunk-ANBOLDON.js} +2 -2
  49. package/dist/{chunk-TLSAQ6FG.js → chunk-AO3RFGNV.js} +1 -1
  50. package/dist/{chunk-KU5OPV7U.js → chunk-ATSMK66C.js} +1 -1
  51. package/dist/{chunk-LTWXTDDR.js → chunk-AU5EZQW7.js} +1 -1
  52. package/dist/{chunk-2YXKZWYW.js → chunk-AVD3INWF.js} +1 -1
  53. package/dist/chunk-AWEB5AQM.js +1 -0
  54. package/dist/{chunk-X4CV6TRE.js → chunk-AXNAGI32.js} +1 -1
  55. package/dist/{chunk-FQDRVPCY.js → chunk-BL46CZ2M.js} +1 -1
  56. package/dist/{chunk-OKOYLEA7.js → chunk-BQWK3C47.js} +3 -3
  57. package/dist/{chunk-C3LZPAAH.js → chunk-CEHXOWA6.js} +1 -1
  58. package/dist/{chunk-N5ROZKPZ.js → chunk-CFOXXOO2.js} +1 -1
  59. package/dist/{chunk-PIBY5DDZ.js → chunk-CRALWNNO.js} +1 -1
  60. package/dist/{chunk-NO5KVFTV.js → chunk-CV5EQGES.js} +3 -3
  61. package/dist/{chunk-H4W4DFKK.js → chunk-CX5CC6P5.js} +1 -1
  62. package/dist/{chunk-OKNBZSGN.js → chunk-DCLUZFT7.js} +1 -1
  63. package/dist/{chunk-2EJCY4CE.js → chunk-DNXYKGV2.js} +1 -1
  64. package/dist/{chunk-IOQQUHST.js → chunk-DTIWUT2T.js} +1 -1
  65. package/dist/{chunk-6TORWTD7.js → chunk-DYNH5SKT.js} +1 -1
  66. package/dist/{chunk-D3DDLLNF.js → chunk-DZQYG32N.js} +1 -1
  67. package/dist/{chunk-QTGMS62F.js → chunk-E7DHELFH.js} +1 -1
  68. package/dist/{chunk-PUTZFF2Z.js → chunk-EH7ZTFS4.js} +3 -3
  69. package/dist/{chunk-YS6VOQ7I.js → chunk-EJDWYASP.js} +1 -1
  70. package/dist/chunk-EKVTNWHM.js +1 -0
  71. package/dist/{chunk-6M3ZYNGO.js → chunk-ET2CGROE.js} +1 -1
  72. package/dist/{chunk-6ZIOYXEF.js → chunk-EVZA2TCI.js} +1 -1
  73. package/dist/{chunk-QSTEVZFQ.js → chunk-F3TMLDLC.js} +1 -1
  74. package/dist/{chunk-CW7WJZKR.js → chunk-FIYAECXH.js} +1 -1
  75. package/dist/{chunk-WDC3KIZT.js → chunk-FKIVKNOV.js} +1 -1
  76. package/dist/{chunk-7DVOSOEP.js → chunk-FOFJBRSL.js} +1 -1
  77. package/dist/{chunk-D656BV5Z.js → chunk-FQ5ZZX2G.js} +1 -1
  78. package/dist/{chunk-6YHJ554P.js → chunk-G2LVUM7N.js} +1 -1
  79. package/dist/{chunk-NPM3MFB3.js → chunk-G2OHWAY2.js} +1 -1
  80. package/dist/chunk-G3JJLXPH.js +1 -0
  81. package/dist/{chunk-57N2DFIF.js → chunk-G3RWLAOG.js} +1 -1
  82. package/dist/{chunk-4V4DQ6W7.js → chunk-G4OQABDT.js} +30 -30
  83. package/dist/{chunk-KLMDWDT2.js → chunk-GB3YC4TI.js} +1 -1
  84. package/dist/{chunk-OCOY5MV2.js → chunk-GCN4O7HM.js} +1 -1
  85. package/dist/{chunk-2N4O33VM.js → chunk-GDHD3TGC.js} +1 -1
  86. package/dist/{chunk-N3YWHJMB.js → chunk-GJXINXSU.js} +2 -2
  87. package/dist/{chunk-RAH5NW3R.js → chunk-GWHV62YT.js} +1 -1
  88. package/dist/{chunk-VA5IUGZV.js → chunk-HCTZN7L4.js} +1 -1
  89. package/dist/{chunk-LITB5QQX.js → chunk-HDC5V7RY.js} +1 -1
  90. package/dist/{chunk-K7K6GNF6.js → chunk-HIQHYPLU.js} +1 -1
  91. package/dist/{chunk-VEDZUOVI.js → chunk-HOSFU6UP.js} +3 -3
  92. package/dist/{chunk-HSYRYSX4.js → chunk-I22ZTRKK.js} +1 -1
  93. package/dist/{chunk-KLA7AWG6.js → chunk-I4R7TML2.js} +1 -1
  94. package/dist/{chunk-EENHXSWU.js → chunk-I5A6BPCP.js} +1 -1
  95. package/dist/{chunk-TNQXTZAX.js → chunk-IWOTLFOY.js} +1 -1
  96. package/dist/{chunk-PBTXPBI6.js → chunk-J3H4LPN6.js} +3 -3
  97. package/dist/{chunk-6HZTMQD6.js → chunk-J3HX6ZGD.js} +1 -1
  98. package/dist/{chunk-OYP7DKPU.js → chunk-J3JPJCWP.js} +1 -1
  99. package/dist/{chunk-E2YBU6D3.js → chunk-J5BRKYGE.js} +2 -2
  100. package/dist/{chunk-5TIJLYZU.js → chunk-JAWKLBOB.js} +1 -1
  101. package/dist/{chunk-6AJZKIZ3.js → chunk-JAWOP4HJ.js} +1 -1
  102. package/dist/{chunk-TQGTEVSR.js → chunk-JCIN73BE.js} +1 -1
  103. package/dist/{chunk-C6ABJCRG.js → chunk-JEZ3PGVC.js} +1 -1
  104. package/dist/{chunk-TGACBJIY.js → chunk-JJ6RM54S.js} +1 -1
  105. package/dist/{chunk-TXUTT6UA.js → chunk-JK3NIHTX.js} +1 -1
  106. package/dist/{chunk-OLOBQ42K.js → chunk-JLE4NBMT.js} +1 -1
  107. package/dist/{chunk-7KJ5TBWG.js → chunk-JSOGPMWB.js} +1 -1
  108. package/dist/{chunk-L2VSSINY.js → chunk-JUYJZUYU.js} +1 -1
  109. package/dist/chunk-KRQGLK2Q.js +3 -0
  110. package/dist/{chunk-3VZEETAV.js → chunk-KRZABRYT.js} +1 -1
  111. package/dist/{chunk-FBVBO5YQ.js → chunk-L2PC4MUV.js} +1 -1
  112. package/dist/{chunk-SSM346XI.js → chunk-LCZDC6EE.js} +1 -1
  113. package/dist/{chunk-NEZEHBT2.js → chunk-LXVORHCQ.js} +1 -1
  114. package/dist/{chunk-DERA4K6A.js → chunk-M2YINBHF.js} +1 -1
  115. package/dist/{chunk-VT77EFRL.js → chunk-M7YFD4EV.js} +6 -6
  116. package/dist/{chunk-DCBYHVKW.js → chunk-MEIEEENL.js} +1 -1
  117. package/dist/{chunk-7BFDUVOG.js → chunk-MIDYZPO4.js} +1 -1
  118. package/dist/{chunk-I3LX25MB.js → chunk-MINZGZ4N.js} +1 -1
  119. package/dist/{chunk-U3ZG675O.js → chunk-MMIHHCMW.js} +1 -1
  120. package/dist/{chunk-PRKBO42R.js → chunk-MPW2YJWU.js} +1 -1
  121. package/dist/{chunk-C2FFA4O4.js → chunk-MRS6LAY7.js} +1 -1
  122. package/dist/{chunk-IVGWFPMA.js → chunk-N3CNWCC2.js} +1 -1
  123. package/dist/{chunk-NXL6LDJU.js → chunk-N3NE4MVN.js} +1 -1
  124. package/dist/{chunk-WNGV4JQS.js → chunk-N3YTDGFY.js} +1 -1
  125. package/dist/{chunk-A5SQCM63.js → chunk-N5LVGFDS.js} +1 -1
  126. package/dist/{chunk-GVITHCQJ.js → chunk-NILXAUUT.js} +1 -1
  127. package/dist/{chunk-5Y7GIF2W.js → chunk-NJOO5XJV.js} +1 -1
  128. package/dist/{chunk-ULQG3XQS.js → chunk-NNOSZ447.js} +1 -1
  129. package/dist/{chunk-MGL4YM3S.js → chunk-NTRAWIEJ.js} +4 -4
  130. package/dist/{chunk-2WNODIWJ.js → chunk-NWXDOCL5.js} +1 -1
  131. package/dist/{chunk-K77WAKOB.js → chunk-OU3M32A2.js} +1 -1
  132. package/dist/chunk-OU4SKQTC.js +5 -0
  133. package/dist/{chunk-4KRT35A2.js → chunk-OXJBYKMX.js} +1 -1
  134. package/dist/{chunk-LCCMXY6N.js → chunk-OZBY45KT.js} +1 -1
  135. package/dist/{chunk-75VPUOC5.js → chunk-P2OI2P2M.js} +1 -1
  136. package/dist/{chunk-XP6IRAZN.js → chunk-PCCK4YTE.js} +1 -1
  137. package/dist/{chunk-2VLMN5QZ.js → chunk-PFGYC53K.js} +1 -1
  138. package/dist/{chunk-YGMVL6NZ.js → chunk-PMS4MNHB.js} +2 -2
  139. package/dist/{chunk-OA4P6AKS.js → chunk-PNP5OKNZ.js} +1 -1
  140. package/dist/{chunk-XX343DDG.js → chunk-PXHY753L.js} +1 -1
  141. package/dist/{chunk-UURFVUAH.js → chunk-Q73GEVSJ.js} +1 -1
  142. package/dist/{chunk-M2TJICTB.js → chunk-Q77MM2N2.js} +1 -1
  143. package/dist/{chunk-XDAOLCPN.js → chunk-Q7C44DX5.js} +1 -1
  144. package/dist/chunk-QDVJJKLB.js +1 -0
  145. package/dist/{chunk-5CH3B62S.js → chunk-RJ5VF3QY.js} +1 -1
  146. package/dist/{chunk-LQMSF3F7.js → chunk-RKDZGK5K.js} +1 -1
  147. package/dist/{chunk-VYXVYOIJ.js → chunk-RSRYC5ZF.js} +1 -1
  148. package/dist/{chunk-HLMFVORT.js → chunk-S22NCNAJ.js} +1 -1
  149. package/dist/{chunk-UARVYVLN.js → chunk-S5IFJ737.js} +2 -2
  150. package/dist/{chunk-42RMKTCJ.js → chunk-S6B2ADVR.js} +1 -1
  151. package/dist/chunk-S7F5KFQP.js +1 -0
  152. package/dist/{chunk-UBKVCI7A.js → chunk-SSCYLDSX.js} +1 -1
  153. package/dist/{chunk-QFWIDATO.js → chunk-STJ3LWFL.js} +1 -1
  154. package/dist/{chunk-LKS47US7.js → chunk-T3ERXB7F.js} +1 -1
  155. package/dist/{chunk-PLQFX5ZP.js → chunk-T4IV643Z.js} +1 -1
  156. package/dist/{chunk-BECEP46I.js → chunk-T4NS63K4.js} +1 -1
  157. package/dist/{chunk-3YWUSKWF.js → chunk-T6CC5WUU.js} +1 -1
  158. package/dist/{chunk-3TNEIDOD.js → chunk-T7KHS6RF.js} +1 -1
  159. package/dist/{chunk-QYR5VPQA.js → chunk-TOLPNBZK.js} +1 -1
  160. package/dist/{chunk-XXE7667M.js → chunk-TP7E54WN.js} +1 -1
  161. package/dist/chunk-TPCG6DCA.js +1 -0
  162. package/dist/{chunk-2KH2S7PI.js → chunk-TRYWVIVJ.js} +1 -1
  163. package/dist/chunk-TU47HMTL.js +1 -0
  164. package/dist/{chunk-HHXHOQQP.js → chunk-TUNUEOHO.js} +1 -1
  165. package/dist/{chunk-PS25FEBF.js → chunk-TY6BZTG3.js} +1 -1
  166. package/dist/chunk-TYMYIUIQ.js +1 -0
  167. package/dist/chunk-UB26DGTR.js +6 -0
  168. package/dist/{chunk-HJSYHK4S.js → chunk-UC7KMA6W.js} +1 -1
  169. package/dist/{chunk-FD5S2O6M.js → chunk-UOHNRH6E.js} +1 -1
  170. package/dist/{chunk-ZR76GGZ6.js → chunk-UQWFDL3F.js} +1 -1
  171. package/dist/{chunk-M4LOKANA.js → chunk-USLYL5AC.js} +1 -1
  172. package/dist/{chunk-VICNWPLQ.js → chunk-UTO4Z6P6.js} +12 -12
  173. package/dist/{chunk-F47MFBKM.js → chunk-UU5P2IYU.js} +1 -1
  174. package/dist/chunk-UYSF234H.js +1 -0
  175. package/dist/chunk-VE35YELD.js +1 -0
  176. package/dist/{chunk-6YAXFS6V.js → chunk-VI34CKV6.js} +1 -1
  177. package/dist/{chunk-M4V2OQAX.js → chunk-VJ6KDRZI.js} +1 -1
  178. package/dist/{chunk-VBUZWRUL.js → chunk-VJEKDBGZ.js} +1 -1
  179. package/dist/chunk-VKWPEFWQ.js +1 -0
  180. package/dist/chunk-VPPWSKOY.js +1 -0
  181. package/dist/chunk-VRJTLVG3.js +1 -0
  182. package/dist/chunk-VUMUCNI7.js +1 -0
  183. package/dist/chunk-W7DDV2EY.js +1 -0
  184. package/dist/{chunk-RL5BWZ7D.js → chunk-WA3YC5W4.js} +1 -1
  185. package/dist/{chunk-MFLBTJO7.js → chunk-WHNWE7P2.js} +1 -1
  186. package/dist/{chunk-R6JNXEB3.js → chunk-WVRGCNBZ.js} +1 -1
  187. package/dist/{chunk-MOA33ZFO.js → chunk-WW7TENNA.js} +1 -1
  188. package/dist/{chunk-HZA6IAA4.js → chunk-XVUHUA36.js} +1 -1
  189. package/dist/{chunk-PSQFZAF3.js → chunk-XWPPBOGF.js} +1 -1
  190. package/dist/chunk-YIRFEW5M.js +1 -0
  191. package/dist/{chunk-RGNAWKD7.js → chunk-YL3TYQGT.js} +1 -1
  192. package/dist/{chunk-A3VYI4LO.js → chunk-YLQ3LNNY.js} +3 -3
  193. package/dist/{chunk-MA52QGHP.js → chunk-YMAWEIUR.js} +1 -1
  194. package/dist/{chunk-6LK6ZP3Q.js → chunk-YPBCSDFQ.js} +1 -1
  195. package/dist/{chunk-3BRUCKZ2.js → chunk-YSIBRY6C.js} +1 -1
  196. package/dist/{chunk-FGVC22EY.js → chunk-YVQXEPHY.js} +1 -1
  197. package/dist/{chunk-4LNCYIS3.js → chunk-ZDF5N422.js} +1 -1
  198. package/dist/{chunk-T4M5CWAO.js → chunk-ZG7BVVT2.js} +1 -1
  199. package/dist/chunk-ZGJ3DFTQ.js +9 -0
  200. package/dist/{chunk-NKQBEFPS.js → chunk-ZI7LK3LW.js} +1 -1
  201. package/dist/{chunk-IXUVSFW2.js → chunk-ZM75DSIW.js} +1 -1
  202. package/dist/{chunk-3V63X7WZ.js → chunk-ZUKLGZOU.js} +1 -1
  203. package/dist/cli/commands/app/app-logs/sources.js +1 -1
  204. package/dist/cli/commands/app/build.js +1 -1
  205. package/dist/cli/commands/app/bulk/cancel.js +1 -1
  206. package/dist/cli/commands/app/bulk/execute.js +1 -1
  207. package/dist/cli/commands/app/bulk/status.js +1 -1
  208. package/dist/cli/commands/app/config/link.js +1 -1
  209. package/dist/cli/commands/app/config/pull.js +1 -1
  210. package/dist/cli/commands/app/config/use.js +1 -1
  211. package/dist/cli/commands/app/config/validate.js +1 -1
  212. package/dist/cli/commands/app/demo/watcher.js +1 -1
  213. package/dist/cli/commands/app/deploy.js +1 -1
  214. package/dist/cli/commands/app/dev/clean.js +1 -1
  215. package/dist/cli/commands/app/dev.js +1 -1
  216. package/dist/cli/commands/app/env/pull.js +1 -1
  217. package/dist/cli/commands/app/env/show.js +1 -1
  218. package/dist/cli/commands/app/execute.js +1 -1
  219. package/dist/cli/commands/app/function/build.js +1 -1
  220. package/dist/cli/commands/app/function/info.js +1 -1
  221. package/dist/cli/commands/app/function/replay.js +1 -1
  222. package/dist/cli/commands/app/function/run.js +1 -1
  223. package/dist/cli/commands/app/function/schema.js +1 -1
  224. package/dist/cli/commands/app/function/typegen.js +1 -1
  225. package/dist/cli/commands/app/generate/extension.js +1 -1
  226. package/dist/cli/commands/app/import-custom-data-definitions.js +1 -1
  227. package/dist/cli/commands/app/import-extensions.js +1 -1
  228. package/dist/cli/commands/app/info.js +1 -1
  229. package/dist/cli/commands/app/init.js +1 -1
  230. package/dist/cli/commands/app/logs.js +1 -1
  231. package/dist/cli/commands/app/release.js +1 -1
  232. package/dist/cli/commands/app/versions/list.js +1 -1
  233. package/dist/cli/commands/app/webhook/trigger.js +1 -1
  234. package/dist/cli/commands/auth/login.js +1 -1
  235. package/dist/cli/commands/auth/logout.js +1 -1
  236. package/dist/cli/commands/cache/clear.js +1 -1
  237. package/dist/cli/commands/config/autoupgrade/constants.js +1 -1
  238. package/dist/cli/commands/config/autoupgrade/off.js +1 -1
  239. package/dist/cli/commands/config/autoupgrade/on.js +1 -1
  240. package/dist/cli/commands/config/autoupgrade/status.js +1 -1
  241. package/dist/cli/commands/debug/command-flags.js +1 -1
  242. package/dist/cli/commands/doc/fetch.d.ts +12 -0
  243. package/dist/cli/commands/doc/fetch.js +1 -0
  244. package/dist/cli/commands/doc/search.d.ts +13 -0
  245. package/dist/cli/commands/doc/search.js +1 -0
  246. package/dist/cli/commands/docs/generate.js +1 -1
  247. package/dist/cli/commands/doctor-release/doctor-release.js +1 -1
  248. package/dist/cli/commands/doctor-release/theme/index.js +1 -1
  249. package/dist/cli/commands/help.js +1 -1
  250. package/dist/cli/commands/kitchen-sink/async.js +1 -1
  251. package/dist/cli/commands/kitchen-sink/index.js +1 -1
  252. package/dist/cli/commands/kitchen-sink/prompts.js +1 -1
  253. package/dist/cli/commands/kitchen-sink/static.js +1 -1
  254. package/dist/cli/commands/notifications/generate.js +1 -1
  255. package/dist/cli/commands/notifications/list.js +1 -1
  256. package/dist/cli/commands/organization/list.js +1 -1
  257. package/dist/cli/commands/search.d.ts +4 -0
  258. package/dist/cli/commands/search.js +1 -1
  259. package/dist/cli/commands/theme/check.js +1 -1
  260. package/dist/cli/commands/theme/console.js +1 -1
  261. package/dist/cli/commands/theme/delete.js +1 -1
  262. package/dist/cli/commands/theme/dev.js +1 -1
  263. package/dist/cli/commands/theme/duplicate.js +1 -1
  264. package/dist/cli/commands/theme/info.js +1 -1
  265. package/dist/cli/commands/theme/init.js +1 -1
  266. package/dist/cli/commands/theme/language-server.js +1 -1
  267. package/dist/cli/commands/theme/list.js +1 -1
  268. package/dist/cli/commands/theme/metafields/pull.js +1 -1
  269. package/dist/cli/commands/theme/open.js +1 -1
  270. package/dist/cli/commands/theme/package.js +1 -1
  271. package/dist/cli/commands/theme/preview.js +1 -1
  272. package/dist/cli/commands/theme/profile.js +1 -1
  273. package/dist/cli/commands/theme/publish.js +1 -1
  274. package/dist/cli/commands/theme/pull.js +1 -1
  275. package/dist/cli/commands/theme/push.js +1 -1
  276. package/dist/cli/commands/theme/rename.js +1 -1
  277. package/dist/cli/commands/theme/share.js +1 -1
  278. package/dist/cli/commands/upgrade.js +1 -1
  279. package/dist/cli/commands/version.js +1 -1
  280. package/dist/cli/services/commands/doc/fetch.d.ts +1 -0
  281. package/dist/cli/services/commands/doc/fetch.js +45 -0
  282. package/dist/cli/services/commands/doc/search.d.ts +1 -0
  283. package/dist/cli/services/commands/doc/search.js +47 -0
  284. package/dist/command-registry.js +1 -1
  285. package/dist/{conf-store-6QNH5BID.js → conf-store-UY3MDGGA.js} +1 -1
  286. package/dist/{custom-oclif-loader-TSPWW5YF.js → custom-oclif-loader-3AICQCNU.js} +1 -1
  287. package/dist/deprecations-KNUMDRIU.js +1 -0
  288. package/dist/{devtools-HCKYP7DQ.js → devtools-37DE4MUR.js} +1 -1
  289. package/dist/{devtools-VEZNCV6W.js → devtools-WAWU5KQL.js} +1 -1
  290. package/dist/dist-C5IV2YDQ.js +1 -0
  291. package/dist/dist-VL4KZWV2.js +1 -0
  292. package/dist/environments-YPRVO2CF.js +1 -0
  293. package/dist/error-XRBQTNFM.js +1 -0
  294. package/dist/error-handler-NI7D6GSY.js +1 -0
  295. package/dist/{estree-BYYJYS3A.js → estree-JV5M77BA.js} +1 -1
  296. package/dist/{flow-M3Q2HPQT.js → flow-N4JYPYMQ.js} +1 -1
  297. package/dist/{fs-YMUQ6JLE.js → fs-LJWVNO4H.js} +1 -1
  298. package/dist/{glimmer-3DEJJGOJ.js → glimmer-JEV3BXHR.js} +1 -1
  299. package/dist/{graphql-A4HHE3MB.js → graphql-DTF6MHYF.js} +1 -1
  300. package/dist/hooks/app-init.js +1 -1
  301. package/dist/hooks/did-you-mean.js +1 -1
  302. package/dist/hooks/hydrogen-init.js +1 -1
  303. package/dist/hooks/plugin-plugins.js +1 -1
  304. package/dist/hooks/postrun.js +1 -1
  305. package/dist/hooks/prerun.js +1 -1
  306. package/dist/hooks/public-metadata.js +1 -1
  307. package/dist/hooks/sensitive-metadata.js +1 -1
  308. package/dist/hooks/tunnel-provider.js +1 -1
  309. package/dist/hooks/tunnel-start.js +1 -1
  310. package/dist/{html-HETICZ2F.js → html-LVOJ3RQS.js} +1 -1
  311. package/dist/{http-proxy-node16-Q5DZMBHC.js → http-proxy-node16-X2WAMUT5.js} +1 -1
  312. package/dist/index.js +28 -7
  313. package/dist/is-global-W6ALVC5L.js +1 -0
  314. package/dist/{is-wsl-TN2CXYI7.js → is-wsl-UEMXYJPN.js} +1 -1
  315. package/dist/{latest-version-6OAYLOBL.js → latest-version-32HXMWJ7.js} +1 -1
  316. package/dist/lib-AIKYSHWL.js +1 -0
  317. package/dist/lib-O5EZ4NVT.js +1 -0
  318. package/dist/lib-Q4PWEMFD.js +1 -0
  319. package/dist/lib-QJDPPAWN.js +1 -0
  320. package/dist/{local-GPDAXHE6.js → local-GKEWZAIV.js} +1 -1
  321. package/dist/local-storage-ZOZMA22B.js +1 -0
  322. package/dist/{markdown-5TVCXM53.js → markdown-J6CE6POI.js} +1 -1
  323. package/dist/{meriyah-23OZNYWC.js → meriyah-PNQQZQYI.js} +1 -1
  324. package/dist/metadata-UEUN64TK.js +1 -0
  325. package/dist/{morph-I35VYPBH.js → morph-CGOZEPPZ.js} +1 -1
  326. package/dist/{multipart-parser-Q4QJZK3V.js → multipart-parser-5NSSTW27.js} +1 -1
  327. package/dist/{node-package-manager-GO4ZRTKQ.js → node-package-manager-4ASQQIIF.js} +1 -1
  328. package/dist/notifications-system-HLXJCAMG.js +1 -0
  329. package/dist/{npa-VNALV7XY.js → npa-A4YSCQ5Q.js} +1 -1
  330. package/dist/{open-VA7TLUIL.js → open-KLSGXBIW.js} +1 -1
  331. package/dist/out-CDCY25QC.js +1 -0
  332. package/dist/{output-7IYOMPSA.js → output-S6E37GJQ.js} +1 -1
  333. package/dist/{path-CWUNINMX.js → path-MBXP7ZIC.js} +1 -1
  334. package/dist/{postcss-IIK6CGAW.js → postcss-Q36SHOML.js} +1 -1
  335. package/dist/{prettier-ZSBNNQTK.js → prettier-EGVCP5CY.js} +1 -1
  336. package/dist/{source-map-3K6Y2OMO.js → source-map-E7FCCJL7.js} +1 -1
  337. package/dist/system-YQZNGSWB.js +1 -0
  338. package/dist/tsconfig.tsbuildinfo +1 -1
  339. package/dist/typescript-5R4Y7PXE.js +1 -0
  340. package/dist/{typescript-YKZ232QT.js → typescript-WYPDGPSV.js} +1 -1
  341. package/dist/ui-D2FFWRK7.js +1 -0
  342. package/dist/upgrade-TVTCFMXM.js +1 -0
  343. package/dist/version-J6MDN7BZ.js +1 -0
  344. package/dist/version-RIRW5EXQ.js +1 -0
  345. package/dist/{workerd-ST6XJKUN.js → workerd-QOTT6UCO.js} +1 -1
  346. package/dist/{yaml-SJKIH3VD.js → yaml-6KWCJ64X.js} +1 -1
  347. package/oclif.manifest.json +304 -6
  348. package/package.json +11 -8
  349. package/dist/analytics-CX22YIUZ.js +0 -1
  350. package/dist/analytics-UBWQIQYF.js +0 -1
  351. package/dist/chunk-4ZGSSQC6.js +0 -1
  352. package/dist/chunk-6SXOUZ7V.js +0 -1
  353. package/dist/chunk-ATPFTRCC.js +0 -1
  354. package/dist/chunk-AWQ5AR2K.js +0 -5
  355. package/dist/chunk-BHWEA4V2.js +0 -1
  356. package/dist/chunk-CCEA5CUX.js +0 -1
  357. package/dist/chunk-FP2NOZSD.js +0 -1
  358. package/dist/chunk-FSTCEWXX.js +0 -1
  359. package/dist/chunk-K3PGC6DC.js +0 -1
  360. package/dist/chunk-KFCGMT67.js +0 -1
  361. package/dist/chunk-KQU6HOJ3.js +0 -1
  362. package/dist/chunk-NP4UFPAX.js +0 -9
  363. package/dist/chunk-RVMB5LC2.js +0 -1
  364. package/dist/chunk-T5MK7ZSF.js +0 -1
  365. package/dist/chunk-UOQ75BL3.js +0 -1
  366. package/dist/chunk-UWJ73J4B.js +0 -1
  367. package/dist/chunk-VPRTJUIN.js +0 -1
  368. package/dist/chunk-WCWNI3ZV.js +0 -283
  369. package/dist/chunk-XEFQQPL4.js +0 -1
  370. package/dist/chunk-YJB7P2HC.js +0 -1
  371. package/dist/chunk-YOZNRLFC.js +0 -1
  372. package/dist/deprecations-F6JWVV2W.js +0 -1
  373. package/dist/dist-4BD6KOLR.js +0 -1
  374. package/dist/dist-AUABCVPI.js +0 -1
  375. package/dist/environments-RGLI75HN.js +0 -1
  376. package/dist/error-OZALZZ3U.js +0 -1
  377. package/dist/error-handler-V7LSEXHM.js +0 -1
  378. package/dist/is-global-BLIZ57HQ.js +0 -1
  379. package/dist/lib-AK5EOIKR.js +0 -1
  380. package/dist/lib-LVUMLZ4H.js +0 -1
  381. package/dist/lib-ME6554NA.js +0 -1
  382. package/dist/lib-WU3FEA6I.js +0 -1
  383. package/dist/local-storage-P66KJG6I.js +0 -1
  384. package/dist/metadata-TRH25EHU.js +0 -1
  385. package/dist/notifications-system-HM6JZ6WJ.js +0 -1
  386. package/dist/out-WLY6KV4B.js +0 -1
  387. package/dist/system-X5C4EQQH.js +0 -1
  388. package/dist/typescript-K5CWIA4V.js +0 -1
  389. package/dist/ui-H62CMRLG.js +0 -1
  390. package/dist/upgrade-EEOPH464.js +0 -1
  391. package/dist/version-76NBQR4K.js +0 -1
  392. package/dist/version-IGSEISUA.js +0 -1
@@ -1,2 +1,2 @@
1
- import{a as T}from"./chunk-OYP7DKPU.js";import{a as de}from"./chunk-TXUTT6UA.js";import{b as te,c as re,d as oe,e as se,f as ne,h as ie,i as ae,k as le,l as ce,n as me}from"./chunk-X2TC7S57.js";import{a as j}from"./chunk-MA52QGHP.js";import{A as Q,B as b,J as X,c as Y,s as B,w as N,x as V,y as x}from"./chunk-IOQQUHST.js";import{c as Z,e as ee}from"./chunk-M4V2OQAX.js";import{k as v,l as z,n as k}from"./chunk-MZJRNFAU.js";import{n as C,p as P}from"./chunk-HHXHOQQP.js";import{ta as L,xa as _}from"./chunk-4V4DQ6W7.js";import{a as O}from"./chunk-JUVAGMIH.js";import{J as K,P as J,s as W,u as M,v as q,w as R,y as U,z as G}from"./chunk-MGL4YM3S.js";import{d as H,e as I}from"./chunk-6YAXFS6V.js";import{d as g}from"./chunk-BHWEA4V2.js";import{Fb as y,Hb as p,Mb as E,Pb as f}from"./chunk-VPL2NDH6.js";import{u as w}from"./chunk-7JESXDF2.js";import{g as m}from"./chunk-VPRTJUIN.js";m();m();m();m();var fe={workPromise:Promise.resolve()};async function ue(e,t,o,r,s){if(o.length===0)return fe;f("Initiating theme asset reconciliation process");let{filesOnlyPresentLocally:i,filesOnlyPresentOnRemote:n,filesWithConflictingChecksums:l}=$e(o,r),a=i.length===0&&n.length===0&&l.length===0;if(_(`theme-service:theme-reconciliation:manual:${a}`),a)return f("Local and remote checksums match - no need to reconcile theme assets"),fe;let c=await Oe({filesOnlyPresentLocally:i,filesOnlyPresentOnRemote:n,filesWithConflictingChecksums:l},s);return{workPromise:Fe(e,t,r,c)}}function $e(e,t){let o=new Set,r=[],s=[];for(let n of e){o.add(n.key);let l=t.files.get(n.key);l?n.checksum!==l.checksum&&s.push(n):r.push(n)}let i=Array.from(t.files.values()).filter(n=>!o.has(n.key));return{filesOnlyPresentOnRemote:A(r,t),filesOnlyPresentLocally:A(i,t),filesWithConflictingChecksums:A(s,t)}}function A(e,t){return t.applyIgnoreFilters(e).filter(r=>r.key.endsWith(".json"))}async function S(e,t,o){if(e.length===0)return;M({body:{list:{title:t,items:e.map(s=>s.key)}}}),await G({message:"Reconciliation Strategy",choices:[{label:o.remote.label,value:D},{label:o.local.label,value:he}]})===D?o.remote.callback(e):o.local.callback(e)}async function Fe(e,t,o,r){let{localFilesToDelete:s,filesToDownload:i,remoteFilesToDelete:n}=r,l=s.map(d=>o.delete(d.key)),a=T(i,P,async d=>{let u=await v(e.id,d.map(h=>h.key),t);return Promise.all(u.map(h=>{if(h)return o.write(h)}))}),c=z(e.id,n.map(d=>d.key),t);await Promise.all([...l,...a,c])}async function Oe(e,t){let{filesOnlyPresentLocally:o,filesOnlyPresentOnRemote:r,filesWithConflictingChecksums:s}=e,i=[],n=[],l=[];return t.noDelete||await S(o,"The files listed below are only present locally. What would you like to do?",{remote:{label:"Delete files from the local directory",callback:a=>{i.push(...a)}},local:{label:"Upload local files to the remote theme",callback:()=>{}}}),await S(r,"The files listed below are only present on the remote theme. What would you like to do?",{remote:{label:"Download remote files to the local directory",callback:a=>{n.push(...a)}},local:{label:"Delete files from the remote theme",callback:a=>{l.push(...a)}}}),await S(s,"The files listed below differ between the local and remote versions. What would you like to do?",{remote:{label:"Keep the remote version",callback:a=>{n.push(...a)}},local:{label:"Keep the local version",callback:()=>{}}}),{localFilesToDelete:i,filesToDownload:n,remoteFilesToDelete:l}}m();var Le=3e3,$=class extends Error{};function ye(e,t,o,r,s,i){f("Listening for changes in the theme editor");let n=5,l=0,a="",c=o,d=async()=>{await new Promise(u=>setTimeout(u,Le)),c=await _e(e,t,c,r,s).then(u=>(l=0,a="",u)).catch(u=>{if(l++,u.message!==a&&(a=u.message,b("Error while polling for changes.",u)),l>=n){let h=new g("Too many polling errors...","Please check the errors above and ensure you have a stable internet connection.");U(h),i(h)}return c})};setTimeout(async()=>{for(;;)await d()})}async function _e(e,t,o,r,s){let i=new Set(r.unsyncedFileKeys),n=pe(o,r,i),l=await k(e.id,t).then(d=>pe(d,r,i)),a=Ie(n,l),c=He(l,n);return await qe(r,a),await We(e,t,r,a),await Me(r,c,s),l}function He(e,t){let o=new Map(e.map(s=>[s.key,s]));return t.filter(s=>o.get(s.key)===void 0)}function Ie(e,t){let o=new Map(e.map(s=>[s.key,s]));return t.filter(s=>{let i=o.get(s.key);if(!i||i.checksum!==s.checksum)return!0})}async function We(e,t,o,r){let s=r.filter(n=>o.files.get(n.key)?.checksum!==n.checksum),i=T(s,P,async n=>v(e.id,n.map(l=>l.key),t).then(l=>Promise.all(l.map(async a=>{a&&(await o.write(a),E(p`• ${C.format(new Date)} Synced ${y.raw("\xBB")} ${y.gray(`download ${a.key} from remote theme`)}`))}))));await Promise.all(i)}async function Me(e,t,o){if(!o.noDelete)return Promise.all(t.map(r=>{if(e.files.get(r.key))return e.delete(r.key).then(()=>{E(p`• ${C.format(new Date)} Synced ${y.raw("\xBB")} ${y.gray(`remove ${r.key} from local theme`)}`)})}))}async function qe(e,t){let o=new Map(e.files);await Promise.all(t.map(r=>e.read(r.key)));for(let r of t){let s=o.get(r.key)?.checksum,i=e.files.get(r.key)?.checksum;if(s!==i)throw new $(`Detected changes to the file '${r.key}' on both local and remote sources. Aborting...`)}}function pe(e,t,o){return t.applyIgnoreFilters(e).filter(s=>s.key.endsWith(".json")).filter(s=>!o.has(s.key))}var he="local",D="remote";async function we(e,t,o,r,s,i){f("Initiating theme asset reconciliation process"),await r.ready();let{workPromise:n}=await ue(e,t,o,r,s);return{updatedRemoteChecksumsPromise:n.then(async()=>{let a=await k(e.id,t);return ye(e,t,a,r,s,i),a}),workPromise:n}}m();function ge(){if(Promise.withResolvers)return Promise.withResolvers();let e,t;return{promise:new Promise((r,s)=>{e=r,t=s}),resolve:e,reject:t}}import{createServer as Ue}from"node:http";function ke(e,t){let{promise:o,resolve:r,reject:s}=ge(),i=ie(e,t),n=Ge(e,t,s),l=Promise.all([i,n.workPromise]).then(()=>t.localThemeFileSystem.startWatcher(e.id.toString(),t.session)),a=Je(e,t,l);return{workPromise:l,serverStart:a.start,dispatchEvent:a.dispatch,renderDevSetupProgress:n.renderProgress,backgroundJobPromise:o,resolveBackgroundJob:r}}function Ge(e,t,o){let r=a=>(b("Failed to perform the initial theme synchronization.",a),o(a),new Promise(()=>{})),i=k(e.id,t.session).then(a=>Ke(e,t,a,o)),n=i.then(async({updatedRemoteChecksumsPromise:a})=>{let c=await a;return de(e,t.session,c,t.localThemeFileSystem,{nodelete:t.options.noDelete,deferPartialWork:!0,backgroundWorkCatch:r})});return{workPromise:n.then(a=>a.workPromise).catch(r),renderProgress:async()=>{if(t.options.themeEditorSync){let{workPromise:c}=await i;await ee([{title:"Performing file synchronization. This may take a while...",task:async()=>{await c}}])}let{renderThemeSyncProgress:a}=await n;await a()}}}function Ke(e,t,o,r){return t.options.themeEditorSync?we(e,t.session,o,t.localThemeFileSystem,{noDelete:t.options.noDelete,ignore:t.options.ignore,only:t.options.only},r):Promise.resolve({updatedRemoteChecksumsPromise:Promise.resolve(o),workPromise:Promise.resolve()})}function Je(e,t,o){let r=x(),s=[`http://${t.options.host}:${t.options.port}`,`https://${t.session.storeFqdn}`,"https://online-store-web.shopifyapps.com"];r.use(se(t.options.host,t.options.port)),r.use(V(async()=>(await o,N(n=>{n.node.req.headers.origin&&B(n,{origin:a=>s.includes(a),credentials:!0,methods:["GET","POST","HEAD","OPTIONS"],preflight:{statusCode:204}})})))),t.options.liveReload!=="off"&&r.use(ae(e,t)),r.use(oe(e,t)),r.use(te(e,t)),r.use(re(e,t));let i=Ue(Q(r));return{dispatch:r.handler.bind(r),start:async()=>new Promise(n=>i.listen({port:t.options.port,host:t.options.host},()=>n({close:async()=>{await Promise.all([new Promise(l=>{i.closeAllConnections(),i.close(l)})])}})))}}m();import{createServer as Te}from"net";var Pe=new Set;async function Re(e,t){if(e&&await F(e))return f(p`Port ${e.toString()} is free`),e;f(p`Getting a random port...`);let o=await be(()=>ve(),t?.maxTries,t?.waitTimeInSeconds);for(let r=0;r<(t?.maxTries??5)&&Pe.has(o);r++)o=await be(()=>ve(),t?.maxTries,t?.waitTimeInSeconds);return f(p`Random port obtained: ${y.raw(`${o}`)}`),Pe.add(o),o}async function F(e){return new Promise(t=>{let o=Te();o.unref(),o.once("error",()=>t(!1));try{o.listen(e,"localhost",()=>{o.close(()=>t(!0))})}catch(r){if(!(r instanceof RangeError))throw r;t(!1)}})}function ve(){return new Promise((e,t)=>{let o=Te();o.unref(),o.once("error",t),o.listen(0,"localhost",()=>{let r=o.address();if(r&&typeof r=="object"){let s=r.port;o.close(()=>e(s))}else o.close(()=>t(new Error("Unable to determine assigned port")))})})}async function be(e,t=5,o=1){let r=1;for(;;)try{return await e()}catch(s){if(r++<t)f(p`Unknown problem getting a random port: ${s.message}`),await J(o);else throw new g(s.message)}}import ze from"readline";var Ye="127.0.0.1",je=9292,Ee=!1;async function lr(e){if(!await me(e.directory)&&!await Z(e.force))return;e.password?.startsWith("shpat_")&&R({headline:"Admin API token missing features:",body:["Directly using an Admin API token will result in some missing features.","We recommend generating a password from the Theme Access app.","Alternatively, you can authenticate normally by not passing the --password flag.",`
1
+ import{a as T}from"./chunk-J3JPJCWP.js";import{a as de}from"./chunk-JK3NIHTX.js";import{b as te,c as re,d as oe,e as se,f as ne,h as ie,i as ae,k as le,l as ce,n as me}from"./chunk-3YDYZ232.js";import{a as j}from"./chunk-YMAWEIUR.js";import{A as Q,B as b,J as X,c as Y,s as B,w as N,x as V,y as x}from"./chunk-DTIWUT2T.js";import{c as Z,e as ee}from"./chunk-VJ6KDRZI.js";import{k as v,l as z,n as k}from"./chunk-5XDQ76DQ.js";import{n as C,p as P}from"./chunk-TUNUEOHO.js";import{ta as L,xa as _}from"./chunk-G4OQABDT.js";import{a as O}from"./chunk-5C7HDTHJ.js";import{J as K,P as J,s as W,u as M,v as q,w as R,y as U,z as G}from"./chunk-NTRAWIEJ.js";import{d as H,e as I}from"./chunk-VI34CKV6.js";import{d as g}from"./chunk-TPCG6DCA.js";import{Fb as y,Hb as p,Mb as E,Pb as f}from"./chunk-7FQFEB33.js";import{u as w}from"./chunk-A4SBXDZB.js";import{g as m}from"./chunk-VKWPEFWQ.js";m();m();m();m();var fe={workPromise:Promise.resolve()};async function ue(e,t,o,r,s){if(o.length===0)return fe;f("Initiating theme asset reconciliation process");let{filesOnlyPresentLocally:i,filesOnlyPresentOnRemote:n,filesWithConflictingChecksums:l}=$e(o,r),a=i.length===0&&n.length===0&&l.length===0;if(_(`theme-service:theme-reconciliation:manual:${a}`),a)return f("Local and remote checksums match - no need to reconcile theme assets"),fe;let c=await Oe({filesOnlyPresentLocally:i,filesOnlyPresentOnRemote:n,filesWithConflictingChecksums:l},s);return{workPromise:Fe(e,t,r,c)}}function $e(e,t){let o=new Set,r=[],s=[];for(let n of e){o.add(n.key);let l=t.files.get(n.key);l?n.checksum!==l.checksum&&s.push(n):r.push(n)}let i=Array.from(t.files.values()).filter(n=>!o.has(n.key));return{filesOnlyPresentOnRemote:A(r,t),filesOnlyPresentLocally:A(i,t),filesWithConflictingChecksums:A(s,t)}}function A(e,t){return t.applyIgnoreFilters(e).filter(r=>r.key.endsWith(".json"))}async function S(e,t,o){if(e.length===0)return;M({body:{list:{title:t,items:e.map(s=>s.key)}}}),await G({message:"Reconciliation Strategy",choices:[{label:o.remote.label,value:D},{label:o.local.label,value:he}]})===D?o.remote.callback(e):o.local.callback(e)}async function Fe(e,t,o,r){let{localFilesToDelete:s,filesToDownload:i,remoteFilesToDelete:n}=r,l=s.map(d=>o.delete(d.key)),a=T(i,P,async d=>{let u=await v(e.id,d.map(h=>h.key),t);return Promise.all(u.map(h=>{if(h)return o.write(h)}))}),c=z(e.id,n.map(d=>d.key),t);await Promise.all([...l,...a,c])}async function Oe(e,t){let{filesOnlyPresentLocally:o,filesOnlyPresentOnRemote:r,filesWithConflictingChecksums:s}=e,i=[],n=[],l=[];return t.noDelete||await S(o,"The files listed below are only present locally. What would you like to do?",{remote:{label:"Delete files from the local directory",callback:a=>{i.push(...a)}},local:{label:"Upload local files to the remote theme",callback:()=>{}}}),await S(r,"The files listed below are only present on the remote theme. What would you like to do?",{remote:{label:"Download remote files to the local directory",callback:a=>{n.push(...a)}},local:{label:"Delete files from the remote theme",callback:a=>{l.push(...a)}}}),await S(s,"The files listed below differ between the local and remote versions. What would you like to do?",{remote:{label:"Keep the remote version",callback:a=>{n.push(...a)}},local:{label:"Keep the local version",callback:()=>{}}}),{localFilesToDelete:i,filesToDownload:n,remoteFilesToDelete:l}}m();var Le=3e3,$=class extends Error{};function ye(e,t,o,r,s,i){f("Listening for changes in the theme editor");let n=5,l=0,a="",c=o,d=async()=>{await new Promise(u=>setTimeout(u,Le)),c=await _e(e,t,c,r,s).then(u=>(l=0,a="",u)).catch(u=>{if(l++,u.message!==a&&(a=u.message,b("Error while polling for changes.",u)),l>=n){let h=new g("Too many polling errors...","Please check the errors above and ensure you have a stable internet connection.");U(h),i(h)}return c})};setTimeout(async()=>{for(;;)await d()})}async function _e(e,t,o,r,s){let i=new Set(r.unsyncedFileKeys),n=pe(o,r,i),l=await k(e.id,t).then(d=>pe(d,r,i)),a=Ie(n,l),c=He(l,n);return await qe(r,a),await We(e,t,r,a),await Me(r,c,s),l}function He(e,t){let o=new Map(e.map(s=>[s.key,s]));return t.filter(s=>o.get(s.key)===void 0)}function Ie(e,t){let o=new Map(e.map(s=>[s.key,s]));return t.filter(s=>{let i=o.get(s.key);if(!i||i.checksum!==s.checksum)return!0})}async function We(e,t,o,r){let s=r.filter(n=>o.files.get(n.key)?.checksum!==n.checksum),i=T(s,P,async n=>v(e.id,n.map(l=>l.key),t).then(l=>Promise.all(l.map(async a=>{a&&(await o.write(a),E(p`• ${C.format(new Date)} Synced ${y.raw("\xBB")} ${y.gray(`download ${a.key} from remote theme`)}`))}))));await Promise.all(i)}async function Me(e,t,o){if(!o.noDelete)return Promise.all(t.map(r=>{if(e.files.get(r.key))return e.delete(r.key).then(()=>{E(p`• ${C.format(new Date)} Synced ${y.raw("\xBB")} ${y.gray(`remove ${r.key} from local theme`)}`)})}))}async function qe(e,t){let o=new Map(e.files);await Promise.all(t.map(r=>e.read(r.key)));for(let r of t){let s=o.get(r.key)?.checksum,i=e.files.get(r.key)?.checksum;if(s!==i)throw new $(`Detected changes to the file '${r.key}' on both local and remote sources. Aborting...`)}}function pe(e,t,o){return t.applyIgnoreFilters(e).filter(s=>s.key.endsWith(".json")).filter(s=>!o.has(s.key))}var he="local",D="remote";async function we(e,t,o,r,s,i){f("Initiating theme asset reconciliation process"),await r.ready();let{workPromise:n}=await ue(e,t,o,r,s);return{updatedRemoteChecksumsPromise:n.then(async()=>{let a=await k(e.id,t);return ye(e,t,a,r,s,i),a}),workPromise:n}}m();function ge(){if(Promise.withResolvers)return Promise.withResolvers();let e,t;return{promise:new Promise((r,s)=>{e=r,t=s}),resolve:e,reject:t}}import{createServer as Ue}from"node:http";function ke(e,t){let{promise:o,resolve:r,reject:s}=ge(),i=ie(e,t),n=Ge(e,t,s),l=Promise.all([i,n.workPromise]).then(()=>t.localThemeFileSystem.startWatcher(e.id.toString(),t.session)),a=Je(e,t,l);return{workPromise:l,serverStart:a.start,dispatchEvent:a.dispatch,renderDevSetupProgress:n.renderProgress,backgroundJobPromise:o,resolveBackgroundJob:r}}function Ge(e,t,o){let r=a=>(b("Failed to perform the initial theme synchronization.",a),o(a),new Promise(()=>{})),i=k(e.id,t.session).then(a=>Ke(e,t,a,o)),n=i.then(async({updatedRemoteChecksumsPromise:a})=>{let c=await a;return de(e,t.session,c,t.localThemeFileSystem,{nodelete:t.options.noDelete,deferPartialWork:!0,backgroundWorkCatch:r})});return{workPromise:n.then(a=>a.workPromise).catch(r),renderProgress:async()=>{if(t.options.themeEditorSync){let{workPromise:c}=await i;await ee([{title:"Performing file synchronization. This may take a while...",task:async()=>{await c}}])}let{renderThemeSyncProgress:a}=await n;await a()}}}function Ke(e,t,o,r){return t.options.themeEditorSync?we(e,t.session,o,t.localThemeFileSystem,{noDelete:t.options.noDelete,ignore:t.options.ignore,only:t.options.only},r):Promise.resolve({updatedRemoteChecksumsPromise:Promise.resolve(o),workPromise:Promise.resolve()})}function Je(e,t,o){let r=x(),s=[`http://${t.options.host}:${t.options.port}`,`https://${t.session.storeFqdn}`,"https://online-store-web.shopifyapps.com"];r.use(se(t.options.host,t.options.port)),r.use(V(async()=>(await o,N(n=>{n.node.req.headers.origin&&B(n,{origin:a=>s.includes(a),credentials:!0,methods:["GET","POST","HEAD","OPTIONS"],preflight:{statusCode:204}})})))),t.options.liveReload!=="off"&&r.use(ae(e,t)),r.use(oe(e,t)),r.use(te(e,t)),r.use(re(e,t));let i=Ue(Q(r));return{dispatch:r.handler.bind(r),start:async()=>new Promise(n=>i.listen({port:t.options.port,host:t.options.host},()=>n({close:async()=>{await Promise.all([new Promise(l=>{i.closeAllConnections(),i.close(l)})])}})))}}m();import{createServer as Te}from"net";var Pe=new Set;async function Re(e,t){if(e&&await F(e))return f(p`Port ${e.toString()} is free`),e;f(p`Getting a random port...`);let o=await be(()=>ve(),t?.maxTries,t?.waitTimeInSeconds);for(let r=0;r<(t?.maxTries??5)&&Pe.has(o);r++)o=await be(()=>ve(),t?.maxTries,t?.waitTimeInSeconds);return f(p`Random port obtained: ${y.raw(`${o}`)}`),Pe.add(o),o}async function F(e){return new Promise(t=>{let o=Te();o.unref(),o.once("error",()=>t(!1));try{o.listen(e,"localhost",()=>{o.close(()=>t(!0))})}catch(r){if(!(r instanceof RangeError))throw r;t(!1)}})}function ve(){return new Promise((e,t)=>{let o=Te();o.unref(),o.once("error",t),o.listen(0,"localhost",()=>{let r=o.address();if(r&&typeof r=="object"){let s=r.port;o.close(()=>e(s))}else o.close(()=>t(new Error("Unable to determine assigned port")))})})}async function be(e,t=5,o=1){let r=1;for(;;)try{return await e()}catch(s){if(r++<t)f(p`Unknown problem getting a random port: ${s.message}`),await J(o);else throw new g(s.message)}}import ze from"readline";var Ye="127.0.0.1",je=9292,Ee=!1;async function lr(e){if(!await me(e.directory)&&!await Z(e.force))return;e.password?.startsWith("shpat_")&&R({headline:"Admin API token missing features:",body:["Directly using an Admin API token will result in some missing features.","We recommend generating a password from the Theme Access app.","Alternatively, you can authenticate normally by not passing the --password flag.",`
2
2
  `,{list:{title:"Known limitations:",items:["Hot module reloading","Password protected storefronts"]}}],link:{label:"Theme Access app",url:"https://shopify.dev/docs/storefronts/themes/tools/theme-access"}}),e.listing&&await le(e.directory,e.listing);let t=await Y(e.adminSession).then(De=>De?j(e.storePassword,e.adminSession.storeFqdn):void 0),o=ne(),r=ce(e.directory,{filters:e,listing:e.listing,noDelete:e.noDelete,notify:e.notify}),s=e.host??Ye,i;if(e.port){if(!await F(e.port))throw new g(`Port ${e.port} is not available. Try a different port or remove the --port flag to use an available port.`);i=e.port}else i=await Re(je);let n={local:`http://${s}:${i}`,giftCard:`http://${s}:${i}/gift_cards/[store_id]/preview`,themeEditor:`https://${e.store}/admin/themes/${e.theme.id}/editor?hr=${i}`,preview:`https://${e.store}/?preview_theme_id=${e.theme.id}`},l=await t,c={session:await X(e.theme.id.toString(),e.adminSession,e.password,l),localThemeFileSystem:r,localThemeExtensionFileSystem:o,directory:e.directory,type:"theme",lastRequestedPath:"",options:{themeEditorSync:e["theme-editor-sync"],host:s,port:i,open:e.open,liveReload:e["live-reload"],standardEventsDevBundle:!0,standardEventsInspector:e["standard-events-inspector"],noDelete:e.noDelete,ignore:e.ignore,only:e.only,errorOverlay:e["error-overlay"]}},{serverStart:d,renderDevSetupProgress:u,backgroundJobPromise:h,resolveBackgroundJob:Ae}=ke(e.theme,c);ze.emitKeypressEvents(process.stdin);let Se=Ne(n,c,Ae);process.stdin.on("keypress",Se),await Promise.all([h,u().then(d).then(()=>{process.stdin.isTTY&&process.stdin.setRawMode(!0),xe(n),e.open&&Ce(n.local,"development server")})]),await Be(e.commandConfig,e.adminSession),process.exit(0)}async function Be(e,t){if(!Ee){Ee=!0;try{await H(()=>({store_fqdn_hash:O(t.storeFqdn)})),await I(()=>({store_fqdn:t.storeFqdn})),await L({config:e,exitMode:"ok"})}catch{}}}function Ne(e,t,o){let r=W(Ce,100,{leading:!0,trailing:!1});return(s,i)=>{if(i.ctrl&&i.name==="c"){o();return}switch(i.name){case void 0:break;case"t":r(e.local,"localhost");break;case"p":r(e.preview,"theme preview");break;case"e":r(t.lastRequestedPath==="/"?e.themeEditor:`${e.themeEditor}&previewPath=${encodeURIComponent(t.lastRequestedPath)}`,"theme editor");break;case"g":r(e.giftCard,"gift card preview");break;default:break}}}function Ce(e,t){K(e).catch(Ve(t))}function Ve(e){return t=>{R({headline:`Failed to open ${e}.`,body:t.stack??t.message})}}function xe(e){q({body:[{list:{title:w.bold("Preview your theme ")+w.cyan("(t)"),items:[{link:{url:e.local}}]}}],nextSteps:[[{link:{label:`Share your theme preview ${w.cyan("(p)")}`,url:e.preview}},{subdued:e.preview}],[{link:{label:`Customize your theme at the theme editor ${w.cyan("(e)")}`,url:e.themeEditor}}],[{link:{label:`Preview your gift cards ${w.cyan("(g)")}`,url:e.giftCard}}]]})}export{Re as a,F as b,lr as c,Ce as d};
@@ -1,3 +1,3 @@
1
- import{d as w,n as y,r as n}from"./chunk-4V4DQ6W7.js";import{w as l}from"./chunk-WUK5NQSX.js";import{k as u,l as m}from"./chunk-LITB5QQX.js";import{a as h}from"./chunk-YJB7P2HC.js";import{a as x}from"./chunk-MOA33ZFO.js";import{O as S,u as d,w as g,x as N}from"./chunk-MGL4YM3S.js";import{f as _}from"./chunk-BHWEA4V2.js";import{Pb as a}from"./chunk-VPL2NDH6.js";import{a as f}from"./chunk-ULQG3XQS.js";import{g as p}from"./chunk-VPRTJUIN.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-V7LSEXHM.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-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,`
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 eN}from"./chunk-FD5S2O6M.js";import{a as QN}from"./chunk-NPM3MFB3.js";import{b as jN}from"./chunk-6ZIOYXEF.js";import{a as $N}from"./chunk-CW7WJZKR.js";import{a as eB}from"./chunk-6YHJ554P.js";import{a as tB}from"./chunk-DNLOSMHL.js";import{a as qN}from"./chunk-HJSYHK4S.js";import{a as HN}from"./chunk-3V63X7WZ.js";import{a as UN,b as WN,c as zN,d as GN}from"./chunk-RAH5NW3R.js";import{a as JN}from"./chunk-5TIJLYZU.js";import{a as VN}from"./chunk-LKS47US7.js";import{a as YN}from"./chunk-KLA7AWG6.js";import{a as KN}from"./chunk-I3LX25MB.js";import{a as XN}from"./chunk-UBKVCI7A.js";import{a as PN}from"./chunk-IVGWFPMA.js";import{a as LN}from"./chunk-QLQGHMVU.js";import{a as NN}from"./chunk-FTN7Y6HD.js";import{a as ON}from"./chunk-ZZYFG22L.js";import{a as mc,b as $S}from"./chunk-D3DDLLNF.js";import{g as BN}from"./chunk-X2TC7S57.js";import{a as KS}from"./chunk-MA52QGHP.js";import{A as q4,c as JS,e as _N,f as MN,g as jS,h as zv,i as FN,j as Gv,l as AN,p as eh,q as O4,r as ol,w as to,y as D4,z as Z4}from"./chunk-IOQQUHST.js";import{a as DN}from"./chunk-DERA4K6A.js";import{a as ZN}from"./chunk-BPVZ7E63.js";import{a as kN}from"./chunk-2KH2S7PI.js";import{b as RN,g as B4,j as QS}from"./chunk-MZJRNFAU.js";import{c as rB}from"./chunk-LQMSF3F7.js";import{a as GB,b as VB}from"./chunk-C6ABJCRG.js";import{a as DB,b as tE,c as C1,d as ZB}from"./chunk-YGMVL6NZ.js";import{a as YB,f as XB,g as QB,h as rE,i as JB,j as KB,k as jB,l as $B,m as eO,n as tO,o as rO,p as aO,q as nO,v as oO,x as iO,z as aE}from"./chunk-NBYS6YQ2.js";import{c as lO}from"./chunk-WNGV4JQS.js";import{a as Yv}from"./chunk-RL5BWZ7D.js";import{a as qB,b as HB,c as UB,d as WB,e as zB}from"./chunk-NEZEHBT2.js";import{a as nB}from"./chunk-DCBYHVKW.js";import{a as OB}from"./chunk-LCCMXY6N.js";import{a as BB}from"./chunk-T5MK7ZSF.js";import{a as aB}from"./chunk-DCK2FX6J.js";import{Aa as W4,F as IB,Fa as NB,H as SB,J as th,R as EB,U as PB,V as RB,Z as kB,a as oB,aa as _B,fa as MB,g as iB,i as cB,ia as FB,j as sB,ja as AB,k as g5,ka as LB,l as uB,n as dB,q as hB,r as eE,s as fB,u as vB,v as gB,w as mB,x as pB,y as bB,z as yB,za as U4}from"./chunk-WCWNI3ZV.js";import{N as xB,O as CB,Y as TB,ba as wB,d as H4,i as Vv,o as lB}from"./chunk-VICNWPLQ.js";import{c as TN,e as wN}from"./chunk-N5ROZKPZ.js";import{c as xN}from"./chunk-AP3RFOPL.js";import{a as Ns}from"./chunk-FP2NOZSD.js";import{$ as hN,A as GS,N as dN,S as xke,Z as j7,a as oN,c as iN,g as Eke,h as lN,l as cN,n as K7,q as sN,t as uN,ta as vN,u as w4,z as f5}from"./chunk-4V4DQ6W7.js";import{a as QL}from"./chunk-YJB7P2HC.js";import{b as CN,d as N4}from"./chunk-4KRT35A2.js";import{a as zS,c as nN}from"./chunk-JUVAGMIH.js";import{D as M4,H as pN,J as x1,O as F4,P as Wv,Q as XS,R as yN,T as IN,a as aN,g as fN,i as VS,j as P4,k as vc,l as gc,m as R4,n as YS,o as mN,p as k4,u as _4,w as c2}from"./chunk-MGL4YM3S.js";import{a as Cke}from"./chunk-QUTQDXSL.js";import{d as gN}from"./chunk-6YAXFS6V.js";import{d as ln,g as $7,l as bN}from"./chunk-BHWEA4V2.js";import{r as Ske}from"./chunk-3YWUSKWF.js";import{a as z4}from"./chunk-XP6IRAZN.js";import{$a as Uv,Ea as jL,Fb as wr,Gb as EN,Hb as Kr,Mb as v5,Na as C4,Pb as mt,Q as WS,Qb as nl,Ta as E1,Wa as T4,cb as $L,eb as I,fb as _o,gb as Tr,jb as X7,kb as Q7,ma as ko,mb as tN,nb as rN,tb as J7,ua as E4,wa as x4}from"./chunk-VPL2NDH6.js";import{d as SN,f as A4,j as L4}from"./chunk-UARVYVLN.js";import{a as y4}from"./chunk-ULQG3XQS.js";import{d as na,f as US,g as I4,i as Y7,j as JL,k as S4,o as KL,p as Hv}from"./chunk-IU2ZQ6TE.js";import{a as S1,c as m,e as Ro,g as o}from"./chunk-VPRTJUIN.js";var ZO=m(ll=>{"use strict";o();var h_e=I();function DO(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var r=2;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function T1(){}var il={d:{f:T1,r:function(){throw Error(DO(522))},D:T1,C:T1,L:T1,m:T1,X:T1,S:T1,M:T1},p:0,findDOMNode:null},f_e=Symbol.for("react.portal");function v_e(e,t,r){var a=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:f_e,key:a==null?null:""+a,children:e,containerInfo:t,implementation:r}}var Jv=h_e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function K4(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}ll.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=il;ll.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(DO(299));return v_e(e,t,null,r)};ll.flushSync=function(e){var t=Jv.T,r=il.p;try{if(Jv.T=null,il.p=2,e)return e()}finally{Jv.T=t,il.p=r,il.d.f()}};ll.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,il.d.C(e,t))};ll.prefetchDNS=function(e){typeof e=="string"&&il.d.D(e)};ll.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var r=t.as,a=K4(r,t.crossOrigin),n=typeof t.integrity=="string"?t.integrity:void 0,i=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;r==="style"?il.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:a,integrity:n,fetchPriority:i}):r==="script"&&il.d.X(e,{crossOrigin:a,integrity:n,fetchPriority:i,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};ll.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var r=K4(t.as,t.crossOrigin);il.d.M(e,{crossOrigin:r,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0})}}else t==null&&il.d.M(e)};ll.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var r=t.as,a=K4(r,t.crossOrigin);il.d.L(e,r,{crossOrigin:a,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,type:typeof t.type=="string"?t.type:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy=="string"?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet=="string"?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes=="string"?t.imageSizes:void 0,media:typeof t.media=="string"?t.media:void 0})}};ll.preloadModule=function(e,t){if(typeof e=="string")if(t){var r=K4(t.as,t.crossOrigin);il.d.m(e,{as:typeof t.as=="string"&&t.as!=="script"?t.as:void 0,crossOrigin:r,integrity:typeof t.integrity=="string"?t.integrity:void 0})}else il.d.m(e)};ll.requestFormReset=function(e){il.d.r(e)};ll.unstable_batchedUpdates=function(e,t){return e(t)};ll.useFormState=function(e,t,r){return Jv.H.useFormState(e,t,r)};ll.useFormStatus=function(){return Jv.H.useHostTransitionStatus()};ll.version="19.2.4"});var qO=m(cl=>{"use strict";o();process.env.NODE_ENV!=="production"&&(function(){function e(){}function t(y){return""+y}function r(y,S,E){var P=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;try{t(P);var k=!1}catch{k=!0}return k&&(console.error("The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",typeof Symbol=="function"&&Symbol.toStringTag&&P[Symbol.toStringTag]||P.constructor.name||"Object"),t(P)),{$$typeof:v,key:P==null?null:""+P,children:y,containerInfo:S,implementation:E}}function a(y,S){if(y==="font")return"";if(typeof S=="string")return S==="use-credentials"?S:""}function n(y){return y===null?"`null`":y===void 0?"`undefined`":y===""?"an empty string":'something with type "'+typeof y+'"'}function i(y){return y===null?"`null`":y===void 0?"`undefined`":y===""?"an empty string":typeof y=="string"?JSON.stringify(y):typeof y=="number"?"`"+y+"`":'something with type "'+typeof y+'"'}function l(){var y=b.H;return y===null&&console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1
+ import{a as eN}from"./chunk-UOHNRH6E.js";import{a as KN}from"./chunk-MINZGZ4N.js";import{a as XN}from"./chunk-SSCYLDSX.js";import{a as QN}from"./chunk-G2OHWAY2.js";import{b as jN}from"./chunk-EVZA2TCI.js";import{a as $N}from"./chunk-FIYAECXH.js";import{a as eB}from"./chunk-G2LVUM7N.js";import{a as tB}from"./chunk-AERKD4TO.js";import{a as DN}from"./chunk-M2YINBHF.js";import{a as ZN}from"./chunk-7LV55VWE.js";import{a as qN}from"./chunk-UC7KMA6W.js";import{a as HN}from"./chunk-ZUKLGZOU.js";import{a as UN,b as WN,c as zN,d as GN}from"./chunk-GWHV62YT.js";import{a as JN}from"./chunk-JAWKLBOB.js";import{a as VN}from"./chunk-T3ERXB7F.js";import{a as YN}from"./chunk-I4R7TML2.js";import{a as GB,b as VB}from"./chunk-JEZ3PGVC.js";import{a as PN}from"./chunk-N3CNWCC2.js";import{a as LN}from"./chunk-57PPQKJT.js";import{a as NN}from"./chunk-2XZBQZ5R.js";import{a as ON}from"./chunk-2EHBJWC6.js";import{a as mc,b as $S}from"./chunk-DZQYG32N.js";import{g as BN}from"./chunk-3YDYZ232.js";import{a as KS}from"./chunk-YMAWEIUR.js";import{A as q4,c as JS,e as _N,f as MN,g as jS,h as zv,i as FN,j as Gv,l as AN,p as eh,q as O4,r as ol,w as to,y as D4,z as Z4}from"./chunk-DTIWUT2T.js";import{a as kN}from"./chunk-TRYWVIVJ.js";import{b as RN,g as B4,j as QS}from"./chunk-5XDQ76DQ.js";import{c as lO}from"./chunk-N3YTDGFY.js";import{c as rB}from"./chunk-RKDZGK5K.js";import{a as Yv}from"./chunk-WA3YC5W4.js";import{a as DB,b as tE,c as C1,d as ZB}from"./chunk-PMS4MNHB.js";import{a as YB,f as XB,g as QB,h as rE,i as JB,j as KB,k as jB,l as $B,m as eO,n as tO,o as rO,p as aO,q as nO,v as oO,x as iO,z as aE}from"./chunk-25HJX3L2.js";import{a as qB,b as HB,c as UB,d as WB,e as zB}from"./chunk-LXVORHCQ.js";import{a as nB}from"./chunk-MEIEEENL.js";import{a as OB}from"./chunk-OZBY45KT.js";import{a as BB}from"./chunk-EKVTNWHM.js";import{a as aB}from"./chunk-5BKCIDMS.js";import{Aa as W4,F as IB,Fa as NB,H as SB,J as th,R as EB,U as PB,V as RB,Z as kB,a as oB,aa as _B,fa as MB,g as iB,i as cB,ia as FB,j as sB,ja as AB,k as g5,ka as LB,l as uB,n as dB,o as hB,r as eE,s as fB,u as vB,v as gB,w as mB,x as pB,y as bB,z as yB,za as U4}from"./chunk-4QTEPWEJ.js";import{O as xB,P as CB,Z as TB,ca as wB,e as H4,j as Vv,p as lB}from"./chunk-UTO4Z6P6.js";import{c as TN,e as wN}from"./chunk-CFOXXOO2.js";import{c as xN}from"./chunk-A5HKAMAC.js";import{a as Ns}from"./chunk-QDVJJKLB.js";import{$ as hN,A as GS,N as dN,S as xke,Z as j7,a as oN,c as iN,g as Eke,h as lN,l as cN,n as K7,q as sN,t as uN,ta as vN,u as w4,z as f5}from"./chunk-G4OQABDT.js";import{a as QL}from"./chunk-VPPWSKOY.js";import{b as CN,d as N4}from"./chunk-OXJBYKMX.js";import{a as zS,c as nN}from"./chunk-5C7HDTHJ.js";import{D as M4,H as pN,J as x1,O as F4,P as Wv,Q as XS,R as yN,T as IN,a as aN,g as fN,i as VS,j as P4,k as vc,l as gc,m as R4,n as YS,o as mN,p as k4,u as _4,w as c2}from"./chunk-NTRAWIEJ.js";import{a as Cke}from"./chunk-7UNQOKZW.js";import{d as gN}from"./chunk-VI34CKV6.js";import{d as ln,g as $7,l as bN}from"./chunk-TPCG6DCA.js";import{r as Ske}from"./chunk-T6CC5WUU.js";import{a as z4}from"./chunk-PCCK4YTE.js";import{$a as Uv,Ea as jL,Fb as wr,Gb as EN,Hb as Kr,Mb as v5,Na as C4,Pb as mt,Q as WS,Qb as nl,Ta as E1,Wa as T4,cb as $L,eb as I,fb as _o,gb as Tr,jb as X7,kb as Q7,ma as ko,mb as tN,nb as rN,tb as J7,ua as E4,wa as x4}from"./chunk-7FQFEB33.js";import{d as SN,f as A4,j as L4}from"./chunk-S5IFJ737.js";import{a as y4}from"./chunk-NNOSZ447.js";import{d as na,f as US,g as I4,i as Y7,j as JL,k as S4,o as KL,p as Hv}from"./chunk-773TIA5M.js";import{a as S1,c as m,e as Ro,g as o}from"./chunk-VKWPEFWQ.js";var ZO=m(ll=>{"use strict";o();var h_e=I();function DO(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var r=2;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function T1(){}var il={d:{f:T1,r:function(){throw Error(DO(522))},D:T1,C:T1,L:T1,m:T1,X:T1,S:T1,M:T1},p:0,findDOMNode:null},f_e=Symbol.for("react.portal");function v_e(e,t,r){var a=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:f_e,key:a==null?null:""+a,children:e,containerInfo:t,implementation:r}}var Jv=h_e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function K4(e,t){if(e==="font")return"";if(typeof t=="string")return t==="use-credentials"?t:""}ll.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=il;ll.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(DO(299));return v_e(e,t,null,r)};ll.flushSync=function(e){var t=Jv.T,r=il.p;try{if(Jv.T=null,il.p=2,e)return e()}finally{Jv.T=t,il.p=r,il.d.f()}};ll.preconnect=function(e,t){typeof e=="string"&&(t?(t=t.crossOrigin,t=typeof t=="string"?t==="use-credentials"?t:"":void 0):t=null,il.d.C(e,t))};ll.prefetchDNS=function(e){typeof e=="string"&&il.d.D(e)};ll.preinit=function(e,t){if(typeof e=="string"&&t&&typeof t.as=="string"){var r=t.as,a=K4(r,t.crossOrigin),n=typeof t.integrity=="string"?t.integrity:void 0,i=typeof t.fetchPriority=="string"?t.fetchPriority:void 0;r==="style"?il.d.S(e,typeof t.precedence=="string"?t.precedence:void 0,{crossOrigin:a,integrity:n,fetchPriority:i}):r==="script"&&il.d.X(e,{crossOrigin:a,integrity:n,fetchPriority:i,nonce:typeof t.nonce=="string"?t.nonce:void 0})}};ll.preinitModule=function(e,t){if(typeof e=="string")if(typeof t=="object"&&t!==null){if(t.as==null||t.as==="script"){var r=K4(t.as,t.crossOrigin);il.d.M(e,{crossOrigin:r,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0})}}else t==null&&il.d.M(e)};ll.preload=function(e,t){if(typeof e=="string"&&typeof t=="object"&&t!==null&&typeof t.as=="string"){var r=t.as,a=K4(r,t.crossOrigin);il.d.L(e,r,{crossOrigin:a,integrity:typeof t.integrity=="string"?t.integrity:void 0,nonce:typeof t.nonce=="string"?t.nonce:void 0,type:typeof t.type=="string"?t.type:void 0,fetchPriority:typeof t.fetchPriority=="string"?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy=="string"?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet=="string"?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes=="string"?t.imageSizes:void 0,media:typeof t.media=="string"?t.media:void 0})}};ll.preloadModule=function(e,t){if(typeof e=="string")if(t){var r=K4(t.as,t.crossOrigin);il.d.m(e,{as:typeof t.as=="string"&&t.as!=="script"?t.as:void 0,crossOrigin:r,integrity:typeof t.integrity=="string"?t.integrity:void 0})}else il.d.m(e)};ll.requestFormReset=function(e){il.d.r(e)};ll.unstable_batchedUpdates=function(e,t){return e(t)};ll.useFormState=function(e,t,r){return Jv.H.useFormState(e,t,r)};ll.useFormStatus=function(){return Jv.H.useHostTransitionStatus()};ll.version="19.2.4"});var qO=m(cl=>{"use strict";o();process.env.NODE_ENV!=="production"&&(function(){function e(){}function t(y){return""+y}function r(y,S,E){var P=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;try{t(P);var k=!1}catch{k=!0}return k&&(console.error("The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",typeof Symbol=="function"&&Symbol.toStringTag&&P[Symbol.toStringTag]||P.constructor.name||"Object"),t(P)),{$$typeof:v,key:P==null?null:""+P,children:y,containerInfo:S,implementation:E}}function a(y,S){if(y==="font")return"";if(typeof S=="string")return S==="use-credentials"?S:""}function n(y){return y===null?"`null`":y===void 0?"`undefined`":y===""?"an empty string":'something with type "'+typeof y+'"'}function i(y){return y===null?"`null`":y===void 0?"`undefined`":y===""?"an empty string":typeof y=="string"?JSON.stringify(y):typeof y=="number"?"`"+y+"`":'something with type "'+typeof y+'"'}function l(){var y=b.H;return y===null&&console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
2
2
  1. You might have mismatching versions of React and the renderer (such as React DOM)
3
3
  2. You might be breaking the Rules of Hooks
4
4
  3. You might have more than one copy of React in the same app
@@ -198,7 +198,7 @@ ${wr.json(i)}
198
198
  ${wr.json(a)}
199
199
  `,t.stdout),mO(e,a,t)}}function mO(e,t,r){mt(Kr`Sending websocket with event type ${t.event} and data:
200
200
  ${wr.json(t.data)}
201
- `,r.stdout);let a=JSON.stringify(t);e.clients.forEach(n=>n.send(a))}function e_e(e,t){let r=t.payloadStore.getRawPayload();return{...e,version:t.manifestVersion,data:{...e.data,extensions:[],store:r.store,app:r.app}}}var t_e=10;function pO(e){let t=new eN.default({noServer:!0,clientTracking:!0}),r=r_e(t);return e.httpServer.on("upgrade",vO(t,e)),e.payloadStore.on(Qv.Update,gO(t,e)),{close:()=>{t.close(),clearInterval(r)}}}function r_e(e){return setInterval(()=>{e.clients.forEach(t=>{t.readyState<2&&t.ping()})},t_e*1e3)}o();o();o();function bO(e,t){let{url:r}=V4(e.type,t);if(e.surface==="checkout"&&r){let a=new URL(`https://${t.storeFqdn}/`);return a.pathname=r,a.searchParams.append("dev",`${t.url}/extensions`),a.toString()}else{let a=new URL(`https://${t.storeFqdn}/`);return a.pathname="admin/extensions-dev",a.searchParams.append("url",J4(e,t)),a.toString()}}function yO(e,t,r){let a=W4(e),n=new URL(`https://${r.storeFqdn}/`);switch(a){case"checkout":n.pathname=r.checkoutCartUrl,n.searchParams.append("dev",`${r.url}/extensions`);break;case"post_purchase":if(n.pathname=r.checkoutCartUrl,n.searchParams.set("script_url",`${r.url}/extensions/${t.devUUID}/assets/${t.localIdentifier}.js`),n.searchParams.set("post_purchase_dev_api_key",r.apiKey),t.devUUID&&r.websocketURL&&(n.searchParams.set("uuid",t.devUUID),n.searchParams.set("socket_url",r.websocketURL)),"metafields"in t.configuration){let i={config:{metafields:t.configuration.metafields}};n.searchParams.set("config",JSON.stringify(i))}break;case"admin":n.pathname="admin/extensions-dev",n.searchParams.append("url",J4(t,r)),n.searchParams.append("target",e);break;case"customer-accounts":n=a_e(t,r,e);break;default:return}return n.toString()}function a_e(e,t,r=""){let a=`${t.url}/extensions`,n=t.storeId,i="shopify.com",l=new URL(`https://${i}/${n}/account/extensions-development`);return l.searchParams.append("origin",a),l.searchParams.append("extensionId",e.devUUID),l.searchParams.append("source","CUSTOMER_ACCOUNT_EXTENSION"),l.searchParams.append("appId",t.id??""),r!==""&&l.searchParams.append("target",r),l}function J4(e,t){let r=new URL(t.url);return r.pathname=`/extensions/${e.devUUID}`,r.toString()}function Bs(e,t){MN(e,_N(t))}o();var lE=class extends $7{constructor(t){super(`Couldn't find template ${t.template} for extension surface ${t.extensionSurface}`)}};async function IO(e){let t=await n_e(e),r=await ko(t);return Yv(r,e.data)}async function n_e(e){let t=await o_e(),r=[];e.extensionSurface&&r.push(na(t,`${e.extensionSurface}/${e.template}.html.liquid`)),r.push(na(t,`${e.template}.html.liquid`));let a=await T4(r);if(a.length===0)throw new lE(e);return a[0]}async function o_e(){return await Uv("templates/ui-extensions/html",{type:"directory",cwd:Hv(import.meta.url)})}var SO=to(e=>{ol(e,"Access-Control-Allow-Origin","*"),ol(e,"Access-Control-Allow-Methods","GET, OPTIONS"),ol(e,"Access-Control-Allow-Headers","Accept, Content-Type, Content-Length, Accept-Encoding, X-CSRF-Token, Authorization, ngrok-skip-browser-warning")}),EO=to(e=>{ol(e,"Cache-Control","no-cache")}),xO=to(async e=>O4(e,"/extensions/dev-console",307));async function cE(e,t){let{filePath:r}=t;if(!await E1(r))return Bs(e,{statusCode:404,statusMessage:`Not Found: ${r}`});if(await jL(r)&&(r+=r.endsWith("/")?"index.html":"/index.html",!await E1(r)))return Bs(e,{statusCode:404,statusMessage:`Not Found: ${r}`});let a=await ko(r,{}),n={".ico":"image/x-icon",".html":"text/html",".js":"text/javascript",".json":"application/json",".wasm":"application/wasm",".css":"text/css",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".wav":"audio/wav",".mp3":"audio/mpeg",".svg":"image/svg+xml",".pdf":"application/pdf",".doc":"application/msword"},i=S4(r),l=n[i]||"text/plain";return ol(e,"Content-Type",l),a}function CO({getExtensions:e,payloadStore:t}){return to(async r=>{let{extensionId:a,assetPath:n=""}=zv(r),i=e().find(b=>b.devUUID===a);if(!i)return Bs(r,{statusCode:404,statusMessage:`Extension with id ${a} not found`});let f=t.getAssetResolver(i.devUUID)?.get(n)??n,h=US(hB(i.outputPath)),v=US(na(h,f));return KL(h,v)?cE(r,{filePath:v}):Bs(r,{statusCode:404,statusMessage:"Not Found"})})}function sE({payloadStore:e}){return to(t=>(ol(t,"content-type","application/json"),e.getRawPayload()))}var TO=to(async e=>{let t=await Uv(na("assets","dev-console"),{type:"directory",cwd:Hv(import.meta.url)});return t?cE(e,{filePath:t}):Bs(e,{statusCode:404,statusMessage:"Could not find root directory for dev console"})}),wO=to(async e=>{let{assetPath:t=""}=zv(e),r=await Uv(na("assets","dev-console","extensions","dev-console","assets"),{type:"directory",cwd:Hv(import.meta.url)});return r?cE(e,{filePath:na(r,t)}):Bs(e,{statusCode:404,statusMessage:"Could not find root directory for dev console asset"})});function PO({devOptions:e}){return to(t=>{mt(`UI extensions server received a ${t.method} request to URL ${t.path}`,e.stdout)})}function uE({devOptions:e,getExtensions:t}){return to(async r=>{let{extensionId:a}=zv(r),n=t().find(f=>f.devUUID===a);if(!n)return Bs(r,{statusCode:404,statusMessage:`Extension with id ${a} not found`});if(Gv(r,"accept")?.startsWith("text/html")){if(n.type==="checkout_post_purchase")return IO({data:{url:J4(n,e)},template:"index",extensionSurface:"post_purchase"});{let f=bO(n,e);return O4(r,f,307)}}let l=e.appWatcher.buildOutputPath;return ol(r,"content-type","application/json"),{app:{apiKey:e.apiKey},version:e.manifestVersion,root:{url:new URL("/extensions",e.url).toString()},socket:{url:ah(e.url)},devConsole:{url:new URL("/extensions/dev-console",e.url).toString()},store:e.storeFqdn,extension:await rh(n,l,e)}})}function RO({devOptions:e,getExtensions:t}){return to(async r=>{let{extensionId:a,extensionPointTarget:n=""}=zv(r),i=t().find(f=>f.devUUID===a);if(!i)return Bs(r,{statusCode:404,statusMessage:`Extension with id ${a} not found`});if(i.configuration.type!=="checkout_post_purchase"&&!i.hasExtensionPointTarget(n))return Bs(r,{statusCode:404,statusMessage:`Extension with id ${a} has not configured the "${n}" extension target`});let l=yO(n,i,e);return l?O4(r,l,307):Bs(r,{statusCode:404,statusMessage:`Redirect url can't be constructed for extension with id ${a} and extension target "${n}"`})})}import{createServer as i_e}from"http";function kO(e){let t=D4(),r=Z4();t.use(PO(e)),t.use(SO),t.use(EO),r.use("/extensions/dev-console",TO),r.use("/extensions/dev-console/assets/**:assetPath",wO),r.use("/extensions/:extensionId",uE(e)),r.use("/extensions/:extensionId/",uE(e)),r.use("/extensions/:extensionId/:extensionPointTarget",RO(e)),r.use("/extensions/:extensionId/assets/**:assetPath",CO(e)),r.use("/extensions",sE(e)),r.use("/extensions/",sE(e)),r.use("/",xO),t.use(r);let a=i_e(q4(t));return a.listen(e.devOptions.port,"localhost"),a}async function _O(e){let t={...e,websocketURL:ah(e.url)},r=t.appWatcher.buildOutputPath,a=new Map,n=await fO(t,r,a),i=new Q4(n,t,a),l=t.extensions.filter(y=>y.isPreviewable),f=()=>l;mt("Setting up the UI extensions HTTP server...",t.stdout);let h=kO({devOptions:t,payloadStore:i,getExtensions:f});mt("Setting up the UI extensions Websocket server...",t.stdout);let v=pO({...t,httpServer:h,payloadStore:i});mt("Setting up the UI extensions bundler and file watching...",t.stdout);let b=async({appWasReloaded:y,app:S,extensionEvents:E})=>{y&&(l=S.allExtensions.filter(P=>P.isPreviewable));for(let P of E){if(!P.extension.isPreviewable)continue;let k=P.buildResult?.status==="ok"?"success":"error",_=P.buildResult?.status==="error"?{message:P.buildResult.error,file:P.buildResult.file}:void 0;switch(P.type){case C1.Created:if(t.extensions.push(P.extension),!t.checkoutCartUrl){let F=await U4(t.extensions,t.storeFqdn);t.checkoutCartUrl=F}await i.addExtension(P.extension,r);break;case C1.Updated:await i.updateExtension(P.extension,t,r,{status:k,error:_});break;case C1.Deleted:t.extensions=t.extensions.filter(F=>F.devUUID!==P.extension.devUUID),await i.deleteExtension(P.extension);break}}};t.appWatcher.onEvent(b).onStart(b),t.signal.addEventListener("abort",()=>{mt("Closing the UI extensions dev server..."),v.close(),h.close()})}function ah(e){let t=new URL("/extensions",e);return t.protocol="wss:",t.toString()}var l_e="3",c_e=async({stderr:e,stdout:t,abortSignal:r},{apiKey:a,storeFqdn:n,storeId:i,subscriptionProductUrl:l,port:f,cartUrl:h,proxyUrl:v,appName:b,appDotEnvFile:y,appId:S,grantedScopes:E,allExtensions:P,appDirectory:k,appWatcher:_})=>{await _O({appName:b,appDotEnvFile:y,appDirectory:k,id:S,extensions:P,stdout:t,stderr:e,signal:r,url:v,port:f,storeFqdn:f5(n),storeId:i,apiKey:a,grantedScopes:E,checkoutCartUrl:h,subscriptionProductUrl:l,manifestVersion:l_e,appWatcher:_})};async function MO({allExtensions:e,storeFqdn:t,checkoutCartUrl:r,...a}){let n=e.filter(l=>l.isPreviewable),i=await U4(n,t,r);return{prefix:"extensions",type:"previewable-extension",function:c_e,options:{pathPrefix:"/extensions",port:-1,storeFqdn:t,allExtensions:e,cartUrl:i,...a}}}o();o();o();async function FO(e){let t={},r=await dB(e);return await Promise.all(r.map(async a=>{let n=I4(e.directory,a),l=Y7(n)==="assets"?"binary":"utf8",f=await ko(a,{encoding:l});t[n]=Buffer.from(f,l).toString("base64")})),{theme_extension:{files:t}}}async function AO({extension:e,developerPlatformClient:t,apiKey:r,registrationId:a,stdout:n,stderr:i,appConfiguration:l,bundlePath:f}){let h,v=e.getOutputPathForDirectory(f);if(e.features.includes("esbuild")){let _=await ko(v);if(!_)return;h=Buffer.from(_).toString("base64")}let b;e.isThemeExtension?b=await FO(e):b=await e.deployConfig({apiKey:r,appConfiguration:l})??{};let y={...b,serialized_script:h};if(e.isFunctionExtension){let _=await ko(e.outputPath,{encoding:"base64"});y.uploaded_files={"dist/index.wasm":_}}let S={apiKey:r,config:JSON.stringify(y),handle:e.handle,context:e.contextValue,registrationId:a},E,P=[];try{E=await t.updateExtension(S)}catch(_){if(P=[{message:"Unknown error"}],_&&typeof _=="object"){let F=_;F.errors?.length?P=F.errors:F.message&&(P=[{message:F.message}])}else typeof _=="string"&&(P=[{message:_}])}let k=E?.extensionUpdateDraft?.userErrors;if(k?.length&&P.push(...k),P.length>0){let _=P.map(F=>F.message).join(", ");i.write(`${e.draftMessages.errorMessage}: ${_}`)}else{let _=e.draftMessages.successMessage;_&&v5(_,n)}}var s_e=async({stderr:e,stdout:t},{developerPlatformClient:r,apiKey:a,remoteExtensionIds:n,localApp:i,appWatcher:l})=>{await iB(i);let f=i.draftableExtensions.map(v=>v.handle),h=async v=>{let y=v.extensionEvents.filter(S=>S.type===C1.Updated).filter(S=>S.buildResult?.status==="ok").filter(S=>f.includes(S.extension.handle)).map(async S=>{let E=S.extension,P=n[E.localIdentifier];if(!P)throw new ln(`Extension ${E.localIdentifier} not found on remote app.`);await gc({outputPrefix:E.outputPrefix},async()=>{await AO({extension:E,developerPlatformClient:r,apiKey:a,registrationId:P,stdout:t,stderr:e,appConfiguration:i.configuration,bundlePath:l.buildOutputPath})})});await Promise.all(y)};l.onEvent(h).onStart(h)};async function LO({localApp:e,apiKey:t,developerPlatformClient:r,remoteApp:a,...n}){let i=e.draftableExtensions;if(i.length===0)return;let l=_B({app:e}),{extensionIds:f,extensions:h}=await kB({app:e,remoteApp:a,appId:t,appName:a.title,force:!0,release:!0,developerPlatformClient:r,envIdentifiers:l,includeDraftExtensions:!0});return e.updateExtensionUUIDS(h),{type:"draftable-extension",prefix:"extensions",function:s_e,options:{localApp:e,apiKey:t,developerPlatformClient:r,...n,extensions:i,remoteExtensionIds:f}}}o();o();function u2(e){let t=e.find(a=>th(a,g5.Frontend)),r=e.find(a=>th(a,g5.Backend));return{frontendConfig:t,backendConfig:r}}o();async function NO(e){let r={topic:"app/uninstalled",api_version:(await CB(e.developerPlatformClient,e.organizationId))[1],address:e.address,delivery_method:VB.LOCALHOST,shared_secret:e.sharedSecret},a=await xB(e.developerPlatformClient,r,e.organizationId);e.stdout.write("Sending APP_UNINSTALLED webhook to app server"),await Wv(3);let n=await u_e(e,a);return e.stdout.write(n?"APP_UNINSTALLED webhook delivered":"APP_UNINSTALLED webhook delivery failed"),n}async function u_e(e,t){let r=0;for(;r<3;){try{return await GB(e.address,t.samplePayload,JSON.stringify({...JSON.parse(t.headers),"X-Shopify-Shop-Domain":e.storeFqdn}))}catch(a){if(a instanceof cN&&a.code==="ECONNREFUSED")r<3&&(e.stdout.write("App isn't responding yet, retrying in 5 seconds"),await Wv(5));else throw a}r++}return e.stdout.write("App hasn't started in time, giving up"),!1}var d_e=async({stdout:e},t)=>{await NO({stdout:e,developerPlatformClient:t.developerPlatformClient,address:`http://localhost:${t.deliveryPort}${t.webhooksPath}`,sharedSecret:t.apiSecret,storeFqdn:t.storeFqdn,organizationId:t.organizationId})};function BO({webs:e,remoteAppUpdated:t,backendPort:r,frontendPort:a,organizationId:n,...i}){let{backendConfig:l,frontendConfig:f}=u2(e),h=e.map(({configuration:b})=>b.webhooks_path).find(b=>b)??"/api/webhooks";if(h&&t&&(f??l))return{type:"send-webhook",prefix:"webhooks",function:d_e,options:{deliveryPort:l?r:a,webhooksPath:h,organizationId:n,...i}}}o();o();function OO({apiKey:e,apiSecret:t,storeFqdn:r}){let a,n=async()=>{let i=await K7(`https://${r}/admin/oauth/access_token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:e,client_secret:t,grant_type:"client_credentials"})}),l=await i.json();if(!i.ok||!l.access_token)throw new Error(`Token request failed with status ${i.status}`);return a=l.access_token,a};return{getToken:async()=>a??n(),refreshToken:async()=>(a=void 0,n())}}o();o();var Ot=Ro(I(),1),UI=Ro(Ox(),1),Dr=Ro(FL(),1);o();o();var np=Ro(I(),1),qI=function(t){return np.default.createElement("svg",Object.assign({viewBox:"0 0 20 20"},t),np.default.createElement("path",{d:"M10 6a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5a.75.75 0 0 1 .75-.75Z"}),np.default.createElement("path",{d:"M11 13a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"}),np.default.createElement("path",{fillRule:"evenodd",d:"M17 10a7 7 0 1 1-14 0 7 7 0 0 1 14 0Zm-1.5 0a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0Z"}))};qI.displayName="AlertCircleIcon";o();var AL=Ro(I(),1),op=function(t){return AL.default.createElement("svg",Object.assign({viewBox:"0 0 20 20"},t),AL.default.createElement("path",{fillRule:"evenodd",d:"M17 10a7 7 0 1 1-14 0 7 7 0 0 1 14 0Zm-3.677 4.383a5.5 5.5 0 0 1-7.706-7.706l7.706 7.706Zm1.06-1.06-7.706-7.706a5.5 5.5 0 0 1 7.706 7.706Z"}))};op.displayName="DisabledIcon";o();var LL=Ro(I(),1),ip=function(t){return LL.default.createElement("svg",Object.assign({viewBox:"0 0 20 20"},t),LL.default.createElement("path",{fillRule:"evenodd",d:"M15.842 4.175a3.746 3.746 0 0 0-5.298 0l-2.116 2.117a3.75 3.75 0 0 0 .01 5.313l.338.336a.75.75 0 1 0 1.057-1.064l-.339-.337a2.25 2.25 0 0 1-.005-3.187l2.116-2.117a2.246 2.246 0 1 1 3.173 3.18l-1.052 1.047a.75.75 0 0 0 1.058 1.064l1.052-1.047a3.746 3.746 0 0 0 .006-5.305Zm-11.664 11.67a3.75 3.75 0 0 0 5.304 0l2.121-2.121a3.75 3.75 0 0 0 0-5.303l-.362-.362a.75.75 0 0 0-1.06 1.06l.362.362a2.25 2.25 0 0 1 0 3.182l-2.122 2.122a2.25 2.25 0 1 1-3.182-3.182l1.07-1.07a.75.75 0 1 0-1.062-1.06l-1.069 1.069a3.75 3.75 0 0 0 0 5.303Z"}))};ip.displayName="LinkIcon";var Lar=Ro(I(),1);var HI=fN().platform==="darwin"?"MAC_COMMAND_KEY":"Ctrl",T4t=`
201
+ `,r.stdout);let a=JSON.stringify(t);e.clients.forEach(n=>n.send(a))}function e_e(e,t){let r=t.payloadStore.getRawPayload();return{...e,version:t.manifestVersion,data:{...e.data,extensions:[],store:r.store,app:r.app}}}var t_e=10;function pO(e){let t=new eN.default({noServer:!0,clientTracking:!0}),r=r_e(t);return e.httpServer.on("upgrade",vO(t,e)),e.payloadStore.on(Qv.Update,gO(t,e)),{close:()=>{t.close(),clearInterval(r)}}}function r_e(e){return setInterval(()=>{e.clients.forEach(t=>{t.readyState<2&&t.ping()})},t_e*1e3)}o();o();o();function bO(e,t){let{url:r}=V4(e.type,t);if(e.surface==="checkout"&&r){let a=new URL(`https://${t.storeFqdn}/`);return a.pathname=r,a.searchParams.append("dev",`${t.url}/extensions`),a.toString()}else{let a=new URL(`https://${t.storeFqdn}/`);return a.pathname="admin/extensions-dev",a.searchParams.append("url",J4(e,t)),a.toString()}}function yO(e,t,r){let a=W4(e),n=new URL(`https://${r.storeFqdn}/`);switch(a){case"checkout":n.pathname=r.checkoutCartUrl,n.searchParams.append("dev",`${r.url}/extensions`);break;case"post_purchase":if(n.pathname=r.checkoutCartUrl,n.searchParams.set("script_url",`${r.url}/extensions/${t.devUUID}/assets/${t.localIdentifier}.js`),n.searchParams.set("post_purchase_dev_api_key",r.apiKey),t.devUUID&&r.websocketURL&&(n.searchParams.set("uuid",t.devUUID),n.searchParams.set("socket_url",r.websocketURL)),"metafields"in t.configuration){let i={config:{metafields:t.configuration.metafields}};n.searchParams.set("config",JSON.stringify(i))}break;case"admin":n.pathname="admin/extensions-dev",n.searchParams.append("url",J4(t,r)),n.searchParams.append("target",e);break;case"customer-accounts":n=a_e(t,r,e);break;default:return}return n.toString()}function a_e(e,t,r=""){let a=`${t.url}/extensions`,n=t.storeId,i="shopify.com",l=new URL(`https://${i}/${n}/account/extensions-development`);return l.searchParams.append("origin",a),l.searchParams.append("extensionId",e.devUUID),l.searchParams.append("source","CUSTOMER_ACCOUNT_EXTENSION"),l.searchParams.append("appId",t.id??""),r!==""&&l.searchParams.append("target",r),l}function J4(e,t){let r=new URL(t.url);return r.pathname=`/extensions/${e.devUUID}`,r.toString()}function Bs(e,t){MN(e,_N(t))}o();var lE=class extends $7{constructor(t){super(`Couldn't find template ${t.template} for extension surface ${t.extensionSurface}`)}};async function IO(e){let t=await n_e(e),r=await ko(t);return Yv(r,e.data)}async function n_e(e){let t=await o_e(),r=[];e.extensionSurface&&r.push(na(t,`${e.extensionSurface}/${e.template}.html.liquid`)),r.push(na(t,`${e.template}.html.liquid`));let a=await T4(r);if(a.length===0)throw new lE(e);return a[0]}async function o_e(){return await Uv("templates/ui-extensions/html",{type:"directory",cwd:Hv(import.meta.url)})}var SO=to(e=>{ol(e,"Access-Control-Allow-Origin","*"),ol(e,"Access-Control-Allow-Methods","GET, OPTIONS"),ol(e,"Access-Control-Allow-Headers","Accept, Content-Type, Content-Length, Accept-Encoding, X-CSRF-Token, Authorization, ngrok-skip-browser-warning")}),EO=to(e=>{ol(e,"Cache-Control","no-cache")}),xO=to(async e=>O4(e,"/extensions/dev-console",307));async function cE(e,t){let{filePath:r}=t;if(!await E1(r))return Bs(e,{statusCode:404,statusMessage:`Not Found: ${r}`});if(await jL(r)&&(r+=r.endsWith("/")?"index.html":"/index.html",!await E1(r)))return Bs(e,{statusCode:404,statusMessage:`Not Found: ${r}`});let a=await ko(r,{}),n={".ico":"image/x-icon",".html":"text/html",".js":"text/javascript",".json":"application/json",".wasm":"application/wasm",".css":"text/css",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".wav":"audio/wav",".mp3":"audio/mpeg",".svg":"image/svg+xml",".pdf":"application/pdf",".doc":"application/msword"},i=S4(r),l=n[i]||"text/plain";return ol(e,"Content-Type",l),a}function CO({getExtensions:e,payloadStore:t}){return to(async r=>{let{extensionId:a,assetPath:n=""}=zv(r),i=e().find(b=>b.devUUID===a);if(!i)return Bs(r,{statusCode:404,statusMessage:`Extension with id ${a} not found`});let f=t.getAssetResolver(i.devUUID)?.get(n)??n,h=US(dB(i.outputPath)),v=US(na(h,f));return KL(h,v)?cE(r,{filePath:v}):Bs(r,{statusCode:404,statusMessage:"Not Found"})})}function sE({payloadStore:e}){return to(t=>(ol(t,"content-type","application/json"),e.getRawPayload()))}var TO=to(async e=>{let t=await Uv(na("assets","dev-console"),{type:"directory",cwd:Hv(import.meta.url)});return t?cE(e,{filePath:t}):Bs(e,{statusCode:404,statusMessage:"Could not find root directory for dev console"})}),wO=to(async e=>{let{assetPath:t=""}=zv(e),r=await Uv(na("assets","dev-console","extensions","dev-console","assets"),{type:"directory",cwd:Hv(import.meta.url)});return r?cE(e,{filePath:na(r,t)}):Bs(e,{statusCode:404,statusMessage:"Could not find root directory for dev console asset"})});function PO({devOptions:e}){return to(t=>{mt(`UI extensions server received a ${t.method} request to URL ${t.path}`,e.stdout)})}function uE({devOptions:e,getExtensions:t}){return to(async r=>{let{extensionId:a}=zv(r),n=t().find(f=>f.devUUID===a);if(!n)return Bs(r,{statusCode:404,statusMessage:`Extension with id ${a} not found`});if(Gv(r,"accept")?.startsWith("text/html")){if(n.type==="checkout_post_purchase")return IO({data:{url:J4(n,e)},template:"index",extensionSurface:"post_purchase"});{let f=bO(n,e);return O4(r,f,307)}}let l=e.appWatcher.buildOutputPath;return ol(r,"content-type","application/json"),{app:{apiKey:e.apiKey},version:e.manifestVersion,root:{url:new URL("/extensions",e.url).toString()},socket:{url:ah(e.url)},devConsole:{url:new URL("/extensions/dev-console",e.url).toString()},store:e.storeFqdn,extension:await rh(n,l,e)}})}function RO({devOptions:e,getExtensions:t}){return to(async r=>{let{extensionId:a,extensionPointTarget:n=""}=zv(r),i=t().find(f=>f.devUUID===a);if(!i)return Bs(r,{statusCode:404,statusMessage:`Extension with id ${a} not found`});if(i.configuration.type!=="checkout_post_purchase"&&!i.hasExtensionPointTarget(n))return Bs(r,{statusCode:404,statusMessage:`Extension with id ${a} has not configured the "${n}" extension target`});let l=yO(n,i,e);return l?O4(r,l,307):Bs(r,{statusCode:404,statusMessage:`Redirect url can't be constructed for extension with id ${a} and extension target "${n}"`})})}import{createServer as i_e}from"http";function kO(e){let t=D4(),r=Z4();t.use(PO(e)),t.use(SO),t.use(EO),r.use("/extensions/dev-console",TO),r.use("/extensions/dev-console/assets/**:assetPath",wO),r.use("/extensions/:extensionId",uE(e)),r.use("/extensions/:extensionId/",uE(e)),r.use("/extensions/:extensionId/:extensionPointTarget",RO(e)),r.use("/extensions/:extensionId/assets/**:assetPath",CO(e)),r.use("/extensions",sE(e)),r.use("/extensions/",sE(e)),r.use("/",xO),t.use(r);let a=i_e(q4(t));return a.listen(e.devOptions.port,"localhost"),a}async function _O(e){let t={...e,websocketURL:ah(e.url)},r=t.appWatcher.buildOutputPath,a=new Map,n=await fO(t,r,a),i=new Q4(n,t,a),l=t.extensions.filter(y=>y.isPreviewable),f=()=>l;mt("Setting up the UI extensions HTTP server...",t.stdout);let h=kO({devOptions:t,payloadStore:i,getExtensions:f});mt("Setting up the UI extensions Websocket server...",t.stdout);let v=pO({...t,httpServer:h,payloadStore:i});mt("Setting up the UI extensions bundler and file watching...",t.stdout);let b=async({appWasReloaded:y,app:S,extensionEvents:E})=>{y&&(l=S.allExtensions.filter(P=>P.isPreviewable));for(let P of E){if(!P.extension.isPreviewable)continue;let k=P.buildResult?.status==="ok"?"success":"error",_=P.buildResult?.status==="error"?{message:P.buildResult.error,file:P.buildResult.file}:void 0;switch(P.type){case C1.Created:if(t.extensions.push(P.extension),!t.checkoutCartUrl){let F=await U4(t.extensions,t.storeFqdn);t.checkoutCartUrl=F}await i.addExtension(P.extension,r);break;case C1.Updated:await i.updateExtension(P.extension,t,r,{status:k,error:_});break;case C1.Deleted:t.extensions=t.extensions.filter(F=>F.devUUID!==P.extension.devUUID),await i.deleteExtension(P.extension);break}}};t.appWatcher.onEvent(b).onStart(b),t.signal.addEventListener("abort",()=>{mt("Closing the UI extensions dev server..."),v.close(),h.close()})}function ah(e){let t=new URL("/extensions",e);return t.protocol="wss:",t.toString()}var l_e="3",c_e=async({stderr:e,stdout:t,abortSignal:r},{apiKey:a,storeFqdn:n,storeId:i,subscriptionProductUrl:l,port:f,cartUrl:h,proxyUrl:v,appName:b,appDotEnvFile:y,appId:S,grantedScopes:E,allExtensions:P,appDirectory:k,appWatcher:_})=>{await _O({appName:b,appDotEnvFile:y,appDirectory:k,id:S,extensions:P,stdout:t,stderr:e,signal:r,url:v,port:f,storeFqdn:f5(n),storeId:i,apiKey:a,grantedScopes:E,checkoutCartUrl:h,subscriptionProductUrl:l,manifestVersion:l_e,appWatcher:_})};async function MO({allExtensions:e,storeFqdn:t,checkoutCartUrl:r,...a}){let n=e.filter(l=>l.isPreviewable),i=await U4(n,t,r);return{prefix:"extensions",type:"previewable-extension",function:c_e,options:{pathPrefix:"/extensions",port:-1,storeFqdn:t,allExtensions:e,cartUrl:i,...a}}}o();o();o();async function FO(e){let t={},r=await hB(e);return await Promise.all(r.map(async a=>{let n=I4(e.directory,a),l=Y7(n)==="assets"?"binary":"utf8",f=await ko(a,{encoding:l});t[n]=Buffer.from(f,l).toString("base64")})),{theme_extension:{files:t}}}async function AO({extension:e,developerPlatformClient:t,apiKey:r,registrationId:a,stdout:n,stderr:i,appConfiguration:l,bundlePath:f}){let h,v=e.getOutputPathForDirectory(f);if(e.features.includes("esbuild")){let _=await ko(v);if(!_)return;h=Buffer.from(_).toString("base64")}let b;e.isThemeExtension?b=await FO(e):b=await e.deployConfig({apiKey:r,appConfiguration:l})??{};let y={...b,serialized_script:h};if(e.isFunctionExtension){let _=await ko(e.outputPath,{encoding:"base64"});y.uploaded_files={"dist/index.wasm":_}}let S={apiKey:r,config:JSON.stringify(y),handle:e.handle,context:e.contextValue,registrationId:a},E,P=[];try{E=await t.updateExtension(S)}catch(_){if(P=[{message:"Unknown error"}],_&&typeof _=="object"){let F=_;F.errors?.length?P=F.errors:F.message&&(P=[{message:F.message}])}else typeof _=="string"&&(P=[{message:_}])}let k=E?.extensionUpdateDraft?.userErrors;if(k?.length&&P.push(...k),P.length>0){let _=P.map(F=>F.message).join(", ");i.write(`${e.draftMessages.errorMessage}: ${_}`)}else{let _=e.draftMessages.successMessage;_&&v5(_,n)}}var s_e=async({stderr:e,stdout:t},{developerPlatformClient:r,apiKey:a,remoteExtensionIds:n,localApp:i,appWatcher:l})=>{await iB(i);let f=i.draftableExtensions.map(v=>v.handle),h=async v=>{let y=v.extensionEvents.filter(S=>S.type===C1.Updated).filter(S=>S.buildResult?.status==="ok").filter(S=>f.includes(S.extension.handle)).map(async S=>{let E=S.extension,P=n[E.localIdentifier];if(!P)throw new ln(`Extension ${E.localIdentifier} not found on remote app.`);await gc({outputPrefix:E.outputPrefix},async()=>{await AO({extension:E,developerPlatformClient:r,apiKey:a,registrationId:P,stdout:t,stderr:e,appConfiguration:i.configuration,bundlePath:l.buildOutputPath})})});await Promise.all(y)};l.onEvent(h).onStart(h)};async function LO({localApp:e,apiKey:t,developerPlatformClient:r,remoteApp:a,...n}){let i=e.draftableExtensions;if(i.length===0)return;let l=_B({app:e}),{extensionIds:f,extensions:h}=await kB({app:e,remoteApp:a,appId:t,appName:a.title,force:!0,release:!0,developerPlatformClient:r,envIdentifiers:l,includeDraftExtensions:!0});return e.updateExtensionUUIDS(h),{type:"draftable-extension",prefix:"extensions",function:s_e,options:{localApp:e,apiKey:t,developerPlatformClient:r,...n,extensions:i,remoteExtensionIds:f}}}o();o();function u2(e){let t=e.find(a=>th(a,g5.Frontend)),r=e.find(a=>th(a,g5.Backend));return{frontendConfig:t,backendConfig:r}}o();async function NO(e){let r={topic:"app/uninstalled",api_version:(await CB(e.developerPlatformClient,e.organizationId))[1],address:e.address,delivery_method:VB.LOCALHOST,shared_secret:e.sharedSecret},a=await xB(e.developerPlatformClient,r,e.organizationId);e.stdout.write("Sending APP_UNINSTALLED webhook to app server"),await Wv(3);let n=await u_e(e,a);return e.stdout.write(n?"APP_UNINSTALLED webhook delivered":"APP_UNINSTALLED webhook delivery failed"),n}async function u_e(e,t){let r=0;for(;r<3;){try{return await GB(e.address,t.samplePayload,JSON.stringify({...JSON.parse(t.headers),"X-Shopify-Shop-Domain":e.storeFqdn}))}catch(a){if(a instanceof cN&&a.code==="ECONNREFUSED")r<3&&(e.stdout.write("App isn't responding yet, retrying in 5 seconds"),await Wv(5));else throw a}r++}return e.stdout.write("App hasn't started in time, giving up"),!1}var d_e=async({stdout:e},t)=>{await NO({stdout:e,developerPlatformClient:t.developerPlatformClient,address:`http://localhost:${t.deliveryPort}${t.webhooksPath}`,sharedSecret:t.apiSecret,storeFqdn:t.storeFqdn,organizationId:t.organizationId})};function BO({webs:e,remoteAppUpdated:t,backendPort:r,frontendPort:a,organizationId:n,...i}){let{backendConfig:l,frontendConfig:f}=u2(e),h=e.map(({configuration:b})=>b.webhooks_path).find(b=>b)??"/api/webhooks";if(h&&t&&(f??l))return{type:"send-webhook",prefix:"webhooks",function:d_e,options:{deliveryPort:l?r:a,webhooksPath:h,organizationId:n,...i}}}o();o();function OO({apiKey:e,apiSecret:t,storeFqdn:r}){let a,n=async()=>{let i=await K7(`https://${r}/admin/oauth/access_token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:e,client_secret:t,grant_type:"client_credentials"})}),l=await i.json();if(!i.ok||!l.access_token)throw new Error(`Token request failed with status ${i.status}`);return a=l.access_token,a};return{getToken:async()=>a??n(),refreshToken:async()=>(a=void 0,n())}}o();o();var Ot=Ro(I(),1),UI=Ro(Ox(),1),Dr=Ro(FL(),1);o();o();var np=Ro(I(),1),qI=function(t){return np.default.createElement("svg",Object.assign({viewBox:"0 0 20 20"},t),np.default.createElement("path",{d:"M10 6a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5a.75.75 0 0 1 .75-.75Z"}),np.default.createElement("path",{d:"M11 13a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"}),np.default.createElement("path",{fillRule:"evenodd",d:"M17 10a7 7 0 1 1-14 0 7 7 0 0 1 14 0Zm-1.5 0a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0Z"}))};qI.displayName="AlertCircleIcon";o();var AL=Ro(I(),1),op=function(t){return AL.default.createElement("svg",Object.assign({viewBox:"0 0 20 20"},t),AL.default.createElement("path",{fillRule:"evenodd",d:"M17 10a7 7 0 1 1-14 0 7 7 0 0 1 14 0Zm-3.677 4.383a5.5 5.5 0 0 1-7.706-7.706l7.706 7.706Zm1.06-1.06-7.706-7.706a5.5 5.5 0 0 1 7.706 7.706Z"}))};op.displayName="DisabledIcon";o();var LL=Ro(I(),1),ip=function(t){return LL.default.createElement("svg",Object.assign({viewBox:"0 0 20 20"},t),LL.default.createElement("path",{fillRule:"evenodd",d:"M15.842 4.175a3.746 3.746 0 0 0-5.298 0l-2.116 2.117a3.75 3.75 0 0 0 .01 5.313l.338.336a.75.75 0 1 0 1.057-1.064l-.339-.337a2.25 2.25 0 0 1-.005-3.187l2.116-2.117a2.246 2.246 0 1 1 3.173 3.18l-1.052 1.047a.75.75 0 0 0 1.058 1.064l1.052-1.047a3.746 3.746 0 0 0 .006-5.305Zm-11.664 11.67a3.75 3.75 0 0 0 5.304 0l2.121-2.121a3.75 3.75 0 0 0 0-5.303l-.362-.362a.75.75 0 0 0-1.06 1.06l.362.362a2.25 2.25 0 0 1 0 3.182l-2.122 2.122a2.25 2.25 0 1 1-3.182-3.182l1.07-1.07a.75.75 0 1 0-1.062-1.06l-1.069 1.069a3.75 3.75 0 0 0 0 5.303Z"}))};ip.displayName="LinkIcon";var Lar=Ro(I(),1);var HI=fN().platform==="darwin"?"MAC_COMMAND_KEY":"Ctrl",T4t=`
202
202
  # Welcome to GraphiQL for the Shopify Admin API! If you've used
203
203
  # GraphiQL before, you can jump to the next tab.
204
204
  #
@@ -507,7 +507,7 @@ ${wr.json(t.data)}
507
507
  `),setTimeout(()=>{YI({stdout:e,appLogsFetchInput:{jwtToken:t,cursor:void 0},developerPlatformClient:a,resubscribeCallback:n,storeName:i,organizationId:l,abortSignal:f,logsDir:h}).catch(y=>{mt(`Unexpected error during polling: ${y}}
508
508
  `)})},rE)}};function W4t(e,t,r){let a=(t.fuel_consumed/KB).toFixed(4);e.status==="success"?r.write(`Function export "${t.export}" executed successfully using ${a}M instructions.`):e.status==="failure"&&r.write(`\u274C Function export "${t.export}" failed to execute with error: ${t.error_type}`);let n=t.logs;n.length>0&&r.write(n.split(`
509
509
  `).filter(Boolean).map(i=>Kr`${wr.gray("\u2502 ")}${i}`.value).join(`
510
- `))}function z4t(e,t,r){e.log_type===eO?r.write("Function network access response retrieved from cache."):e.log_type===tO?t.reason===aO?r.write("Function network access request executing in background because there is no cached response."):t.reason===nO&&r.write("Function network access request executing in background because the cached response is about to expire."):e.log_type===rO&&(e.status==="success"?r.write("Function network access request executed successfully."):e.status==="failure"&&r.write(`\u274C Function network access request failed to execute with error: ${t.error}.`))}function G4t(e){return e.allExtensions.some(t=>t.isFunctionExtension)}async function QRe({developerPlatformClient:e,subscription:{shopIds:t,apiKey:r},storeName:a,organizationId:n,appWatcher:i,localApp:l}){return{type:"app-logs-subscribe",prefix:"app-logs",function:V4t,options:{developerPlatformClient:e,appLogsSubscribeVariables:{shopIds:t,apiKey:r},storeName:a,organizationId:n,appWatcher:i,localApp:l}}}var V4t=async({stdout:e,stderr:t,abortSignal:r},{developerPlatformClient:a,appLogsSubscribeVariables:n,storeName:i,organizationId:l,appWatcher:f,localApp:h})=>{async function v(b){let y=await aE(a,n,l,e),S=h.getLogsDir();await x4(S),await YI({stdout:e,appLogsFetchInput:{jwtToken:y},resubscribeCallback:()=>aE(a,n,l),developerPlatformClient:a,storeName:i,organizationId:l,abortSignal:b,logsDir:S})}try{let b=!1,y,S=async E=>{let P=G4t(E.app);if(P&&!b){mt("Function extensions detected, starting logs polling"),b=!0,y=new AbortController;try{await v(y.signal)}catch(k){mt(`Failed to start function logs: ${k}`,t)}}else!P&&b&&(mt("No function extensions detected, stopping logs polling"),b=!1,y?.abort(),y=void 0)};f.onStart(S).onEvent(S)}catch{}};o();async function JRe(e){return{type:"app-watcher",prefix:"app-preview",options:e,function:Y4t}}var Y4t=async({stdout:e,stderr:t,abortSignal:r},a)=>{let{appWatcher:n}=a;await n.start({stdout:e,stderr:t,signal:r})};o();import{EventEmitter as X4t}from"events";var Q4t={BUILD_ERROR:{message:"Build error. Please review your code and try again",type:"error"},READY:{message:"Ready, watching for changes in your app",type:"success"},LOADING:{message:"Preparing dev preview",type:"loading"},UPDATED:{message:"Updated",type:"success"},VALIDATION_ERROR:{message:"Validation error in your app configuration",type:"error"},REMOTE_ERROR:{message:"Error updating dev preview",type:"error"},CHANGE_DETECTED:{message:"Change detected, updating dev preview",type:"loading"}},XI=class extends X4t{constructor(t){super(),this.currentStatus={isReady:!1,previewURL:void 0,graphiqlURL:void 0,statusMessage:void 0},t&&(this.currentStatus=t)}updateStatus(t){let r={...this.currentStatus,...t};hN(this.currentStatus,r)||(this.currentStatus=r,this.emit("dev-session-update",r))}setMessage(t){this.updateStatus({statusMessage:Q4t[t]})}get status(){return this.currentStatus}reset(){this.currentStatus={isReady:!1,previewURL:void 0,graphiqlURL:void 0,statusMessage:void 0}}};o();import*as KRe from"http";import*as jRe from"https";function $Re(e){return"errors"in e&&Array.isArray(e.errors)}async function eke(e,t,r,a){let i=(await import("./http-proxy-node16-Q5DZMBHC.js")).default.createProxyServer(),l=K4t(e,i,a),f=r?jRe.createServer(r,l):KRe.createServer(l);return f.on("upgrade",J4t(e,i,a)),t.addEventListener("abort",()=>{mt("Closing reverse HTTP proxy"),f.close()}),{server:f}}function J4t(e,t,r){return function(a,n,i){let l=tke(e,a,!0);if(l)return t.ws(a,n,i,{target:l},f=>{gc({outputPrefix:"proxy",stripAnsi:!1},()=>{let v=($Re(f)?f.errors[f.errors.length-1]:void 0)??f;nl(`Error forwarding websocket request: ${v.message}`,r),nl(`\u2514 Unreachable target "${l}" for path: "${a.url}"`,r)})});n.destroy()}}function K4t(e,t,r){return function(a,n){let i=tke(e,a);if(i)return a.method==="OPTIONS"?(n.writeHead(204,{"Access-Control-Allow-Origin":a.headers.origin??"*","Access-Control-Allow-Methods":a.headers["access-control-request-method"]??"GET, POST, PUT, DELETE, PATCH, OPTIONS","Access-Control-Allow-Headers":a.headers["access-control-request-headers"]??"Content-Type, Authorization","Access-Control-Max-Age":"86400"}),n.end()):t.web(a,n,{target:i},l=>{gc({outputPrefix:"proxy",stripAnsi:!1},()=>{let h=($Re(l)?l.errors[l.errors.length-1]:void 0)??l;nl(`Error forwarding web request: ${h.message}`,r),nl(`\u2514 Unreachable target "${i}" for path: "${a.url}"`,r)})});mt(Kr`
510
+ `))}function z4t(e,t,r){e.log_type===eO?r.write("Function network access response retrieved from cache."):e.log_type===tO?t.reason===aO?r.write("Function network access request executing in background because there is no cached response."):t.reason===nO&&r.write("Function network access request executing in background because the cached response is about to expire."):e.log_type===rO&&(e.status==="success"?r.write("Function network access request executed successfully."):e.status==="failure"&&r.write(`\u274C Function network access request failed to execute with error: ${t.error}.`))}function G4t(e){return e.allExtensions.some(t=>t.isFunctionExtension)}async function QRe({developerPlatformClient:e,subscription:{shopIds:t,apiKey:r},storeName:a,organizationId:n,appWatcher:i,localApp:l}){return{type:"app-logs-subscribe",prefix:"app-logs",function:V4t,options:{developerPlatformClient:e,appLogsSubscribeVariables:{shopIds:t,apiKey:r},storeName:a,organizationId:n,appWatcher:i,localApp:l}}}var V4t=async({stdout:e,stderr:t,abortSignal:r},{developerPlatformClient:a,appLogsSubscribeVariables:n,storeName:i,organizationId:l,appWatcher:f,localApp:h})=>{async function v(b){let y=await aE(a,n,l,e),S=h.getLogsDir();await x4(S),await YI({stdout:e,appLogsFetchInput:{jwtToken:y},resubscribeCallback:()=>aE(a,n,l),developerPlatformClient:a,storeName:i,organizationId:l,abortSignal:b,logsDir:S})}try{let b=!1,y,S=async E=>{let P=G4t(E.app);if(P&&!b){mt("Function extensions detected, starting logs polling"),b=!0,y=new AbortController;try{await v(y.signal)}catch(k){mt(`Failed to start function logs: ${k}`,t)}}else!P&&b&&(mt("No function extensions detected, stopping logs polling"),b=!1,y?.abort(),y=void 0)};f.onStart(S).onEvent(S)}catch{}};o();async function JRe(e){return{type:"app-watcher",prefix:"app-preview",options:e,function:Y4t}}var Y4t=async({stdout:e,stderr:t,abortSignal:r},a)=>{let{appWatcher:n}=a;await n.start({stdout:e,stderr:t,signal:r})};o();import{EventEmitter as X4t}from"events";var Q4t={BUILD_ERROR:{message:"Build error. Please review your code and try again",type:"error"},READY:{message:"Ready, watching for changes in your app",type:"success"},LOADING:{message:"Preparing dev preview",type:"loading"},UPDATED:{message:"Updated",type:"success"},VALIDATION_ERROR:{message:"Validation error in your app configuration",type:"error"},REMOTE_ERROR:{message:"Error updating dev preview",type:"error"},CHANGE_DETECTED:{message:"Change detected, updating dev preview",type:"loading"}},XI=class extends X4t{constructor(t){super(),this.currentStatus={isReady:!1,previewURL:void 0,graphiqlURL:void 0,statusMessage:void 0},t&&(this.currentStatus=t)}updateStatus(t){let r={...this.currentStatus,...t};hN(this.currentStatus,r)||(this.currentStatus=r,this.emit("dev-session-update",r))}setMessage(t){this.updateStatus({statusMessage:Q4t[t]})}get status(){return this.currentStatus}reset(){this.currentStatus={isReady:!1,previewURL:void 0,graphiqlURL:void 0,statusMessage:void 0}}};o();import*as KRe from"http";import*as jRe from"https";function $Re(e){return"errors"in e&&Array.isArray(e.errors)}async function eke(e,t,r,a){let i=(await import("./http-proxy-node16-X2WAMUT5.js")).default.createProxyServer(),l=K4t(e,i,a),f=r?jRe.createServer(r,l):KRe.createServer(l);return f.on("upgrade",J4t(e,i,a)),t.addEventListener("abort",()=>{mt("Closing reverse HTTP proxy"),f.close()}),{server:f}}function J4t(e,t,r){return function(a,n,i){let l=tke(e,a,!0);if(l)return t.ws(a,n,i,{target:l},f=>{gc({outputPrefix:"proxy",stripAnsi:!1},()=>{let v=($Re(f)?f.errors[f.errors.length-1]:void 0)??f;nl(`Error forwarding websocket request: ${v.message}`,r),nl(`\u2514 Unreachable target "${l}" for path: "${a.url}"`,r)})});n.destroy()}}function K4t(e,t,r){return function(a,n){let i=tke(e,a);if(i)return a.method==="OPTIONS"?(n.writeHead(204,{"Access-Control-Allow-Origin":a.headers.origin??"*","Access-Control-Allow-Methods":a.headers["access-control-request-method"]??"GET, POST, PUT, DELETE, PATCH, OPTIONS","Access-Control-Allow-Headers":a.headers["access-control-request-headers"]??"Content-Type, Authorization","Access-Control-Max-Age":"86400"}),n.end()):t.web(a,n,{target:i},l=>{gc({outputPrefix:"proxy",stripAnsi:!1},()=>{let h=($Re(l)?l.errors[l.errors.length-1]:void 0)??l;nl(`Error forwarding web request: ${h.message}`,r),nl(`\u2514 Unreachable target "${i}" for path: "${a.url}"`,r)})});mt(Kr`
511
511
  Reverse HTTP proxy error - Invalid path: ${a.url??""}
512
512
  These are the allowed paths:
513
513
  ${wr.json(JSON.stringify(e))}
@@ -1 +1 @@
1
- import{b as P,e as E,g as w}from"./chunk-7JESXDF2.js";import{c as s,g as a}from"./chunk-VPRTJUIN.js";var k=s((ve,W)=>{a();var z=P(),G=function(){return z.Date.now()};W.exports=G});var R=s((be,N)=>{a();var J=/\s/;function K(e){for(var r=e.length;r--&&J.test(e.charAt(r)););return r}N.exports=K});var C=s((Ee,S)=>{a();var Q=R(),V=/^\s+/;function Y(e){return e&&e.slice(0,Q(e)+1).replace(V,"")}S.exports=Y});var _=s((pe,M)=>{a();var Z=C(),A=E(),ee=w(),L=NaN,re=/^[-+]0x[0-9a-f]+$/i,ne=/^0b[01]+$/i,ie=/^0o[0-7]+$/i,te=parseInt;function ae(e){if(typeof e=="number")return e;if(ee(e))return L;if(A(e)){var r=typeof e.valueOf=="function"?e.valueOf():e;e=A(r)?r+"":r}if(typeof e!="string")return e===0?e:+e;e=Z(e);var i=ne.test(e);return i||ie.test(e)?te(e.slice(2),i?2:8):re.test(e)?L:+e}M.exports=ae});var F=s((qe,B)=>{a();var ue=E(),I=k(),j=_(),fe="Expected a function",de=Math.max,ce=Math.min;function oe(e,r,i){var u,f,x,o,t,c,m=0,p=!1,l=!1,T=!0;if(typeof e!="function")throw new TypeError(fe);r=j(r)||0,ue(i)&&(p=!!i.leading,l="maxWait"in i,x=l?de(j(i.maxWait)||0,r):x,T="trailing"in i?!!i.trailing:T);function b(n){var d=u,g=f;return u=f=void 0,m=n,o=e.apply(g,d),o}function U(n){return m=n,t=setTimeout(v,r),p?b(n):o}function X(n){var d=n-c,g=n-m,O=r-d;return l?ce(O,x-g):O}function y(n){var d=n-c,g=n-m;return c===void 0||d>=r||d<0||l&&g>=x}function v(){var n=I();if(y(n))return q(n);t=setTimeout(v,X(n))}function q(n){return t=void 0,T&&u?b(n):(u=f=void 0,o)}function D(){t!==void 0&&clearTimeout(t),m=0,u=c=f=t=void 0}function H(){return t===void 0?o:q(I())}function h(){var n=I(),d=y(n);if(u=arguments,f=this,c=n,d){if(t===void 0)return U(c);if(l)return clearTimeout(t),t=setTimeout(v,r),b(c)}return t===void 0&&(t=setTimeout(v,r)),o}return h.cancel=D,h.flush=H,h}B.exports=oe});var xe=s((We,$)=>{a();var se=F(),me=E(),le="Expected a function";function ge(e,r,i){var u=!0,f=!0;if(typeof e!="function")throw new TypeError(le);return me(i)&&(u="leading"in i?!!i.leading:u,f="trailing"in i?!!i.trailing:f),se(e,r,{leading:u,maxWait:r,trailing:f})}$.exports=ge});export{F as a,xe as b};
1
+ import{b as P,e as E,g as w}from"./chunk-A4SBXDZB.js";import{c as s,g as a}from"./chunk-VKWPEFWQ.js";var k=s((ve,W)=>{a();var z=P(),G=function(){return z.Date.now()};W.exports=G});var R=s((be,N)=>{a();var J=/\s/;function K(e){for(var r=e.length;r--&&J.test(e.charAt(r)););return r}N.exports=K});var C=s((Ee,S)=>{a();var Q=R(),V=/^\s+/;function Y(e){return e&&e.slice(0,Q(e)+1).replace(V,"")}S.exports=Y});var _=s((pe,M)=>{a();var Z=C(),A=E(),ee=w(),L=NaN,re=/^[-+]0x[0-9a-f]+$/i,ne=/^0b[01]+$/i,ie=/^0o[0-7]+$/i,te=parseInt;function ae(e){if(typeof e=="number")return e;if(ee(e))return L;if(A(e)){var r=typeof e.valueOf=="function"?e.valueOf():e;e=A(r)?r+"":r}if(typeof e!="string")return e===0?e:+e;e=Z(e);var i=ne.test(e);return i||ie.test(e)?te(e.slice(2),i?2:8):re.test(e)?L:+e}M.exports=ae});var F=s((qe,B)=>{a();var ue=E(),I=k(),j=_(),fe="Expected a function",de=Math.max,ce=Math.min;function oe(e,r,i){var u,f,x,o,t,c,m=0,p=!1,l=!1,T=!0;if(typeof e!="function")throw new TypeError(fe);r=j(r)||0,ue(i)&&(p=!!i.leading,l="maxWait"in i,x=l?de(j(i.maxWait)||0,r):x,T="trailing"in i?!!i.trailing:T);function b(n){var d=u,g=f;return u=f=void 0,m=n,o=e.apply(g,d),o}function U(n){return m=n,t=setTimeout(v,r),p?b(n):o}function X(n){var d=n-c,g=n-m,O=r-d;return l?ce(O,x-g):O}function y(n){var d=n-c,g=n-m;return c===void 0||d>=r||d<0||l&&g>=x}function v(){var n=I();if(y(n))return q(n);t=setTimeout(v,X(n))}function q(n){return t=void 0,T&&u?b(n):(u=f=void 0,o)}function D(){t!==void 0&&clearTimeout(t),m=0,u=c=f=t=void 0}function H(){return t===void 0?o:q(I())}function h(){var n=I(),d=y(n);if(u=arguments,f=this,c=n,d){if(t===void 0)return U(c);if(l)return clearTimeout(t),t=setTimeout(v,r),b(c)}return t===void 0&&(t=setTimeout(v,r)),o}return h.cancel=D,h.flush=H,h}B.exports=oe});var xe=s((We,$)=>{a();var se=F(),me=E(),le="Expected a function";function ge(e,r,i){var u=!0,f=!0;if(typeof e!="function")throw new TypeError(le);return me(i)&&(u="leading"in i?!!i.leading:u,f="trailing"in i?!!i.trailing:f),se(e,r,{leading:u,maxWait:r,trailing:f})}$.exports=ge});export{F as a,xe as b};
@@ -0,0 +1 @@
1
+ import{a as o}from"./chunk-AWEB5AQM.js";import{g as e}from"./chunk-VKWPEFWQ.js";e();var t=class extends o{};export{t as a};