@shopify/cli 4.8.4 → 4.9.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.
- package/dist/analytics-QK4RFCB6.js +1 -0
- package/dist/analytics-R6I5APDB.js +1 -0
- package/dist/assets/hydrogen/starter/package.json +1 -1
- package/dist/bootstrap.js +1 -3
- package/dist/chunk-22LJALHJ.js +7 -0
- package/dist/{chunk-APUYMORT.js → chunk-23K3B23N.js} +1 -1
- package/dist/chunk-2KLXRVGQ.js +317 -0
- package/dist/{chunk-QXR5DJC2.js → chunk-2LZQM5JG.js} +1 -1
- package/dist/chunk-2OHSGC4Q.js +1 -0
- package/dist/chunk-2Q3WIH7S.js +6 -0
- package/dist/{chunk-FRRA5MI2.js → chunk-2W6M7YDY.js} +1 -1
- package/dist/{chunk-NHOF2IN6.js → chunk-2YFB3PTV.js} +9 -9
- package/dist/chunk-2YRVHJEY.js +4 -0
- package/dist/{chunk-3CZ7DKE5.js → chunk-3AASYIOA.js} +3 -3
- package/dist/chunk-3DMDSAWK.js +20 -0
- package/dist/{chunk-KWQGJ3VC.js → chunk-3SG5EJFC.js} +1 -1
- package/dist/chunk-3T2WMZHC.js +1 -0
- package/dist/{chunk-773TIA5M.js → chunk-3VYOLEQE.js} +2 -2
- package/dist/chunk-3WVEL423.js +1 -0
- package/dist/{chunk-SVYHWGMI.js → chunk-3ZK5JZLY.js} +1 -1
- package/dist/chunk-44QTWXOJ.js +8 -0
- package/dist/{chunk-4QBJ5JBX.js → chunk-4A7FPJVT.js} +16 -15
- package/dist/chunk-4TQFTZVD.js +18 -0
- package/dist/chunk-4WACZNFF.js +1 -0
- package/dist/{chunk-RIM7FNP3.js → chunk-4XSYMLQG.js} +1 -1
- package/dist/{chunk-EJJPEWSB.js → chunk-4Y22EM45.js} +1 -1
- package/dist/chunk-53U6XS3J.js +1 -0
- package/dist/chunk-55NKAIIT.js +1 -0
- package/dist/chunk-55PABKRC.js +5 -0
- package/dist/chunk-5BLXN5WU.js +1 -0
- package/dist/{chunk-LAMTFOVF.js → chunk-5BYVVXGD.js} +1 -1
- package/dist/{chunk-Z5KYKXMH.js → chunk-5HEBS5DG.js} +3 -3
- package/dist/{chunk-LEW5IJK6.js → chunk-5HONV6NQ.js} +1 -1
- package/dist/chunk-5RL6DKWR.js +5 -0
- package/dist/chunk-5XO6PAMV.js +1 -0
- package/dist/chunk-6DHY67FO.js +6 -0
- package/dist/{chunk-6QADNGH4.js → chunk-6GA56I3E.js} +1 -1
- package/dist/chunk-6IL3B5Z5.js +4 -0
- package/dist/{chunk-RHBLXZGU.js → chunk-6ILP6QCH.js} +1 -1
- package/dist/{chunk-H7TDIRIU.js → chunk-6RBCFXJT.js} +1 -1
- package/dist/{chunk-WAJRWCZY.js → chunk-72HS7MHV.js} +1 -1
- package/dist/{chunk-SPNM3GES.js → chunk-74HXMIDM.js} +1 -1
- package/dist/{chunk-ZAH6QID2.js → chunk-77B77IGP.js} +1 -1
- package/dist/chunk-7DRKDQRT.js +1 -0
- package/dist/chunk-7HDJBEBP.js +3 -0
- package/dist/chunk-7IGMIDKK.js +15 -0
- package/dist/chunk-7QQPAT4L.js +1 -0
- package/dist/chunk-7Y4X5I6N.js +1 -0
- package/dist/{chunk-WGFGWDWP.js → chunk-7ZSN2QT5.js} +1 -1
- package/dist/chunk-A54V5UCD.js +5 -0
- package/dist/{chunk-VETLNJ56.js → chunk-AD4S2VEI.js} +1 -1
- package/dist/chunk-ADW7ECNU.js +7 -0
- package/dist/chunk-AS2O62JX.js +1 -0
- package/dist/chunk-ASUARYJD.js +1 -0
- package/dist/chunk-B4RPJYDH.js +1 -0
- package/dist/{chunk-ZCNNJCTQ.js → chunk-BJOJNAKH.js} +1 -1
- package/dist/chunk-BL5JWD3Y.js +16 -0
- package/dist/chunk-BOFCBTX7.js +1 -0
- package/dist/chunk-BPIQ4YTW.js +1 -0
- package/dist/chunk-C6FZII5S.js +1 -0
- package/dist/{chunk-NBXXTQWA.js → chunk-CACPRKUF.js} +1 -1
- package/dist/{chunk-QVO5CAJN.js → chunk-CHLSNYF7.js} +1 -1
- package/dist/chunk-CMICT4XI.js +1 -0
- package/dist/chunk-CPFAATMO.js +6 -0
- package/dist/{chunk-CSOCXWP6.js → chunk-CSRNHTHO.js} +2 -2
- package/dist/chunk-D3K42KBL.js +9 -0
- package/dist/chunk-DGMRL5DQ.js +1 -0
- package/dist/chunk-DKJPE42V.js +2 -0
- package/dist/{chunk-AIILEPSK.js → chunk-DYA5UUXL.js} +1 -1
- package/dist/chunk-E5ND6RBL.js +1 -0
- package/dist/{chunk-XKHKXUQY.js → chunk-E75DJTAF.js} +1 -1
- package/dist/chunk-ECEOBSGD.js +1 -0
- package/dist/{chunk-NDT3F2PR.js → chunk-EYSZRIUL.js} +1 -1
- package/dist/chunk-FCULF3JA.js +1 -0
- package/dist/chunk-FL34EOXG.js +1 -0
- package/dist/chunk-FW5HGFSZ.js +20 -0
- package/dist/{chunk-XRJCD3AO.js → chunk-G54BKNIX.js} +1 -1
- package/dist/{chunk-74CYT3VX.js → chunk-G7OIACY5.js} +1 -1
- package/dist/{chunk-IHH5XTPV.js → chunk-GALDYSEX.js} +1 -1
- package/dist/{chunk-A5U4KKNV.js → chunk-GDQLA5NB.js} +1 -1
- package/dist/{chunk-6A3TDSON.js → chunk-GJJBOCKD.js} +3 -3
- package/dist/{chunk-TAY7HU7X.js → chunk-GQZPGTG7.js} +20 -20
- package/dist/{chunk-XHXKPRF5.js → chunk-GVRFO4CV.js} +1 -1
- package/dist/chunk-HB3MJYBK.js +1 -0
- package/dist/{chunk-AEUCDGTB.js → chunk-HDQXFGYG.js} +1 -1
- package/dist/chunk-HSTNTHWM.js +1 -0
- package/dist/{chunk-A3U7JDUC.js → chunk-HSZC2LBB.js} +1 -1
- package/dist/chunk-I4FGM6UH.js +8 -0
- package/dist/chunk-I7GYNNCU.js +6 -0
- package/dist/{chunk-ZVA5F4QC.js → chunk-IBTQO3JD.js} +1 -1
- package/dist/{chunk-XWXAFJFC.js → chunk-IISE7SBT.js} +1 -1
- package/dist/chunk-IUZZWXJG.js +3 -0
- package/dist/chunk-IWML2HLC.js +5 -0
- package/dist/{chunk-CTNBSUVU.js → chunk-JA2QZ635.js} +2 -2
- package/dist/chunk-JOJRABPY.js +3 -0
- package/dist/chunk-JQKB3D37.js +1 -0
- package/dist/chunk-JROJL6RV.js +1 -0
- package/dist/{chunk-GINXNPAR.js → chunk-JTPVSO6Y.js} +1 -1
- package/dist/chunk-JWDUSMCA.js +1 -0
- package/dist/{chunk-CBMX6XI7.js → chunk-KLYJDAP6.js} +1 -1
- package/dist/{chunk-4HOJJCZ6.js → chunk-KVROYIUQ.js} +1 -1
- package/dist/chunk-L5XWYTHY.js +836 -0
- package/dist/chunk-LOTGSNS5.js +2 -0
- package/dist/{chunk-FGRW7GT4.js → chunk-LQLFMDVD.js} +1 -1
- package/dist/{chunk-7LZ34C4S.js → chunk-LSWFHTJT.js} +1 -1
- package/dist/{chunk-HYPY5WH6.js → chunk-LV2IWYGL.js} +1 -1
- package/dist/{chunk-W4SGAPPR.js → chunk-LYPNQFWX.js} +1 -1
- package/dist/{chunk-U6URYCC6.js → chunk-MRVQ6XRW.js} +1 -1
- package/dist/chunk-MVVHISCR.js +2 -0
- package/dist/{chunk-UJBMY5WR.js → chunk-N4DE5H65.js} +1 -1
- package/dist/{chunk-W6ST525S.js → chunk-N56BJ3F7.js} +1 -1
- package/dist/{chunk-W4SQE6NR.js → chunk-NF7MOA4K.js} +1 -1
- package/dist/{chunk-7KLPRSQR.js → chunk-NGN7U2UF.js} +1 -1
- package/dist/{chunk-TCFGEOE4.js → chunk-NTVEJYKI.js} +1 -1
- package/dist/chunk-NYABB6XW.js +1 -0
- package/dist/{chunk-DH3DMUE2.js → chunk-O6E7YL7N.js} +2 -2
- package/dist/chunk-OASB6XPV.js +16 -0
- package/dist/{chunk-WY7QF7VU.js → chunk-OBYY45BX.js} +1 -1
- package/dist/chunk-OETFY7FE.js +28 -0
- package/dist/{chunk-QZEDYQVT.js → chunk-OEZATTOS.js} +1 -1
- package/dist/{chunk-D6LQ56XT.js → chunk-OG7SF4FU.js} +1 -1
- package/dist/chunk-OM243CQ6.js +6 -0
- package/dist/chunk-P3Z5RLVV.js +3 -0
- package/dist/{chunk-HINK4QAR.js → chunk-PBBZNGS4.js} +1 -1
- package/dist/chunk-PGTKKP2B.js +11 -0
- package/dist/chunk-PK4ID32C.js +1 -0
- package/dist/{chunk-7FVCUY54.js → chunk-PVOWU77O.js} +1 -1
- package/dist/{chunk-66HW6J57.js → chunk-PXD2WJOI.js} +3 -3
- package/dist/chunk-PXXTSW6I.js +4 -0
- package/dist/{chunk-AU7GNCOK.js → chunk-PZHE37Z4.js} +1 -1
- package/dist/{chunk-TA2M37OB.js → chunk-Q34PKJRR.js} +1 -1
- package/dist/{chunk-S5H5U3PR.js → chunk-Q3O3AFZT.js} +1 -1
- package/dist/chunk-Q45XAEG2.js +16 -0
- package/dist/{chunk-QKTBYAUD.js → chunk-QAXFCAOV.js} +5 -5
- package/dist/{chunk-FY47X4NG.js → chunk-QBGSSUJP.js} +1 -1
- package/dist/chunk-QILWHHAQ.js +1 -0
- package/dist/chunk-QJST4LZX.js +1 -0
- package/dist/chunk-QQN4PJZD.js +1 -0
- package/dist/{chunk-6P5FGN6P.js → chunk-QSKOR3ED.js} +1 -1
- package/dist/{chunk-FRVRTOTF.js → chunk-QTEWTPAQ.js} +2 -2
- package/dist/chunk-QWDJRSJJ.js +1 -0
- package/dist/{chunk-GTAYTMCP.js → chunk-R757TSQ6.js} +1 -1
- package/dist/chunk-RCIU7NHA.js +1 -0
- package/dist/chunk-RGIUP4FW.js +1 -0
- package/dist/{chunk-RDS2WYQH.js → chunk-RHNFWHFY.js} +1 -1
- package/dist/{chunk-VG3YVCZW.js → chunk-S7536EWZ.js} +4 -4
- package/dist/{chunk-VBICZDA4.js → chunk-SDFO7P2M.js} +1 -1
- package/dist/{chunk-JQPPLSFT.js → chunk-SDJNAUU6.js} +1 -1
- package/dist/chunk-SGBLCVUX.js +1 -0
- package/dist/chunk-SJARQZVN.js +3 -0
- package/dist/chunk-SKRUMRB4.js +383 -0
- package/dist/{chunk-5Z6EW3FA.js → chunk-SW5EWGBJ.js} +1 -1
- package/dist/chunk-SXPWOYLT.js +7 -0
- package/dist/chunk-T234RERA.js +7 -0
- package/dist/chunk-TJJVX7CU.js +4 -0
- package/dist/{chunk-L4LDNEFK.js → chunk-TMV37ENR.js} +1 -1
- package/dist/{chunk-BYX7SQPM.js → chunk-TNXZWQZU.js} +1 -1
- package/dist/{chunk-67QK26HI.js → chunk-TO7TXDLU.js} +1 -1
- package/dist/chunk-TSLZNTFM.js +3 -0
- package/dist/{chunk-BG7QQU23.js → chunk-UFU2LGFK.js} +1 -1
- package/dist/chunk-VDDNDA5K.js +15 -0
- package/dist/{chunk-T4V7KOGJ.js → chunk-VFO5OYQ4.js} +1 -1
- package/dist/{chunk-HXVUDGLH.js → chunk-VFP3PUGZ.js} +24 -24
- package/dist/{chunk-6QDOCBD4.js → chunk-VZUHMW5E.js} +4 -3
- package/dist/chunk-W7CBJNXD.js +12 -0
- package/dist/chunk-WCAGYCT7.js +4 -0
- package/dist/{chunk-DPNZWBT5.js → chunk-WNO2V53C.js} +1 -1
- package/dist/{chunk-Y4BBTWM5.js → chunk-WPUQTUDX.js} +1 -1
- package/dist/chunk-WU7MSL3I.js +8 -0
- package/dist/chunk-WXV35TPE.js +1 -0
- package/dist/{chunk-2WATX3XV.js → chunk-XBSWZ6BT.js} +6 -6
- package/dist/chunk-XCNJL7ES.js +1 -0
- package/dist/{chunk-C4Y7PQDQ.js → chunk-XFZDFDZV.js} +1 -1
- package/dist/chunk-XTYSJIZY.js +1 -0
- package/dist/chunk-Y5ZN62VF.js +1 -0
- package/dist/{chunk-PNNW7YQG.js → chunk-YAH5WFYR.js} +3 -3
- package/dist/{chunk-DUNE3INK.js → chunk-YBQKJHZW.js} +1 -1
- package/dist/chunk-YD66PU3Y.js +1 -0
- package/dist/chunk-YGFEUXKQ.js +1 -0
- package/dist/chunk-YJWNM4XO.js +18 -0
- package/dist/{chunk-L3JBKCAS.js → chunk-YQQHBFMA.js} +1 -1
- package/dist/chunk-YRHFPXC3.js +1 -0
- package/dist/chunk-YTJ3EPD3.js +1 -0
- package/dist/chunk-YX5GRXRS.js +2368 -0
- package/dist/chunk-Z35PUKKP.js +7 -0
- package/dist/{chunk-7VQBIGJB.js → chunk-Z3XIZMEM.js} +1 -1
- package/dist/chunk-ZGASBRSQ.js +5 -0
- package/dist/{chunk-OY6L7J53.js → chunk-ZHJ6KA43.js} +1 -1
- package/dist/{chunk-YHTONNIZ.js → chunk-ZO4IBP4B.js} +1 -1
- package/dist/chunk-ZOYSMJ27.js +1 -0
- package/dist/chunk-ZPCCSPAE.js +3 -0
- package/dist/chunk-ZSJXZCAW.js +4 -0
- package/dist/{chunk-CP56F5UR.js → chunk-ZSVR5NEO.js} +1 -1
- package/dist/{chunk-JJJIRCQP.js → chunk-ZUVAHONX.js} +1 -1
- package/dist/chunk-ZVDFCUJT.js +2 -0
- package/dist/cli/commands/app/app-logs/sources.js +1 -1
- package/dist/cli/commands/app/build.js +1 -1
- package/dist/cli/commands/app/bulk/cancel.js +1 -1
- package/dist/cli/commands/app/bulk/execute.js +1 -1
- package/dist/cli/commands/app/bulk/status.js +1 -1
- package/dist/cli/commands/app/config/link.js +1 -1
- package/dist/cli/commands/app/config/pull.js +1 -1
- package/dist/cli/commands/app/config/use.js +1 -1
- package/dist/cli/commands/app/config/validate.js +1 -1
- package/dist/cli/commands/app/demo/watcher.js +1 -1
- package/dist/cli/commands/app/deploy.js +1 -1
- package/dist/cli/commands/app/dev/clean.js +1 -1
- package/dist/cli/commands/app/dev.js +1 -1
- package/dist/cli/commands/app/env/pull.js +1 -1
- package/dist/cli/commands/app/env/show.js +1 -1
- package/dist/cli/commands/app/execute.js +1 -1
- package/dist/cli/commands/app/function/build.js +1 -1
- package/dist/cli/commands/app/function/info.js +1 -1
- package/dist/cli/commands/app/function/replay.js +1 -1
- package/dist/cli/commands/app/function/run.js +1 -1
- package/dist/cli/commands/app/function/schema.js +1 -1
- package/dist/cli/commands/app/function/typegen.js +1 -1
- package/dist/cli/commands/app/generate/extension.js +1 -1
- package/dist/cli/commands/app/graphiql.js +1 -1
- package/dist/cli/commands/app/import/channel-config.js +1 -0
- package/dist/cli/commands/app/import/custom-data-definitions.js +1 -0
- package/dist/cli/commands/app/import/dashboard-extensions.js +1 -0
- package/dist/cli/commands/app/import-custom-data-definitions.js +1 -1
- package/dist/cli/commands/app/import-extensions.js +1 -1
- package/dist/cli/commands/app/info.js +1 -1
- package/dist/cli/commands/app/init.js +1 -1
- package/dist/cli/commands/app/logs.js +1 -1
- package/dist/cli/commands/app/release.js +1 -1
- package/dist/cli/commands/app/security/check.js +1 -0
- package/dist/cli/commands/app/security/clean.js +1 -0
- package/dist/cli/commands/app/security/instructions.js +1 -0
- package/dist/cli/commands/app/security/record.js +1 -0
- package/dist/cli/commands/app/security/review.js +1 -0
- package/dist/cli/commands/app/subscription-migrations/cancel.js +1 -1
- package/dist/cli/commands/app/subscription-migrations/list.js +1 -1
- package/dist/cli/commands/app/subscription-migrations/schedule.js +1 -1
- package/dist/cli/commands/app/subscription-migrations/status.js +1 -1
- package/dist/cli/commands/app/subscription-migrations/unschedule.js +1 -1
- package/dist/cli/commands/app/versions/list.js +1 -1
- package/dist/cli/commands/app/webhook/trigger.js +1 -1
- package/dist/cli/commands/auth/login.d.ts +16 -1
- package/dist/cli/commands/auth/login.js +1 -1
- package/dist/cli/commands/auth/logout.d.ts +16 -1
- package/dist/cli/commands/auth/logout.js +1 -1
- package/dist/cli/commands/cache/clear.js +1 -1
- package/dist/cli/commands/config/autoupgrade/off.d.ts +13 -0
- package/dist/cli/commands/config/autoupgrade/off.js +1 -1
- package/dist/cli/commands/config/autoupgrade/on.d.ts +13 -0
- package/dist/cli/commands/config/autoupgrade/on.js +1 -1
- package/dist/cli/commands/config/autoupgrade/status.d.ts +13 -0
- package/dist/cli/commands/config/autoupgrade/status.js +1 -1
- package/dist/cli/commands/debug/command-flags.js +1 -1
- package/dist/cli/commands/doc/fetch.d.ts +2 -0
- package/dist/cli/commands/doc/fetch.js +1 -1
- package/dist/cli/commands/doc/search.d.ts +1 -0
- package/dist/cli/commands/doc/search.js +1 -1
- package/dist/cli/commands/docs/generate.js +1 -1
- package/dist/cli/commands/doctor-release/doctor-release.js +1 -1
- package/dist/cli/commands/doctor-release/theme/index.d.ts +1 -0
- package/dist/cli/commands/doctor-release/theme/index.js +1 -1
- package/dist/cli/commands/help.d.ts +431 -1
- package/dist/cli/commands/help.js +1 -1
- package/dist/cli/commands/kitchen-sink/async.js +1 -1
- package/dist/cli/commands/kitchen-sink/index.js +1 -1
- package/dist/cli/commands/kitchen-sink/prompts.js +1 -1
- package/dist/cli/commands/kitchen-sink/static.js +1 -1
- package/dist/cli/commands/notifications/generate.js +1 -1
- package/dist/cli/commands/notifications/list.js +1 -1
- package/dist/cli/commands/organization/list.js +1 -1
- package/dist/cli/commands/search.d.ts +11 -1
- package/dist/cli/commands/search.js +1 -1
- package/dist/cli/commands/send-analytics.js +1 -1
- package/dist/cli/commands/theme/check.js +1 -1
- package/dist/cli/commands/theme/console.js +1 -1
- package/dist/cli/commands/theme/delete.js +1 -1
- package/dist/cli/commands/theme/dev.js +1 -1
- package/dist/cli/commands/theme/duplicate.js +1 -1
- package/dist/cli/commands/theme/info.js +1 -1
- package/dist/cli/commands/theme/init.js +1 -1
- package/dist/cli/commands/theme/language-server.js +1 -1
- package/dist/cli/commands/theme/list.js +1 -1
- package/dist/cli/commands/theme/metafields/pull.js +1 -1
- package/dist/cli/commands/theme/open.js +1 -1
- package/dist/cli/commands/theme/package.js +1 -1
- package/dist/cli/commands/theme/preview.js +1 -1
- package/dist/cli/commands/theme/profile.js +1 -1
- package/dist/cli/commands/theme/publish.js +1 -1
- package/dist/cli/commands/theme/pull.js +1 -1
- package/dist/cli/commands/theme/push.js +1 -1
- package/dist/cli/commands/theme/rename.js +1 -1
- package/dist/cli/commands/theme/share.js +1 -1
- package/dist/cli/commands/upgrade.js +1 -1
- package/dist/cli/commands/version.d.ts +15 -1
- package/dist/cli/commands/version.js +1 -1
- package/dist/cli/help.d.ts +5 -2
- package/dist/cli/help.js +6 -2
- package/dist/cli/services/commands/auth/login/types.d.ts +11 -0
- package/dist/cli/services/commands/auth/login/types.js +7 -0
- package/dist/cli/services/commands/config/autoupgrade/index.d.ts +3 -0
- package/dist/cli/services/commands/config/autoupgrade/index.js +9 -0
- package/dist/cli/services/commands/config/autoupgrade/result.d.ts +2 -0
- package/dist/cli/services/commands/config/autoupgrade/result.js +15 -0
- package/dist/cli/services/commands/config/autoupgrade/types.d.ts +10 -0
- package/dist/cli/services/commands/config/autoupgrade/types.js +7 -0
- package/dist/cli/services/commands/doc/fetch.d.ts +1 -1
- package/dist/cli/services/commands/doc/fetch.js +11 -2
- package/dist/cli/services/commands/help/index.d.ts +3 -0
- package/dist/cli/services/commands/help/index.js +51 -0
- package/dist/cli/services/commands/help/result.d.ts +2 -0
- package/dist/cli/services/commands/help/result.js +6 -0
- package/dist/cli/services/commands/help/types.d.ts +431 -0
- package/dist/cli/services/commands/help/types.js +71 -0
- package/dist/cli/services/commands/search/index.d.ts +2 -0
- package/dist/cli/services/commands/search/index.js +8 -0
- package/dist/cli/services/commands/search/result.d.ts +2 -0
- package/dist/cli/services/commands/search/result.js +12 -0
- package/dist/cli/services/commands/search/types.d.ts +10 -0
- package/dist/cli/services/commands/search/types.js +7 -0
- package/dist/cli/services/commands/version/index.d.ts +2 -0
- package/dist/cli/services/commands/version/index.js +5 -0
- package/dist/cli/services/commands/version/result.d.ts +2 -0
- package/dist/cli/services/commands/version/result.js +6 -0
- package/dist/cli/services/commands/version/types.d.ts +10 -0
- package/dist/cli/services/commands/version/types.js +7 -0
- package/dist/command-json-schema-Y3N2NUZN.js +1 -0
- package/dist/command-registry.js +1 -1
- package/dist/{conf-store-H3UAVGN5.js → conf-store-5ZA3ILWV.js} +1 -1
- package/dist/custom-oclif-loader-VQKMCXNH.js +1 -0
- package/dist/deprecations-PFQXWNF6.js +1 -0
- package/dist/dist-4X53WJBQ.js +1 -0
- package/dist/dist-5M2V3YCM.js +1 -0
- package/dist/environment-ZUTBXY7U.js +1 -0
- package/dist/environments-3RUZ7F4Q.js +1 -0
- package/dist/error-FBSXLW22.js +1 -0
- package/dist/error-handler-D5BURRJ7.js +1 -0
- package/dist/fs-ZLV5W4TV.js +1 -0
- package/dist/hooks/did-you-mean.js +1 -1
- package/dist/hooks/hydrogen-init.js +1 -1
- package/dist/hooks/plugin-plugins.js +1 -1
- package/dist/hooks/postrun.js +1 -1
- package/dist/hooks/prerun.js +1 -1
- package/dist/hooks/public-metadata.js +1 -1
- package/dist/hooks/sensitive-metadata.js +1 -1
- package/dist/hooks/tunnel-provider.js +1 -1
- package/dist/hooks/tunnel-start.js +1 -1
- package/dist/http-proxy-node16-D3JUYA5D.js +38 -0
- package/dist/index.js +13 -14
- package/dist/is-global-GZ5CIXQA.js +1 -0
- package/dist/json-error-2BL3UZ7H.js +1 -0
- package/dist/lib-AD2G3QH3.js +1 -0
- package/dist/lib-VEVNMHDE.js +1 -0
- package/dist/lib-ZQW4E7QU.js +1 -0
- package/dist/local-KAZJAYLX.js +1 -0
- package/dist/metadata-M3ZE24WB.js +1 -0
- package/dist/{morph-BMYYMQNX.js → morph-42EXMN3K.js} +3 -3
- package/dist/node-package-manager-RVPONQBY.js +1 -0
- package/dist/notifications-system-MYEMV7JF.js +1 -0
- package/dist/os-DRUILZZR.js +1 -0
- package/dist/output-SDE274Y5.js +1 -0
- package/dist/{path-MBXP7ZIC.js → path-6YMSTSWG.js} +1 -1
- package/dist/system-5FQ3L5PA.js +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/ui-TEZZM7SE.js +1 -0
- package/dist/uncaught-error-handler.d.ts +6 -0
- package/dist/uncaught-error-handler.js +33 -0
- package/dist/upgrade-3PIVJYBL.js +1 -0
- package/dist/version-FMWTVLMF.js +1 -0
- package/dist/version-IAMVSP7U.js +1 -0
- package/dist/workerd-WRW4ZUYM.js +18 -0
- package/oclif.manifest.json +2646 -226
- package/package.json +17 -8
- package/dist/analytics-M4OC7RPG.js +0 -1
- package/dist/analytics-RGIJMP4U.js +0 -1
- package/dist/chunk-2HW6VRJT.js +0 -2
- package/dist/chunk-2HYR6EUD.js +0 -1
- package/dist/chunk-2IRRFPEY.js +0 -1
- package/dist/chunk-2KD4LHRT.js +0 -5
- package/dist/chunk-2SL443J6.js +0 -1
- package/dist/chunk-2VJ6NBPV.js +0 -15
- package/dist/chunk-2ZROBXJX.js +0 -11
- package/dist/chunk-3DIRCEXA.js +0 -1
- package/dist/chunk-3DT4NS4S.js +0 -4
- package/dist/chunk-3IQ6WXDD.js +0 -3
- package/dist/chunk-43FRAUV6.js +0 -19
- package/dist/chunk-44QD4QNO.js +0 -1
- package/dist/chunk-4DLRS7MT.js +0 -12
- package/dist/chunk-4F3XYIEY.js +0 -1
- package/dist/chunk-4OMKKYFC.js +0 -9
- package/dist/chunk-4ZTRKEA2.js +0 -1
- package/dist/chunk-5DMFEDKY.js +0 -28
- package/dist/chunk-66G2HJ2A.js +0 -3
- package/dist/chunk-6B727IUY.js +0 -5
- package/dist/chunk-6C5AVMKR.js +0 -375
- package/dist/chunk-6CR2EEZ3.js +0 -6
- package/dist/chunk-6V6UNUMM.js +0 -3
- package/dist/chunk-6XLFFOPK.js +0 -1
- package/dist/chunk-A3V2A2I4.js +0 -2
- package/dist/chunk-AQPOPSQ7.js +0 -1
- package/dist/chunk-BAWBC66R.js +0 -5
- package/dist/chunk-BHJ3TGS7.js +0 -1
- package/dist/chunk-BHTHUKHU.js +0 -1
- package/dist/chunk-BV62ZERJ.js +0 -6
- package/dist/chunk-CFQ5G2QS.js +0 -1
- package/dist/chunk-CNK3ZO2B.js +0 -836
- package/dist/chunk-CRALWNNO.js +0 -1
- package/dist/chunk-CVW2HMQO.js +0 -317
- package/dist/chunk-D6QTOQEJ.js +0 -6
- package/dist/chunk-DDZEYA2I.js +0 -8
- package/dist/chunk-DO4SRE4M.js +0 -3
- package/dist/chunk-DZZORIWL.js +0 -4
- package/dist/chunk-EQ2PD2ZA.js +0 -2
- package/dist/chunk-ERBXXVOZ.js +0 -2
- package/dist/chunk-FW3RORD7.js +0 -1
- package/dist/chunk-G2YTINLI.js +0 -6
- package/dist/chunk-GCN4O7HM.js +0 -1
- package/dist/chunk-GGPMDCCB.js +0 -8
- package/dist/chunk-GJHBAOGJ.js +0 -1
- package/dist/chunk-H2HR2AQE.js +0 -7
- package/dist/chunk-HYM3HBDG.js +0 -20
- package/dist/chunk-IHEBV2KO.js +0 -1
- package/dist/chunk-JWHQPDOK.js +0 -3
- package/dist/chunk-JXG2T76F.js +0 -6
- package/dist/chunk-K2DP5Z76.js +0 -1
- package/dist/chunk-KUZ5Z6HM.js +0 -1
- package/dist/chunk-KZU727AL.js +0 -1
- package/dist/chunk-L2DCUVZV.js +0 -1
- package/dist/chunk-L3M7PTHU.js +0 -15
- package/dist/chunk-LBA6FGKC.js +0 -3
- package/dist/chunk-LX5UXWZ7.js +0 -1
- package/dist/chunk-M7VQLMSW.js +0 -1
- package/dist/chunk-MBRFIXCU.js +0 -1705
- package/dist/chunk-MYLMGH7Y.js +0 -1
- package/dist/chunk-NKC3K3XP.js +0 -1
- package/dist/chunk-O72SHE3Q.js +0 -7
- package/dist/chunk-OAG72Q2O.js +0 -1
- package/dist/chunk-OPOPO7DG.js +0 -7
- package/dist/chunk-OUA6EOLX.js +0 -11
- package/dist/chunk-OYCAYEQE.js +0 -7
- package/dist/chunk-PGWQHSDV.js +0 -1
- package/dist/chunk-PM3HRKPR.js +0 -1
- package/dist/chunk-POMWFTBD.js +0 -16
- package/dist/chunk-R3GLEZSE.js +0 -4
- package/dist/chunk-RHNZA4IL.js +0 -5
- package/dist/chunk-SCLGMVNB.js +0 -1
- package/dist/chunk-TU47HMTL.js +0 -1
- package/dist/chunk-UPGRXCFS.js +0 -4
- package/dist/chunk-V2GLAK2W.js +0 -1
- package/dist/chunk-V4774HTF.js +0 -1
- package/dist/chunk-VDGTHMIQ.js +0 -3
- package/dist/chunk-VJ5YOXKL.js +0 -1
- package/dist/chunk-WGUCRVII.js +0 -3
- package/dist/chunk-X4V2CD2H.js +0 -8
- package/dist/chunk-XOYICV6P.js +0 -1
- package/dist/chunk-XYUTD6IU.js +0 -1
- package/dist/chunk-YNFXYVYN.js +0 -2
- package/dist/chunk-Z2HN5L6G.js +0 -6
- package/dist/chunk-ZVJD6CUY.js +0 -18
- package/dist/cli/commands/app/doctor/instructions.js +0 -1
- package/dist/cli/commands/app/doctor.js +0 -1
- package/dist/cli/commands/config/autoupgrade/constants.d.ts +0 -4
- package/dist/cli/commands/config/autoupgrade/constants.js +0 -1
- package/dist/cli/services/commands/search.d.ts +0 -1
- package/dist/cli/services/commands/search.js +0 -7
- package/dist/cli/services/commands/version.d.ts +0 -1
- package/dist/cli/services/commands/version.js +0 -6
- package/dist/custom-oclif-loader-BWAMUFQ4.js +0 -1
- package/dist/deprecations-TEUM7CML.js +0 -1
- package/dist/dist-62I5X3FS.js +0 -1
- package/dist/dist-YHZ5BTYD.js +0 -1
- package/dist/environments-LAFWOQWO.js +0 -1
- package/dist/error-6ZCGAC5E.js +0 -1
- package/dist/error-handler-JNCW56EC.js +0 -1
- package/dist/fs-QEWOWUPQ.js +0 -1
- package/dist/http-proxy-node16-A6AKKRQH.js +0 -38
- package/dist/is-global-UYMEAGDR.js +0 -1
- package/dist/lib-2BR2WN7L.js +0 -1
- package/dist/lib-M72BVWQ3.js +0 -1
- package/dist/lib-P3APEIHY.js +0 -1
- package/dist/local-Z4ZEMWE4.js +0 -1
- package/dist/metadata-ZCQMB5AB.js +0 -1
- package/dist/node-package-manager-HMOTOBDS.js +0 -1
- package/dist/notifications-system-RT3CY6LZ.js +0 -1
- package/dist/os-G6KDPJMC.js +0 -1
- package/dist/output-BJCZYDNG.js +0 -1
- package/dist/system-T4H2ISV6.js +0 -1
- package/dist/ui-4MQSY5IN.js +0 -1
- package/dist/upgrade-4234MIYJ.js +0 -1
- package/dist/version-FRSRSCRX.js +0 -1
- package/dist/version-RF7QQXRX.js +0 -1
- package/dist/workerd-7E4H2DM3.js +0 -18
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{v as xy}from"./chunk-DO4SRE4M.js";import{A as zy,B as hi,C as Oy,D as zn,E as Ay,F as Ly,G as ja,H as qy,I as $a,J as Wy,K as ls,L as r0,M as Hy,N as Ba,O as cs,P as ds,Q as On,R as Uy,S as ln,T as Va,U as Ga,V as $,W as i0,X as o0,a as Y,aa as qu,b as La,c as ky,d as Nn,e as Te,f as qa,g as Cy,h as Ty,i as _y,j as Ey,k as Ry,l as as,m as Dy,n as Wa,o as J,p as Ha,q as Fy,r as Ua,s as Jt,t as Py,u as G,v as dt,w as Dr,x as My,y as Iy,z as Ny}from"./chunk-ZVA5F4QC.js";import{b as Sy}from"./chunk-K2DP5Z76.js";import{a as Vt,b as ee,c as w,d as wy,e as Gt,f as Kt,g as h}from"./chunk-VKWPEFWQ.js";var Ui=w(ht=>{"use strict";h();Object.defineProperty(ht,"__esModule",{value:!0});ht.stringArray=ht.array=ht.func=ht.error=ht.number=ht.string=ht.boolean=void 0;function s0(n){return n===!0||n===!1}ht.boolean=s0;function jy(n){return typeof n=="string"||n instanceof String}ht.string=jy;function a0(n){return typeof n=="number"||n instanceof Number}ht.number=a0;function l0(n){return n instanceof Error}ht.error=l0;function c0(n){return typeof n=="function"}ht.func=c0;function $y(n){return Array.isArray(n)}ht.array=$y;function d0(n){return $y(n)&&n.every(e=>jy(e))}ht.stringArray=d0});var cp=w(B=>{"use strict";h();Object.defineProperty(B,"__esModule",{value:!0});B.Message=B.NotificationType9=B.NotificationType8=B.NotificationType7=B.NotificationType6=B.NotificationType5=B.NotificationType4=B.NotificationType3=B.NotificationType2=B.NotificationType1=B.NotificationType0=B.NotificationType=B.RequestType9=B.RequestType8=B.RequestType7=B.RequestType6=B.RequestType5=B.RequestType4=B.RequestType3=B.RequestType2=B.RequestType1=B.RequestType=B.RequestType0=B.AbstractMessageSignature=B.ParameterStructures=B.ResponseError=B.ErrorCodes=void 0;var ui=Ui(),By;(function(n){n.ParseError=-32700,n.InvalidRequest=-32600,n.MethodNotFound=-32601,n.InvalidParams=-32602,n.InternalError=-32603,n.jsonrpcReservedErrorRangeStart=-32099,n.serverErrorStart=-32099,n.MessageWriteError=-32099,n.MessageReadError=-32098,n.PendingResponseRejected=-32097,n.ConnectionInactive=-32096,n.ServerNotInitialized=-32002,n.UnknownErrorCode=-32001,n.jsonrpcReservedErrorRangeEnd=-32e3,n.serverErrorEnd=-32e3})(By=B.ErrorCodes||(B.ErrorCodes={}));var Wu=class n extends Error{constructor(e,t,r){super(t),this.code=ui.number(e)?e:By.UnknownErrorCode,this.data=r,Object.setPrototypeOf(this,n.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};B.ResponseError=Wu;var Rt=class n{constructor(e){this.kind=e}static is(e){return e===n.auto||e===n.byName||e===n.byPosition}toString(){return this.kind}};B.ParameterStructures=Rt;Rt.auto=new Rt("auto");Rt.byPosition=new Rt("byPosition");Rt.byName=new Rt("byName");var _e=class{constructor(e,t){this.method=e,this.numberOfParams=t}get parameterStructures(){return Rt.auto}};B.AbstractMessageSignature=_e;var Hu=class extends _e{constructor(e){super(e,0)}};B.RequestType0=Hu;var Uu=class extends _e{constructor(e,t=Rt.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};B.RequestType=Uu;var ju=class extends _e{constructor(e,t=Rt.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};B.RequestType1=ju;var $u=class extends _e{constructor(e){super(e,2)}};B.RequestType2=$u;var Bu=class extends _e{constructor(e){super(e,3)}};B.RequestType3=Bu;var Vu=class extends _e{constructor(e){super(e,4)}};B.RequestType4=Vu;var Gu=class extends _e{constructor(e){super(e,5)}};B.RequestType5=Gu;var Ku=class extends _e{constructor(e){super(e,6)}};B.RequestType6=Ku;var Ju=class extends _e{constructor(e){super(e,7)}};B.RequestType7=Ju;var Xu=class extends _e{constructor(e){super(e,8)}};B.RequestType8=Xu;var Yu=class extends _e{constructor(e){super(e,9)}};B.RequestType9=Yu;var Qu=class extends _e{constructor(e,t=Rt.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};B.NotificationType=Qu;var Zu=class extends _e{constructor(e){super(e,0)}};B.NotificationType0=Zu;var ep=class extends _e{constructor(e,t=Rt.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};B.NotificationType1=ep;var tp=class extends _e{constructor(e){super(e,2)}};B.NotificationType2=tp;var np=class extends _e{constructor(e){super(e,3)}};B.NotificationType3=np;var rp=class extends _e{constructor(e){super(e,4)}};B.NotificationType4=rp;var ip=class extends _e{constructor(e){super(e,5)}};B.NotificationType5=ip;var op=class extends _e{constructor(e){super(e,6)}};B.NotificationType6=op;var sp=class extends _e{constructor(e){super(e,7)}};B.NotificationType7=sp;var ap=class extends _e{constructor(e){super(e,8)}};B.NotificationType8=ap;var lp=class extends _e{constructor(e){super(e,9)}};B.NotificationType9=lp;var h0;(function(n){function e(i){let o=i;return o&&ui.string(o.method)&&(ui.string(o.id)||ui.number(o.id))}n.isRequest=e;function t(i){let o=i;return o&&ui.string(o.method)&&i.id===void 0}n.isNotification=t;function r(i){let o=i;return o&&(o.result!==void 0||!!o.error)&&(ui.string(o.id)||ui.number(o.id)||o.id===null)}n.isResponse=r})(h0=B.Message||(B.Message={}))});var hp=w(tr=>{"use strict";h();var Vy;Object.defineProperty(tr,"__esModule",{value:!0});tr.LRUCache=tr.LinkedMap=tr.Touch=void 0;var gt;(function(n){n.None=0,n.First=1,n.AsOld=n.First,n.Last=2,n.AsNew=n.Last})(gt=tr.Touch||(tr.Touch={}));var Ka=class{constructor(){this[Vy]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,t=gt.None){let r=this._map.get(e);if(r)return t!==gt.None&&this.touch(r,t),r.value}set(e,t,r=gt.None){let i=this._map.get(e);if(i)i.value=t,r!==gt.None&&this.touch(i,r);else{switch(i={key:e,value:t,next:void 0,previous:void 0},r){case gt.None:this.addItemLast(i);break;case gt.First:this.addItemFirst(i);break;case gt.Last:this.addItemLast(i);break;default:this.addItemLast(i);break}this._map.set(e,i),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){let r=this._state,i=this._head;for(;i;){if(t?e.bind(t)(i.value,i.key,this):e(i.value,i.key,this),this._state!==r)throw new Error("LinkedMap got modified during iteration.");i=i.next}}keys(){let e=this._state,t=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){let i={value:t.key,done:!1};return t=t.next,i}else return{value:void 0,done:!0}}};return r}values(){let e=this._state,t=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){let i={value:t.value,done:!1};return t=t.next,i}else return{value:void 0,done:!0}}};return r}entries(){let e=this._state,t=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){let i={value:[t.key,t.value],done:!1};return t=t.next,i}else return{value:void 0,done:!0}}};return r}[(Vy=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._head,r=this.size;for(;t&&r>e;)this._map.delete(t.key),t=t.next,r--;this._head=t,this._size=r,t&&(t.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let t=e.next,r=e.previous;if(!t||!r)throw new Error("Invalid list");t.previous=r,r.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(t!==gt.First&&t!==gt.Last)){if(t===gt.First){if(e===this._head)return;let r=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(r.previous=i,i.next=r),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(t===gt.Last){if(e===this._tail)return;let r=e.next,i=e.previous;e===this._head?(r.previous=void 0,this._head=r):(r.previous=i,i.next=r),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((t,r)=>{e.push([r,t])}),e}fromJSON(e){this.clear();for(let[t,r]of e)this.set(t,r)}};tr.LinkedMap=Ka;var dp=class extends Ka{constructor(e,t=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,t),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,t=gt.AsNew){return super.get(e,t)}peek(e){return super.get(e,gt.None)}set(e,t){return super.set(e,t,gt.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};tr.LRUCache=dp});var Gy=w(hs=>{"use strict";h();Object.defineProperty(hs,"__esModule",{value:!0});hs.Disposable=void 0;var u0;(function(n){function e(t){return{dispose:t}}n.create=e})(u0=hs.Disposable||(hs.Disposable={}))});var Fr=w(mp=>{"use strict";h();Object.defineProperty(mp,"__esModule",{value:!0});var up;function pp(){if(up===void 0)throw new Error("No runtime abstraction layer installed");return up}(function(n){function e(t){if(t===void 0)throw new Error("No runtime abstraction layer provided");up=t}n.install=e})(pp||(pp={}));mp.default=pp});var ji=w(pi=>{"use strict";h();Object.defineProperty(pi,"__esModule",{value:!0});pi.Emitter=pi.Event=void 0;var p0=Fr(),m0;(function(n){let e={dispose(){}};n.None=function(){return e}})(m0=pi.Event||(pi.Event={}));var fp=class{add(e,t=null,r){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(t),Array.isArray(r)&&r.push({dispose:()=>this.remove(e,t)})}remove(e,t=null){if(!this._callbacks)return;let r=!1;for(let i=0,o=this._callbacks.length;i<o;i++)if(this._callbacks[i]===e)if(this._contexts[i]===t){this._callbacks.splice(i,1),this._contexts.splice(i,1);return}else r=!0;if(r)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...e){if(!this._callbacks)return[];let t=[],r=this._callbacks.slice(0),i=this._contexts.slice(0);for(let o=0,s=r.length;o<s;o++)try{t.push(r[o].apply(i[o],e))}catch(a){(0,p0.default)().console.error(a)}return t}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},Ja=class n{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,t,r)=>{this._callbacks||(this._callbacks=new fp),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,t);let i={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,t),i.dispose=n._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(r)&&r.push(i),i}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};pi.Emitter=Ja;Ja._noop=function(){}});var Ya=w(mi=>{"use strict";h();Object.defineProperty(mi,"__esModule",{value:!0});mi.CancellationTokenSource=mi.CancellationToken=void 0;var f0=Fr(),g0=Ui(),gp=ji(),bp;(function(n){n.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:gp.Event.None}),n.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:gp.Event.None});function e(t){let r=t;return r&&(r===n.None||r===n.Cancelled||g0.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}n.is=e})(bp=mi.CancellationToken||(mi.CancellationToken={}));var b0=Object.freeze(function(n,e){let t=(0,f0.default)().timer.setTimeout(n.bind(e),0);return{dispose(){t.dispose()}}}),Xa=class{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?b0:(this._emitter||(this._emitter=new gp.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},vp=class{get token(){return this._token||(this._token=new Xa),this._token}cancel(){this._token?this._token.cancel():this._token=bp.Cancelled}dispose(){this._token?this._token instanceof Xa&&this._token.dispose():this._token=bp.None}};mi.CancellationTokenSource=vp});var Ky=w($i=>{"use strict";h();Object.defineProperty($i,"__esModule",{value:!0});$i.SharedArrayReceiverStrategy=$i.SharedArraySenderStrategy=void 0;var v0=Ya(),us;(function(n){n.Continue=0,n.Cancelled=1})(us||(us={}));var yp=class{constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;let t=new SharedArrayBuffer(4),r=new Int32Array(t,0,1);r[0]=us.Continue,this.buffers.set(e.id,t),e.$cancellationData=t}async sendCancellation(e,t){let r=this.buffers.get(t);if(r===void 0)return;let i=new Int32Array(r,0,1);Atomics.store(i,0,us.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};$i.SharedArraySenderStrategy=yp;var wp=class{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===us.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},Sp=class{constructor(e){this.token=new wp(e)}cancel(){}dispose(){}},xp=class{constructor(){this.kind="request"}createCancellationTokenSource(e){let t=e.$cancellationData;return t===void 0?new v0.CancellationTokenSource:new Sp(t)}};$i.SharedArrayReceiverStrategy=xp});var Cp=w(Qa=>{"use strict";h();Object.defineProperty(Qa,"__esModule",{value:!0});Qa.Semaphore=void 0;var y0=Fr(),kp=class{constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((t,r)=>{this._waiting.push({thunk:e,resolve:t,reject:r}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,y0.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{let t=e.thunk();t instanceof Promise?t.then(r=>{this._active--,e.resolve(r),this.runNext()},r=>{this._active--,e.reject(r),this.runNext()}):(this._active--,e.resolve(t),this.runNext())}catch(t){this._active--,e.reject(t),this.runNext()}}};Qa.Semaphore=kp});var Jy=w(nr=>{"use strict";h();Object.defineProperty(nr,"__esModule",{value:!0});nr.ReadableStreamMessageReader=nr.AbstractMessageReader=nr.MessageReader=void 0;var _p=Fr(),Bi=Ui(),Tp=ji(),w0=Cp(),S0;(function(n){function e(t){let r=t;return r&&Bi.func(r.listen)&&Bi.func(r.dispose)&&Bi.func(r.onError)&&Bi.func(r.onClose)&&Bi.func(r.onPartialMessage)}n.is=e})(S0=nr.MessageReader||(nr.MessageReader={}));var Za=class{constructor(){this.errorEmitter=new Tp.Emitter,this.closeEmitter=new Tp.Emitter,this.partialMessageEmitter=new Tp.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:new Error(`Reader received error. Reason: ${Bi.string(e.message)?e.message:"unknown"}`)}};nr.AbstractMessageReader=Za;var Ep;(function(n){function e(t){let r,i,o,s=new Map,a,l=new Map;if(t===void 0||typeof t=="string")r=t??"utf-8";else{if(r=t.charset??"utf-8",t.contentDecoder!==void 0&&(o=t.contentDecoder,s.set(o.name,o)),t.contentDecoders!==void 0)for(let c of t.contentDecoders)s.set(c.name,c);if(t.contentTypeDecoder!==void 0&&(a=t.contentTypeDecoder,l.set(a.name,a)),t.contentTypeDecoders!==void 0)for(let c of t.contentTypeDecoders)l.set(c.name,c)}return a===void 0&&(a=(0,_p.default)().applicationJson.decoder,l.set(a.name,a)),{charset:r,contentDecoder:o,contentDecoders:s,contentTypeDecoder:a,contentTypeDecoders:l}}n.fromOptions=e})(Ep||(Ep={}));var Rp=class extends Za{constructor(e,t){super(),this.readable=e,this.options=Ep.fromOptions(t),this.buffer=(0,_p.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new w0.Semaphore(1)}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;let t=this.readable.onData(r=>{this.onData(r)});return this.readable.onError(r=>this.fireError(r)),this.readable.onClose(()=>this.fireClose()),t}onData(e){for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let r=this.buffer.tryReadHeaders(!0);if(!r)return;let i=r.get("content-length");if(!i){this.fireError(new Error("Header must provide a Content-Length property."));return}let o=parseInt(i);if(isNaN(o)){this.fireError(new Error("Content-Length value must be a number."));return}this.nextMessageLength=o}let t=this.buffer.tryReadBody(this.nextMessageLength);if(t===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let r=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(t):t,i=await this.options.contentTypeDecoder.decode(r,this.options);this.callback(i)}).catch(r=>{this.fireError(r)})}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,_p.default)().timer.setTimeout((e,t)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:t}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};nr.ReadableStreamMessageReader=Rp});var Zy=w(rr=>{"use strict";h();Object.defineProperty(rr,"__esModule",{value:!0});rr.WriteableStreamMessageWriter=rr.AbstractMessageWriter=rr.MessageWriter=void 0;var Xy=Fr(),ps=Ui(),x0=Cp(),Yy=ji(),k0="Content-Length: ",Qy=`\r
|
|
1
|
+
import{v as xy}from"./chunk-P3Z5RLVV.js";import{A as zy,B as hi,C as Oy,D as zn,E as Ay,F as Ly,G as ja,H as qy,I as $a,J as Wy,K as ls,L as r0,M as Hy,N as Ba,O as cs,P as ds,Q as On,R as Uy,S as ln,T as Va,U as Ga,V as $,W as i0,X as o0,a as Y,aa as qu,b as La,c as ky,d as Nn,e as Te,f as qa,g as Cy,h as Ty,i as _y,j as Ey,k as Ry,l as as,m as Dy,n as Wa,o as J,p as Ha,q as Fy,r as Ua,s as Jt,t as Py,u as G,v as dt,w as Dr,x as My,y as Iy,z as Ny}from"./chunk-IBTQO3JD.js";import{b as Sy}from"./chunk-DGMRL5DQ.js";import{a as Vt,b as ee,c as w,d as wy,e as Gt,f as Kt,g as h}from"./chunk-VKWPEFWQ.js";var Ui=w(ht=>{"use strict";h();Object.defineProperty(ht,"__esModule",{value:!0});ht.stringArray=ht.array=ht.func=ht.error=ht.number=ht.string=ht.boolean=void 0;function s0(n){return n===!0||n===!1}ht.boolean=s0;function jy(n){return typeof n=="string"||n instanceof String}ht.string=jy;function a0(n){return typeof n=="number"||n instanceof Number}ht.number=a0;function l0(n){return n instanceof Error}ht.error=l0;function c0(n){return typeof n=="function"}ht.func=c0;function $y(n){return Array.isArray(n)}ht.array=$y;function d0(n){return $y(n)&&n.every(e=>jy(e))}ht.stringArray=d0});var cp=w(B=>{"use strict";h();Object.defineProperty(B,"__esModule",{value:!0});B.Message=B.NotificationType9=B.NotificationType8=B.NotificationType7=B.NotificationType6=B.NotificationType5=B.NotificationType4=B.NotificationType3=B.NotificationType2=B.NotificationType1=B.NotificationType0=B.NotificationType=B.RequestType9=B.RequestType8=B.RequestType7=B.RequestType6=B.RequestType5=B.RequestType4=B.RequestType3=B.RequestType2=B.RequestType1=B.RequestType=B.RequestType0=B.AbstractMessageSignature=B.ParameterStructures=B.ResponseError=B.ErrorCodes=void 0;var ui=Ui(),By;(function(n){n.ParseError=-32700,n.InvalidRequest=-32600,n.MethodNotFound=-32601,n.InvalidParams=-32602,n.InternalError=-32603,n.jsonrpcReservedErrorRangeStart=-32099,n.serverErrorStart=-32099,n.MessageWriteError=-32099,n.MessageReadError=-32098,n.PendingResponseRejected=-32097,n.ConnectionInactive=-32096,n.ServerNotInitialized=-32002,n.UnknownErrorCode=-32001,n.jsonrpcReservedErrorRangeEnd=-32e3,n.serverErrorEnd=-32e3})(By=B.ErrorCodes||(B.ErrorCodes={}));var Wu=class n extends Error{constructor(e,t,r){super(t),this.code=ui.number(e)?e:By.UnknownErrorCode,this.data=r,Object.setPrototypeOf(this,n.prototype)}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};B.ResponseError=Wu;var Rt=class n{constructor(e){this.kind=e}static is(e){return e===n.auto||e===n.byName||e===n.byPosition}toString(){return this.kind}};B.ParameterStructures=Rt;Rt.auto=new Rt("auto");Rt.byPosition=new Rt("byPosition");Rt.byName=new Rt("byName");var _e=class{constructor(e,t){this.method=e,this.numberOfParams=t}get parameterStructures(){return Rt.auto}};B.AbstractMessageSignature=_e;var Hu=class extends _e{constructor(e){super(e,0)}};B.RequestType0=Hu;var Uu=class extends _e{constructor(e,t=Rt.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};B.RequestType=Uu;var ju=class extends _e{constructor(e,t=Rt.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};B.RequestType1=ju;var $u=class extends _e{constructor(e){super(e,2)}};B.RequestType2=$u;var Bu=class extends _e{constructor(e){super(e,3)}};B.RequestType3=Bu;var Vu=class extends _e{constructor(e){super(e,4)}};B.RequestType4=Vu;var Gu=class extends _e{constructor(e){super(e,5)}};B.RequestType5=Gu;var Ku=class extends _e{constructor(e){super(e,6)}};B.RequestType6=Ku;var Ju=class extends _e{constructor(e){super(e,7)}};B.RequestType7=Ju;var Xu=class extends _e{constructor(e){super(e,8)}};B.RequestType8=Xu;var Yu=class extends _e{constructor(e){super(e,9)}};B.RequestType9=Yu;var Qu=class extends _e{constructor(e,t=Rt.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};B.NotificationType=Qu;var Zu=class extends _e{constructor(e){super(e,0)}};B.NotificationType0=Zu;var ep=class extends _e{constructor(e,t=Rt.auto){super(e,1),this._parameterStructures=t}get parameterStructures(){return this._parameterStructures}};B.NotificationType1=ep;var tp=class extends _e{constructor(e){super(e,2)}};B.NotificationType2=tp;var np=class extends _e{constructor(e){super(e,3)}};B.NotificationType3=np;var rp=class extends _e{constructor(e){super(e,4)}};B.NotificationType4=rp;var ip=class extends _e{constructor(e){super(e,5)}};B.NotificationType5=ip;var op=class extends _e{constructor(e){super(e,6)}};B.NotificationType6=op;var sp=class extends _e{constructor(e){super(e,7)}};B.NotificationType7=sp;var ap=class extends _e{constructor(e){super(e,8)}};B.NotificationType8=ap;var lp=class extends _e{constructor(e){super(e,9)}};B.NotificationType9=lp;var h0;(function(n){function e(i){let o=i;return o&&ui.string(o.method)&&(ui.string(o.id)||ui.number(o.id))}n.isRequest=e;function t(i){let o=i;return o&&ui.string(o.method)&&i.id===void 0}n.isNotification=t;function r(i){let o=i;return o&&(o.result!==void 0||!!o.error)&&(ui.string(o.id)||ui.number(o.id)||o.id===null)}n.isResponse=r})(h0=B.Message||(B.Message={}))});var hp=w(tr=>{"use strict";h();var Vy;Object.defineProperty(tr,"__esModule",{value:!0});tr.LRUCache=tr.LinkedMap=tr.Touch=void 0;var gt;(function(n){n.None=0,n.First=1,n.AsOld=n.First,n.Last=2,n.AsNew=n.Last})(gt=tr.Touch||(tr.Touch={}));var Ka=class{constructor(){this[Vy]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,t=gt.None){let r=this._map.get(e);if(r)return t!==gt.None&&this.touch(r,t),r.value}set(e,t,r=gt.None){let i=this._map.get(e);if(i)i.value=t,r!==gt.None&&this.touch(i,r);else{switch(i={key:e,value:t,next:void 0,previous:void 0},r){case gt.None:this.addItemLast(i);break;case gt.First:this.addItemFirst(i);break;case gt.Last:this.addItemLast(i);break;default:this.addItemLast(i);break}this._map.set(e,i),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let t=this._map.get(e);if(t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){let r=this._state,i=this._head;for(;i;){if(t?e.bind(t)(i.value,i.key,this):e(i.value,i.key,this),this._state!==r)throw new Error("LinkedMap got modified during iteration.");i=i.next}}keys(){let e=this._state,t=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){let i={value:t.key,done:!1};return t=t.next,i}else return{value:void 0,done:!0}}};return r}values(){let e=this._state,t=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){let i={value:t.value,done:!1};return t=t.next,i}else return{value:void 0,done:!0}}};return r}entries(){let e=this._state,t=this._head,r={[Symbol.iterator]:()=>r,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(t){let i={value:[t.key,t.value],done:!1};return t=t.next,i}else return{value:void 0,done:!0}}};return r}[(Vy=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let t=this._head,r=this.size;for(;t&&r>e;)this._map.delete(t.key),t=t.next,r--;this._head=t,this._size=r,t&&(t.previous=void 0),this._state++}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous}else{let t=e.next,r=e.previous;if(!t||!r)throw new Error("Invalid list");t.previous=r,r.next=t}e.next=void 0,e.previous=void 0,this._state++}touch(e,t){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(t!==gt.First&&t!==gt.Last)){if(t===gt.First){if(e===this._head)return;let r=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(r.previous=i,i.next=r),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(t===gt.Last){if(e===this._tail)return;let r=e.next,i=e.previous;e===this._head?(r.previous=void 0,this._head=r):(r.previous=i,i.next=r),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++}}}toJSON(){let e=[];return this.forEach((t,r)=>{e.push([r,t])}),e}fromJSON(e){this.clear();for(let[t,r]of e)this.set(t,r)}};tr.LinkedMap=Ka;var dp=class extends Ka{constructor(e,t=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,t),1)}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim()}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim()}get(e,t=gt.AsNew){return super.get(e,t)}peek(e){return super.get(e,gt.None)}set(e,t){return super.set(e,t,gt.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}};tr.LRUCache=dp});var Gy=w(hs=>{"use strict";h();Object.defineProperty(hs,"__esModule",{value:!0});hs.Disposable=void 0;var u0;(function(n){function e(t){return{dispose:t}}n.create=e})(u0=hs.Disposable||(hs.Disposable={}))});var Fr=w(mp=>{"use strict";h();Object.defineProperty(mp,"__esModule",{value:!0});var up;function pp(){if(up===void 0)throw new Error("No runtime abstraction layer installed");return up}(function(n){function e(t){if(t===void 0)throw new Error("No runtime abstraction layer provided");up=t}n.install=e})(pp||(pp={}));mp.default=pp});var ji=w(pi=>{"use strict";h();Object.defineProperty(pi,"__esModule",{value:!0});pi.Emitter=pi.Event=void 0;var p0=Fr(),m0;(function(n){let e={dispose(){}};n.None=function(){return e}})(m0=pi.Event||(pi.Event={}));var fp=class{add(e,t=null,r){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(t),Array.isArray(r)&&r.push({dispose:()=>this.remove(e,t)})}remove(e,t=null){if(!this._callbacks)return;let r=!1;for(let i=0,o=this._callbacks.length;i<o;i++)if(this._callbacks[i]===e)if(this._contexts[i]===t){this._callbacks.splice(i,1),this._contexts.splice(i,1);return}else r=!0;if(r)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...e){if(!this._callbacks)return[];let t=[],r=this._callbacks.slice(0),i=this._contexts.slice(0);for(let o=0,s=r.length;o<s;o++)try{t.push(r[o].apply(i[o],e))}catch(a){(0,p0.default)().console.error(a)}return t}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},Ja=class n{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,t,r)=>{this._callbacks||(this._callbacks=new fp),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,t);let i={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,t),i.dispose=n._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(r)&&r.push(i),i}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};pi.Emitter=Ja;Ja._noop=function(){}});var Ya=w(mi=>{"use strict";h();Object.defineProperty(mi,"__esModule",{value:!0});mi.CancellationTokenSource=mi.CancellationToken=void 0;var f0=Fr(),g0=Ui(),gp=ji(),bp;(function(n){n.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:gp.Event.None}),n.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:gp.Event.None});function e(t){let r=t;return r&&(r===n.None||r===n.Cancelled||g0.boolean(r.isCancellationRequested)&&!!r.onCancellationRequested)}n.is=e})(bp=mi.CancellationToken||(mi.CancellationToken={}));var b0=Object.freeze(function(n,e){let t=(0,f0.default)().timer.setTimeout(n.bind(e),0);return{dispose(){t.dispose()}}}),Xa=class{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?b0:(this._emitter||(this._emitter=new gp.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},vp=class{get token(){return this._token||(this._token=new Xa),this._token}cancel(){this._token?this._token.cancel():this._token=bp.Cancelled}dispose(){this._token?this._token instanceof Xa&&this._token.dispose():this._token=bp.None}};mi.CancellationTokenSource=vp});var Ky=w($i=>{"use strict";h();Object.defineProperty($i,"__esModule",{value:!0});$i.SharedArrayReceiverStrategy=$i.SharedArraySenderStrategy=void 0;var v0=Ya(),us;(function(n){n.Continue=0,n.Cancelled=1})(us||(us={}));var yp=class{constructor(){this.buffers=new Map}enableCancellation(e){if(e.id===null)return;let t=new SharedArrayBuffer(4),r=new Int32Array(t,0,1);r[0]=us.Continue,this.buffers.set(e.id,t),e.$cancellationData=t}async sendCancellation(e,t){let r=this.buffers.get(t);if(r===void 0)return;let i=new Int32Array(r,0,1);Atomics.store(i,0,us.Cancelled)}cleanup(e){this.buffers.delete(e)}dispose(){this.buffers.clear()}};$i.SharedArraySenderStrategy=yp;var wp=class{constructor(e){this.data=new Int32Array(e,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===us.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},Sp=class{constructor(e){this.token=new wp(e)}cancel(){}dispose(){}},xp=class{constructor(){this.kind="request"}createCancellationTokenSource(e){let t=e.$cancellationData;return t===void 0?new v0.CancellationTokenSource:new Sp(t)}};$i.SharedArrayReceiverStrategy=xp});var Cp=w(Qa=>{"use strict";h();Object.defineProperty(Qa,"__esModule",{value:!0});Qa.Semaphore=void 0;var y0=Fr(),kp=class{constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[]}lock(e){return new Promise((t,r)=>{this._waiting.push({thunk:e,resolve:t,reject:r}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,y0.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{let t=e.thunk();t instanceof Promise?t.then(r=>{this._active--,e.resolve(r),this.runNext()},r=>{this._active--,e.reject(r),this.runNext()}):(this._active--,e.resolve(t),this.runNext())}catch(t){this._active--,e.reject(t),this.runNext()}}};Qa.Semaphore=kp});var Jy=w(nr=>{"use strict";h();Object.defineProperty(nr,"__esModule",{value:!0});nr.ReadableStreamMessageReader=nr.AbstractMessageReader=nr.MessageReader=void 0;var _p=Fr(),Bi=Ui(),Tp=ji(),w0=Cp(),S0;(function(n){function e(t){let r=t;return r&&Bi.func(r.listen)&&Bi.func(r.dispose)&&Bi.func(r.onError)&&Bi.func(r.onClose)&&Bi.func(r.onPartialMessage)}n.is=e})(S0=nr.MessageReader||(nr.MessageReader={}));var Za=class{constructor(){this.errorEmitter=new Tp.Emitter,this.closeEmitter=new Tp.Emitter,this.partialMessageEmitter=new Tp.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:new Error(`Reader received error. Reason: ${Bi.string(e.message)?e.message:"unknown"}`)}};nr.AbstractMessageReader=Za;var Ep;(function(n){function e(t){let r,i,o,s=new Map,a,l=new Map;if(t===void 0||typeof t=="string")r=t??"utf-8";else{if(r=t.charset??"utf-8",t.contentDecoder!==void 0&&(o=t.contentDecoder,s.set(o.name,o)),t.contentDecoders!==void 0)for(let c of t.contentDecoders)s.set(c.name,c);if(t.contentTypeDecoder!==void 0&&(a=t.contentTypeDecoder,l.set(a.name,a)),t.contentTypeDecoders!==void 0)for(let c of t.contentTypeDecoders)l.set(c.name,c)}return a===void 0&&(a=(0,_p.default)().applicationJson.decoder,l.set(a.name,a)),{charset:r,contentDecoder:o,contentDecoders:s,contentTypeDecoder:a,contentTypeDecoders:l}}n.fromOptions=e})(Ep||(Ep={}));var Rp=class extends Za{constructor(e,t){super(),this.readable=e,this.options=Ep.fromOptions(t),this.buffer=(0,_p.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new w0.Semaphore(1)}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;let t=this.readable.onData(r=>{this.onData(r)});return this.readable.onError(r=>this.fireError(r)),this.readable.onClose(()=>this.fireClose()),t}onData(e){for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let r=this.buffer.tryReadHeaders(!0);if(!r)return;let i=r.get("content-length");if(!i){this.fireError(new Error("Header must provide a Content-Length property."));return}let o=parseInt(i);if(isNaN(o)){this.fireError(new Error("Content-Length value must be a number."));return}this.nextMessageLength=o}let t=this.buffer.tryReadBody(this.nextMessageLength);if(t===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let r=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(t):t,i=await this.options.contentTypeDecoder.decode(r,this.options);this.callback(i)}).catch(r=>{this.fireError(r)})}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,_p.default)().timer.setTimeout((e,t)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:t}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};nr.ReadableStreamMessageReader=Rp});var Zy=w(rr=>{"use strict";h();Object.defineProperty(rr,"__esModule",{value:!0});rr.WriteableStreamMessageWriter=rr.AbstractMessageWriter=rr.MessageWriter=void 0;var Xy=Fr(),ps=Ui(),x0=Cp(),Yy=ji(),k0="Content-Length: ",Qy=`\r
|
|
2
2
|
`,C0;(function(n){function e(t){let r=t;return r&&ps.func(r.dispose)&&ps.func(r.onClose)&&ps.func(r.onError)&&ps.func(r.write)}n.is=e})(C0=rr.MessageWriter||(rr.MessageWriter={}));var el=class{constructor(){this.errorEmitter=new Yy.Emitter,this.closeEmitter=new Yy.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,t,r){this.errorEmitter.fire([this.asError(e),t,r])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:new Error(`Writer received error. Reason: ${ps.string(e.message)?e.message:"unknown"}`)}};rr.AbstractMessageWriter=el;var Dp;(function(n){function e(t){return t===void 0||typeof t=="string"?{charset:t??"utf-8",contentTypeEncoder:(0,Xy.default)().applicationJson.encoder}:{charset:t.charset??"utf-8",contentEncoder:t.contentEncoder,contentTypeEncoder:t.contentTypeEncoder??(0,Xy.default)().applicationJson.encoder}}n.fromOptions=e})(Dp||(Dp={}));var Fp=class extends el{constructor(e,t){super(),this.writable=e,this.options=Dp.fromOptions(t),this.errorCount=0,this.writeSemaphore=new x0.Semaphore(1),this.writable.onError(r=>this.fireError(r)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(r=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(r):r).then(r=>{let i=[];return i.push(k0,r.byteLength.toString(),Qy),i.push(Qy),this.doWrite(e,i,r)},r=>{throw this.fireError(r),r}))}async doWrite(e,t,r){try{return await this.writable.write(t.join(""),"ascii"),this.writable.write(r)}catch(i){return this.handleError(i,e),Promise.reject(i)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){this.writable.end()}};rr.WriteableStreamMessageWriter=Fp});var ew=w(tl=>{"use strict";h();Object.defineProperty(tl,"__esModule",{value:!0});tl.AbstractMessageBuffer=void 0;var T0=13,_0=10,E0=`\r
|
|
3
3
|
`,Pp=class{constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){let t=typeof e=="string"?this.fromString(e,this._encoding):e;this._chunks.push(t),this._totalLength+=t.byteLength}tryReadHeaders(e=!1){if(this._chunks.length===0)return;let t=0,r=0,i=0,o=0;e:for(;r<this._chunks.length;){let c=this._chunks[r];for(i=0;i<c.length;){switch(c[i]){case T0:switch(t){case 0:t=1;break;case 2:t=3;break;default:t=0}break;case _0:switch(t){case 1:t=2;break;case 3:t=4,i++;break e;default:t=0}break;default:t=0}i++}o+=c.byteLength,r++}if(t!==4)return;let s=this._read(o+i),a=new Map,l=this.toString(s,"ascii").split(E0);if(l.length<2)return a;for(let c=0;c<l.length-2;c++){let d=l[c],p=d.indexOf(":");if(p===-1)throw new Error("Message header must separate key and value using :");let m=d.substr(0,p),g=d.substr(p+1).trim();a.set(e?m.toLowerCase():m,g)}return a}tryReadBody(e){if(!(this._totalLength<e))return this._read(e)}get numberOfBytes(){return this._totalLength}_read(e){if(e===0)return this.emptyBuffer();if(e>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){let o=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(o)}if(this._chunks[0].byteLength>e){let o=this._chunks[0],s=this.asNative(o,e);return this._chunks[0]=o.slice(e),this._totalLength-=e,s}let t=this.allocNative(e),r=0,i=0;for(;e>0;){let o=this._chunks[i];if(o.byteLength>e){let s=o.slice(0,e);t.set(s,r),r+=e,this._chunks[i]=o.slice(e),this._totalLength-=e,e-=e}else t.set(o,r),r+=o.byteLength,this._chunks.shift(),this._totalLength-=o.byteLength,e-=o.byteLength}return t}};tl.AbstractMessageBuffer=Pp});var aw=w(j=>{"use strict";h();Object.defineProperty(j,"__esModule",{value:!0});j.createMessageConnection=j.ConnectionOptions=j.MessageStrategy=j.CancellationStrategy=j.CancellationSenderStrategy=j.CancellationReceiverStrategy=j.RequestCancellationReceiverStrategy=j.IdCancellationReceiverStrategy=j.ConnectionStrategy=j.ConnectionError=j.ConnectionErrors=j.LogTraceNotification=j.SetTraceNotification=j.TraceFormat=j.TraceValues=j.Trace=j.NullLogger=j.ProgressType=j.ProgressToken=void 0;var tw=Fr(),Me=Ui(),X=cp(),nw=hp(),ms=ji(),Mp=Ya(),gs;(function(n){n.type=new X.NotificationType("$/cancelRequest")})(gs||(gs={}));var rw;(function(n){function e(t){return typeof t=="string"||typeof t=="number"}n.is=e})(rw=j.ProgressToken||(j.ProgressToken={}));var fs;(function(n){n.type=new X.NotificationType("$/progress")})(fs||(fs={}));var Ip=class{constructor(){}};j.ProgressType=Ip;var Np;(function(n){function e(t){return Me.func(t)}n.is=e})(Np||(Np={}));j.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var ge;(function(n){n[n.Off=0]="Off",n[n.Messages=1]="Messages",n[n.Compact=2]="Compact",n[n.Verbose=3]="Verbose"})(ge=j.Trace||(j.Trace={}));var R0;(function(n){n.Off="off",n.Messages="messages",n.Compact="compact",n.Verbose="verbose"})(R0=j.TraceValues||(j.TraceValues={}));(function(n){function e(r){if(!Me.string(r))return n.Off;switch(r=r.toLowerCase(),r){case"off":return n.Off;case"messages":return n.Messages;case"compact":return n.Compact;case"verbose":return n.Verbose;default:return n.Off}}n.fromString=e;function t(r){switch(r){case n.Off:return"off";case n.Messages:return"messages";case n.Compact:return"compact";case n.Verbose:return"verbose";default:return"off"}}n.toString=t})(ge=j.Trace||(j.Trace={}));var cn;(function(n){n.Text="text",n.JSON="json"})(cn=j.TraceFormat||(j.TraceFormat={}));(function(n){function e(t){return Me.string(t)?(t=t.toLowerCase(),t==="json"?n.JSON:n.Text):n.Text}n.fromString=e})(cn=j.TraceFormat||(j.TraceFormat={}));var iw;(function(n){n.type=new X.NotificationType("$/setTrace")})(iw=j.SetTraceNotification||(j.SetTraceNotification={}));var zp;(function(n){n.type=new X.NotificationType("$/logTrace")})(zp=j.LogTraceNotification||(j.LogTraceNotification={}));var nl;(function(n){n[n.Closed=1]="Closed",n[n.Disposed=2]="Disposed",n[n.AlreadyListening=3]="AlreadyListening"})(nl=j.ConnectionErrors||(j.ConnectionErrors={}));var Vi=class n extends Error{constructor(e,t){super(t),this.code=e,Object.setPrototypeOf(this,n.prototype)}};j.ConnectionError=Vi;var ow;(function(n){function e(t){let r=t;return r&&Me.func(r.cancelUndispatched)}n.is=e})(ow=j.ConnectionStrategy||(j.ConnectionStrategy={}));var Lp;(function(n){function e(t){let r=t;return r&&(r.kind===void 0||r.kind==="id")&&Me.func(r.createCancellationTokenSource)&&(r.dispose===void 0||Me.func(r.dispose))}n.is=e})(Lp=j.IdCancellationReceiverStrategy||(j.IdCancellationReceiverStrategy={}));var sw;(function(n){function e(t){let r=t;return r&&r.kind==="request"&&Me.func(r.createCancellationTokenSource)&&(r.dispose===void 0||Me.func(r.dispose))}n.is=e})(sw=j.RequestCancellationReceiverStrategy||(j.RequestCancellationReceiverStrategy={}));var Op;(function(n){n.Message=Object.freeze({createCancellationTokenSource(t){return new Mp.CancellationTokenSource}});function e(t){return Lp.is(t)||sw.is(t)}n.is=e})(Op=j.CancellationReceiverStrategy||(j.CancellationReceiverStrategy={}));var Ap;(function(n){n.Message=Object.freeze({sendCancellation(t,r){return t.sendNotification(gs.type,{id:r})},cleanup(t){}});function e(t){let r=t;return r&&Me.func(r.sendCancellation)&&Me.func(r.cleanup)}n.is=e})(Ap=j.CancellationSenderStrategy||(j.CancellationSenderStrategy={}));var qp;(function(n){n.Message=Object.freeze({receiver:Op.Message,sender:Ap.Message});function e(t){let r=t;return r&&Op.is(r.receiver)&&Ap.is(r.sender)}n.is=e})(qp=j.CancellationStrategy||(j.CancellationStrategy={}));var Wp;(function(n){function e(t){let r=t;return r&&Me.func(r.handleMessage)}n.is=e})(Wp=j.MessageStrategy||(j.MessageStrategy={}));var D0;(function(n){function e(t){let r=t;return r&&(qp.is(r.cancellationStrategy)||ow.is(r.connectionStrategy)||Wp.is(r.messageStrategy))}n.is=e})(D0=j.ConnectionOptions||(j.ConnectionOptions={}));var dn;(function(n){n[n.New=1]="New",n[n.Listening=2]="Listening",n[n.Closed=3]="Closed",n[n.Disposed=4]="Disposed"})(dn||(dn={}));function F0(n,e,t,r){let i=t!==void 0?t:j.NullLogger,o=0,s=0,a=0,l="2.0",c,d=new Map,p,m=new Map,g=new Map,S,F=new nw.LinkedMap,P=new Map,I=new Set,x=new Map,y=ge.Off,R=cn.Text,O,W=dn.New,ke=new ms.Emitter,Fe=new ms.Emitter,jt=new ms.Emitter,Mt=new ms.Emitter,Tt=new ms.Emitter,_t=r&&r.cancellationStrategy?r.cancellationStrategy:qp.Message;function Pn(v){if(v===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+v.toString()}function ci(v){return v===null?"res-unknown-"+(++a).toString():"res-"+v.toString()}function $t(){return"not-"+(++s).toString()}function It(v,D){X.Message.isRequest(D)?v.set(Pn(D.id),D):X.Message.isResponse(D)?v.set(ci(D.id),D):v.set($t(),D)}function Er(v){}function Bt(){return W===dn.Listening}function Mn(){return W===dn.Closed}function Ye(){return W===dn.Disposed}function Rr(){(W===dn.New||W===dn.Listening)&&(W=dn.Closed,Fe.fire(void 0))}function is(v){ke.fire([v,void 0,void 0])}function Ai(v){ke.fire(v)}n.onClose(Rr),n.onError(is),e.onClose(Rr),e.onError(Ai);function Li(){S||F.size===0||(S=(0,tw.default)().timer.setImmediate(()=>{S=void 0,Nu()}))}function qi(v){X.Message.isRequest(v)?zu(v):X.Message.isNotification(v)?Au(v):X.Message.isResponse(v)?Ou(v):Aa(v)}function Nu(){if(F.size===0)return;let v=F.shift();try{let D=r?.messageStrategy;Wp.is(D)?D.handleMessage(v,qi):qi(v)}finally{Li()}}let di=v=>{try{if(X.Message.isNotification(v)&&v.method===gs.type.method){let D=v.params.id,z=Pn(D),U=F.get(z);if(X.Message.isRequest(U)){let be=r?.connectionStrategy,ze=be&&be.cancelUndispatched?be.cancelUndispatched(U,Er):void 0;if(ze&&(ze.error!==void 0||ze.result!==void 0)){F.delete(z),x.delete(D),ze.id=U.id,K(ze,v.method,Date.now()),e.write(ze).catch(()=>i.error("Sending response for canceled message failed."));return}}let Ce=x.get(D);if(Ce!==void 0){Ce.cancel(),Et(v);return}else I.add(D)}It(F,v)}finally{Li()}};function zu(v){if(Ye())return;function D(ce,Pe,fe){let Ve={jsonrpc:l,id:v.id};ce instanceof X.ResponseError?Ve.error=ce.toJson():Ve.result=ce===void 0?null:ce,K(Ve,Pe,fe),e.write(Ve).catch(()=>i.error("Sending response failed."))}function z(ce,Pe,fe){let Ve={jsonrpc:l,id:v.id,error:ce.toJson()};K(Ve,Pe,fe),e.write(Ve).catch(()=>i.error("Sending response failed."))}function U(ce,Pe,fe){ce===void 0&&(ce=null);let Ve={jsonrpc:l,id:v.id,result:ce};K(Ve,Pe,fe),e.write(Ve).catch(()=>i.error("Sending response failed."))}De(v);let Ce=d.get(v.method),be,ze;Ce&&(be=Ce.type,ze=Ce.handler);let Ae=Date.now();if(ze||c){let ce=v.id??String(Date.now()),Pe=Lp.is(_t.receiver)?_t.receiver.createCancellationTokenSource(ce):_t.receiver.createCancellationTokenSource(v);v.id!==null&&I.has(v.id)&&Pe.cancel(),v.id!==null&&x.set(ce,Pe);try{let fe;if(ze)if(v.params===void 0){if(be!==void 0&&be.numberOfParams!==0){z(new X.ResponseError(X.ErrorCodes.InvalidParams,`Request ${v.method} defines ${be.numberOfParams} params but received none.`),v.method,Ae);return}fe=ze(Pe.token)}else if(Array.isArray(v.params)){if(be!==void 0&&be.parameterStructures===X.ParameterStructures.byName){z(new X.ResponseError(X.ErrorCodes.InvalidParams,`Request ${v.method} defines parameters by name but received parameters by position`),v.method,Ae);return}fe=ze(...v.params,Pe.token)}else{if(be!==void 0&&be.parameterStructures===X.ParameterStructures.byPosition){z(new X.ResponseError(X.ErrorCodes.InvalidParams,`Request ${v.method} defines parameters by position but received parameters by name`),v.method,Ae);return}fe=ze(v.params,Pe.token)}else c&&(fe=c(v.method,v.params,Pe.token));let Ve=fe;fe?Ve.then?Ve.then(ft=>{x.delete(ce),D(ft,v.method,Ae)},ft=>{x.delete(ce),ft instanceof X.ResponseError?z(ft,v.method,Ae):ft&&Me.string(ft.message)?z(new X.ResponseError(X.ErrorCodes.InternalError,`Request ${v.method} failed with message: ${ft.message}`),v.method,Ae):z(new X.ResponseError(X.ErrorCodes.InternalError,`Request ${v.method} failed unexpectedly without providing any details.`),v.method,Ae)}):(x.delete(ce),D(fe,v.method,Ae)):(x.delete(ce),U(fe,v.method,Ae))}catch(fe){x.delete(ce),fe instanceof X.ResponseError?D(fe,v.method,Ae):fe&&Me.string(fe.message)?z(new X.ResponseError(X.ErrorCodes.InternalError,`Request ${v.method} failed with message: ${fe.message}`),v.method,Ae):z(new X.ResponseError(X.ErrorCodes.InternalError,`Request ${v.method} failed unexpectedly without providing any details.`),v.method,Ae)}}else z(new X.ResponseError(X.ErrorCodes.MethodNotFound,`Unhandled method ${v.method}`),v.method,Ae)}function Ou(v){if(!Ye())if(v.id===null)v.error?i.error(`Received response message without id: Error is:
|
|
4
4
|
${JSON.stringify(v.error,void 0,4)}`):i.error("Received response message without id. No further error information provided.");else{let D=v.id,z=P.get(D);if(Z_(v,z),z!==void 0){P.delete(D);try{if(v.error){let U=v.error;z.reject(new X.ResponseError(U.code,U.message,U.data))}else if(v.result!==void 0)z.resolve(v.result);else throw new Error("Should never happen.")}catch(U){U.message?i.error(`Response handler '${z.method}' failed with message: ${U.message}`):i.error(`Response handler '${z.method}' failed unexpectedly.`)}}}}function Au(v){if(Ye())return;let D,z;if(v.method===gs.type.method){let U=v.params.id;I.delete(U),Et(v);return}else{let U=m.get(v.method);U&&(z=U.handler,D=U.type)}if(z||p)try{if(Et(v),z)if(v.params===void 0)D!==void 0&&D.numberOfParams!==0&&D.parameterStructures!==X.ParameterStructures.byName&&i.error(`Notification ${v.method} defines ${D.numberOfParams} params but received none.`),z();else if(Array.isArray(v.params)){let U=v.params;v.method===fs.type.method&&U.length===2&&rw.is(U[0])?z({token:U[0],value:U[1]}):(D!==void 0&&(D.parameterStructures===X.ParameterStructures.byName&&i.error(`Notification ${v.method} defines parameters by name but received parameters by position`),D.numberOfParams!==v.params.length&&i.error(`Notification ${v.method} defines ${D.numberOfParams} params but received ${U.length} arguments`)),z(...U))}else D!==void 0&&D.parameterStructures===X.ParameterStructures.byPosition&&i.error(`Notification ${v.method} defines parameters by position but received parameters by name`),z(v.params);else p&&p(v.method,v.params)}catch(U){U.message?i.error(`Notification handler '${v.method}' failed with message: ${U.message}`):i.error(`Notification handler '${v.method}' failed unexpectedly.`)}else jt.fire(v)}function Aa(v){if(!v){i.error("Received empty message.");return}i.error(`Received message which is neither a response nor a notification message:
|
|
@@ -563,4 +563,4 @@ In order to let ::-webkit-progress-value take effect, -webkit-appearance needs t
|
|
|
563
563
|
`).join("")+c.source.slice(c.blockStartPosition.end,c.blockEndPosition.start).replace(/\n$/,""),m=xO.TextDocument.create(i.uri,"json",i.version,p),g=t.parseStylesheet(m);return[m,g]}}}};ch.CSSLanguageService=Fb});var m1=w(hh=>{"use strict";h();Object.defineProperty(hh,"__esModule",{value:!0});hh.SchemaTranslationStringDefinitionProvider=void 0;var p1=Y(),dh=$(),Pb=he(),Mb=class{documentManager;getDefaultSchemaLocaleSourceCode;constructor(e,t){this.documentManager=e,this.getDefaultSchemaLocaleSourceCode=t}async definitions(e,t,r){let i=this.documentManager.get(e.textDocument.uri);if(!i||i.type!==dh.SourceCodeType.LiquidHtml)return[];if(t.type!==p1.NodeTypes.TextNode)return[];if(!r.find(kO))return[];let s=await i.getSchema();if(!s||s.ast instanceof Error)return[];let a=await this.getDefaultSchemaLocaleSourceCode(e.textDocument.uri);if(!a||a.type!==dh.SourceCodeType.JSON||a.ast instanceof Error)return[];let c=i.textDocument.offsetAt(e.position)-s.offset,[d,p]=(0,dh.findJSONNode)(s.ast,c);if(d.type!=="Literal")return[];if(typeof d.value!="string"||!d.value.startsWith("t:"))return[];let m=d.value.slice(2).trim(),g=(0,dh.nodeAtPath)(a.ast,m.split("."));if(!g)return[];let S=Pb.Range.create(a.textDocument.positionAt(g.loc.start.offset),a.textDocument.positionAt(g.loc.end.offset)),F=Pb.Range.create(i.textDocument.positionAt(s.offset+d.loc.start.offset),i.textDocument.positionAt(s.offset+d.loc.end.offset));return[Pb.LocationLink.create(a.textDocument.uri,S,S,F)]}};hh.SchemaTranslationStringDefinitionProvider=Mb;function kO(n){return n.type===p1.NodeTypes.LiquidRawTag&&n.name==="schema"}});var b1=w(uh=>{"use strict";h();Object.defineProperty(uh,"__esModule",{value:!0});uh.TranslationStringDefinitionProvider=void 0;var f1=Y(),g1=$(),Ib=he(),Nb=class{documentManager;getDefaultLocaleSourceCode;constructor(e,t){this.documentManager=e,this.getDefaultLocaleSourceCode=t}async definitions(e,t,r){let i=this.documentManager.get(e.textDocument.uri)?.textDocument;if(!i)return[];if(t.type!==f1.NodeTypes.String)return[];let o=r.at(-1);if(!o||o.type!==f1.NodeTypes.LiquidVariable)return[];if(o.expression!==t)return[];if(o.filters.length===0||!["t","translate"].includes(o.filters[0].name))return[];let s=await this.getDefaultLocaleSourceCode(e.textDocument.uri);if(!s||s.type!==g1.SourceCodeType.JSON||s.ast instanceof Error)return[];let a=t.value,l=(0,g1.nodeAtPath)(s.ast,a.split("."));if(!l)return[];let c=Ib.Range.create(s.textDocument.positionAt(l.loc.start.offset),s.textDocument.positionAt(l.loc.end.offset)),d=Ib.Range.create(i.positionAt(t.position.start),i.positionAt(t.position.end));return[Ib.LocationLink.create(s.textDocument.uri,c,c,d)]}};uh.TranslationStringDefinitionProvider=Nb});var y1=w(ph=>{"use strict";h();Object.defineProperty(ph,"__esModule",{value:!0});ph.DefinitionProvider=void 0;var v1=$(),CO=m1(),TO=b1(),zb=class{documentManager;providers;constructor(e,t,r){this.documentManager=e,this.providers=[new TO.TranslationStringDefinitionProvider(e,t),new CO.SchemaTranslationStringDefinitionProvider(e,r)]}async definitions(e){let t=this.documentManager.get(e.textDocument.uri);if(!t||t.type!==v1.SourceCodeType.LiquidHtml||t.ast instanceof Error)return null;let{textDocument:r}=t,[i,o]=(0,v1.findCurrentNode)(t.ast,r.offsetAt(e.position)),s=await Promise.all(this.providers.map(a=>a.definitions(e,i,o))).then(a=>a.flat());return s.length>0?s:null}};ph.DefinitionProvider=zb});var Ob=w(mh=>{"use strict";h();Object.defineProperty(mh,"__esModule",{value:!0});mh.offenseToDiagnostic=EO;mh.offenseSeverity=FO;var ri=te(),kr=$(),_O=kr.allChecks.reduce((n,e)=>{let t=e.meta.docs.url,r=e.meta.code;return t!==void 0&&(n[r]=t),n},{});function EO(n){let e=ri.Diagnostic.create(RO(n),n.message,DO(n),n.check,"theme-check"),t=_O[n.check];return t&&(e.codeDescription={href:t}),e}function RO({start:n,end:e}){return{start:{line:n.line,character:n.character},end:{line:e.line,character:e.character}}}function DO(n){switch(n.severity){case kr.Severity.INFO:return ri.DiagnosticSeverity.Information;case kr.Severity.WARNING:return ri.DiagnosticSeverity.Warning;case kr.Severity.ERROR:return ri.DiagnosticSeverity.Error;default:return(0,kr.assertNever)(n.severity)}}function FO(n){switch(n.severity){case ri.DiagnosticSeverity.Hint:case ri.DiagnosticSeverity.Information:return kr.Severity.INFO;case ri.DiagnosticSeverity.Warning:return kr.Severity.WARNING;case ri.DiagnosticSeverity.Error:return kr.Severity.ERROR;default:return kr.Severity.INFO}}});var w1=w(fh=>{"use strict";h();Object.defineProperty(fh,"__esModule",{value:!0});fh.DiagnosticsManager=void 0;var PO=Ob(),Ab=class{connection;diagnostics=new Map;constructor(e){this.connection=e}get(e){return this.diagnostics.get(e)}set(e,t,r){let i=r.map((o,s)=>({offense:o,diagnostic:(0,PO.offenseToDiagnostic)(o),id:s}));this.diagnostics.set(e,{uri:e,version:t,anomalies:i}),this.connection.sendDiagnostics({uri:e,version:t,diagnostics:i.map(o=>o.diagnostic)})}clear(e){this.diagnostics.delete(e),this.connection.sendDiagnostics({uri:e,version:void 0,diagnostics:[]})}};fh.DiagnosticsManager=Ab});var S1=w(Lb=>{"use strict";h();Object.defineProperty(Lb,"__esModule",{value:!0});Lb.makeRunChecks=IO;var kt=$(),MO=Ob();function IO(n,e,{fs:t,loadConfig:r,themeDocset:i,jsonValidationSet:o,getMetafieldDefinitions:s,cssLanguageService:a,themeGraphManager:l}){return async function(d){let p=(0,kt.makeFileExists)(t),m=await Promise.all(d.map(F=>(0,kt.findRoot)(F,p))),g=new Set(m.filter(F=>!!F));await Promise.all([...g].map(S));return;async function S(F){let P=await r(F,t),I=n.theme(P.rootUri),x=a?await Promise.all(I.map(O=>NO(a,O))).then(O=>O.flat()):[],R=[...await(0,kt.check)(I,P,{fs:t,themeDocset:i,jsonValidationSet:o,getMetafieldDefinitions:s,async getReferences(O){return l?l.getReferences(O):[]},async getDependencies(O){return l?l.getDependencies(O):[]},getCSSClassesForURI(O){let W=n.get(O);return W?.type===kt.SourceCodeType.LiquidHtml?W.getCSSClasses():O.endsWith(".css")?(0,kt.extractCSSClassesFromAssetUri)(O,t):(0,kt.extractCSSClassesFromLiquidUri)(O,t)},async getBlockSchema(O){let W=kt.path.join(P.rootUri,"blocks",`${O}.liquid`),ke=n.get(W);return ke?.type!==kt.SourceCodeType.LiquidHtml?void 0:await ke.getSchema()},async getSectionSchema(O){let W=kt.path.join(P.rootUri,"sections",`${O}.liquid`),ke=n.get(W);return ke?.type!==kt.SourceCodeType.LiquidHtml?void 0:await ke.getSchema()},async getDocDefinition(O){let W=kt.path.join(P.rootUri,O),ke=n.get(W);if(ke?.type===kt.SourceCodeType.LiquidHtml)return ke.getLiquidDoc()}}),...x];for(let O of I){let W=R.filter(ke=>ke.uri===O.uri);e.set(O.uri,O.version,W)}}}}async function NO(n,e){return e.type!==kt.SourceCodeType.LiquidHtml?[]:(await n.diagnostics({textDocument:{uri:e.uri}})).map(r=>({check:"css",message:r.message,end:{index:e.textDocument.offsetAt(r.range.end),line:r.range.end.line,character:r.range.end.character},start:{index:e.textDocument.offsetAt(r.range.start),line:r.range.start.line,character:r.range.start.character},severity:(0,MO.offenseSeverity)(r),uri:e.uri,type:kt.SourceCodeType.LiquidHtml})).filter(r=>r.severity!==kt.Severity.INFO)}});var x1=w(Bo=>{"use strict";h();Object.defineProperty(Bo,"__esModule",{value:!0});Bo.makeRunChecks=Bo.DiagnosticsManager=void 0;var zO=w1();Object.defineProperty(Bo,"DiagnosticsManager",{enumerable:!0,get:function(){return zO.DiagnosticsManager}});var OO=S1();Object.defineProperty(Bo,"makeRunChecks",{enumerable:!0,get:function(){return OO.makeRunChecks}})});var bh=w(gh=>{"use strict";h();Object.defineProperty(gh,"__esModule",{value:!0});gh.getHtmlElementNameRanges=AO;gh.isDanglingOpenHtmlElement=T1;var qb=Y(),k1=te(),C1=tm();function AO(n,e,t,r){let i=null,o=e.at(-1);if(o&&o.type===qb.NodeTypes.HtmlElement&&o.name.length>0&&(0,C1.isCovered)(r.offsetAt(t.position),{start:o.name[0].position.start,end:o.name.at(-1).position.end})&&(i=o),n.type===qb.NodeTypes.HtmlElement&&n.name.length>0&&(0,C1.isCovered)(r.offsetAt(t.position),n.blockEndPosition)&&(i=n),!i||T1(i))return null;let s=i.name,a=s.at(0),l=s.at(-1),c=k1.Range.create(r.positionAt(a.position.start),r.positionAt(l.position.end)),d=k1.Range.create(r.positionAt(i.blockEndPosition.start+2),r.positionAt(i.blockEndPosition.end-1));return[c,d]}function T1(n){return n.type===qb.NodeTypes.HtmlElement&&n.blockEndPosition.start===n.blockEndPosition.end}});var _1=w(vh=>{"use strict";h();Object.defineProperty(vh,"__esModule",{value:!0});vh.HtmlTagNameDocumentHighlightsProvider=void 0;var LO=bh(),Wb=class{documentManager;constructor(e){this.documentManager=e}async documentHighlights(e,t,r){let i=this.documentManager.get(r.textDocument.uri)?.textDocument;if(!i)return null;let o=(0,LO.getHtmlElementNameRanges)(e,t,r,i);return o?o.map(s=>({range:s})):null}};vh.HtmlTagNameDocumentHighlightsProvider=Wb});var R1=w(wh=>{"use strict";h();Object.defineProperty(wh,"__esModule",{value:!0});wh.LiquidBlockTagDocumentHighlightsProvider=void 0;var yh=Y(),Hb=te(),Ub=class{documentManager;constructor(e){this.documentManager=e}async documentHighlights(e,t,r){let i=this.documentManager.get(r.textDocument.uri)?.textDocument;if(!i||(E1(e)&&(e=t.at(-1)),!qO(e)||!e.blockEndPosition))return null;let o=e.source.indexOf(e.name,e.blockStartPosition.start),s=e.source.indexOf("end"+e.name,e.blockEndPosition.start),a=[Hb.Range.create(i.positionAt(o),i.positionAt(o+e.name.length)),Hb.Range.create(i.positionAt(s),i.positionAt(s+3+e.name.length))];if(WO(e)&&e.children&&e.children.every(E1))for(let l of e.children.filter(c=>c.name!==null)){let c=e.source.indexOf(l.name,l.blockStartPosition.start);a.push(Hb.Range.create(i.positionAt(c),i.positionAt(c+l.name.length)))}return a.map(l=>({range:l}))}};wh.LiquidBlockTagDocumentHighlightsProvider=Ub;function E1(n){return n.type===yh.NodeTypes.LiquidBranch}function qO(n){return n.type===yh.NodeTypes.LiquidTag||n.type===yh.NodeTypes.LiquidRawTag}function WO(n){return n.type===yh.NodeTypes.LiquidTag}});var D1=w(Vo=>{"use strict";h();Object.defineProperty(Vo,"__esModule",{value:!0});Vo.LiquidBlockTagDocumentHighlightsProvider=Vo.HtmlTagNameDocumentHighlightsProvider=void 0;var HO=_1();Object.defineProperty(Vo,"HtmlTagNameDocumentHighlightsProvider",{enumerable:!0,get:function(){return HO.HtmlTagNameDocumentHighlightsProvider}});var UO=R1();Object.defineProperty(Vo,"LiquidBlockTagDocumentHighlightsProvider",{enumerable:!0,get:function(){return UO.LiquidBlockTagDocumentHighlightsProvider}})});var P1=w(ii=>{"use strict";h();Object.defineProperty(ii,"__esModule",{value:!0});ii.DocumentHighlightsProvider=ii.PREVENT_DEFAULT=void 0;var jO=$(),$O=$(),F1=D1();ii.PREVENT_DEFAULT=[];var jb=class{documentManager;providers;constructor(e){this.documentManager=e,this.providers=[new F1.HtmlTagNameDocumentHighlightsProvider(e),new F1.LiquidBlockTagDocumentHighlightsProvider(e)]}async documentHighlights(e){let t=this.documentManager.get(e.textDocument.uri);if(!t||t.type!==jO.SourceCodeType.LiquidHtml||t.ast instanceof Error)return ii.PREVENT_DEFAULT;let[r,i]=(0,$O.findCurrentNode)(t.ast,t.textDocument.offsetAt(e.position)),o=this.providers.map(a=>a.documentHighlights(r,i,e).catch(()=>null));return(await Promise.all(o)).find(Boolean)??ii.PREVENT_DEFAULT}};ii.DocumentHighlightsProvider=jb});var I1=w(Sh=>{"use strict";h();Object.defineProperty(Sh,"__esModule",{value:!0});Sh.DocumentLinksProvider=void 0;var $b=Y(),BO=$(),Go=te(),Ko=La(),VO=$(),Bb=class{documentManager;findThemeRootURI;constructor(e,t){this.documentManager=e,this.findThemeRootURI=t}async documentLinks(e){let t=this.documentManager.get(e);if(!t||t.type!==BO.SourceCodeType.LiquidHtml||t.ast instanceof Error)return[];let r=await this.findThemeRootURI(e);if(!r)return[];let i=GO(t.textDocument,Ko.URI.parse(r));return(0,VO.visit)(t.ast,i)}};Sh.DocumentLinksProvider=Bb;function GO(n,e){return{LiquidTag(t){if((t.name==="render"||t.name==="include")&&typeof t.markup!="string"&&M1(t.markup.snippet)){let r=t.markup.snippet;return Go.DocumentLink.create(Fa(n,r),Ko.Utils.resolvePath(e,"snippets",r.value+".liquid").toString())}if(t.name==="section"&&typeof t.markup!="string"){let r=t.markup.name;return Go.DocumentLink.create(Fa(n,r),Ko.Utils.resolvePath(e,"sections",r.value+".liquid").toString())}if(t.name===$b.NamedTags.block&&typeof t.markup!="string"){let r=t.markup.name;return Go.DocumentLink.create(Fa(n,r),Ko.Utils.resolvePath(e,"blocks",r.value+".liquid").toString())}if(t.name===$b.NamedTags.content_for&&typeof t.markup!="string"){let r=t.markup.args.find(i=>i.name==="type");if(r&&r.value.type==="String")return Go.DocumentLink.create(Fa(n,r.value),Ko.Utils.resolvePath(e,"blocks",r.value.value+".liquid").toString())}},LiquidVariable(t){if(t.filters.length===0||t.filters[0].name!=="asset_url"||!M1(t.expression))return;let r=t.expression;return Go.DocumentLink.create(Fa(n,t.expression),Ko.Utils.resolvePath(e,"assets",r.value).toString())}}}function Fa(n,e){let t=n.positionAt(e.position.start+1),r=n.positionAt(e.position.end-1);return Go.Range.create(t,r)}function M1(n){return n.type===$b.NodeTypes.String}});var N1=w(xh=>{"use strict";h();Object.defineProperty(xh,"__esModule",{value:!0});xh.DocumentLinksProvider=void 0;var KO=I1();Object.defineProperty(xh,"DocumentLinksProvider",{enumerable:!0,get:function(){return KO.DocumentLinksProvider}})});var z1=w(Pa=>{"use strict";h();Object.defineProperty(Pa,"__esModule",{value:!0});Pa.Progress=void 0;Pa.percent=JO;var kh=he(),Vb=class n{connection;progressToken;constructor(e,t){this.connection=e,this.progressToken=t}static create(e,t,r){return!e||!t||!t.hasProgressSupport?{start:async()=>{},report:async()=>{},end:async()=>{}}:new n(e,r)}async start(e){await this.connection.sendRequest(kh.WorkDoneProgressCreateRequest.type,{token:this.progressToken}),await this.connection.sendProgress(kh.WorkDoneProgress.type,this.progressToken,{kind:"begin",title:e})}async report(e,t){await this.connection.sendProgress(kh.WorkDoneProgress.type,this.progressToken,{kind:"report",message:t,percentage:e})}async end(e){await this.connection.sendProgress(kh.WorkDoneProgress.type,this.progressToken,{kind:"end",message:e})}};Pa.Progress=Vb;function JO(n,e,t=0){return Math.round(t+n/e*(100-t))}});var A1=w(Ch=>{"use strict";h();Object.defineProperty(Ch,"__esModule",{value:!0});Ch.DocumentManager=void 0;var lt=$(),XO=(cs(),Kt(Ba)),O1=z1(),YO=$(),QO=n=>new Promise(e=>setTimeout(e,n)),Gb=class{fs;connection;clientCapabilities;getModeForUri;isValidSchema;sourceCodes;recentlyRenamed;constructor(e,t,r,i,o){this.fs=e,this.connection=t,this.clientCapabilities=r,this.getModeForUri=i,this.isValidSchema=o,this.sourceCodes=new Map,this.recentlyRenamed=new Set}open(e,t,r){return this.set(e,t,r)}change(e,t,r){return this.set(e,t,r)}async changeFromDisk(e){if(!this.fs)throw new Error("Cannot call changeFromDisk without a FileSystem");this.change(e,await this.fs.readFile(e),void 0)}close(e){let t=this.sourceCodes.get(e);if(t)return this.set(e,t.source,void 0)}delete(e){return this.sourceCodes.delete(e)}rename(e,t){this.trackRename(e,t);let r=this.sourceCodes.get(e);r&&(this.sourceCodes.delete(e),this.set(t,r.source,r.version))}theme(e,t=!1){return[...this.sourceCodes.values()].filter(r=>r.uri.startsWith(e)).filter(r=>t||r.version!==void 0)}get openDocuments(){return[...this.sourceCodes.values()].filter(e=>e.version!==void 0)}get(e){return this.sourceCodes.get(lt.path.normalize(e))}has(e){return this.sourceCodes.has(lt.path.normalize(e))}hasRecentRename(e){return this.recentlyRenamed.has(e)}clearRecentRename(e){this.recentlyRenamed.delete(e)}set(e,t,r){e=lt.path.normalize(e),!(!/\.(json|liquid)$/.test(e)||/\.(s?css|js).liquid$/.test(e))&&this.sourceCodes.set(e,this.augmentedSourceCode(e,t,r))}preload=(0,lt.memoize)(async e=>{if(!this.fs)throw new Error("Cannot call preload without a FileSystem");let{fs:t,connection:r,clientCapabilities:i}=this,o=O1.Progress.create(r,i,`preload#${e}`);o.start("Initializing Liquid LSP"),e.endsWith("/")||(e+="/");let s=(await Promise.all(["assets","blocks","config","layout","locales","sections","snippets","templates"].map(c=>(0,lt.recursiveReadDirectory)(t,lt.path.join(e,c),([d])=>/\.(liquid|json)$/.test(d)&&!this.sourceCodes.has(d)).catch(()=>[])))).flat();o.report(10,"Preloading files");let[a,l]=[0,s.length];await Promise.all(s.map(async c=>{try{this.set(c,await t.readFile(c),void 0)}catch(d){console.error("Failed to preload",c,d)}if(++a%10===0){let d=`Preloading files [${a}/${l}]`;o.report((0,O1.percent)(a,l,10),d)}})),o.end("Completed")},e=>e);augmentedSourceCode(e,t,r){let i=(0,lt.toSourceCode)(e,t,r),o=XO.TextDocument.create(e,i.type,i.version??0,i.source);switch(i.type){case lt.SourceCodeType.JSON:return{...i,textDocument:o};case lt.SourceCodeType.LiquidHtml:return{...i,textDocument:o,getSchema:(0,lt.memo)(async()=>{if(!this.getModeForUri||!this.isValidSchema)return;let s=await this.getModeForUri(e);return(0,lt.toSchema)(s,e,i,this.isValidSchema,!1)}),getLiquidDoc:(0,lt.memo)(async()=>{let s=i.ast;if(!(0,lt.isError)(s))return(0,YO.extractDocDefinition)(e,s)}),getCSSClasses:(0,lt.memo)(async()=>{let s=i.ast;return(0,lt.isError)(s)?new Set:(0,lt.extractCSSClassesFromLiquidAST)(s)})};default:return(0,lt.assertNever)(i)}}trackRename(e,t){this.recentlyRenamed.add(e),this.recentlyRenamed.add(t),QO(2e3).then(()=>{this.clearRecentRename(e),this.clearRecentRename(t)})}};Ch.DocumentManager=Gb});var q1=w(Jo=>{"use strict";h();Object.defineProperty(Jo,"__esModule",{value:!0});Jo.isJsonSourceCode=Jo.isLiquidSourceCode=void 0;var L1=$(),ZO=n=>n.type===L1.SourceCodeType.LiquidHtml;Jo.isLiquidSourceCode=ZO;var eA=n=>n.type===L1.SourceCodeType.JSON;Jo.isJsonSourceCode=eA});var Ni=w(Cr=>{"use strict";h();var tA=Cr&&Cr.__createBinding||(Object.create?(function(n,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,r,i)}):(function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]})),nA=Cr&&Cr.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&tA(e,n,t)};Object.defineProperty(Cr,"__esModule",{value:!0});Cr.DocumentManager=void 0;var rA=A1();Object.defineProperty(Cr,"DocumentManager",{enumerable:!0,get:function(){return rA.DocumentManager}});nA(q1(),Cr)});var W1=w(Th=>{"use strict";h();Object.defineProperty(Th,"__esModule",{value:!0});Th.BracketsAutoclosingOnTypeFormattingProvider=void 0;var Tn=he(),Kb=class{onTypeFormatting(e,t){let r=e.textDocument,i=t.ch,{line:o,character:s}=t.position;if(i===" "&&s<=2||s<=1)return null;let a=Tn.Range.create(Tn.Position.create(o,0),Tn.Position.create(o+1,0)),l=r.getText(a),c=i===" "?s-2:s-1;switch(l.at(c)){case"{":case"%":{let p=l.slice(c-1,c+4);if(p==="{{ }}"||p==="{% %}")return[Tn.TextEdit.insert(Tn.Position.create(o,c+1)," ")]}case"-":{if(c<3)return null;let p=l.slice(c-3,c+4);if(p==="{{ - }}"||p==="{% - %}")return[Tn.TextEdit.replace(Tn.Range.create(Tn.Position.create(o,c-1),Tn.Position.create(o,c+1)),"- "),Tn.TextEdit.insert(Tn.Position.create(o,c+2),"-")]}}return null}};Th.BracketsAutoclosingOnTypeFormattingProvider=Kb});var $1=w(_h=>{"use strict";h();Object.defineProperty(_h,"__esModule",{value:!0});_h.HtmlElementAutoclosingOnTypeFormattingProvider=void 0;var Ct=Y(),oi=he(),j1=$(),Jb=n=>setTimeout(n,10),Xb=class{setCursorPosition;constructor(e){this.setCursorPosition=e}onTypeFormatting(e,t){let r=e.textDocument,i=t.ch,{line:o,character:s}=t.position;switch(i){case">":{let a=e.ast;if(a instanceof Ct.LiquidHTMLASTParsingError&&a.unclosed&&a.unclosed.type===Ct.NodeTypes.HtmlElement&&(a.unclosed.blockStartPosition.end===r.offsetAt(t.position)||iA(a.unclosed,H1(r,t.position))))return Jb(()=>this.setCursorPosition(r,t.position)),[oi.TextEdit.insert(oi.Position.create(o,s),`</${a.unclosed.name}>`)];if(a instanceof Ct.LiquidHTMLASTParsingError){let l=H1(r,t.position);if(l&&U1(l))return Jb(()=>this.setCursorPosition(r,t.position)),[oi.TextEdit.insert(oi.Position.create(o,s),`</${Yb(l)}>`)]}else if(!(a instanceof Error)){let[l]=(0,j1.findCurrentNode)(a,r.offsetAt(t.position));if(U1(l))return Jb(()=>this.setCursorPosition(r,t.position)),[oi.TextEdit.insert(oi.Position.create(o,s),`</${Yb(l)}>`)]}}}return null}};_h.HtmlElementAutoclosingOnTypeFormattingProvider=Xb;function H1(n,e){let t=n.getText(oi.Range.create(oi.Position.create(0,0),e));try{let r=(0,Ct.toLiquidHtmlAST)(t,{allowUnclosedDocumentNode:!0,mode:"tolerant"}),[i,o]=(0,j1.findCurrentNode)(r,n.offsetAt(e));return o.at(-1)?.type===Ct.NodeTypes.HtmlElement||i.type===Ct.NodeTypes.LiquidBranch?o.at(-1):i}catch{return null}}function iA(n,e){return e===null||!("blockStartPosition"in e)?!1:[Ct.NodeTypes.HtmlElement,Ct.NodeTypes.LiquidTag,Ct.NodeTypes.HtmlRawNode].includes(n.type)&&Yb(e)===n.name}function U1(n){return n!==null&&n.type===Ct.NodeTypes.HtmlElement&&n.blockEndPosition.start===n.blockEndPosition.end}function Yb(n){switch(n.type){case Ct.NodeTypes.HtmlElement:case Ct.NodeTypes.HtmlDanglingMarkerClose:case Ct.NodeTypes.HtmlSelfClosingElement:return n.name.map(e=>e.type===Ct.NodeTypes.TextNode?e.value:e.type===Ct.NodeTypes.LiquidVariableOutput?typeof e.markup=="string"?`{{${e.markup.trim()}}}`:`{{${e.markup.rawSource}}}`:e.source.slice(e.position.start,e.position.end)).join("");default:return"name"in n&&typeof n.name=="string"?n.name:null}}});var B1=w(Eh=>{"use strict";h();Object.defineProperty(Eh,"__esModule",{value:!0});Eh.OnTypeFormattingProvider=void 0;var oA=W1(),sA=$1(),Qb=class{documentManager;setCursorPosition;providers;constructor(e,t=async()=>{}){this.documentManager=e,this.setCursorPosition=t,this.providers=[new oA.BracketsAutoclosingOnTypeFormattingProvider,new sA.HtmlElementAutoclosingOnTypeFormattingProvider(t)]}async onTypeFormatting(e){let t=this.documentManager.get(e.textDocument.uri);return t?this.providers.map(i=>i.onTypeFormatting(t,e)).find(i=>i!==null)??null:null}};Eh.OnTypeFormattingProvider=Qb});var V1=w(Rh=>{"use strict";h();Object.defineProperty(Rh,"__esModule",{value:!0});Rh.OnTypeFormattingProvider=void 0;var aA=B1();Object.defineProperty(Rh,"OnTypeFormattingProvider",{enumerable:!0,get:function(){return aA.OnTypeFormattingProvider}})});var J1=w(Dh=>{"use strict";h();Object.defineProperty(Dh,"__esModule",{value:!0});Dh.BlockParameterHoverProvider=void 0;var G1=Y(),lA=te(),K1=Ks(),Zb=class{getBlockParametersForURI;getSchemaTranslationsForURI;constructor(e,t){this.getBlockParametersForURI=e,this.getSchemaTranslationsForURI=t}async hover(e,t,r){let i=t.at(-1);if(e.type!==G1.NodeTypes.NamedArgument||i?.type!==G1.NodeTypes.BlockMarkup)return null;let s=(await this.getBlockParametersForURI(r.textDocument.uri,i.name.value))?.get(e.name);if(!s)return null;let a=await(0,K1.getBlockParameterTranslations)(this.getSchemaTranslationsForURI,r.textDocument.uri,[s]);return{contents:{kind:lA.MarkupKind.Markdown,value:(0,K1.formatBlockParameter)(s,a)}}}};Dh.BlockParameterHoverProvider=Zb});var X1=w(Fh=>{"use strict";h();Object.defineProperty(Fh,"__esModule",{value:!0});Fh.LiquidTagHoverProvider=void 0;var ev=Y(),cA=Lt(),tv=class{themeDocset;constructor(e){this.themeDocset=e}async hover(e){if(e.type!==ev.NodeTypes.LiquidTag&&e.type!==ev.NodeTypes.LiquidRawTag&&e.type!==ev.NodeTypes.LiquidBranch)return null;let t=e.name,i=(await this.themeDocset.tags()).find(o=>o.name===t);return i?{contents:{kind:"markdown",value:(0,cA.render)(i,void 0,"tag")}}:null}};Fh.LiquidTagHoverProvider=tv});var Y1=w(Ph=>{"use strict";h();Object.defineProperty(Ph,"__esModule",{value:!0});Ph.LiquidFilterHoverProvider=void 0;var dA=Y(),hA=Lt(),nv=class{themeDocset;constructor(e){this.themeDocset=e}async hover(e){if(e.type!==dA.NodeTypes.LiquidFilter)return null;let t=e.name,i=(await this.themeDocset.filters()).find(o=>o.name===t);return i?{contents:{kind:"markdown",value:(0,hA.render)(i,void 0,"filter")}}:null}};Ph.LiquidFilterHoverProvider=nv});var Z1=w(Mh=>{"use strict";h();Object.defineProperty(Mh,"__esModule",{value:!0});Mh.LiquidFilterArgumentHoverProvider=void 0;var Q1=Y(),uA=Lt(),rv=class{themeDocset;constructor(e){this.themeDocset=e}async hover(e,t){let r=t.at(-1);if(!r||r.type!==Q1.NodeTypes.LiquidFilter||e.type!==Q1.NodeTypes.NamedArgument)return null;let i=r.name,s=(await this.themeDocset.filters()).find(l=>l.name===i);if(!s)return null;let a=s.parameters?.find(l=>l.name===e.name);return a?{contents:{kind:"markdown",value:(0,uA.render)(a,void 0,"filter")}}:null}};Mh.LiquidFilterArgumentHoverProvider=rv});var tT=w(Ih=>{"use strict";h();Object.defineProperty(Ih,"__esModule",{value:!0});Ih.LiquidObjectHoverProvider=void 0;var iv=Y(),ov=Ur(),eT=Lt(),sv=class{typeSystem;constructor(e){this.typeSystem=e}async hover(e,t,r){if(e.type!==iv.NodeTypes.VariableLookup&&e.type!==iv.NodeTypes.AssignMarkup||!e.name)return null;let i=e;i.type===iv.NodeTypes.VariableLookup&&(i={...e,lookups:[]});let o=await this.typeSystem.inferType(i,t[0],r.textDocument.uri),s=await this.typeSystem.objectMap(r.textDocument.uri,t[0]),a=s[(0,ov.isArrayType)(o)?o.valueType:(0,ov.getBaseType)(o)];if(o===ov.Unknown)return null;if(!a){let l=s[e.name]??{};return{contents:{kind:"markdown",value:(0,eT.render)({...l,name:e.name},o,"object")}}}return{contents:{kind:"markdown",value:(0,eT.render)({...a,name:e.name},o,"object")}}}};Ih.LiquidObjectHoverProvider=sv});var iT=w(Nh=>{"use strict";h();Object.defineProperty(Nh,"__esModule",{value:!0});Nh.LiquidObjectAttributeHoverProvider=void 0;var nT=Y(),Xo=Ur(),rT=Lt(),av=class{typeSystem;constructor(e){this.typeSystem=e}async hover(e,t,r){let i=t.at(-1),o=r.textDocument.uri;if(e.type!==nT.NodeTypes.String||!i||i.type!==nT.NodeTypes.VariableLookup||!i.lookups.includes(e))return null;let s=i.lookups.findIndex(S=>S===e),a={...i,lookups:i.lookups.slice(0,s)},l=await this.typeSystem.objectMap(o,t[0]),c=await this.typeSystem.inferType(a,t[0],o),d=(0,Xo.getBaseType)(c);if((0,Xo.isArrayType)(c)||d==="string"||c===Xo.Untyped){let S=await this.typeSystem.inferType({...i,lookups:i.lookups.slice(0,s+1)},t[0],o);if((0,Xo.isArrayType)(S)||S===Xo.Unknown)return null;let F={...l[(0,Xo.getBaseType)(S)]??{},name:e.value};return{contents:{kind:"markdown",value:(0,rT.render)(F,S)}}}let p=l[d];if(!p)return null;let g=(p.properties||[]).find(S=>S.name===e.value);return g?{contents:{kind:"markdown",value:(0,rT.render)(g)}}:null}};Nh.LiquidObjectAttributeHoverProvider=av});var sT=w(zh=>{"use strict";h();Object.defineProperty(zh,"__esModule",{value:!0});zh.HtmlTagHoverProvider=void 0;var oT=Lt(),lv=Dt(),cv=class{async hover(e,t){let r,i=t.at(-1);if((0,lv.isNamedHtmlElementNode)(e)&&typeof e.name=="string"?r=e.name:(0,lv.isTextNode)(e)&&i&&(0,lv.isNamedHtmlElementNode)(i)&&typeof i.name!="string"&&i.name.includes(e)&&i.name.length===1&&(r=e.value),!r)return null;let o=oT.HtmlData.tags.find(s=>s.name===r);return o?{contents:{kind:"markdown",value:(0,oT.renderHtmlEntry)(o)}}:null}};zh.HtmlTagHoverProvider=cv});var aT=w(Oh=>{"use strict";h();Object.defineProperty(Oh,"__esModule",{value:!0});Oh.HtmlAttributeHoverProvider=void 0;var dv=Lt(),Yo=Dt(),hv=class{async hover(e,t){let r=t.at(-1),i=(0,Yo.findLast)(t,Yo.isNamedHtmlElementNode);if(!r||!i||!(0,Yo.isTextNode)(e)||!(0,Yo.isHtmlAttribute)(r)||!r.name.includes(e)||r.name.length>1||!(0,Yo.isNamedHtmlElementNode)(i))return null;let o=e.value,s=(0,Yo.getCompoundName)(i),a=dv.HtmlData.tags.find(d=>d.name===s),l=a?.attributes||[],c=dv.HtmlData.globalAttributes.find(d=>d.name===o)??l.find(d=>d.name===o);return c?{contents:{kind:"markdown",value:(0,dv.renderHtmlEntry)(c,"references"in c?void 0:a)}}:null}};Oh.HtmlAttributeHoverProvider=hv});var pv=w(Lh=>{"use strict";h();Object.defineProperty(Lh,"__esModule",{value:!0});Lh.HtmlAttributeValueHoverProvider=void 0;var pA=Y(),Ah=Lt(),Tr=Dt(),uv=class{async hover(e,t){let r=(0,Tr.findLast)(t,Tr.isHtmlAttribute),i=(0,Tr.findLast)(t,Tr.isNamedHtmlElementNode);if(!(0,Tr.isTextNode)(e)||!r||!i||!(0,Tr.isHtmlAttribute)(r)||!(0,Tr.isNamedHtmlElementNode)(i)||r.type===pA.NodeTypes.AttrEmpty||r.value.length!==1||!r.value.includes(e))return null;let o=e.value,s=(0,Tr.getCompoundName)(r),a=(0,Tr.getCompoundName)(i),l=Ah.HtmlData.tags.find(g=>g.name===a),c=Ah.HtmlData.globalAttributes.find(g=>g.name===s)??l?.attributes.find(g=>g.name===s),d=c?.valueSet,m=Ah.HtmlData.valueSets.find(g=>g.name===d)?.values.find(g=>g.name===o);return m?{contents:{kind:"markdown",value:(0,Ah.renderHtmlEntry)(m,c?.references?c:l)}}:null}};Lh.HtmlAttributeValueHoverProvider=uv});var dT=w(qh=>{"use strict";h();Object.defineProperty(qh,"__esModule",{value:!0});qh.TranslationHoverProvider=void 0;var lT=Y(),cT=Hn(),mv=class{getTranslationsForUri;documentManager;constructor(e,t){this.getTranslationsForUri=e,this.documentManager=t}async hover(e,t,r){let i=t.at(-1);if(e.type!==lT.NodeTypes.String||!i||i.type!==lT.NodeTypes.LiquidVariable||!i.filters[0]||!["t","translate"].includes(i.filters[0].name))return null;let o=await this.getTranslationsForUri(r.textDocument.uri),s=(0,cT.translationValue)(e.value,o),a=this.documentManager.get(r.textDocument.uri)?.textDocument;return!s||!a?null:{contents:{kind:"markdown",value:(0,cT.renderTranslation)(s)},range:{start:a.positionAt(e.position.start),end:a.positionAt(e.position.end)}}}};qh.TranslationHoverProvider=mv});var uT=w(Wh=>{"use strict";h();Object.defineProperty(Wh,"__esModule",{value:!0});Wh.RenderSnippetHoverProvider=void 0;var hT=Y(),mA=vn(),fv=class{getDocDefinitionForURI;constructor(e){this.getDocDefinitionForURI=e}async hover(e,t,r){let i=t.at(-1);if(e.type!==hT.NodeTypes.String||!i||i.type!==hT.NodeTypes.RenderMarkup)return null;let o=e.value,s=await this.getDocDefinitionForURI(r.textDocument.uri,"snippets",o);return{contents:{kind:"markdown",value:(0,mA.formatLiquidDocContentMarkdown)(o,s)}}}};Wh.RenderSnippetHoverProvider=fv});var pT=w(Hh=>{"use strict";h();Object.defineProperty(Hh,"__esModule",{value:!0});Hh.RenderSnippetParameterHoverProvider=void 0;var gv=Y(),fA=vn(),bv=class{getDocDefinitionForURI;constructor(e){this.getDocDefinitionForURI=e}async hover(e,t,r){let i=t.at(-1);if(e.type!==gv.NodeTypes.NamedArgument||!i||i.type!==gv.NodeTypes.RenderMarkup||i.snippet.type!==gv.NodeTypes.String)return null;let o=await this.getDocDefinitionForURI(r.textDocument.uri,"snippets",i.snippet.value),s=e.name,a=o?.liquidDoc?.parameters?.find(l=>l.name===s);return a?{contents:{kind:"markdown",value:(0,fA.formatLiquidDocParameter)(a,!0)}}:null}};Hh.RenderSnippetParameterHoverProvider=bv});var mT=w(xe=>{"use strict";h();Object.defineProperty(xe,"__esModule",{value:!0});xe.RenderSnippetParameterHoverProvider=xe.RenderSnippetHoverProvider=xe.TranslationHoverProvider=xe.HtmlAttributeValueHoverProvider=xe.HtmlAttributeHoverProvider=xe.HtmlTagHoverProvider=xe.LiquidObjectAttributeHoverProvider=xe.LiquidObjectHoverProvider=xe.LiquidFilterArgumentHoverProvider=xe.LiquidFilterHoverProvider=xe.LiquidTagHoverProvider=xe.BlockParameterHoverProvider=void 0;var gA=J1();Object.defineProperty(xe,"BlockParameterHoverProvider",{enumerable:!0,get:function(){return gA.BlockParameterHoverProvider}});var bA=X1();Object.defineProperty(xe,"LiquidTagHoverProvider",{enumerable:!0,get:function(){return bA.LiquidTagHoverProvider}});var vA=Y1();Object.defineProperty(xe,"LiquidFilterHoverProvider",{enumerable:!0,get:function(){return vA.LiquidFilterHoverProvider}});var yA=Z1();Object.defineProperty(xe,"LiquidFilterArgumentHoverProvider",{enumerable:!0,get:function(){return yA.LiquidFilterArgumentHoverProvider}});var wA=tT();Object.defineProperty(xe,"LiquidObjectHoverProvider",{enumerable:!0,get:function(){return wA.LiquidObjectHoverProvider}});var SA=iT();Object.defineProperty(xe,"LiquidObjectAttributeHoverProvider",{enumerable:!0,get:function(){return SA.LiquidObjectAttributeHoverProvider}});var xA=sT();Object.defineProperty(xe,"HtmlTagHoverProvider",{enumerable:!0,get:function(){return xA.HtmlTagHoverProvider}});var kA=aT();Object.defineProperty(xe,"HtmlAttributeHoverProvider",{enumerable:!0,get:function(){return kA.HtmlAttributeHoverProvider}});var CA=pv();Object.defineProperty(xe,"HtmlAttributeValueHoverProvider",{enumerable:!0,get:function(){return CA.HtmlAttributeValueHoverProvider}});var TA=dT();Object.defineProperty(xe,"TranslationHoverProvider",{enumerable:!0,get:function(){return TA.TranslationHoverProvider}});var _A=uT();Object.defineProperty(xe,"RenderSnippetHoverProvider",{enumerable:!0,get:function(){return _A.RenderSnippetHoverProvider}});var EA=pT();Object.defineProperty(xe,"RenderSnippetParameterHoverProvider",{enumerable:!0,get:function(){return EA.RenderSnippetParameterHoverProvider}})});var gT=w(Uh=>{"use strict";h();Object.defineProperty(Uh,"__esModule",{value:!0});Uh.LiquidDocTagHoverProvider=void 0;var vv=Y(),RA=te(),fT=vn(),yv=class{documentManager;constructor(e){this.documentManager=e}async hover(e,t,r){let i=t.at(-1);if(e.type!==vv.NodeTypes.LiquidDocParamNode&&e.type!==vv.NodeTypes.LiquidDocDescriptionNode&&e.type!==vv.NodeTypes.LiquidDocExampleNode)return null;let o=this.documentManager.get(r.textDocument.uri)?.textDocument;if(o&&o.offsetAt(r.position)>e.position.start+e.name.length)return null;let s=fT.SUPPORTED_LIQUID_DOC_TAG_HANDLES[e.name];return s?{contents:{kind:RA.MarkupKind.Markdown,value:(0,fT.formatLiquidDocTagHandle)(e.name,s.description,s.example)}}:null}};Uh.LiquidDocTagHoverProvider=yv});var bT=w(jh=>{"use strict";h();Object.defineProperty(jh,"__esModule",{value:!0});jh.ContentForArgumentHoverProvider=void 0;var wv=Y(),DA=$(),FA=vn(),Sv=class{getDocDefinitionForURI;constructor(e){this.getDocDefinitionForURI=e}async hover(e,t,r){let i=t.at(-1);if(e.type!==wv.NodeTypes.NamedArgument||!i||i.type!==wv.NodeTypes.ContentForMarkup||i.contentForType.type!==wv.NodeTypes.String)return null;let o=(0,DA.getBlockName)(i);if(!o)return null;let a=(await this.getDocDefinitionForURI(r.textDocument.uri,"blocks",o))?.liquidDoc?.parameters?.find(l=>l.name===e.name);return a?{contents:{kind:"markdown",value:(0,FA.formatLiquidDocParameter)(a,!0)}}:null}};jh.ContentForArgumentHoverProvider=Sv});var vT=w($h=>{"use strict";h();Object.defineProperty($h,"__esModule",{value:!0});$h.ContentForTypeHoverProvider=void 0;var xv=Y(),PA=vn(),kv=class{getDocDefinitionForURI;constructor(e){this.getDocDefinitionForURI=e}async hover(e,t,r){let i=t.at(-1),o=t.at(-2);if(e.type!==xv.NodeTypes.String||!i||!o||i.type!==xv.NodeTypes.NamedArgument||i.name!=="type"||o.type!==xv.NodeTypes.ContentForMarkup)return null;let s=e.value,a=await this.getDocDefinitionForURI(r.textDocument.uri,"blocks",s);return{contents:{kind:"markdown",value:(0,PA.formatLiquidDocContentMarkdown)(s,a)}}}};$h.ContentForTypeHoverProvider=kv});var yT=w(Bh=>{"use strict";h();Object.defineProperty(Bh,"__esModule",{value:!0});Bh.HoverProvider=void 0;var MA=$(),IA=Ur(),_n=mT(),NA=pv(),zA=$(),OA=gT(),AA=bT(),LA=vT(),qA=Ks(),Cv=class{documentManager;themeDocset;getMetafieldDefinitions;getTranslationsForURI;getSettingsSchemaForURI;getDocDefinitionForURI;getModeForURI;getThemeBlockSchema;getSchemaTranslationsForURI;providers=[];constructor(e,t,r,i=async()=>({}),o=async()=>[],s=async()=>{},a=async()=>"theme",l=async()=>{},c=async()=>({})){this.documentManager=e,this.themeDocset=t,this.getMetafieldDefinitions=r,this.getTranslationsForURI=i,this.getSettingsSchemaForURI=o,this.getDocDefinitionForURI=s,this.getModeForURI=a,this.getThemeBlockSchema=l,this.getSchemaTranslationsForURI=c;let d=new IA.TypeSystem(t,o,r,a);this.providers=[new AA.ContentForArgumentHoverProvider(s),new LA.ContentForTypeHoverProvider(s),new _n.BlockParameterHoverProvider((0,qA.makeGetBlockParametersForURI)(l,s),c),new _n.LiquidTagHoverProvider(t),new _n.LiquidFilterArgumentHoverProvider(t),new _n.LiquidFilterHoverProvider(t),new _n.LiquidObjectHoverProvider(d),new _n.LiquidObjectAttributeHoverProvider(d),new _n.HtmlTagHoverProvider,new _n.HtmlAttributeHoverProvider,new NA.HtmlAttributeValueHoverProvider,new _n.TranslationHoverProvider(i,e),new _n.RenderSnippetHoverProvider(s),new _n.RenderSnippetParameterHoverProvider(s),new OA.LiquidDocTagHoverProvider(e)]}async hover(e){let t=e.textDocument.uri,r=this.documentManager.get(t);if(r?.type!==MA.SourceCodeType.LiquidHtml||r.ast instanceof Error)return null;let[i,o]=(0,zA.findCurrentNode)(r.ast,r.textDocument.offsetAt(e.position)),s=this.providers.map(l=>l.hover(i,o,e));return(await Promise.all(s)).find(Boolean)??null}};Bh.HoverProvider=Cv});var wT=w(Vh=>{"use strict";h();Object.defineProperty(Vh,"__esModule",{value:!0});Vh.HoverProvider=void 0;var WA=yT();Object.defineProperty(Vh,"HoverProvider",{enumerable:!0,get:function(){return WA.HoverProvider}})});var si=w(Gh=>{"use strict";h();Object.defineProperty(Gh,"__esModule",{value:!0});Gh.isLiquidRequestContext=HA;Gh.isJSONRequestContext=UA;var Ma=$();function HA(n){let{doc:e,schema:t,parsed:r}=n;return e.type===Ma.SourceCodeType.LiquidHtml&&!!t&&!(0,Ma.isError)(e.ast)&&!(0,Ma.isError)(r)}function UA(n){let{doc:e}=n;return e.type===Ma.SourceCodeType.JSON&&!(0,Ma.isError)(e.ast)}});var En=w(zi=>{"use strict";h();Object.defineProperty(zi,"__esModule",{value:!0});zi.fileMatch=$A;zi.isSectionFile=ST;zi.isBlockFile=xT;zi.isSectionOrBlockFile=BA;zi.findSchemaNode=VA;var jA=$();function $A(n,e){return e.some(t=>t.test(n))}function ST(n){return/\/sections\/[^/]*\.liquid$/.test(n)}function xT(n){return/\/blocks\/[^/]*\.liquid$/.test(n)}function BA(n){return ST(n)||xT(n)}function VA(n){return(0,jA.visit)(n,{LiquidRawTag(t){if(t.name==="schema")return t}})[0]}});var Oi=w(Rn=>{"use strict";h();Object.defineProperty(Rn,"__esModule",{value:!0});Rn.BlockTypeCompletionProvider=void 0;Rn.createBlockNameCompletionItems=kT;Rn.isBlockDefinitionPath=CT;Rn.isPresetBlockPath=XA;Rn.isBlockTypePath=YA;Rn.hasLocalBlockDefinitions=TT;Rn.isLocalBlockDefinition=QA;Rn.isSectionOrBlockSchema=_T;var ai=$(),GA=he(),KA=si(),JA=En(),Tv=class{getThemeBlockNames;constructor(e){this.getThemeBlockNames=e}async completeValue(e,t){if(!(0,JA.isSectionOrBlockFile)(e.doc.uri)||!(0,KA.isLiquidRequestContext)(e)||!CT(t))return[];let{doc:r}=e,i=await r.getSchema();if(!i||(0,ai.isError)(i.parsed)||!_T(i))return[];if(TT(i))return[];let o=await this.getThemeBlockNames(r.uri,!0);return kT(o)}};Rn.BlockTypeCompletionProvider=Tv;function kT(n){return n.map(e=>({kind:GA.CompletionItemKind.Value,label:`"${e}"`,insertText:`"${e}"`}))}function CT(n){return n.at(0)==="blocks"}function XA(n){return n.at(0)==="presets"}function YA(n){let e=n.at(0);if(e!=="blocks"&&e!=="presets"||n.length<4)return!1;let[t,r,i]=n.slice(-3);return t==="blocks"&&i==="type"}function TT(n){if(n.type!==ai.ThemeSchemaType.Section||(0,ai.isError)(n.parsed))return!1;let e=(0,ai.deepGet)(n.parsed,["blocks"]);return!e||!Array.isArray(e)?!1:e.some(t=>t&&t.name!==void 0)}function QA(n,e){if(n.type!==ai.ThemeSchemaType.Section)return!1;let t=[...e.slice(0,-1),"name"];return(0,ai.deepGet)(n.parsed,t)!==void 0}var ZA=[ai.ThemeSchemaType.Section,ai.ThemeSchemaType.Block];function _T(n){return ZA.includes(n.type)}});var ET=w(Kh=>{"use strict";h();Object.defineProperty(Kh,"__esModule",{value:!0});Kh.ReferencedBlockTypeCompletionProvider=void 0;var Ev=$(),eL=si(),tL=En(),_v=Oi(),Rv=class{getThemeBlockNames;getThemeBlockSchema;constructor(e,t){this.getThemeBlockNames=e,this.getThemeBlockSchema=t}async completeValue(e,t){if(!(0,tL.isSectionOrBlockFile)(e.doc.uri)||!(0,eL.isLiquidRequestContext)(e)||!nL(t))return[];let{doc:r}=e,i=await r.getSchema();if(!i||(0,Ev.isError)(i.parsed)||!(0,_v.isSectionOrBlockSchema)(i))return[];let o=i.parsed;if(rL(t)){let c=iL(i.parsed,t);if(!c)return[];let d=await this.getThemeBlockSchema(r.uri,c);if(!d||(0,Ev.isError)(d.parsed)||!(0,_v.isSectionOrBlockSchema)(d))return[];o=d.parsed}let s=o.blocks||[],a={themeBlocks:!1,specificBlockNames:[]};s.forEach(c=>{c.type==="@theme"?a.themeBlocks=!0:c.type.startsWith("@")||a.specificBlockNames.push(c.type)});let l=a.specificBlockNames;return a.themeBlocks&&l.push(...await this.getThemeBlockNames(r.uri,!1)),(0,_v.createBlockNameCompletionItems)(l)}};Kh.ReferencedBlockTypeCompletionProvider=Rv;function nL(n){return(n.at(0)==="presets"||n.at(0)==="default")&&n.at(-3)==="blocks"&&n.at(-1)==="type"}function rL(n){return n.at(-5)==="blocks"&&n.at(-3)==="blocks"&&n.at(-1)==="type"}function iL(n,e){return(0,Ev.deepGet)(n,[...e.slice(0,-3),"type"])}});var DT=w(Jh=>{"use strict";h();Object.defineProperty(Jh,"__esModule",{value:!0});Jh.SchemaTranslationsCompletionProvider=void 0;var oL=$(),sL=(Ga(),Kt(Va)),RT=Hn(),aL=si(),lL=En(),Dv=class{getDefaultSchemaTranslations;constructor(e){this.getDefaultSchemaTranslations=e}async completeValue(e,t){if(!(0,lL.isSectionOrBlockFile)(e.doc.uri)||!(0,aL.isLiquidRequestContext)(e))return[];let{doc:r,parsed:i}=e,o=(0,oL.deepGet)(i,t);if(!o||typeof o!="string"||!o.startsWith("t:"))return[];if(/^t:(.*)/.exec(o)?.[1]===void 0)return[];let a=await this.getDefaultSchemaTranslations(r.uri);return(0,RT.translationOptions)(a).map(c=>{let d=`t:${c.path.join(".")}`;return{label:d,kind:sL.CompletionItemKind.Value,filterText:`"${d}"`,insertText:`"${d}"`,insertTextFormat:1,documentation:{kind:"markdown",value:(0,RT.renderTranslation)(c.translation)}}})}};Jh.SchemaTranslationsCompletionProvider=Dv});var MT=w(Xh=>{"use strict";h();Object.defineProperty(Xh,"__esModule",{value:!0});Xh.SchemaTranslationHoverProvider=void 0;var FT=$(),PT=Hn(),cL=si(),dL=En(),Fv=class{getDefaultSchemaTranslations;constructor(e){this.getDefaultSchemaTranslations=e}canHover(e,t){let r=(0,FT.deepGet)(e.parsed,t);return(0,dL.isSectionOrBlockFile)(e.doc.uri)&&(0,cL.isLiquidRequestContext)(e)&&t.length!==0&&r&&typeof r=="string"&&r.startsWith("t:")}async hover(e,t){if(!this.canHover(e,t))return[];let r=(0,FT.deepGet)(e.parsed,t);return this.getDefaultSchemaTranslations(e.doc.uri).then(i=>{let o=r.slice(2),s=(0,PT.translationValue)(o,i);if(s)return[(0,PT.renderTranslation)(s)]})}};Xh.SchemaTranslationHoverProvider=Fv});var zT=w(Ia=>{"use strict";h();Object.defineProperty(Ia,"__esModule",{value:!0});Ia.TranslationPathHoverProvider=void 0;Ia.contextualizedLabel=Yh;var hL=$(),IT=Hn(),uL=si(),pL=En(),Pv=class{filePatterns=[/^.*\/locales\/[^\/]*\.json$/];canHover(e,t){return(0,pL.fileMatch)(e.doc.uri,this.filePatterns)&&t.length>0&&(0,uL.isJSONRequestContext)(e)}async hover(e,t){if(!this.canHover(e,t))return[];let{doc:r}=e,i=r.ast,o=(0,hL.nodeAtPath)(i,t);switch(!0){case["zero","one","two","few","many","other"].includes(t.at(-1)):return!o||o.type!=="Literal"||typeof o.value!="string"?["Pluralized translations should have a string value"]:[Yh(r.uri,t.slice(0,-1),o.value)];case t.at(-1).toString().endsWith("_html"):return!o||o.type!=="Literal"||typeof o.value!="string"?["Translations ending in '_html' should have a string value"]:[Yh(r.uri,t,o.value),"The '_html' suffix prevents the HTML content from being escaped."];default:return!o||o.type!=="Literal"||typeof o.value!="string"?[`Translation group: ${t.join(".")}`]:[Yh(r.uri,t,o.value)]}}};Ia.TranslationPathHoverProvider=Pv;function Yh(n,e,t){if(n.includes(".schema"))return NT(`"t:${e.join(".")}"`,"json");{let r=(0,IT.extractParams)(t);return NT(`{{ '${e.join(".")}' | t${(0,IT.paramsString)(r)} }}`,"liquid")}}function NT(n,e="liquid"){return{language:e,value:n}}});var Zh=w(Qh=>{"use strict";h();Object.defineProperty(Qh,"__esModule",{value:!0});Qh.schemaSettingsPropertyCompletionItems=mL;Qh.getSectionBlockByName=fL;var OT=(Ga(),Kt(Va)),AT=Hn();function mL(n,e){return n.filter(t=>t.id).map(t=>{let r="";if(t.label)if(t.label.startsWith("t:")){let o=(0,AT.translationValue)(t.label.substring(2),e);o&&(r=(0,AT.renderTranslation)(o))}else r=t.label;let i=t.id?`"${t.id}"`:"";return{kind:OT.CompletionItemKind.Property,label:i,insertText:i,documentation:{kind:OT.MarkupKind.Markdown,value:r}}})}function fL(n={},e){return n.blocks?.filter(t=>"name"in t)?.find(t=>t.type===e)}});var HT=w(eu=>{"use strict";h();Object.defineProperty(eu,"__esModule",{value:!0});eu.SettingsPropertyCompletionProvider=void 0;var LT=$(),qT=En(),gL=Oi(),bL=Zh(),Mv=class{getDefaultSchemaTranslations;constructor(e){this.getDefaultSchemaTranslations=e}async completeProperty(e,t){let{doc:r}=e;if(r.type!==LT.SourceCodeType.LiquidHtml)return[];if(!((0,qT.isSectionFile)(r.uri)&&(WT(t)||vL(t)))&&!((0,qT.isBlockFile)(r.uri)&&WT(t)))return[];let i=await r.getSchema();if(!i||!(0,gL.isSectionOrBlockSchema)(i)||(0,LT.isError)(i.parsed))return[];let o=i.parsed;if(!o?.settings||!Array.isArray(o.settings))return[];let s=await this.getDefaultSchemaTranslations(r.textDocument.uri);return(0,bL.schemaSettingsPropertyCompletionItems)(o.settings,s)}};eu.SettingsPropertyCompletionProvider=Mv;function WT(n){return n.length===3&&n.at(0)==="presets"&&n.at(2)==="settings"}function vL(n){return n.length===2&&n.at(0)==="default"&&n.at(1)==="settings"}});var jT=w(tu=>{"use strict";h();Object.defineProperty(tu,"__esModule",{value:!0});tu.SettingsHoverProvider=void 0;var yL=$(),UT=Hn(),wL=si(),SL=En(),xL=Oi(),Iv=class{getDefaultSchemaTranslations;constructor(e){this.getDefaultSchemaTranslations=e}canHover(e,t){return(0,SL.isSectionOrBlockFile)(e.doc.uri)&&(0,wL.isLiquidRequestContext)(e)&&t.length!==0&&(kL(t)||CL(t))}async hover(e,t){if(!this.canHover(e,t))return[];let{doc:r}=e,i=await TL(r,t.at(-1));return i?i.startsWith("t:")?this.getDefaultSchemaTranslations(r.uri).then(o=>{let s=i.substring(2),a=(0,UT.translationValue)(s,o);if(a)return[(0,UT.renderTranslation)(a)]}):[i]:[]}};tu.SettingsHoverProvider=Iv;function kL(n){return n.at(0)==="presets"&&n.at(2)==="settings"&&n.at(3)!==void 0&&typeof n.at(3)=="string"}function CL(n){return n.at(0)==="default"&&n.at(1)==="settings"&&n.at(2)!==void 0&&typeof n.at(2)=="string"}async function TL(n,e){let t=await n.getSchema();if(!(!t||!(0,xL.isSectionOrBlockSchema)(t)||(0,yL.isError)(t.parsed)||t.parsed.settings===void 0||!Array.isArray(t.parsed.settings)))return t.parsed.settings.find(r=>r?.id===e)?.label}});var GT=w(ru=>{"use strict";h();Object.defineProperty(ru,"__esModule",{value:!0});ru.BlockSettingsPropertyCompletionProvider=void 0;var $T=En(),nu=$(),BT=Oi(),Nv=Zh(),zv=class{getDefaultSchemaTranslations;getThemeBlockSchema;constructor(e,t){this.getDefaultSchemaTranslations=e,this.getThemeBlockSchema=t}async completeProperty(e,t){let{doc:r}=e;if(r.type!==nu.SourceCodeType.LiquidHtml)return[];if(!((0,$T.isSectionFile)(r.uri)&&(VT(t)||_L(t)))&&!((0,$T.isBlockFile)(r.uri)&&VT(t)))return[];let i=await r.getSchema();if(!i||!(0,BT.isSectionOrBlockSchema)(i)||(0,nu.isError)(i.parsed))return[];let o=(0,nu.deepGet)(i.parsed,[...t.slice(0,-1),"type"]);if(!o)return[];let s=await this.getDefaultSchemaTranslations(r.textDocument.uri),a=(0,Nv.getSectionBlockByName)(i.parsed,o);if(a){if(a.settings)return(0,Nv.schemaSettingsPropertyCompletionItems)(a.settings,s)}else{let l=await this.getThemeBlockSchema(r.uri,o);return!l||(0,nu.isError)(l.parsed)||!(0,BT.isSectionOrBlockSchema)(l)?[]:!l.parsed?.settings||!Array.isArray(l.parsed?.settings)?[]:(0,Nv.schemaSettingsPropertyCompletionItems)(l.parsed.settings,s)}return[]}};ru.BlockSettingsPropertyCompletionProvider=zv;function VT(n){return n.at(0)==="presets"&&n.at(-3)==="blocks"&&n.at(-1)==="settings"}function _L(n){return n.at(0)==="default"&&n.at(1)==="blocks"&&n.at(3)==="settings"}});var ZT=w(iu=>{"use strict";h();Object.defineProperty(iu,"__esModule",{value:!0});iu.BlockSettingsHoverProvider=void 0;var QT=$(),KT=Hn(),EL=si(),RL=En(),DL=Oi(),FL=Zh(),Ov=class{getDefaultSchemaTranslations;getThemeBlockSchema;constructor(e,t){this.getDefaultSchemaTranslations=e,this.getThemeBlockSchema=t}canHover(e,t){return(0,RL.isSectionOrBlockFile)(e.doc.uri)&&(0,EL.isLiquidRequestContext)(e)&&t.length!==0&&PL(t)}async hover(e,t){if(!this.canHover(e,t))return[];let{doc:r}=e,i=await r.getSchema();if(!JT(i))return[];let o=(0,QT.deepGet)(i.parsed,[...t.slice(0,-2),"type"]);if(!o)return[];let s=(0,FL.getSectionBlockByName)(i.parsed,o),a;if(s){if(!XT(s.settings))return[];a=YT(s.settings,t.at(-1))}else{let d=await this.getThemeBlockSchema(r.uri,o);if(!JT(d))return[];if(!XT(d.parsed.settings))return[];a=YT(d.parsed.settings,t.at(-1))}if(!a)return[];if(!a.startsWith("t:"))return[a];let l=await this.getDefaultSchemaTranslations(r.uri),c=(0,KT.translationValue)(a.substring(2),l);return c?[(0,KT.renderTranslation)(c)]:[]}};iu.BlockSettingsHoverProvider=Ov;function PL(n){return(n.at(0)==="presets"||n.at(0)==="default")&&n.at(-4)==="blocks"&&n.at(-2)==="settings"&&n.at(-1)!==void 0&&typeof n.at(-1)=="string"}function JT(n){return!!n&&!(0,QT.isError)(n.parsed)&&(0,DL.isSectionOrBlockSchema)(n)}function XT(n){return n!==void 0&&Array.isArray(n)}function YT(n,e){return n.find(t=>t.id===e)?.label}});var t_=w(ou=>{"use strict";h();Object.defineProperty(ou,"__esModule",{value:!0});ou.JSONContributions=void 0;var e_=$(),ML=Oi(),IL=ET(),NL=DT(),zL=MT(),OL=zT(),AL=En(),LL=HT(),qL=jT(),WL=GT(),HL=ZT(),Av=void 0,Lv=class{documentManager;hoverProviders;completionProviders;constructor(e,t,r,i){this.documentManager=e,this.hoverProviders=[new OL.TranslationPathHoverProvider,new zL.SchemaTranslationHoverProvider(t),new qL.SettingsHoverProvider(t),new HL.BlockSettingsHoverProvider(t,i)],this.completionProviders=[new NL.SchemaTranslationsCompletionProvider(t),new ML.BlockTypeCompletionProvider(r),new IL.ReferencedBlockTypeCompletionProvider(r,i),new WL.BlockSettingsPropertyCompletionProvider(t,i),new LL.SettingsPropertyCompletionProvider(t)]}getInfoContribution(e,t){let r=this.documentManager.get(e);if(!r)return Av;let i=this.getContext(r),o=this.hoverProviders.find(s=>s.canHover(i,t));return o?o.hover(i,t):Av}async collectPropertyCompletions(e,t,r,i,o,s){let a=this.documentManager.get(e);if(!a||a.ast instanceof Error)return;let l=await Promise.all(this.completionProviders.filter(c=>c.completeProperty).map(c=>c.completeProperty(this.getContext(a),t)));for(let c of l.flat())s.add(c)}async collectValueCompletions(e,t,r,i){let o=this.documentManager.get(e);if(!o||o.ast instanceof Error)return;let s=await Promise.all(this.completionProviders.filter(a=>a.completeValue).map(a=>a.completeValue(this.getContext(o),t.concat(r))));for(let a of s.flat())i.add(a)}async collectDefaultCompletions(e,t){}getContext(e){let t={doc:e};if(e.type===e_.SourceCodeType.LiquidHtml&&!(e.ast instanceof Error)){let r=(0,AL.findSchemaNode)(e.ast);if(!r)return Av;let i=r?.source.slice(r.blockStartPosition.end,r.blockEndPosition.start);t.schema=r,t.parsed=(0,e_.parseJSON)(i)}return t}};ou.JSONContributions=Lv});var r_=w(qv=>{"use strict";h();Object.defineProperty(qv,"__esModule",{value:!0});qv.createJSONDocumentLinksVisitor=jL;var n_=te(),UL=La();function jL(n,e,t=0){return{Property(i,o){let s=BL(o);if(s&&i.key.value==="type"&&i.value.type==="Literal"&&typeof i.value.value=="string"&&!(s==="blocks"&&["@app","@theme"].includes(i.value.value)))return n_.DocumentLink.create($L(n,i.value,t),UL.Utils.resolvePath(e,s,i.value.value+".liquid").toString())}}}function $L(n,e,t){let r=n.positionAt(t+e.loc.start.offset+1),i=n.positionAt(t+e.loc.end.offset-1);return n_.Range.create(r,i)}function BL(n){for(let e=n.length-1;e>=0;e--){let t=n[e];if(t.type==="Property"){if(t.key.value==="blocks")return"blocks";if(t.key.value==="sections")return"sections"}}}});var s_=w(su=>{"use strict";h();Object.defineProperty(su,"__esModule",{value:!0});su.JSONLanguageService=void 0;var VL=Y(),er=$(),GL=(Ga(),Kt(Va)),KL=(cs(),Kt(Ba)),JL=t_(),i_=r_(),o_=La(),Wv=class{documentManager;jsonValidationSet;getDefaultSchemaTranslations;getModeForURI;getThemeBlockNames;getThemeBlockSchema;findThemeRootURI;services;schemas;initialized;initialize=()=>{};constructor(e,t,r,i,o,s,a){this.documentManager=e,this.jsonValidationSet=t,this.getDefaultSchemaTranslations=r,this.getModeForURI=i,this.getThemeBlockNames=o,this.getThemeBlockSchema=s,this.findThemeRootURI=a,this.services=Object.fromEntries(er.Modes.map(l=>[l,null])),this.schemas={},this.initialized=new Promise(l=>{this.initialize=l})}async setup(e){let t=er.Modes.map(async r=>{let i=await this.jsonValidationSet.schemas(r);for(let s of i)this.schemas[s.uri]=s;if(!i.length)return;let o=(0,GL.getLanguageService)({clientCapabilities:e,schemaRequestService:this.getSchemaForURI.bind(this),workspaceContext:{resolveRelativePath:(s,a)=>new URL(s,a).toString()},contributions:[new JL.JSONContributions(this.documentManager,this.getDefaultSchemaTranslations,this.getThemeBlockNames,this.getThemeBlockSchema)]});o.configure({schemas:i.map(s=>({uri:s.uri,fileMatch:s.fileMatch}))}),this.services[r]=o});await Promise.all(t),this.initialize()}async completions(e){await this.initialized;let t=await this.getModeForURI(e.textDocument.uri),r=this.services[t];if(!r)return null;let i=this.getDocuments(e,r);if(!i)return null;let[o,s]=i;return r.doComplete(o,e.position,s)}async hover(e){await this.initialized;let t=await this.getModeForURI(e.textDocument.uri),r=this.services[t];if(!r)return null;let i=this.getDocuments(e,r);if(!i)return null;let[o,s]=i;return r.doHover(o,e.position,s)}async documentLinks(e){await this.initialized;let t=await this.findThemeRootURI(e.textDocument.uri);if(!t)return[];let r=this.documentManager.get(e.textDocument.uri);if(!r)return[];switch(r.type){case er.SourceCodeType.JSON:{if(r.ast instanceof Error)return[];let i=(0,i_.createJSONDocumentLinksVisitor)(r.textDocument,o_.URI.parse(t));return(0,er.visit)(r.ast,i)}case er.SourceCodeType.LiquidHtml:{if(r.ast instanceof Error)return[];let i=r.textDocument,o=[],s=await r.getSchema();if(s&&!(s.ast instanceof Error)){let a=(0,i_.createJSONDocumentLinksVisitor)(i,o_.URI.parse(t),s.offset),l=(0,er.visit)(s.ast,a);o.push(...l)}return o}default:return[]}}isValidSchema=async(e,t)=>{await this.initialized;let r=await this.getModeForURI(e),i=this.services[r];return i?(0,er.isValid)(i,e,t):!1};getDocuments(e,t){let r=this.documentManager.get(e.textDocument.uri);if(!r)return null;switch(r.type){case er.SourceCodeType.JSON:{let i=r.textDocument,o=t.parseJSONDocument(i);return[i,o]}case er.SourceCodeType.LiquidHtml:{if(r.ast instanceof Error)return null;let i=r.textDocument,o=i.offsetAt(e.position),[s,a]=(0,er.findCurrentNode)(r.ast,o),l=a.find(g=>g.type===VL.NodeTypes.LiquidRawTag&&g.name==="schema");if(!l)return null;let c=i.positionAt(l.blockStartPosition.end).line,d=Array(c).fill(`
|
|
564
564
|
`).join("")+l.source.slice(l.blockStartPosition.end,l.blockEndPosition.start),p=KL.TextDocument.create(i.uri,"json",i.version,d),m=t.parseJSONDocument(p);return[p,m]}}}async getSchemaForURI(e){let t=this.schemas[e]?.schema;return t||`Could not get schema for '${e}'`}};su.JSONLanguageService=Wv});var Hv=w(au=>{"use strict";h();Object.defineProperty(au,"__esModule",{value:!0});au.htmlElementNameWordPattern=void 0;var XL="[a-zA-Z]",YL="[a-zA-Z0-9-]";au.htmlElementNameWordPattern=`${XL}${YL}*`});var a_=w(lu=>{"use strict";h();Object.defineProperty(lu,"__esModule",{value:!0});lu.EmptyHtmlTagLinkedRangesProvider=void 0;var Na=te(),QL=Hv(),Uv=class{documentManager;constructor(e){this.documentManager=e}async linkedEditingRanges(e,t,{textDocument:{uri:r},position:i}){let o=this.documentManager.get(r),s=o?.textDocument;if(!o||!s)return null;let a=Na.Range.create(Na.Position.create(i.line,i.character-1),Na.Position.create(i.line,i.character+1));if(!["<>","< "].includes(s.getText(a)))return null;let l=o.source.indexOf("</>",s.offsetAt(i));if(l===-1)return null;let c=l+2,d=s.positionAt(c);return{ranges:[Na.Range.create(i,i),Na.Range.create(d,d)],wordPattern:QL.htmlElementNameWordPattern}}};lu.EmptyHtmlTagLinkedRangesProvider=Uv});var l_=w(cu=>{"use strict";h();Object.defineProperty(cu,"__esModule",{value:!0});cu.HtmlTagNameLinkedRangesProvider=void 0;var ZL=bh(),eq=Hv(),jv=class{documentManager;constructor(e){this.documentManager=e}async linkedEditingRanges(e,t,r){if(!e||!t)return null;let i=this.documentManager.get(r.textDocument.uri)?.textDocument;if(!i)return null;let o=(0,ZL.getHtmlElementNameRanges)(e,t,r,i);return o?{ranges:o,wordPattern:eq.htmlElementNameWordPattern}:null}};cu.HtmlTagNameLinkedRangesProvider=jv});var c_=w(Qo=>{"use strict";h();Object.defineProperty(Qo,"__esModule",{value:!0});Qo.HtmlTagNameLinkedRangesProvider=Qo.EmptyHtmlTagLinkedRangesProvider=void 0;var tq=a_();Object.defineProperty(Qo,"EmptyHtmlTagLinkedRangesProvider",{enumerable:!0,get:function(){return tq.EmptyHtmlTagLinkedRangesProvider}});var nq=l_();Object.defineProperty(Qo,"HtmlTagNameLinkedRangesProvider",{enumerable:!0,get:function(){return nq.HtmlTagNameLinkedRangesProvider}})});var h_=w(du=>{"use strict";h();Object.defineProperty(du,"__esModule",{value:!0});du.LinkedEditingRangesProvider=void 0;var rq=$(),iq=$(),d_=c_(),$v=class{documentManager;providers;constructor(e){this.documentManager=e,this.providers=[new d_.HtmlTagNameLinkedRangesProvider(e),new d_.EmptyHtmlTagLinkedRangesProvider(e)]}async linkedEditingRanges(e){let t=this.documentManager.get(e.textDocument.uri);if(!t||t.type!==rq.SourceCodeType.LiquidHtml)return null;let r=null,i=null;t.ast instanceof Error||([r,i]=(0,iq.findCurrentNode)(t.ast,t.textDocument.offsetAt(e.position)));let o=this.providers.map(a=>a.linkedEditingRanges(r,i,e).catch(()=>null));return(await Promise.all(o)).find(Boolean)??null}};du.LinkedEditingRangesProvider=$v});var m_=w(hu=>{"use strict";h();Object.defineProperty(hu,"__esModule",{value:!0});hu.HtmlTagNameRenameProvider=void 0;var p_=he(),u_=bh(),Bv=class{documentManager;constructor(e){this.documentManager=e}async prepare(e,t,r){let i=this.documentManager.get(r.textDocument.uri)?.textDocument;if(!i||!e||!t)return null;let o=(0,u_.getHtmlElementNameRanges)(e,t,r,i);return!o||!o[0]?null:{range:o[0],placeholder:i.getText(o[0])}}async rename(e,t,r){let i=this.documentManager.get(r.textDocument.uri)?.textDocument;if(!i||!e||!t)return null;let o=(0,u_.getHtmlElementNameRanges)(e,t,r,i);return o?{documentChanges:[p_.TextDocumentEdit.create({uri:i.uri,version:i.version},oq(o,r.newName))]}:null}};hu.HtmlTagNameRenameProvider=Bv;function oq(n,e){return n.map(t=>p_.TextEdit.replace(t,e))}});var v_=w(pu=>{"use strict";h();Object.defineProperty(pu,"__esModule",{value:!0});pu.LiquidVariableRenameProvider=void 0;var Ge=Y(),g_=$(),uu=te(),Vv=he(),sq=Ni(),aq=jr(),Gv=class{connection;clientCapabilities;documentManager;findThemeRootURI;constructor(e,t,r,i){this.connection=e,this.clientCapabilities=t,this.documentManager=r,this.findThemeRootURI=i}async prepare(e,t,r){let o=this.documentManager.get(r.textDocument.uri)?.textDocument;if(!o||!e||!t||!f_(e,t))return null;let s=e.type===Ge.NodeTypes.LiquidDocParamNode?e.paramName:e,a=Kv(e),l=o.offsetAt(r.position),c=s.position.start+a.length;return l<s.position.start||l>c?null:{range:uu.Range.create(o.positionAt(s.position.start),o.positionAt(c)),placeholder:a}}async rename(e,t,r){let i=this.documentManager.get(r.textDocument.uri),o=await this.findThemeRootURI(r.textDocument.uri),s=i?.textDocument;if(!o||!s||!e||!t||i.ast instanceof Error||!f_(e,t))return null;if(e.type===Ge.NodeTypes.LiquidDocParamNode){let g=s.offsetAt(r.position),S=e.paramName.position.start+e.paramName.value.length;if(g<e.paramName.position.start||g>S)return null}let a=Kv(e),l=b_(a,t),c=dq(a,s,l),d=!1,p=(0,g_.visit)(i.ast,{VariableLookup:c,AssignMarkup:c,ForMarkup:c,TextNode:(g,S)=>{let F=S.at(-1);if(!(F?.type!==Ge.NodeTypes.LiquidDocParamNode||F?.paramName!==g))return d=!0,c(g,S)}});if(this.clientCapabilities.hasApplyEditSupport&&d){let S=this.documentManager.theme(o,!0).filter(sq.isLiquidSourceCode),F=(0,aq.snippetName)(r.textDocument.uri);hq(this.connection,S,F,a,r.newName)}return{documentChanges:[Vv.TextDocumentEdit.create({uri:s.uri,version:s.version},p.map(g=>Vv.TextEdit.replace(g,r.newName)))]}}};pu.LiquidVariableRenameProvider=Gv;function f_(n,e){return n.type===Ge.NodeTypes.AssignMarkup||n.type===Ge.NodeTypes.VariableLookup||n.type===Ge.NodeTypes.ForMarkup||lq(n,e)||cq(n)}function lq(n,e){let t=e.at(-1);return!!t&&t.type===Ge.NodeTypes.LiquidDocParamNode&&t.paramName===n&&n.type===Ge.NodeTypes.TextNode}function cq(n){return n.type===Ge.NodeTypes.LiquidDocParamNode&&n.paramName?.type===Ge.NodeTypes.TextNode}function Kv(n){switch(n.type){case Ge.NodeTypes.VariableLookup:case Ge.NodeTypes.AssignMarkup:return n.name??"";case Ge.NodeTypes.ForMarkup:return n.variableName??"";case Ge.NodeTypes.TextNode:return n.value;case Ge.NodeTypes.LiquidDocParamNode:return n.paramName.value;default:return""}}function b_(n,e){let t;for(let r=e.length-1;r>=0;r--){let i=e[r];if(i.type===Ge.NodeTypes.LiquidTag&&(i.name===Ge.NamedTags.tablerow||i.name===Ge.NamedTags.for)&&typeof i.markup!="string"&&i.markup.variableName===n){t=i;break}}if(!(!t||!t.blockEndPosition))return{start:t.blockStartPosition.start,end:t.blockEndPosition.end}}function dq(n,e,t){return(r,i)=>{if(Kv(r)!==n)return;let o=b_(n,i);if(!(o?.start!==t?.start||o?.end!==t?.end))return uu.Range.create(e.positionAt(r.position.start),e.positionAt(r.position.start+n.length))}}async function hq(n,e,t,r,i){let o=`Rename snippet parameter '${r}' to '${i}'`,s="renameSnippetParameter",a={documentChanges:[],changeAnnotations:{[s]:{label:o,needsConfirmation:!1}}};for(let l of e){if(l.ast instanceof Error)continue;let c=l.textDocument,d=(0,g_.visit)(l.ast,{RenderMarkup(p){if(p.snippet.type!==Ge.NodeTypes.String||p.snippet.value!==t)return;let m=p.args.find(g=>g.name===r);if(m)return{newText:`${i}: `,range:uu.Range.create(c.positionAt(m.position.start),c.positionAt(m.value.position.start))};if(p.alias?.value===r&&p.variable){let S=/as\s+([^\s,]+)/g.exec(p.source.slice(p.position.start,p.position.end));return S?{newText:`as ${i}`,range:uu.Range.create(c.positionAt(p.position.start+S.index),c.positionAt(p.position.start+S.index+S[0].length))}:void 0}}});d.length!==0&&a.documentChanges.push({textDocument:{uri:c.uri,version:l.version??null},annotationId:s,edits:d})}if(a.documentChanges.length===0){console.error("Nothing to do!");return}await n.sendRequest(Vv.ApplyWorkspaceEditRequest.type,{label:o,edit:a})}});var y_=w(mu=>{"use strict";h();Object.defineProperty(mu,"__esModule",{value:!0});mu.RenameProvider=void 0;var uq=$(),pq=$(),mq=m_(),fq=v_(),Jv=class{documentManager;providers;constructor(e,t,r,i){this.documentManager=r,this.providers=[new mq.HtmlTagNameRenameProvider(r),new fq.LiquidVariableRenameProvider(e,t,r,i)]}async prepare(e){let[t,r]=this.nodes(e);if(t===null||r===null)return null;let i=this.providers.map(s=>s.prepare(t,r,e).catch(()=>null));return(await Promise.all(i)).find(Boolean)??null}async rename(e){let[t,r]=this.nodes(e);if(t===null||r===null)return null;let i=this.providers.map(s=>s.rename(t,r,e).catch(()=>null));return(await Promise.all(i)).find(Boolean)??null}nodes(e){let t=this.documentManager.get(e.textDocument.uri);return!t||t.type!==uq.SourceCodeType.LiquidHtml?[null,null]:t.ast instanceof Error?[null,null]:(0,pq.findCurrentNode)(t.ast,t.textDocument.offsetAt(e.position))}};mu.RenameProvider=Jv});var x_=w(gu=>{"use strict";h();Object.defineProperty(gu,"__esModule",{value:!0});gu.AssetRenameHandler=void 0;var gq=Y(),w_=$(),S_=he(),bq=Ni(),fu=jr(),Xv=class{documentManager;connection;capabilities;findThemeRootURI;constructor(e,t,r,i){this.documentManager=e,this.connection=t,this.capabilities=r,this.findThemeRootURI=i}async onDidRenameFiles(e){if(!this.capabilities.hasApplyEditSupport)return;let t=e.files.filter(m=>(0,fu.isAsset)(m.oldUri)&&(0,fu.isAsset)(m.newUri));if(t.length!==1)return;let r=t[0],i=await this.findThemeRootURI(w_.path.dirname(e.files[0].oldUri));if(!i)return;await this.documentManager.preload(i);let s=this.documentManager.theme(i,!0).filter(bq.isLiquidSourceCode),a=(0,fu.assetName)(r.oldUri),l=(0,fu.assetName)(r.newUri),c=`Rename asset '${a}' to '${l}'`,d="renameAsset",p={documentChanges:[],changeAnnotations:{[d]:{label:c,needsConfirmation:!1}}};for(let m of s){if(m.ast instanceof Error)continue;let g=m.textDocument,S=(0,w_.visit)(m.ast,{LiquidVariable(F){if(!(F.filters.length===0||F.expression.type!==gq.NodeTypes.String||F.filters[0].name!=="asset_url"||F.expression.value!==a))return{newText:l,range:S_.Range.create(g.positionAt(F.expression.position.start+1),g.positionAt(F.expression.position.end-1))}}});S.length!==0&&p.documentChanges.push({textDocument:{uri:g.uri,version:m.version??null},annotationId:d,edits:S})}if(p.documentChanges.length===0){console.error("Nothing to do!");return}await this.connection.sendRequest(S_.ApplyWorkspaceEditRequest.type,{label:c,edit:p})}};gu.AssetRenameHandler=Xv});var Yv=w(bu=>{"use strict";h();Object.defineProperty(bu,"__esModule",{value:!0});bu.isValidTemplate=vq;bu.isValidSectionGroup=yq;function vq(n){return typeof n=="object"&&n!==null&&"sections"in n&&"order"in n&&Array.isArray(n.order)}function yq(n){return typeof n=="object"&&n!==null&&"sections"in n&&"order"in n&&Array.isArray(n.order)}});var T_=w(yu=>{"use strict";h();Object.defineProperty(yu,"__esModule",{value:!0});yu.BlockRenameHandler=void 0;var wq=Y(),Xe=$(),Zo=he(),Qv=Ni(),li=jr(),k_=Yv(),es="renameBlock",Zv=class{documentManager;connection;capabilities;findThemeRootURI;constructor(e,t,r,i){this.documentManager=e,this.connection=t,this.capabilities=r,this.findThemeRootURI=i}async onDidRenameFiles(e){if(!this.capabilities.hasApplyEditSupport)return;let t=e.files.filter(y=>(0,li.isBlock)(y.oldUri)&&(0,li.isBlock)(y.newUri));if(t.length!==1)return;let r=t[0],i=await this.findThemeRootURI(Xe.path.dirname(e.files[0].oldUri));if(!i)return;await this.documentManager.preload(i);let o=this.documentManager.theme(i,!0),s=o.filter(Qv.isLiquidSourceCode),a=s.filter(y=>(0,li.isBlock)(y.uri)||(0,li.isSection)(y.uri)),l=o.filter(Qv.isJsonSourceCode).filter(y=>(0,li.isTemplate)(y.uri)),c=o.filter(Qv.isJsonSourceCode).filter(y=>(0,li.isSectionGroup)(y.uri)),d=(0,li.blockName)(r.oldUri),p=(0,li.blockName)(r.newUri),m=`Rename block '${d}' to '${p}'`,g={documentChanges:[],changeAnnotations:{[es]:{label:m,needsConfirmation:!1}}},S=new Set,F=await Promise.all(a.map(this.getSchemaChanges(S,d,p))),[P,I,x]=await Promise.all([Promise.all(l.map(this.getTemplateChanges(d,p,S))),Promise.all(c.map(this.getSectionGroupChanges(d,p,S))),Promise.all(s.map(this.getContentForChanges(d,p)))]);for(let y of[...F,...P,...I])y!==null&&g.documentChanges.push(y);for(let y of x)if(y!==null){let R=g.documentChanges.find(O=>O.textDocument.uri===y?.textDocument.uri);R?R.edits.push(...y.edits):g.documentChanges.push(y)}if(g.documentChanges.length===0){console.error("Nothing to do!");return}await this.connection.sendRequest(Zo.ApplyWorkspaceEditRequest.type,{label:m,edit:g})}getSchemaChanges(e,t,r){return async i=>{if(i.ast instanceof Error)return null;let o=i.textDocument,s=await i.getSchema();if(!(0,Xe.isBlockSchema)(s)&&!(0,Xe.isSectionSchema)(s)||(0,Xe.isError)(s.validSchema)||(0,Xe.isError)(s.ast))return null;let{validSchema:a,ast:l,offset:c}=s,d=[];if(a.blocks)for(let m=0;m<a.blocks.length;m++){let g=a.blocks[m];if(Sq(g))return(0,Xe.isSectionSchema)(s)&&e.add(s.name),null;if(g.type!==t)continue;let S=(0,Xe.nodeAtPath)(l,["blocks",m,"type"]);d.push({annotationId:es,newText:r,range:Zo.Range.create(o.positionAt(c+S.loc.start.offset+1),o.positionAt(c+S.loc.end.offset-1))})}let p=(m,g)=>!m||!("blocks"in m)?[]:Array.isArray(m.blocks)?m.blocks.flatMap((S,F)=>{let P=p(S,[...g,"blocks",F]);if(S.type===t){let I=(0,Xe.nodeAtPath)(l,[...g,"blocks",F,"type"]);P.push({annotationId:es,newText:r,range:Zo.Range.create(o.positionAt(c+I.loc.start.offset+1),o.positionAt(c+I.loc.end.offset-1))})}return P}):typeof m.blocks=="object"?Object.entries(m.blocks).flatMap(([S,F])=>{let P=p(F,[...g,"blocks",S]);if(F.type===t){let I=(0,Xe.nodeAtPath)(l,[...g,"blocks",S,"type"]);P.push({annotationId:es,newText:r,range:Zo.Range.create(o.positionAt(c+I.loc.start.offset+1),o.positionAt(c+I.loc.end.offset-1))})}return P}):[];return a.presets&&d.push(...a.presets.flatMap((m,g)=>p(m,["presets",g]))),d.length===0?null:vu(i,d)}}getTemplateChanges(e,t,r){return async i=>{let{textDocument:o,ast:s,source:a}=i,l=(0,Xe.parseJSON)(a);if(!l||(0,Xe.isError)(l)||(0,Xe.isError)(s))return null;let c=C_(e,t,o,s),d=(0,k_.isValidTemplate)(l)?Object.entries(l.sections).flatMap(([p,m])=>"blocks"in m&&m.blocks&&!r.has(m.type)?c(m.blocks,["sections",p,"blocks"]):[]):[];return d.length===0?null:vu(i,d)}}getSectionGroupChanges(e,t,r){return async i=>{let{textDocument:o,ast:s,source:a}=i,l=(0,Xe.parseJSON)(a);if(!l||(0,Xe.isError)(l)||(0,Xe.isError)(s))return null;let c=C_(e,t,o,s),d=(0,k_.isValidSectionGroup)(l)?Object.entries(l.sections).flatMap(([p,m])=>"blocks"in m&&m.blocks&&!r.has(m.type)?c(m.blocks,["sections",p,"blocks"]):[]):[];return d.length===0?null:vu(i,d)}}getContentForChanges(e,t){return async r=>{let{textDocument:i,ast:o}=r;if((0,Xe.isError)(o))return null;let s=(0,Xe.visit)(o,{LiquidTag(a){if(a.name!=="content_for"||typeof a.markup=="string"||a.markup.contentForType.value!=="block")return;let l=a.markup.args.find(c=>c.name==="type");if(!(!l||l.value.type!==wq.NodeTypes.String||l.value.value!==e))return{annotationId:es,newText:t,range:Zo.Range.create(i.positionAt(l.value.position.start+1),i.positionAt(l.value.position.end-1))}}});return s.length===0?null:vu(r,s)}}};yu.BlockRenameHandler=Zv;function Sq(n){return"name"in n&&typeof n.name=="string"}function C_(n,e,t,r){return function i(o,s){return o?Object.entries(o).flatMap(([a,l])=>{let c=i(l.blocks,[...s,a,"blocks"]);if(l.type===n){let d=(0,Xe.nodeAtPath)(r,[...s,a,"type"]);c.push({annotationId:es,newText:e,range:Zo.Range.create(t.positionAt(d.loc.start.offset+1),t.positionAt(d.loc.end.offset-1))})}return c}):[]}}function vu(n,e){return{textDocument:{uri:n.uri,version:n.version??null},edits:e}}});var E_=w(xu=>{"use strict";h();Object.defineProperty(xu,"__esModule",{value:!0});xu.SectionRenameHandler=void 0;var Dn=$(),wu=he(),ey=Ni(),ts=jr(),__=Yv(),Su="renameSection",ny=class{documentManager;connection;capabilities;findThemeRootURI;constructor(e,t,r,i){this.documentManager=e,this.connection=t,this.capabilities=r,this.findThemeRootURI=i}async onDidRenameFiles(e){if(!this.capabilities.hasApplyEditSupport)return;let t=e.files.filter(P=>(0,ts.isSection)(P.oldUri)&&(0,ts.isSection)(P.newUri));if(t.length!==1)return;let r=t[0],i=await this.findThemeRootURI(Dn.path.dirname(e.files[0].oldUri));if(!i)return;await this.documentManager.preload(i);let o=this.documentManager.theme(i,!0),s=o.filter(ey.isLiquidSourceCode),a=o.filter(ey.isJsonSourceCode).filter(P=>(0,ts.isTemplate)(P.uri)),l=o.filter(ey.isJsonSourceCode).filter(P=>(0,ts.isSectionGroup)(P.uri)),c=(0,ts.sectionName)(r.oldUri),d=(0,ts.sectionName)(r.newUri),p=`Rename section '${c}' to '${d}'`,m={documentChanges:[],changeAnnotations:{[Su]:{label:p,needsConfirmation:!1}}},[g,S,F]=await Promise.all([Promise.all(a.map(this.getTemplateChanges(c,d))),Promise.all(l.map(this.getSectionGroupChanges(c,d))),Promise.all(s.map(this.getSectionTagChanges(c,d)))]);for(let P of[...g,...S])P!==null&&m.documentChanges.push(P);for(let P of F)if(P!==null){let I=m.documentChanges.find(x=>x.textDocument.uri===P?.textDocument.uri);I?I.edits.push(...P.edits):m.documentChanges.push(P)}if(m.documentChanges.length===0){console.error("Nothing to do!");return}await this.connection.sendRequest(wu.ApplyWorkspaceEditRequest.type,{label:p,edit:m})}getTemplateChanges(e,t){return async r=>{let{textDocument:i,ast:o,source:s}=r,a=(0,Dn.parseJSON)(s);if(!a||(0,Dn.isError)(a)||(0,Dn.isError)(o))return null;let l=(0,__.isValidTemplate)(a)?Object.entries(a.sections).filter(([c,d])=>d.type===e).map(([c])=>{let d=(0,Dn.nodeAtPath)(o,["sections",c,"type"]);return{annotationId:Su,newText:t,range:wu.Range.create(i.positionAt(d.loc.start.offset+1),i.positionAt(d.loc.end.offset-1))}}):[];return l.length===0?null:ty(r,l)}}getSectionGroupChanges(e,t){return async r=>{let{textDocument:i,ast:o,source:s}=r,a=(0,Dn.parseJSON)(s);if(!a||(0,Dn.isError)(a)||(0,Dn.isError)(o))return null;let l=(0,__.isValidSectionGroup)(a)?Object.entries(a.sections).filter(([c,d])=>d.type===e).map(([c])=>{let d=(0,Dn.nodeAtPath)(o,["sections",c,"type"]);return{annotationId:Su,newText:t,range:wu.Range.create(i.positionAt(d.loc.start.offset+1),i.positionAt(d.loc.end.offset-1))}}):[];return l.length===0?null:ty(r,l)}}getSectionTagChanges(e,t){return async r=>{let{textDocument:i,ast:o}=r;if((0,Dn.isError)(o))return null;let s=(0,Dn.visit)(o,{LiquidTag(a){if(a.name!=="section"||typeof a.markup=="string")return;let l=a.markup.name;if(l.value===e)return{annotationId:Su,newText:t,range:wu.Range.create(i.positionAt(l.position.start+1),i.positionAt(l.position.end-1))}}});return s.length===0?null:ty(r,s)}}};xu.SectionRenameHandler=ny;function ty(n,e){return{textDocument:{uri:n.uri,version:n.version??null},edits:e}}});var F_=w(Cu=>{"use strict";h();Object.defineProperty(Cu,"__esModule",{value:!0});Cu.SnippetRenameHandler=void 0;var ry=Y(),R_=$(),D_=he(),xq=Ni(),ku=jr(),iy=class{documentManager;connection;capabilities;findThemeRootURI;constructor(e,t,r,i){this.documentManager=e,this.connection=t,this.capabilities=r,this.findThemeRootURI=i}async onDidRenameFiles(e){if(!this.capabilities.hasApplyEditSupport)return;let t=e.files.filter(m=>(0,ku.isSnippet)(m.oldUri)&&(0,ku.isSnippet)(m.newUri));if(t.length!==1)return;let r=t[0],i=await this.findThemeRootURI(R_.path.dirname(e.files[0].oldUri));if(!i)return;await this.documentManager.preload(i);let s=this.documentManager.theme(i,!0).filter(xq.isLiquidSourceCode),a=(0,ku.snippetName)(r.oldUri),l=(0,ku.snippetName)(r.newUri),c=`Rename snippet '${a}' to '${l}'`,d="renameSnippet",p={documentChanges:[],changeAnnotations:{[d]:{label:c,needsConfirmation:!1}}};for(let m of s){if(m.ast instanceof Error)continue;let g=m.textDocument,S=(0,R_.visit)(m.ast,{LiquidTag(F){if(F.name!==ry.NamedTags.render&&F.name!==ry.NamedTags.include||typeof F.markup=="string")return;let P=F.markup.snippet;if(P.type===ry.NodeTypes.String&&P.value===a)return{newText:`${l}`,range:D_.Range.create(g.positionAt(P.position.start+1),g.positionAt(P.position.end-1))}}});S.length!==0&&p.documentChanges.push({textDocument:{uri:g.uri,version:m.version??null},annotationId:d,edits:S})}if(p.documentChanges.length===0){console.error("Nothing to do!");return}await this.connection.sendRequest(D_.ApplyWorkspaceEditRequest.type,{label:c,edit:p})}};Cu.SnippetRenameHandler=iy});var P_=w(Tu=>{"use strict";h();Object.defineProperty(Tu,"__esModule",{value:!0});Tu.RenameHandler=void 0;var kq=x_(),Cq=T_(),Tq=E_(),_q=F_(),oy=class{handlers;constructor(e,t,r,i){this.handlers=[new _q.SnippetRenameHandler(r,e,t,i),new kq.AssetRenameHandler(r,e,t,i),new Cq.BlockRenameHandler(r,e,t,i),new Tq.SectionRenameHandler(r,e,t,i)]}async onDidRenameFiles(e){try{let t=this.handlers.map(r=>r.onDidRenameFiles(e));await Promise.all(t)}catch(t){console.error(t);return}}};Tu.RenameHandler=oy});var M_=w((j$,Eq)=>{Eq.exports={name:"@shopify/theme-language-server-common",version:"2.23.1",main:"dist/index.js",types:"dist/index.d.ts",author:"CP Clermont <cp.clermont@shopify.com>",homepage:"https://github.com/Shopify/theme-tools/tree/main/packages/theme-language-server-common#readme",repository:{type:"git",url:"git+https://github.com/Shopify/theme-tools.git",directory:"packages/theme-language-server-common"},bugs:{url:"https://github.com/Shopify/theme-tools/issues"},license:"MIT",publishConfig:{access:"public","@shopify:registry":"https://registry.npmjs.org"},dependencies:{"@shopify/liquid-html-parser":"^2.10.2","@shopify/theme-check-common":"3.30.1","@shopify/theme-graph":"^0.3.5","@vscode/web-custom-data":"^0.4.6","vscode-css-languageservice":"6.3.2","vscode-json-languageservice":"^5.3.10","vscode-jsonrpc":"^8.1.0","vscode-languageserver":"^8.0.2","vscode-languageserver-textdocument":"^1.0.8","vscode-uri":"^3.0.7"},devDependencies:{"@types/node":"^22.18.8","@vitest/expect":"4.1.0"},scripts:{build:"pnpm build:ts","build:ci":"pnpm build","build:ts":"tsc -b src/tsconfig.build.json",dev:"tsc -b src --watch",test:"vitest","type-check":"tsc --noEmit -p src/tsconfig.json"}}});var I_=w(ns=>{"use strict";h();var Rq=ns&&ns.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(ns,"__esModule",{value:!0});ns.VERSION=void 0;var Dq=Rq(M_());ns.VERSION=Dq.default.version});var N_=w(_u=>{"use strict";h();Object.defineProperty(_u,"__esModule",{value:!0});_u.CachedFileSystem=void 0;var ay=class{readFile;readDirectory;stat;constructor(e){this.readFile=sy(e.readFile.bind(e)),this.readDirectory=sy(e.readDirectory.bind(e)),this.stat=sy(e.stat.bind(e))}};_u.CachedFileSystem=ay;function sy(n){let e=new Map;function t(r){return e.has(r)||e.set(r,n(r)),e.get(r)}return t.invalidate=r=>{e.delete(r)},t}});var A_=w(re=>{"use strict";h();Object.defineProperty(re,"__esModule",{value:!0});re.Configuration=re.ConfigurationKeys=re.PRELOAD_ON_BOOT=re.CHECK_ON_CHANGE=re.CHECK_ON_SAVE=re.CHECK_ON_OPEN=void 0;var z_=$(),O_=te();re.CHECK_ON_OPEN="themeCheck.checkOnOpen";re.CHECK_ON_SAVE="themeCheck.checkOnSave";re.CHECK_ON_CHANGE="themeCheck.checkOnChange";re.PRELOAD_ON_BOOT="themeCheck.preloadOnBoot";re.ConfigurationKeys=[re.CHECK_ON_OPEN,re.CHECK_ON_SAVE,re.CHECK_ON_CHANGE,re.PRELOAD_ON_BOOT];var ly=class{connection;capabilities;[re.CHECK_ON_OPEN]=!0;[re.CHECK_ON_SAVE]=!0;[re.CHECK_ON_CHANGE]=!0;[re.PRELOAD_ON_BOOT]=!0;constructor(e,t){this.connection=e,this.capabilities=t,this.connection=e,this.capabilities=t}setup(){this[re.CHECK_ON_OPEN]=this.capabilities.initializationOption(re.CHECK_ON_OPEN,!0),this[re.CHECK_ON_SAVE]=this.capabilities.initializationOption(re.CHECK_ON_SAVE,!0),this[re.CHECK_ON_CHANGE]=this.capabilities.initializationOption(re.CHECK_ON_CHANGE,!0),this[re.PRELOAD_ON_BOOT]=this.capabilities.initializationOption(re.PRELOAD_ON_BOOT,!0)}async shouldCheckOnOpen(){return await this.fetchConfiguration(),this[re.CHECK_ON_OPEN]}async shouldCheckOnSave(){return await this.fetchConfiguration(),this[re.CHECK_ON_SAVE]}async shouldCheckOnChange(){return await this.fetchConfiguration(),this[re.CHECK_ON_CHANGE]}async shouldPreloadOnBoot(){return await this.fetchConfiguration(),this[re.PRELOAD_ON_BOOT]}clearCache(){this.fetchConfiguration.clearCache()}fetchConfiguration=(0,z_.memo)(async()=>{if(!this.capabilities.hasWorkspaceConfigurationSupport)return;let e=await this.connection.workspace.getConfiguration(re.ConfigurationKeys.map(t=>({section:t})));for(let t=0;t<re.ConfigurationKeys.length;t++){let r=re.ConfigurationKeys[t];e[t]!==null&&(this[r]=e[t])}});registerDidChangeCapability=(0,z_.memo)(async()=>{if(this.capabilities.hasDidChangeConfigurationDynamicRegistrationSupport)return this.connection.client.register(O_.DidChangeConfigurationNotification.type)});registerDidChangeWatchedFilesNotification=async e=>{if(this.capabilities.hasDidChangeWatchedFilesDynamicRegistrationSupport)return this.connection.client.register(O_.DidChangeWatchedFilesNotification.type,e)}};re.Configuration=ly});var L_=w(Eu=>{"use strict";h();Object.defineProperty(Eu,"__esModule",{value:!0});Eu.safe=void 0;var Fq=(n,e)=>async function(...r){try{return await n(...r)}catch{return e}};Eu.safe=Fq});var q_=w(Ru=>{"use strict";h();Object.defineProperty(Ru,"__esModule",{value:!0});Ru.ThemeGraphManager=void 0;var rs=$(),cy=i0(),Pq=(Ga(),Kt(Va)),Mq=(cs(),Kt(Ba)),Iq=ll(),Nq=Dt(),dy=class{connection;documentManager;fs;findThemeRootURI;getModeForURI;graphs=new Map;constructor(e,t,r,i,o=async()=>"theme"){this.connection=e,this.documentManager=t,this.fs=r,this.findThemeRootURI=i,this.getModeForURI=o}async getThemeGraphForURI(e){let t=await this.findThemeRootURI(e);if(t)return this.graphs.has(t)||this.graphs.set(t,this.buildThemeGraph(t)),this.graphs.get(t)}async getReferences(e,t,{includeIndirect:r=!0,includePreset:i=!0}={}){let o=await this.getThemeGraphForURI(e);if(!o)return[];let s=o.modules[e];if(!s)return[];let a=["direct",r?"indirect":void 0,i?"preset":void 0],l=s.references.filter(c=>a.includes(c.type));return Promise.all(l.map(async c=>{let[d,p]=await Promise.all([this.augmentedLocation(c.source),this.augmentedLocation(c.target)]);return{...c,source:d,target:p}}))}async getDependencies(e,t,{includeIndirect:r=!0,includePreset:i=!0}={}){let o=await this.getThemeGraphForURI(e);if(!o)return[];let s=o.modules[e];if(s||(s=(await this.buildThemeGraph(o.rootUri,[e])).modules[e]),!s)return[];let a=["direct",r?"indirect":void 0,i?"preset":void 0],l=s.dependencies.filter(c=>a.includes(c.type))??[];return Promise.all(l.map(async c=>{let[d,p]=await Promise.all([this.augmentedLocation(c.source),this.augmentedLocation(c.target)]);return{...c,source:d,target:p}}))}async augmentedLocation(e){let t=await this.getSourceCode(e.uri).catch(()=>{}),{uri:r,range:i}=e;if(!t||!i)return{exists:!!t,...e};let o=this.documentManager.get(e.uri)?.textDocument;return o||(o=Mq.TextDocument.create(t.uri,t.type,0,t.source)),{uri:r,range:i,excerpt:t.source.slice(i[0],i[1]),position:Pq.Range.create(o.positionAt(i[0]),o.positionAt(i[0])),exists:!0}}async deadCode(e){let t=await this.getThemeGraphForURI(e);if(!t)return[];let r=await(0,rs.recursiveReadDirectory)(this.fs,e,([o])=>["assets","blocks","layout","sections","snippets","templates"].some(s=>o.startsWith(rs.path.join(e,s)))&&(o.endsWith(".liquid")||o.endsWith(".json")||o.endsWith(".js")||o.endsWith(".css"))),i=new Set;for(let o of r)t.modules[o]||i.add(o);return Array.from(i).sort()}operationQueue=[];async rename(e,t){this.operationQueue.push(e),this.operationQueue.push(t),this.processQueue()}async change(e){this.operationQueue.push(e),this.processQueue()}async create(e){this.operationQueue.push(e),this.processQueue()}async delete(e){this.operationQueue.push(e),this.processQueue()}processQueue=(0,Nq.debounce)(async()=>{let e=[...new Set(this.operationQueue.splice(0,this.operationQueue.length))];if(e.length===0)return;let t=e[0],r=await this.findThemeRootURI(t);!r||!await this.graphs.get(r)||(this.graphs.delete(r),await this.getThemeGraphForURI(r),this.connection.sendNotification(Iq.ThemeGraphDidUpdateNotification.type,{uri:r}))},500);buildThemeGraph=async(e,t)=>{let{documentManager:r}=this;await r.preload(e);let i=await this.graphDependencies(e);return(0,cy.buildThemeGraph)(e,i,t)};getSourceCode=async e=>{let t=this.documentManager.get(e);if(t)return t;let r=await this.fs.readFile(e);return(0,cy.toSourceCode)(e,r)};getWebComponentMap(e){let{fs:t,getSourceCode:r}=this;return(0,cy.getWebComponentMap)(e,{fs:t,getSourceCode:r})}async graphDependencies(e){let{documentManager:t,fs:r,getSourceCode:i}=this,[o,s]=await Promise.all([this.getWebComponentMap(e),this.getModeForURI(e)]);return{fs:r,getSourceCode:i,mode:s,async getBlockSchema(a){let l=rs.path.join(e,"blocks",`${a}.liquid`),c=t.get(l);if(!(!c||c.type!==rs.SourceCodeType.LiquidHtml))return await c.getSchema()},async getSectionSchema(a){let l=rs.path.join(e,"sections",`${a}.liquid`),c=t.get(l);if(!(!c||c.type!==rs.SourceCodeType.LiquidHtml))return await c.getSchema()},getWebComponentDefinitionReference(a){return o.get(a)}}}};Ru.ThemeGraphManager=dy});var j_=w(uy=>{"use strict";h();Object.defineProperty(uy,"__esModule",{value:!0});uy.startServer=tW;var ve=$(),za=te(),zq=ox(),W_=kx(),H_=cc(),Oq=Ak(),Aq=u1(),Lq=y1(),U_=x1(),qq=P1(),Wq=N1(),Hq=Ni(),Uq=V1(),jq=wT(),$q=s_(),Bq=h_(),Vq=y_(),Gq=P_(),Du=ll(),Kq=Dt(),Jq=jr(),Xq=I_(),Yq=N_(),Qq=A_(),hy=L_(),Zq=q_(),eW=()=>{},ct=n=>"textDocument"in n&&"uri"in n.textDocument&&typeof n.textDocument.uri=="string"&&(n.textDocument.uri.startsWith("jj:")||n.textDocument.uri.startsWith("git:")||n.textDocument.uri.startsWith("output:"));function tW(n,{fs:e,loadConfig:t,log:r=eW,jsonValidationSet:i,themeDocset:o,fetchMetafieldDefinitionsForURI:s}){let a=new Yq.CachedFileSystem(e),l=(0,ve.makeFileExists)(a),c=(0,ve.memoize)(t,T=>T),d=new zq.ClientCapabilities,p=new Qq.Configuration(n,d),m=new Hq.DocumentManager(a,n,d,Bt,Rr),g=new Zq.ThemeGraphManager(n,m,a,W,Bt),S=new U_.DiagnosticsManager(n),F=new Wq.DocumentLinksProvider(m,W),P=new W_.CodeActionsProvider(m,S),I=new Uq.OnTypeFormattingProvider(m,async function(q,H){d.hasShowDocumentSupport&&n.sendRequest(za.ShowDocumentRequest.type,{uri:q.uri,takeFocus:!0,selection:{start:H,end:H}})}),x=new Bq.LinkedEditingRangesProvider(m),y=new qq.DocumentHighlightsProvider(m),R=new Vq.RenameProvider(n,d,m,W),O=new Gq.RenameHandler(n,d,m,W);async function W(T){let q=await(0,ve.findRoot)(T,l);return q?(await c(q,a)).rootUri:null}let ke=(0,ve.memoize)((0,ve.makeGetMetafieldDefinitions)(a),T=>T),Fe=async T=>{let q=await W(T);return q?ke(q):{}},jt=new ve.AugmentedThemeDocset(o),Mt=new Aq.CSSLanguageService(m),Tt=(0,Kq.debounce)((0,U_.makeRunChecks)(m,S,{fs:a,loadConfig:c,themeDocset:jt,jsonValidationSet:i,getMetafieldDefinitions:Fe,cssLanguageService:Mt,themeGraphManager:g}),100),_t=async T=>{let q=await W(T);if(!q)return{};let H=m.theme(q),K=(0,ve.makeGetDefaultTranslations)(a,H,q),[De,Et]=await Promise.all([K(),jt.systemTranslations()]);return{...Et,...De}},Pn=async T=>{let q=await W(T);if(!q)return{};let H=m.theme(q);return(0,ve.makeGetDefaultSchemaTranslations)(a,H,q)()},ci=async(T,q,H)=>{let K=await W(T);if(!K)return;let De=ve.path.join(K,q,`${H}.liquid`),Et=m.get(De);if(!(!Et||Et.type!==ve.SourceCodeType.LiquidHtml||(0,ve.isError)(Et.ast)))return Et.getLiquidDoc()},$t=([T])=>/\.liquid$/.test(T)&&/snippets/.test(T),It=(0,hy.safe)(async T=>{let q=await W(T);return q?(await(0,ve.recursiveReadDirectory)(a,q,$t)).map(Jq.snippetName):[]},[]),Er=(0,hy.safe)(async T=>{let q=await W(T);if(!q)return[];let H=ve.path.join(q,"config","settings_schema.json"),K=await a.readFile(H),De=(0,ve.parseJSON)(K);if((0,ve.isError)(De)||!Array.isArray(De))throw new Error("Settings JSON file not in correct format");return De},[]);async function Bt(T){let q=await(0,ve.findRoot)(T,l);return q?(await c(q,a)).context:"theme"}let Mn=(0,hy.safe)(async(T,q)=>{let H=await W(T);if(!H)return[];let De=(await a.readDirectory(ve.path.join(H,"blocks"))).map(([Et])=>ve.path.basename(Et,".liquid"));return q?De:De.filter(Et=>!Et.startsWith("_"))},[]);async function Ye(T,q){let H=await W(T);if(!H)return;let K=ve.path.join(H,"blocks",`${q}.liquid`),De=m.get(K);if(!(!De||De.type!==ve.SourceCodeType.LiquidHtml))return De.getSchema()}async function Rr(T,q){return di.isValidSchema(T,q)}let is=(0,ve.makeGetDefaultLocaleFileUri)(a);async function Ai(T){let q=await W(T);if(!q)return null;let H=await is(q);return H?m.get(H)??null:null}let Li=(0,ve.makeGetDefaultSchemaLocaleFileUri)(a);async function qi(T){let q=await W(T);if(!q)return null;let H=await Li(q);return H?m.get(H)??null:null}let Nu=new Lq.DefinitionProvider(m,Ai,qi),di=new $q.JSONLanguageService(m,i,Pn,Bt,Mn,Ye,W),zu=new Oq.CompletionsProvider({documentManager:m,themeDocset:jt,getTranslationsForURI:_t,getSchemaTranslationsForURI:Pn,getSnippetNamesForURI:It,getThemeSettingsSchemaForURI:Er,log:r,getThemeBlockNames:Mn,getMetafieldDefinitions:Fe,getDocDefinitionForURI:ci,getModeForURI:Bt,getThemeBlockSchema:Ye,findThemeRootURI:W}),Ou=new jq.HoverProvider(m,jt,Fe,_t,Er,ci,Bt,Ye,Pn),Au=new H_.ExecuteCommandProvider(m,S,d,Tt,n),Aa=async T=>{if(s)for(let q of T)await Bt(q.uri)==="theme"&&s(q.uri)};n.onInitialize(T=>{d.setup(T.capabilities,T.initializationOptions),Mt.setup(T.capabilities),di.setup(T.capabilities),p.setup();let q={filters:[{pattern:{glob:"**/*.{liquid,json}"}},{pattern:{glob:"**/assets/*"}}]};return{capabilities:{textDocumentSync:{change:za.TextDocumentSyncKind.Full,save:!0,openClose:!0},codeActionProvider:{codeActionKinds:[...W_.CodeActionKinds]},completionProvider:{triggerCharacters:[".","{{ ","{% ","<","/","[",'"',"'",":","@"]},definitionProvider:!0,documentOnTypeFormattingProvider:{firstTriggerCharacter:" ",moreTriggerCharacter:["{","%","-",">"]},documentLinkProvider:{resolveProvider:!1,workDoneProgress:!1},documentHighlightProvider:!0,linkedEditingRangeProvider:!0,renameProvider:{prepareProvider:!0},executeCommandProvider:{commands:[...H_.Commands]},hoverProvider:{workDoneProgress:!1},workspace:{workspaceFolders:{supported:!0,changeNotifications:!0},fileOperations:{didRename:q}}},serverInfo:{name:"theme-language-server",version:Xq.VERSION}}}),n.onInitialized(()=>{r("[SERVER] Let's roll!"),p.fetchConfiguration(),p.registerDidChangeCapability(),p.registerDidChangeWatchedFilesNotification({watchers:[{globPattern:"**/.theme-check.yml"},{globPattern:"**/.shopify/*"},{globPattern:"**/*.liquid"},{globPattern:"**/assets/*.css"},{globPattern:"**/{locales,sections,templates,customers}/*.json"},{globPattern:"**/config/settings_{data,schema}.json"}]}),d.hasWorkspaceFoldersSupport&&(n.workspace.getWorkspaceFolders().then(async T=>{T&&Aa(T)}),n.workspace.onDidChangeWorkspaceFolders(async T=>{Aa(T.added)}))}),n.onDidChangeConfiguration(T=>{p.clearCache()}),n.onDidOpenTextDocument(async T=>{if(ct(T))return;let{uri:q,text:H,version:K}=T.textDocument;if(m.open(q,H,K),await p.shouldCheckOnOpen()&&Tt([q]),await p.shouldPreloadOnBoot()){let De=await W(q);De&&m.preload(De)}}),n.onDidChangeTextDocument(async T=>{if(ct(T))return;let{uri:q,version:H}=T.textDocument;m.change(q,T.contentChanges[0].text,H),await p.shouldCheckOnChange()?Tt([q]):S.clear(T.textDocument.uri)}),n.onDidSaveTextDocument(async T=>{if(ct(T))return;let{uri:q}=T.textDocument;await p.shouldCheckOnSave()&&Tt([q])}),n.onDidCloseTextDocument(T=>{if(ct(T))return;let{uri:q}=T.textDocument;m.close(q),S.clear(q)}),n.onDocumentLinks(async T=>{if(ct(T))return[];let[q,H]=await Promise.all([F.documentLinks(T.textDocument.uri),di.documentLinks(T)]);return[...q,...H]}),n.onDefinition(async T=>ct(T)?[]:Nu.definitions(T)),n.onCodeAction(async T=>P.codeActions(T)),n.onExecuteCommand(async T=>{await Au.execute(T)}),n.onCompletion(async T=>ct(T)?[]:await Mt.completions(T)??await di.completions(T)??await zu.completions(T)),n.onHover(async T=>ct(T)?null:await Mt.hover(T)??await di.hover(T)??await Ou.hover(T)),n.onDocumentOnTypeFormatting(async T=>ct(T)?null:I.onTypeFormatting(T)),n.onDocumentHighlight(async T=>ct(T)?[]:y.documentHighlights(T)),n.onPrepareRename(async T=>ct(T)?null:R.prepare(T)),n.onRenameRequest(async T=>ct(T)?null:R.rename(T)),n.languages.onLinkedEditingRange(async T=>ct(T)?null:x.linkedEditingRanges(T)),n.workspace.onDidRenameFiles(async T=>{let q=T.files.map(H=>H.newUri);for(let{oldUri:H,newUri:K}of T.files)m.rename(H,K),a.readDirectory.invalidate(ve.path.dirname(H)),a.readDirectory.invalidate(ve.path.dirname(K)),a.readFile.invalidate(H),a.readFile.invalidate(K),a.stat.invalidate(H),a.stat.invalidate(K),g.rename(H,K);await O.onDidRenameFiles(T),Tt.force(q)}),n.onDidChangeWatchedFiles(async T=>{if(T.changes.length===0)return;let q=T.changes.map(K=>K.uri),H=[];for(let K of T.changes){if(K.uri.endsWith(".theme-check.yml")){c.clearCache();continue}if(m.hasRecentRename(K.uri)){m.clearRecentRename(K.uri);continue}switch(K.type){case za.FileChangeType.Created:a.readDirectory.invalidate(ve.path.dirname(K.uri)),a.readFile.invalidate(K.uri),a.stat.invalidate(K.uri),g.create(K.uri),H.push(m.changeFromDisk(K.uri));break;case za.FileChangeType.Changed:a.readFile.invalidate(K.uri),a.stat.invalidate(K.uri),g.change(K.uri),m.get(K.uri)?.version===void 0&&H.push(m.changeFromDisk(K.uri));break;case za.FileChangeType.Deleted:a.readDirectory.invalidate(ve.path.dirname(K.uri)),a.readFile.invalidate(K.uri),a.stat.invalidate(K.uri),g.delete(K.uri),m.delete(K.uri);break}K.uri.endsWith("metafields.json")&&H.push(W(K.uri).then(De=>{De&&ke.invalidate(De)}))}await Promise.all(H),Tt.force(q)}),n.onRequest(Du.ThemeGraphReferenceRequest.type,async T=>{if(ct(T))return[];let{uri:q,offset:H,includeIndirect:K}=T;return g.getReferences(q,H,{includeIndirect:K}).catch(De=>[])}),n.onRequest(Du.ThemeGraphDependenciesRequest.type,async T=>{if(ct(T))return[];let{uri:q,offset:H,includeIndirect:K}=T;return g.getDependencies(q,H,{includeIndirect:K}).catch(De=>[])}),n.onRequest(Du.ThemeGraphRootRequest.type,async T=>{if(ct(T))return"";let{uri:q}=T,H=await W(q).catch(K=>{});return(!H||ve.path.dirname(H)===H)&&console.error(q),H}),n.onRequest(Du.ThemeGraphDeadCodeRequest.type,async T=>{if(ct(T))return[];let{uri:q}=T,H=await W(q);return H?await g.deadCode(H):[]}),n.listen()}});var $_=w(Fu=>{"use strict";h();Object.defineProperty(Fu,"__esModule",{value:!0});Fu.startServer=void 0;var nW=j_();Object.defineProperty(Fu,"startServer",{enumerable:!0,get:function(){return nW.startServer}})});var Mu=w(Re=>{"use strict";h();var rW=Re&&Re.__createBinding||(Object.create?(function(n,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,r,i)}):(function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]})),iW=Re&&Re.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&rW(e,n,t)};Object.defineProperty(Re,"__esModule",{value:!0});Re.SourceCodeType=Re.FileType=Re.allChecks=Re.recommendedChecks=Re.startServer=Re.parseJSON=Re.memo=Re.debounce=Re.visit=void 0;var Pu=$();Object.defineProperty(Re,"allChecks",{enumerable:!0,get:function(){return Pu.allChecks}});Object.defineProperty(Re,"recommendedChecks",{enumerable:!0,get:function(){return Pu.recommended}});Object.defineProperty(Re,"FileType",{enumerable:!0,get:function(){return Pu.FileType}});Object.defineProperty(Re,"SourceCodeType",{enumerable:!0,get:function(){return Pu.SourceCodeType}});iW(ll(),Re);var oW=$();Object.defineProperty(Re,"visit",{enumerable:!0,get:function(){return oW.visit}});var py=Dt();Object.defineProperty(Re,"debounce",{enumerable:!0,get:function(){return py.debounce}});Object.defineProperty(Re,"memo",{enumerable:!0,get:function(){return py.memo}});Object.defineProperty(Re,"parseJSON",{enumerable:!0,get:function(){return py.parseJSON}});var sW=$_();Object.defineProperty(Re,"startServer",{enumerable:!0,get:function(){return sW.startServer}})});var V_=w((s6,B_)=>{"use strict";h();B_.exports=te()});var K_=w(Iu=>{"use strict";h();Object.defineProperty(Iu,"__esModule",{value:!0});Iu.loadConfig=void 0;var Fn=qu(),aW=Mu(),Oa=La();function G_(n){return Oa.URI.isUri(n)?n.fsPath:/^file:/i.test(n)?Oa.URI.parse(n).fsPath:Oa.URI.file(n).fsPath}var lW=async(n,e)=>(await(0,Fn.recursiveReadDirectory)(e,n,([r])=>r.endsWith(".extension.toml"))).length>0,cW=async function(e,t){let r=Fn.path.normalize(e),i=(0,Fn.makeFileExists)(t),o=await(0,Fn.findRoot)(r,i);if(!o)throw new Error(`Could not find theme root for ${r}`);let s=Oa.URI.parse(o),a=s.scheme,l=Oa.Utils.joinPath(s,".theme-check.yml"),[c,d]=await Promise.all([i(Fn.path.normalize(l)),lW(Fn.path.normalize(s),t)]);if(a==="file"){let p=G_(l),m=G_(s);return c?(0,Fn.loadConfig)(p,m).then(my):d?(0,Fn.loadConfig)("theme-check:theme-app-extension",m).then(my):(0,Fn.loadConfig)(void 0,m).then(my)}else return{checks:aW.recommendedChecks,settings:{},context:d?"app":"theme",rootUri:Fn.path.normalize(s)}};Iu.loadConfig=cW;function my(n){return n.rootUri=Fn.path.normalize(n.rootUri),n}});var J_=w(_r=>{"use strict";h();var dW=_r&&_r.__createBinding||(Object.create?(function(n,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,r,i)}):(function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]})),hW=_r&&_r.__setModuleDefault||(Object.create?(function(n,e){Object.defineProperty(n,"default",{enumerable:!0,value:e})}):function(n,e){n.default=e}),uW=_r&&_r.__importStar||(function(){var n=function(e){return n=Object.getOwnPropertyNames||function(t){var r=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[r.length]=i);return r},n(e)};return function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r=n(e),i=0;i<r.length;i++)r[i]!=="default"&&dW(t,e,r[i]);return hW(t,e),t}})();Object.defineProperty(_r,"__esModule",{value:!0});_r.fetchMetafieldDefinitionsForURI=bW;var pW=uW(Vt("child_process")),mW=Vt("node:util"),fy=(0,mW.promisify)(pW.exec),fW=process.platform==="win32",gW=vW();async function bW(n){try{let e=await gW;if(!e)return;await fy(`${e} theme metafields pull`,{cwd:new URL(n),timeout:1e4,env:{...process.env,SHOPIFY_LANGUAGE_SERVER:"1"}})}catch{}}async function vW(){if(process.env.NODE_ENV!=="test")try{if(fW){let{stdout:n}=await fy("where.exe shopify"),e=n.replace(/\r/g,"").split(`
|
|
565
565
|
`).filter(t=>t.endsWith("bat"));return e.length>0?e[0]:""}else{let{stdout:n}=await fy("which shopify");return n.split(`
|
|
566
|
-
`)[0].replace("\r","")}}catch{return}}});var Y_=w(Ut=>{"use strict";h();var yW=Ut&&Ut.__createBinding||(Object.create?(function(n,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,r,i)}):(function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]})),wW=Ut&&Ut.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&yW(e,n,t)};Object.defineProperty(Ut,"__esModule",{value:!0});Ut.getConnection=Ut.NodeFileSystem=void 0;Ut.startServer=DW;var SW=o0(),xW=qu(),kW=Mu(),X_=Vt("node:process"),CW=V_(),TW=K_(),_W=J_(),EW=qu();Object.defineProperty(Ut,"NodeFileSystem",{enumerable:!0,get:function(){return EW.NodeFileSystem}});wW(Mu(),Ut);var RW=()=>(0,CW.createConnection)(X_.stdin,X_.stdout);Ut.getConnection=RW;function DW(n=(0,Ut.getConnection)(),e=xW.NodeFileSystem){let t=i=>console.error(i),r=new SW.ThemeLiquidDocsManager(t);(0,kW.startServer)(n,{fs:e,log:t,loadConfig:TW.loadConfig,themeDocset:r,jsonValidationSet:r,fetchMetafieldDefinitionsForURI:_W.fetchMetafieldDefinitionsForURI})}});h();var Q_=Gt(Y_(),1),gy=class extends xy{static summary="Start a Language Server Protocol server.";static descriptionWithMarkdown="Starts the [Language Server](https://shopify.dev/docs/themes/tools/cli/language-server).";static description=this.
|
|
566
|
+
`)[0].replace("\r","")}}catch{return}}});var Y_=w(Ut=>{"use strict";h();var yW=Ut&&Ut.__createBinding||(Object.create?(function(n,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,r,i)}):(function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]})),wW=Ut&&Ut.__exportStar||function(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&yW(e,n,t)};Object.defineProperty(Ut,"__esModule",{value:!0});Ut.getConnection=Ut.NodeFileSystem=void 0;Ut.startServer=DW;var SW=o0(),xW=qu(),kW=Mu(),X_=Vt("node:process"),CW=V_(),TW=K_(),_W=J_(),EW=qu();Object.defineProperty(Ut,"NodeFileSystem",{enumerable:!0,get:function(){return EW.NodeFileSystem}});wW(Mu(),Ut);var RW=()=>(0,CW.createConnection)(X_.stdin,X_.stdout);Ut.getConnection=RW;function DW(n=(0,Ut.getConnection)(),e=xW.NodeFileSystem){let t=i=>console.error(i),r=new SW.ThemeLiquidDocsManager(t);(0,kW.startServer)(n,{fs:e,log:t,loadConfig:TW.loadConfig,themeDocset:r,jsonValidationSet:r,fetchMetafieldDefinitionsForURI:_W.fetchMetafieldDefinitionsForURI})}});h();var Q_=Gt(Y_(),1),gy=class extends xy{static summary="Start a Language Server Protocol server.";static descriptionWithMarkdown="Starts the [Language Server](https://shopify.dev/docs/themes/tools/cli/language-server).";static description=this.descriptionForHelp();static flags={...Sy};static multiEnvironmentsFlags=null;async command(){(0,Q_.startServer)()}};export{gy as a};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{b as u,c as m}from"./chunk-DGMRL5DQ.js";import{b as h}from"./chunk-FW5HGFSZ.js";import{N as i}from"./chunk-SKRUMRB4.js";import{a as n}from"./chunk-5RL6DKWR.js";import{Ib as p,b as s}from"./chunk-YJWNM4XO.js";import{b as g}from"./chunk-JA2QZ635.js";import{e as S,g as e}from"./chunk-VKWPEFWQ.js";e();e();async function f(t){let r=new URLSearchParams;return r.append("search",t??""),{url:`https://shopify.dev/docs?${r.toString()}`}}e();e();var o=n({name:"SearchResult",schema:s.object({url:s.string().url()})});async function l(t,r){r==="json"?p(o.encode(t)):await i(t.url)}var d=S(g(),1),a=class t extends h{static descriptionWithMarkdown="Search shopify.dev for the most relevant content matching a query. Best for discovery \u2014 surfacing the relevant pieces of documentation for a topic, rather than retrieving a whole document. To download a full document verbatim, use `doc fetch`.";static description=this.descriptionForHelp();static usage="search [query]";static examples=[`# open the search modal on Shopify.dev
|
|
2
|
+
shopify search
|
|
3
|
+
|
|
4
|
+
# search for a term on Shopify.dev
|
|
5
|
+
shopify search <query>
|
|
6
|
+
|
|
7
|
+
# search for a phrase on Shopify.dev
|
|
8
|
+
shopify search "<a search query separated by spaces>"
|
|
9
|
+
`];static args={query:d.Args.string()};static flags={...u,...m};static get jsonOutputSchema(){return o}async run(){let{args:r,flags:c}=await this.parse(t),y=await f(r.query);await l(y,c.json?"json":"text")}};export{a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as h}from"./chunk-5XO6PAMV.js";import{b as p}from"./chunk-WNO2V53C.js";import{b as C}from"./chunk-JA2QZ635.js";import{a as c}from"./chunk-JD5P5RAJ.js";import{e as L,g as u}from"./chunk-VKWPEFWQ.js";u();u();import{fileURLToPath as y}from"node:url";async function g(e){let{isDevelopment:o}=await import("./local-KAZJAYLX.js"),{ShopifyConfig:n}=await import("./custom-oclif-loader-VQKMCXNH.js"),r=await import("./lib-AD2G3QH3.js"),{run:s,flush:m,Errors:l,settings:f}=r.default??r;o()&&(f.debug=!0);try{let t=new n({root:y(e.moduleURL)});await t.load(),e.lazyCommandLoader&&t.setLazyCommandLoader(e.lazyCommandLoader);let a=e.argv??process.argv.slice(2),i=a.indexOf("--");if((i===-1?a:a.slice(0,i)).includes("--json-schema")||c(process.env.SHOPIFY_FLAG_JSON_SCHEMA)){let{printCommandJsonSchema:I}=await import("./command-json-schema-Y3N2NUZN.js");await I(t,a,e.lazyCommandLoader);return}await s(a,t),await m()}catch(t){let{errorHandler:a}=await import("./error-handler-D5BURRJ7.js");await a(t);let i=t;return l.handle({...i,name:i?.name??"Error",message:i?.message??String(t),stack:i?.stack,skipOclifErrorHandling:!0})}}var d=L(C());async function O(e=process.versions){let o=e.node,n=Number(o.split(".")[0]);if(n<22){let{renderError:s}=await import("./ui-TEZZM7SE.js");s({headline:"Upgrade to a supported Node version now.",body:[`Node ${n} has reached end-of-life and poses security risks. When you upgrade to a`,{link:{url:"https://nodejs.dev/en/about/previous-releases",label:"supported version"}},{char:","},"you'll be able to use Shopify CLI without interruption."]}),process.exit(1)}}function v(e,o=process.argv,n=process.env){o.includes("--verbose")&&(n.DEBUG=n.DEBUG??"*"),e.development&&(n.SHOPIFY_CLI_ENV=n.SHOPIFY_CLI_ENV??"development")}function b(e=process.argv,o=process.env){(e.includes("--no-color")||e.includes("--json")||e.includes("-j")||c(o.NO_COLOR)||c(o.SHOPIFY_FLAG_NO_COLOR)||c(o[p.json])||o.TERM==="dumb")&&(o.FORCE_COLOR="0")}async function H(e,o=g,n=process.argv,r=process.env,s=process.versions){return v(e,n,r),e.runInCreateMode&&await w(e,n),b(n,r),await O(s),o({moduleURL:e.moduleURL,lazyCommandLoader:e.lazyCommandLoader})}async function w(e,o=process.argv){let{findUpAndReadPackageJson:n}=await import("./node-package-manager-RVPONQBY.js"),{moduleDirectory:r}=await import("./path-6YMSTSWG.js"),l=(await n(r(e.moduleURL))).content.name.replace("@shopify/create-","");if(o.findIndex(t=>t.includes("init"))===-1){let t=o.findIndex(a=>a.match(new RegExp(`bin(\\/|\\\\)+(create-${l}|dev|run)`)))+1;o.splice(t,0,"init")}}var k={...h,"no-color":d.Flags.boolean({hidden:!1,description:"Disable color output.",env:"SHOPIFY_FLAG_NO_COLOR"}),verbose:d.Flags.boolean({hidden:!1,description:"Increase the verbosity of the output. May include sensitive data.",env:"SHOPIFY_FLAG_VERBOSE"})},U={json:d.Flags.boolean({char:"j",description:"Output the result as JSON. Automatically disables color output.",hidden:!1,default:!1,env:p.json})},V={"auth-alias":d.Flags.string({description:"Alias of the Shopify account to use for authentication.",env:"SHOPIFY_FLAG_AUTH_ALIAS"})},P=(e={})=>{let o=[e.description,"Must be between 1 and 65535."].filter(Boolean).join(" ");return d.Flags.integer({min:1,max:65535,...e,description:o})};function D(e){let o=e.description?.trimEnd(),r=[o&&!o.endsWith(".")?`${o}.`:o,"Required if non interactive."].filter(Boolean).join(" ");return{...e,description:r,requiredIfNonInteractive:!0}}async function M(){let{cacheClear:e}=await import("./conf-store-5ZA3ILWV.js");e()}export{H as a,k as b,U as c,V as d,P as e,D as f,M as g};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{A as x,a as oe,b as ne,c as M,d as ie,e as ae,g as L,i as P,j as le,k as ce,m as ue,n as pe,o as me,r as fe,s as de,t as ge,u as Ee,v,w as he,x as ye,y as Te,z as A}from"./chunk-55PABKRC.js";import{a as se}from"./chunk-JROJL6RV.js";import{a as re}from"./chunk-YGFEUXKQ.js";import{a as K}from"./chunk-JTPVSO6Y.js";import{Ha as te,I as z,aa as Z,ca as ee,l as X}from"./chunk-2KLXRVGQ.js";import{sa as W}from"./chunk-Q45XAEG2.js";import{b as Q,c as Y}from"./chunk-DGMRL5DQ.js";import{u as $}from"./chunk-L5XWYTHY.js";import{d as N,e as m,f as o,l as H,y as G}from"./chunk-SKRUMRB4.js";import{i as C}from"./chunk-FCULF3JA.js";import{Ib as F,Kb as I,ga as V}from"./chunk-YJWNM4XO.js";import{b as Ce}from"./chunk-JA2QZ635.js";import{j}from"./chunk-3VYOLEQE.js";import{e as k,g}from"./chunk-VKWPEFWQ.js";g();g();g();g();g();g();var _=k(N(),1);function be(t){let s=(0,_.useRef)(t);(0,_.useEffect)(()=>{s.current=t},[t]),(0,_.useEffect)(()=>{let n;function i(){s.current().then(({retryIntervalMs:l})=>{l&&(n=setTimeout(i,l))}).catch(()=>{})}return n=setTimeout(i,0),()=>n&&clearTimeout(n)},[])}g();var U=async({pollOptions:{jwtToken:t,cursor:s,filters:n},developerPlatformClient:i,organizationId:a})=>{let l=await i.appLogs({jwtToken:t,cursor:s},a),{errors:f,status:u}=l;if(u!==200){if(u===401||u===429||u>=500)return{errors:f.map(y=>({status:u,message:y}))};throw new C(`${f.join(", ")} while fetching app logs`)}let{cursor:r,app_logs:c}=l,E=_e(c,n);return{cursor:r,appLogs:E}};function _e(t,s){let n=t;return(s.status!==void 0||s.sources!==void 0)&&(n=n.filter(i=>{let a=s.status===void 0?!0:i.status===s.status,l=s.sources===void 0?!0:s.sources.includes(`${i.source_namespace}.${i.source}`);return a&&l})),n}var R=k(N(),1);async function Ne({jwtToken:t,cursor:s,filters:n,storeNameById:i,organizationId:a,setErrors:l,setAppLogOutputs:f,resubscribeCallback:u,developerPlatformClient:r}){let c=t,E=L,y=s,b=await U({pollOptions:{jwtToken:t,cursor:s,filters:n},developerPlatformClient:r,organizationId:a}),p="not_attempted",w=b;if(w.errors){let h=await v({response:w,onThrottle:d=>{l(["Request throttled while polling app logs.",`Retrying in ${d/1e3}s`])},onUnknownError:d=>{l(["Error while polling app logs",`Retrying in ${d/1e3}s`])},onResubscribe:()=>u()});p=h.resubscribeResult,h.nextJwtToken&&(c=h.nextJwtToken),E=h.retryIntervalMs}else{l(d=>d.length?[]:d);let{appLogs:h}=b;if(y=b.cursor,h)for(let d of h){let T,S,q,J=i.get(d.shop_id.toString());if(J===void 0)continue;switch(d.log_type){case ce:T=fe(d.payload),S=`export "${T.export}" executed in ${(T.fuelConsumed/le).toFixed(4)}M instructions`;break;case ue:T=de(d.payload),S="network access response retrieved from cache";break;case pe:T=ge(d.payload),S="network access request executing in background";break;case me:T=Ee(d.payload),q=T.connectTimeMs&&T.writeReadTimeMs?T.connectTimeMs+T.writeReadTimeMs:null,S=`network access request executed${q?` in ${q} ms`:""}`;break;default:continue}let Se={status:d.status==="success"?"Success":"Failure",source:d.source,storeName:J,description:S,logTimestamp:V(d.log_timestamp)};T&&f(ke=>[...ke,{appLog:T,prefix:Se}])}}return{nextJwtToken:c,retryIntervalMs:E,cursor:y??s,resubscribeResult:p}}function we({initialJwt:t,filters:s,resubscribeCallback:n,storeNameById:i,developerPlatformClient:a,organizationId:l}){let[f,u]=(0,R.useState)([]),[r,c]=(0,R.useState)([]),E=(0,R.useRef)(t),y=(0,R.useRef)(0),b=(0,R.useRef)(""),p=(0,R.useRef)(0),w=(0,R.useCallback)(async()=>{let h=await Ne({jwtToken:E.current,cursor:b.current,filters:s,storeNameById:i,setErrors:u,setAppLogOutputs:c,resubscribeCallback:n,developerPlatformClient:a,organizationId:l});if(h.resubscribeResult==="failed"){if(p.current+=1,p.current>=P)return u(["App log streaming session has expired. Please restart your dev session."]),{retryIntervalMs:0}}else h.resubscribeResult==="succeeded"&&(p.current=0);return E.current=h.nextJwtToken,b.current=h.cursor,y.current=h.retryIntervalMs,{retryIntervalMs:y.current}},[]);return be(w),{appLogOutputs:r,errors:f}}var e=k(N(),1);var Fe=t=>{switch(t){case M.NoCachedResponse:return"No cached response available";case M.CacheAboutToExpire:return"Cache is about to expire";case M.Unknown:return"Unknown reason"}},Re=({pollOptions:{jwtToken:t,filters:s},resubscribeCallback:n,storeNameById:i,developerPlatformClient:a,organizationId:l})=>{let{appLogOutputs:f,errors:u}=we({filters:s,initialJwt:t,resubscribeCallback:n,storeNameById:i,developerPlatformClient:a,organizationId:l});return e.default.createElement(e.default.Fragment,null,f.map(({appLog:r,prefix:c},E)=>e.default.createElement(m,{flexDirection:"column",key:E},e.default.createElement(m,{flexDirection:"row",gap:1},e.default.createElement(o,null,e.default.createElement(o,{color:"green"},c.logTimestamp," "),e.default.createElement(o,{color:"blueBright"},`${c.storeName.split(".")[0]}`," "),e.default.createElement(o,{color:"blueBright"},c.source," "),e.default.createElement(o,{color:c.status==="Success"?"green":"red"},c.status," "),e.default.createElement(o,null,c.description))),e.default.createElement(m,{flexDirection:"column",marginLeft:4},r instanceof oe&&e.default.createElement(m,{flexDirection:"column"},e.default.createElement(o,null,r.logs),r.inputQueryVariablesMetafieldKey&&r.inputQueryVariablesMetafieldNamespace?e.default.createElement(m,{flexDirection:"column",marginTop:1},e.default.createElement(o,{bold:!0},"Input Query Variables:"),e.default.createElement(m,{flexDirection:"row",marginLeft:1,marginTop:1},e.default.createElement(o,{dimColor:!0},"Namespace:"),e.default.createElement(o,null," ",r.inputQueryVariablesMetafieldNamespace)),e.default.createElement(m,{flexDirection:"row",marginLeft:1},e.default.createElement(o,{dimColor:!0},"Key:"),e.default.createElement(o,null," ",r.inputQueryVariablesMetafieldKey)),e.default.createElement(m,{marginLeft:1,marginTop:1},e.default.createElement(o,null,x(r.inputQueryVariablesMetafieldValue)??e.default.createElement(o,{color:"red"},"Metafield is not set")))):null,r.input?e.default.createElement(m,{flexDirection:"column",marginTop:1},e.default.createElement(o,{bold:!0},"Input ",e.default.createElement(o,{dimColor:!0},"(",r.inputBytes," bytes):")),e.default.createElement(m,{marginLeft:1,marginTop:1},e.default.createElement(o,null,x(r.input)))):null,r.output?e.default.createElement(m,{flexDirection:"column",marginTop:1},e.default.createElement(o,{bold:!0},"Output ",e.default.createElement(o,{dimColor:!0},"(",r.outputBytes," bytes):")),e.default.createElement(m,{marginLeft:1,marginTop:1},e.default.createElement(o,null,x(r.output)))):null),r instanceof ne&&e.default.createElement(m,{flexDirection:"column"},e.default.createElement(o,null,"Cache write time: ",new Date(r.cacheEntryEpochMs).toISOString()),e.default.createElement(o,null,"Cache TTL: ",r.cacheTtlMs/1e3," s"),e.default.createElement(o,null,"HTTP request:"),e.default.createElement(o,null,x(r.httpRequest)),e.default.createElement(o,null,"HTTP response:"),e.default.createElement(o,null,x(r.httpResponse))),r instanceof ie&&e.default.createElement(m,{flexDirection:"column"},e.default.createElement(o,null,"Reason: ",Fe(r.reason)),e.default.createElement(o,null,"HTTP request:"),e.default.createElement(o,null,x(r.httpRequest))),r instanceof ae&&e.default.createElement(m,{flexDirection:"column"},e.default.createElement(o,null,"Attempt: ",r.attempt),r.connectTimeMs?e.default.createElement(o,null,"Connect time: ",r.connectTimeMs," ms"):null,r.writeReadTimeMs?e.default.createElement(o,null,"Write read time: ",r.writeReadTimeMs," ms"):null,e.default.createElement(o,null,"HTTP request:"),e.default.createElement(o,null,x(r.httpRequest)),r.httpResponse?e.default.createElement(m,{flexDirection:"column"},e.default.createElement(o,null,"HTTP response:"),e.default.createElement(o,null,x(r.httpResponse))):null,r.error?e.default.createElement(o,null,"Error: ",r.error):null)))),u.length>0&&e.default.createElement(m,{flexDirection:"column"},u.map((r,c)=>e.default.createElement(m,{key:c},e.default.createElement(o,{color:"red"},r)))))};var xe=k(N(),1);async function Ie({pollOptions:t,options:{variables:s,developerPlatformClient:n},storeNameById:i,organizationId:a}){let l=async()=>A(n,s,a);return H(xe.default.createElement(Re,{pollOptions:t,resubscribeCallback:l,storeNameById:i,developerPlatformClient:n,organizationId:a}))}g();async function D({pollOptions:t,options:{variables:s,developerPlatformClient:n},storeNameById:i,organizationId:a,consecutiveResubscribeFailures:l=0}){let f=await U({pollOptions:t,developerPlatformClient:n,organizationId:a}),u=L,r=t.jwtToken,c=l,E=f;if(E.errors){let p=await v({response:E,onThrottle:w=>{I(JSON.stringify({message:"Request throttled while polling app logs.",retry_in_ms:w}))},onUnknownError:w=>{I(JSON.stringify({message:"Error while polling app logs.",retry_in_ms:w}))},onResubscribe:()=>A(n,s,a)});if(p.resubscribeResult==="failed"){if(c+=1,c>=P){I(JSON.stringify({message:"App log streaming session has expired. Please restart your dev session."}));return}}else p.resubscribeResult==="succeeded"&&(c=0);p.nextJwtToken&&(r=p.nextJwtToken),u=p.retryIntervalMs}else c=0;let{cursor:y,appLogs:b}=f;b&&b.forEach(p=>{let w=i.get(p.shop_id?.toString());w!==void 0&&F(ye({appLog:p,appLogPayload:Te(p.payload,p.log_type),storeName:w,prettyPrint:!1}))}),setTimeout(()=>{D({options:{variables:s,developerPlatformClient:n},pollOptions:{jwtToken:r||t.jwtToken,cursor:y??t.cursor,filters:t.filters},storeNameById:i,organizationId:a,consecutiveResubscribeFailures:c}).catch(p=>{throw p})},u)}async function Ae(t){let{app:s,remoteApp:n,developerPlatformClient:i}=t,a=await Me(t),l=he(s);if(l.length===0)throw new C("This app has no log sources. Learn more about app logs at https://shopify.dev/docs/api/shopify-cli/app/app-logs");if(t.sources){let y=t.sources.filter(b=>!l.includes(b));if(y.length)throw new C(`Invalid sources: ${y.join(", ")}. Valid sources are: ${l.join(", ")}`)}let f={shopIds:a.storeIds.map(Number),apiKey:n.apiKey},u=await A(i,f,t.organization.id),r={status:t.status,sources:t.sources},c={jwtToken:u,filters:r};t.format==="json"&&F(JSON.stringify({subscribedToStores:t.storeFqdns})),I(`Waiting for app logs...
|
|
2
|
+
`),await(t.format==="json"?D:Ie)({options:{variables:f,developerPlatformClient:i},pollOptions:c,storeNameById:a.storeNameById,organizationId:t.organization.id})}async function Me(t){let{app:s,remoteApp:n,developerPlatformClient:i,primaryStore:a,organization:l}=t,f=j(s.configPath);Le(n.title,a.shopDomain,t.storeFqdns,f,l.businessName);let u=new Map;return u.set(a.shopId,a.shopDomain),t.storeFqdns&&t.storeFqdns.length>1&&await Promise.all(t.storeFqdns?.slice(1).map(async c=>{let E=await W(l,c,i);u.set(E.shopId,c)})),{storeIds:Array.from(u.keys()),storeNameById:u}}function Le(t,s,n,i,a){let l=n&&n.length>0?n:[s],f=i?X(i):void 0;G({headline:i?`Using ${f} for default values:`:"Using these settings:",body:Z({appName:t,org:a,devStores:l,messages:[ee]})})}var O=k(Ce(),1);var B=class t extends re{static summary="Stream detailed logs for your Shopify app.";static descriptionWithMarkdown="\n Opens a real-time stream of detailed app logs from the selected app and store.\n Use the `--source` argument to limit output to a particular log source, such as a specific Shopify Function handle. Use the `shopify app logs sources` command to view a list of sources.\n Use the `--status` argument to filter on status, either `success` or `failure`.\n ```\n shopify app logs --status=success --source=extension.discount-function\n ```\n ";static description=this.descriptionForHelp();static flags={...Q,...K,...Y,store:O.Flags.string({char:"s",description:"Store URL. Must be an existing development or Shopify Plus sandbox store.",env:"SHOPIFY_FLAG_STORE",multiple:!0,parse:async s=>$(s)}),source:O.Flags.string({description:"Filters output to the specified log source.",env:"SHOPIFY_FLAG_SOURCE",multiple:!0}),status:O.Flags.string({description:"Filters output to the specified status (success or failure).",options:["success","failure"],env:"SHOPIFY_FLAG_STATUS"})};async run(){let{flags:s}=await this.parse(t);await z(s.path);let n=await te({directory:s.path,clientId:s["client-id"],forceRelink:s.reset,userProvidedConfigName:s.config}),i=await se({appContextResult:n,storeFqdn:s.store?.[0],forceReselectStore:s.reset}),a={...n,primaryStore:i,storeFqdns:s.store,sources:s.source,status:s.status,format:s.json?"json":"text"};return await Ae(a),{app:n.app}}};export{B as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as s}from"./chunk-
|
|
1
|
+
import{a as s}from"./chunk-QSKOR3ED.js";import{a as e}from"./chunk-2W6M7YDY.js";import{a as o}from"./chunk-Z35PUKKP.js";import{b as i}from"./chunk-FW5HGFSZ.js";import{g as a}from"./chunk-VKWPEFWQ.js";a();var t=class extends i{static description="View all the available UI kit components";static hiddenAliases=["kitchen-sink all"];static hidden=!0;async run(){await o(),await e(),await s()}};export{t as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as v}from"./chunk-G7OIACY5.js";import{b as y,c as P,d as b}from"./chunk-AD4S2VEI.js";import{a as F}from"./chunk-WXV35TPE.js";import{a as m}from"./chunk-JTPVSO6Y.js";import{Ia as x}from"./chunk-2KLXRVGQ.js";import{b as d,c as h}from"./chunk-DGMRL5DQ.js";import{F as g,M as l}from"./chunk-SKRUMRB4.js";import{Nb as n}from"./chunk-YJWNM4XO.js";import{b as _}from"./chunk-JA2QZ635.js";import{e as U,g as u}from"./chunk-VKWPEFWQ.js";u();var i=U(_(),1);var a="_start",s=class w extends F{static summary="Run a function locally for testing.";static descriptionWithMarkdown="Runs the function from your current directory for [testing purposes](https://shopify.dev/docs/apps/functions/testing-and-debugging). To learn how you can monitor and debug functions when errors occur, refer to [Shopify Functions error handling](https://shopify.dev/docs/api/functions/errors).";static description=this.descriptionForHelp();static flags={...d,...m,...y,...h,input:i.Flags.string({char:"i",description:"The input JSON to pass to the function. If omitted, standard input is used.",env:"SHOPIFY_FLAG_INPUT"}),export:i.Flags.string({char:"e",hidden:!1,description:"Name of the WebAssembly export to invoke.",env:"SHOPIFY_FLAG_EXPORT"}),profile:i.Flags.boolean({description:"Generate a WebAssembly performance profile for the function run. The profile can be viewed in Speedscope.",env:"SHOPIFY_FLAG_PROFILE"})};async run(){let{flags:t}=await this.parse(w),o=a,{app:p}=await x({directory:t.path,userProvidedConfigName:t.config}),e=await P(p,t.path);if(t.export!==void 0)n(`Using export ${t.export} from the --export flag.`),o=t.export;else if(e.configuration.targeting!==void 0&&e.configuration.targeting.length>0){let r=e.configuration.targeting;if(r.length>1&&l({})){let O=r.map(f=>({label:f.target,value:f.export||a}));o=await g({message:"Which target would you like to execute?",choices:O})}else o=r?.[0]?.export||a,n(`Using export '${o}'. Use the --export flag or an interactive terminal to select a different export.`)}else n(`No targeting information found. Using the default export '${o}'. Use the --export flag or an interactive terminal to select a different export.`);let c=e?.configuration.targeting?.[0]?.input_query,T=c&&`${e?.directory}/${c}`,A=await b(e,t.path,t["client-id"],t.reset,t.config);return await v({functionExtension:e,json:t.json,inputPath:t.input,export:o,stdin:"inherit",schemaPath:A,queryPath:T,profile:t.profile}),{app:p}}};export{s as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as A}from"./chunk-
|
|
1
|
+
import{n as A}from"./chunk-NTVEJYKI.js";import{a as P}from"./chunk-UFU2LGFK.js";import{c as C}from"./chunk-ECEOBSGD.js";import{s as T}from"./chunk-R757TSQ6.js";import{r as w}from"./chunk-P3Z5RLVV.js";import{a as D}from"./chunk-5HONV6NQ.js";import{K as u}from"./chunk-L5XWYTHY.js";import{B as y,z as h}from"./chunk-SKRUMRB4.js";import{Nb as O,za as p}from"./chunk-YJWNM4XO.js";import{d,q as m}from"./chunk-3VYOLEQE.js";import{g as l}from"./chunk-VKWPEFWQ.js";l();async function q(e){P({verbose:e.verbose,noColor:e.noColor});let t=w({store:e.store}),o=await u(t,e.password);await R(o,{path:e.path??m(),force:e.force??!1,silent:e.silent??!1})}var E={article:"ARTICLE",blog:"BLOG",collection:"COLLECTION",company:"COMPANY",company_location:"COMPANY_LOCATION",location:"LOCATION",market:"MARKET",order:"ORDER",page:"PAGE",product:"PRODUCT",variant:"PRODUCTVARIANT",shop:"SHOP"};async function R(e,t){let{force:o,path:i,silent:n}=t;if(!await A(i)&&(process.env.SHOPIFY_LANGUAGE_SERVER==="1"||!await C(o)))return;let f=[],r=[];for(let[a,s]of Object.entries(E))f.push(T(s,e).catch(c=>(r.push(s),[])).then(c=>({[a]:c})));let b=(await Promise.all(f)).reduce((a,s)=>({...a,...s}));if(r.length===Object.values(E).length){n||y({body:"Failed to fetch metafield definitions.",nextSteps:["Check your network connection and try again.","Ensure you have the permission to fetch metafield definitions."],reference:[{link:{label:"Metafield Definition API",url:"https://shopify.dev/docs/api/admin-graphql/latest/queries/metafieldDefinition"}}]});return}await S(i,b),r.length>0&&O(`Failed to fetch metafield definitions for the following owner types: ${r.join(", ")}`),n||h({body:"Metafield definitions have been successfully downloaded."})}async function S(e,t){let o=await D(e),i=d(o,"metafields.json"),n=JSON.stringify(t,null,2);p(i,n)}export{q as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as p}from"./chunk-R757TSQ6.js";import{ra as i}from"./chunk-L5XWYTHY.js";import{A as f,B as d,E as m,H as l,V as a}from"./chunk-SKRUMRB4.js";import{i as s}from"./chunk-FCULF3JA.js";import{b as c}from"./chunk-5XO6PAMV.js";import{g as u}from"./chunk-VKWPEFWQ.js";u();function h(e){return[`'${e.name}'`,{subdued:`(#${e.id})`}]}function $(e){return{list:{items:e.map(h)}}}async function T(e,r="It doesn't seem like you're running this command in a theme directory.",o,n){if(e)return!0;if(n)return d({headline:o?`Environment: ${o}`:"",body:r}),!1;if(f({body:r}),c())throw new s("This command must run from a theme directory when user input is unavailable.","Run the command from a theme directory, or use `--force` to continue.");if(!a())return!0;let t=await m({message:"Do you want to proceed?"});return i(`theme-service:confirm-directory:${t}`),t}async function C(e,r,o){if(e.role!==p||o)return!0;if(!a())throw new s(`Can't ${r} on the live theme when user input is unavailable.`,"Use `--allow-live` to confirm that you want to continue.");let n=`You're about to ${r} on your live theme "${e.name}". This will make changes visible to customers. Are you sure you want to proceed?`,t=await m({message:n,confirmationMessage:"Yes, proceed with live theme",cancellationMessage:"No, cancel"});return i(`theme-service:confirm-live-theme:${t}`),t}async function x(e,r,o=!1){e.length>0&&await l(e,{renderOptions:{stdout:r??process.stderr},noProgressBar:o})}export{h as a,$ as b,T as c,C as d,x as e};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as B,b as E}from"./chunk-
|
|
1
|
+
import{a as B,b as E}from"./chunk-HSZC2LBB.js";import{b as y,c as A,l as C,n as F,o as S,t as x}from"./chunk-3AASYIOA.js";import{a as D}from"./chunk-YGFEUXKQ.js";import{a as w}from"./chunk-JTPVSO6Y.js";import{b as O}from"./chunk-DGMRL5DQ.js";import{u as f}from"./chunk-L5XWYTHY.js";import{A as b,B as g,y as c,z as k}from"./chunk-SKRUMRB4.js";import{Cb as h,Eb as I}from"./chunk-YJWNM4XO.js";import{b as v}from"./chunk-JA2QZ635.js";import{e as z,g as a}from"./chunk-VKWPEFWQ.js";a();a();async function T(i){let{organization:e,storeFqdn:o,operationId:t,remoteApp:u}=i;c({headline:"Canceling bulk operation.",body:[{list:{items:[`ID: ${t}`,...E({organization:e,remoteApp:u,storeFqdn:o})]}}]});let q=await B(u,o),s=await C({adminSession:q,operationId:t});if(s?.userErrors?.length){F(s.userErrors,"Failed to cancel bulk operation.");return}let n=s?.bulkOperation;if(n){let r=S(n),d=n.status==="CANCELING"?[`This may take a few moments. Check the status with:
|
|
2
2
|
`,{command:`shopify app bulk status --id=${A(n.id)}`}]:r.body,p={headline:r.headline,...d&&{body:d},...r.customSections&&{customSections:r.customSections}};switch(r.renderType){case"success":k(p);break;case"warning":b(p);break;case"info":c(p);break}}else g({headline:"Bulk operation not found or could not be canceled.",body:I`ID: ${h.yellow(t)}`.value})}var l=z(v(),1);var m=class i extends D{static summary="Cancel a bulk operation.";static description="Cancels a running bulk operation by ID.";static flags={...O,...w,id:l.Flags.string({description:"The bulk operation ID to cancel (numeric ID or full GID).",env:"SHOPIFY_FLAG_ID",required:!0}),store:l.Flags.string({char:"s",description:"The store domain. Must be an existing dev store.",env:"SHOPIFY_FLAG_STORE",parse:async e=>f(e)})};async run(){let{flags:e}=await this.parse(i),{appContextResult:o,store:t}=await x(e);return await T({organization:o.organization,storeFqdn:t.shopDomain,operationId:y(e.id),remoteApp:o.remoteApp}),{app:o.app}}};export{m as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Bb as h,Jb as g,Qb as f,ib as E}from"./chunk-YJWNM4XO.js";import{b as O}from"./chunk-JA2QZ635.js";import{e as m}from"./chunk-3VYOLEQE.js";import{e as P,g as o}from"./chunk-VKWPEFWQ.js";o();o();o();var R=new Set(["THROTTLED","429"]),b=new Set(["ACCESS_DENIED","access_denied"]);function I(e){return Array.isArray(e)?e.flatMap(t=>{let s=[],n=t,r=n?.extensions?.code;typeof r=="string"&&s.push(r);let u=n?.extensions?.app_errors?.errors;if(Array.isArray(u))for(let p of u){let l=p?.category;typeof l=="string"&&s.push(l)}return s}):[]}function T(e){return e!==void 0&&R.has(e)}function _(e){return e!==void 0&&b.has(e)}function S(e){return I(e).some(T)}o();var C=new Set([502,503,504]);function x(e){return e!==void 0&&C.has(e)}var M=P(O(),1),i;(function(e){e[e.Abort=0]="Abort",e[e.AbortSilent=1]="AbortSilent",e[e.Bug=2]="Bug"})(i||(i={}));var y=class extends Error{},a=class extends Error{tryMessage;type;nextSteps;formattedMessage;customSections;code;details;skipOclifErrorHandling;constructor(t,s,n=null,r,u){let p=typeof t=="string"||"value"in t;super(p?f(t):E(t)),n?n instanceof h?this.tryMessage=f(n):this.tryMessage=n:this.tryMessage=null,this.type=s,this.nextSteps=r,this.customSections=u,this.skipOclifErrorHandling=!0,p||(this.formattedMessage=t)}},d=class extends a{constructor(t,s=null,n,r){super(t,i.Abort,s,n,r)}},w=class extends a{command;args;constructor(t,s,n,r=null){super(t,i.Abort,r),this.command=s,this.args=n}},A=class extends a{constructor(){super("",i.AbortSilent)}},c=class extends a{constructor(t,s=null){super(t,i.Bug,s)}};async function z(e){let t;if(k(e))t=e;else if(typeof e=="string")t=new c(e);else if(e instanceof Error)t=new c(e.message),t.stack=e.stack;else{let r=e;t=new c(r?.message??"Unknown error"),r?.stack&&(t.stack=r?.stack)}let{jsonOutputEnabled:s}=await import("./environment-ZUTBXY7U.js");if(s()){let{renderFatalErrorAsJson:r}=await import("./json-error-2BL3UZ7H.js");return r(t),await g(),e}let{renderFatalError:n}=await import("./ui-TEZZM7SE.js");return n(t),Promise.resolve(e)}function J(e){if(e instanceof M.Errors.CLIError){let t=new d(e.message);return t.stack=e.stack,Promise.resolve(t)}else return Promise.resolve(e)}function k(e){try{return Object.prototype.hasOwnProperty.call(e,"type")}catch{return!1}}function Q(e){if(!k(e)){if(e instanceof Error){if(v(e))return!1;let t=e.message;return!L(t)}return!0}return e.type===i.Bug}function v(e){let t=e;if(typeof t.response!="object"||t.response===null||t.request===void 0)return!1;let s=t.response.status;return s===401||s===429||x(s)?!0:S(t.response.errors)}function W(e){return m(e).replace("file:/","/").replace(/^\/?[A-Z]:/,"")}function L(e){return["EPERM: operation not permitted, scandir","EPERM: operation not permitted, rename","EACCES: permission denied","EPERM: operation not permitted, symlink","This version of npm supports the following node versions","EBUSY: resource busy or locked","ENOTEMPTY: directory not empty","getaddrinfo ENOTFOUND","Client network socket disconnected before secure TLS connection was established","spawn EPERM","socket hang up","The user aborted a request.","write EPIPE","Unsupported platform"].some(n=>e.includes(n))}export{I as a,T as b,_ as c,S as d,x as e,i as f,y as g,a as h,d as i,w as j,A as k,c as l,z as m,J as n,Q as o,W as p};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as u,b as l}from"./chunk-N4DE5H65.js";import{f as d,i as m}from"./chunk-4Y22EM45.js";import{a as c}from"./chunk-YGFEUXKQ.js";import{Ha as p}from"./chunk-2KLXRVGQ.js";import{i as s}from"./chunk-FCULF3JA.js";import{g as e}from"./chunk-VKWPEFWQ.js";e();e();async function f({clientId:a,operationIds:t,getOperation:n=m}){return Promise.all(t.map(async i=>{let o=await n({clientId:a,operationId:i});if(!o)throw new s(`Migration operation not found: ${i}`);return o}))}var r=class a extends c{static summary="Checks the status of app subscription migration operations.";static descriptionWithMarkdown="Checks app subscription migration operation status.\n\nRepeat `--id` for every operation GID returned by a multi-batch submission. With `--watch`, the command displays the current state while polling and outputs the final state after all requested operations reach a terminal status.\n\n`RUNNING` means an operation is still processing. `COMPLETED` means processing finished, but you must inspect the per-shop results to confirm each outcome. `FAILED` means the operation failed, and `CANCELED` means cancellation stopped further processing.\n\nUse `--json` to output every operation and its per-shop results as structured JSON.\n\nRun the command from an app project. By default, it uses the Client ID from the active app configuration. Use `--path` to select an app directory or `--config` to select a configuration. Pass `--client-id` to select a different app within the project. Use `--reset` to relink the app.";static description=this.descriptionWithoutMarkdown();static examples=["<%= config.bin %> <%= command.id %> --id <operation-id>","<%= config.bin %> <%= command.id %> --path ../my-app --config staging --id <operation-id-1> --id <operation-id-2> --watch","<%= config.bin %> <%= command.id %> --client-id <client-id> --id <operation-id> --json"];static flags={...d};async run(){let{flags:t}=await this.parse(a),{app:n,remoteApp:i}=await p({directory:t.path,clientId:t["client-id"],forceRelink:t.reset,userProvidedConfigName:t.config}),o=t.watch?await l({clientId:i.apiKey,operationIds:t.id}):await f({clientId:i.apiKey,operationIds:t.id});return u(o,t.json),{app:n}}};export{r as a};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import{b as N}from"./chunk-LFOBYEWG.js";import{C as E}from"./chunk-L5XWYTHY.js";import{V as j}from"./chunk-SKRUMRB4.js";import{a as O}from"./chunk-53U6XS3J.js";import{b}from"./chunk-YTJ3EPD3.js";import{d as _}from"./chunk-G54BKNIX.js";import{i as f}from"./chunk-FCULF3JA.js";import{Cb as d,Eb as h,Ib as S,da as T}from"./chunk-YJWNM4XO.js";import{d as P}from"./chunk-SGBLCVUX.js";import{b as A}from"./chunk-JA2QZ635.js";import{a as w}from"./chunk-JD5P5RAJ.js";import{e as C,g as F}from"./chunk-VKWPEFWQ.js";F();var l=C(A()),g=class extends l.Command{static baseFlags={"json-schema":l.Flags.boolean({description:"Print the command's JSON schemas.",env:"SHOPIFY_FLAG_JSON_SCHEMA"})};static descriptionWithMarkdown;static get jsonOutputSchema(){}static get requiresSyncAnalytics(){return!1}static nonTTYFlagRequirements(e){return[]}static descriptionForHelp(){let e=(this.descriptionWithMarkdown??"").replace(/(\[)(.*?)(])(\()(.*?)(\))/gm,'"$2" ($5)');return W(e,this.jsonOutputSchema)}static descriptionWithoutMarkdown(){return this.descriptionForHelp()}static analyticsNameOverride(){}static analyticsStopCommand(){}async catch(e){e.skipOclifErrorHandling=!0;let{errorHandler:t}=await import("./error-handler-D5BURRJ7.js");return await t(e,this.config),l.Errors.handle(e)}async _run(){return O(this.argv,()=>super._run())}async init(){if(this.exitWithTimestampWhenEnvVariablePresent(),N(this.id??""),!P()){let{registerCleanBugsnagErrorsFromWithinPlugins:t}=await import("./error-handler-D5BURRJ7.js");await t(this.config)}await Y(this.config),this.showNpmFlagWarning();let{showNotificationsIfNeeded:e}=await import("./notifications-system-MYEMV7JF.js");return await e(),super.init()}showNpmFlagWarning(){let e=this.constructor;Object.keys(e.flags||{}).map(r=>`npm_config_${T(r).replace(/^no_/,"")}`).some(r=>process.env[r]!==void 0)&&import("./ui-TEZZM7SE.js").then(({renderWarning:r})=>{r({body:["NPM scripts require an extra",{command:"--"},"separator to pass the flags. Example:",{command:"npm run dev -- --reset"}]})})}exitWithTimestampWhenEnvVariablePresent(){w(process.env.SHOPIFY_CLI_ENV_STARTUP_PERFORMANCE_RUN)&&(S(`
|
|
2
|
+
SHOPIFY_CLI_TIMESTAMP_START
|
|
3
|
+
{ "timestamp": ${Date.now()} }
|
|
4
|
+
SHOPIFY_CLI_TIMESTAMP_END
|
|
5
|
+
`),process.exit(0))}async parse(e,t){let n=await super.parse(e,t);return n=await this.resultWithEnvironment(n,e,t),await E(n.flags["auth-alias"]),await I(n.flags),this.failMissingNonTTYFlagRequirements(n.flags,this.applicableNonTTYFlagRequirements(n.flags)),{...n,argv:n.argv}}environmentsFilename(){}failMissingNonTTYFlags(e,t){this.failMissingNonTTYFlagRequirements(e,t.map(n=>({flags:[n]})))}failMissingNonTTYFlagRequirements(e,t){if(j())return;let n=t.filter(o=>o.flags.every(m=>e[m]===void 0||e[m]===!1));if(n.length===0)return;let r=n.length===1?"Flag not specified":"Flags not specified",i=n.map(o=>o.flags.map(m=>`--${m}`).join(" or ")).join(`
|
|
6
|
+
`),a=n.length===1?"This flag is required":"These flags are required";throw new f(h`${r}:
|
|
7
|
+
|
|
8
|
+
${d.cyan(i)}
|
|
9
|
+
|
|
10
|
+
${a} in non-interactive terminal environments, such as a CI environment, or when piping input from another process.`,"To resolve this, specify the options in the command, or run the command in an interactive environment such as your local terminal.")}applicableNonTTYFlagRequirements(e){let t=this.constructor,n={...t.baseFlags,...t.flags},r=Object.entries(n).filter(([,a])=>!!a.requiredIfNonInteractive).map(([a])=>({flags:[a]})),i=(t.nonTTYFlagRequirements?.(e)??[]).filter(a=>a.when?.(e)??!0);return[...r,...i]}async resultWithEnvironment(e,t,n){let r=e.flags,i=this.environmentsFilename();if(!i)return e;let{environmentFilePath:a}=await import("./environments-3RUZ7F4Q.js"),o=await a(i,{from:r.path}),m=[];r.environment&&(m=Array.isArray(r.environment)?r.environment:[r.environment]);let u=m.length>0;if(!o&&!u||u&&m.length>1)return e;let{environment:c,isDefaultEnvironment:p}=await this.loadEnvironmentForCommand(r.path,i,m[0]);if(!c||p&&!$(t?.flags,"environment"))return e;let v=await super.parse(M(t),n),y=await super.parse(t,[...n??this.argv,...R(c,t,v),...p?["--environment","default"]:[]]);return q(v.flags,y.flags,p?"default":m[0],c),y}async loadEnvironmentForCommand(e,t,n){let{loadEnvironment:r}=await import("./environments-3RUZ7F4Q.js");return n?{environment:await r(n,t,{from:e}),isDefaultEnvironment:!1}:{environment:await r("default",t,{from:e,silent:!0}),isDefaultEnvironment:!0}}};async function I(s){await _(()=>({cmd_all_verbose:s.verbose,cmd_all_path_override:s.path!==void 0,cmd_all_path_override_hash:s.path===void 0?void 0:b(s.path)}))}function q(s,e,t,n){let r={};for(let[a,o]of Object.entries(e)){let m=Object.prototype.hasOwnProperty.call(s,a),u=Object.prototype.hasOwnProperty.call(n,a);if(!m&&u){let c=a==="password"?`********${o.substr(-4)}`:o;r[a]=c}}if(Object.keys(r).length===0)return;let i=Object.entries(r).map(([a,o])=>`${a}: ${o}`);import("./ui-TEZZM7SE.js").then(({renderInfo:a})=>{a({headline:["Using applicable flags from",{userInput:t},"environment:"],body:[{list:{items:i}}]})})}function M(s){return s?.flags?{...s,flags:Object.fromEntries(Object.entries(s.flags).map(([e,t])=>{let n={...t};return delete n.default,[e,n]}))}:s}function R(s,e,t){let n=[];for(let[r,i]of Object.entries(s)){let a=$(e?.flags,r),o=t.flags&&Object.prototype.hasOwnProperty.call(t.flags,r);if(a&&!o)if(typeof i=="boolean")if(i)n.push(`--${r}`);else throw new f(h`Environments can only specify true for boolean flags. Attempted to set ${d.yellow(r)} to false.`);else Array.isArray(i)?i.forEach(m=>n.push(`--${r}`,`${m}`)):n.push(`--${r}`,`${i}`)}return n}function $(s,e){return!!s&&Object.prototype.hasOwnProperty.call(s,e)}function W(s,e){if(!e)return s;let t=`Use \`--json-schema\` to print the result, error, and event schemas.
|
|
11
|
+
|
|
12
|
+
Output from \`--json\` conforms to the \`${e.name}\` schema.
|
|
13
|
+
|
|
14
|
+
\`\`\`json
|
|
15
|
+
${JSON.stringify(e.jsonSchema,null,2)}
|
|
16
|
+
\`\`\``;return[s,t].filter(Boolean).join(`
|
|
17
|
+
|
|
18
|
+
`)}async function Y(s){let e=Array.from(s.plugins.values()),t=["@shopify/app","@shopify/plugin-cloudflare"],n=e.filter(i=>t.includes(i.name));if(n.length>0){let i=n.map(o=>` - shopify plugins remove ${o.name}`).join(`
|
|
19
|
+
`),{renderWarning:a}=await import("./ui-TEZZM7SE.js");a({headline:`Unsupported plugins detected: ${n.map(o=>o.name).join(", ")}`,body:["They are already included in the CLI and installing them as custom plugins can cause conflicts.",`You can fix it by running:
|
|
20
|
+
${i}`]})}let r=e.filter(i=>!t.includes(i.name));s.plugins=new Map(r.map(i=>[i.name,i]))}var K=g;export{M as a,K as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{g as b}from"./chunk-SGBLCVUX.js";import{g as m}from"./chunk-VKWPEFWQ.js";m();import{performance as u}from"node:perf_hooks";function w(){return b()?"bubble":"mute-and-report"}function h(g={}){let i={sensitive:{},public:{...g}},p=t=>{Object.assign(i.public,t)},M=t=>{Object.assign(i.sensitive,t)},l=async(t,e,n)=>{let r=n==="auto"?w():n,s=async()=>{let c=await e();t(c)};if(r==="bubble")await s();else try{await s()}catch(c){let{sendErrorToBugsnag:o}=await import("./error-handler-D5BURRJ7.js");await o(c,"unexpected_error")}},a=[];return{getAllPublicMetadata:()=>({...i.public}),getAllSensitiveMetadata:()=>({...i.sensitive}),addPublicMetadata:async(t,e="auto")=>l(p,t,e),addSensitiveMetadata:async(t,e="auto")=>l(M,t,e),runWithTimer:t=>async e=>{a.push(0);let n=u.now();try{return await e()}finally{let r=u.now();r=Math.max(n,r);let s=Math.max(r-n,0),c=a.pop(),o=Math.max(s-c,0);a.length>0&&(a[a.length-1]=(a[a.length-1]??0)+s),u.measure(`${t}#measurable`,{start:n,duration:o}),u.measure(`${t}#wall`,{start:n,end:r});let d=i.public[t]||0;d+=o,i.public[t]=d}}}}var y=h({cmd_all_timing_network_ms:0,cmd_all_timing_prompts_ms:0}),{getAllPublicMetadata:S,getAllSensitiveMetadata:f,addPublicMetadata:x,addSensitiveMetadata:A,runWithTimer:P}=y;export{h as a,S as b,f as c,x as d,A as e,P as f};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as o,c as l,f as m}from"./chunk-
|
|
1
|
+
import{b as o,c as l,f as m}from"./chunk-2KLXRVGQ.js";import{A as a,S as h}from"./chunk-SKRUMRB4.js";import{Xa as f,ra as c}from"./chunk-YJWNM4XO.js";import{d as s}from"./chunk-3VYOLEQE.js";import{g as u}from"./chunk-VKWPEFWQ.js";u();async function d(n){if(n.features.includes("function")&&n.isJavaScript){let e=await m(n);return o(e.functionRunner)}return o()}function p(n){return n.configuration.build?.path?s(n.directory,n.configuration.build.path):n.outputPath}async function y(n,e){try{if(!await f(e))return;let i=c(e);if(!WebAssembly.validate(i))return;let t=new WebAssembly.Module(i);if(WebAssembly.Module.customSections(t,"name").length>0)return;if(n.isJavaScript){a({headline:"The profile won't contain names for your function.",body:"JavaScript functions built with Javy don't include a WebAssembly function name section, regardless of the wasm_opt setting. Function names will appear as <unknown> in the profile."});return}a({headline:"The profile won't contain names for your function.",body:["The built WebAssembly module doesn't contain a function name section. The default wasm-opt step removes this section, and the function compiler can also omit it. To preserve function names, set ",{userInput:"wasm_opt = false"}," under ",{userInput:"[extensions.build]"}," in shopify.extension.toml, configure the compiler to emit function names, and rebuild the function."]})}catch{}}async function W(n){let e=n.functionExtension,i=await d(e);await l(i);let t=[];n.inputPath&&t.push("--input",n.inputPath),n.export&&t.push("--export",n.export),n.json&&t.push("--json"),n.profile&&t.push("--profile"),n.schemaPath&&n.queryPath&&(t.push("--schema-path",n.schemaPath),t.push("--query-path",n.queryPath));let r=p(e);return n.profile&&await y(e,r),h(i.path,["-f",r,...t],{cwd:n.functionExtension.directory,stdin:n.stdin,stdout:n.stdout??"inherit",stderr:n.stderr??"inherit",input:n.input})}export{W as a};
|