@vercel/cli-support 68.0.0 → 68.1.0-snapshot-3c48721091f5
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/chunks/add-57EE2LQO.js +8 -0
- package/dist/chunks/{add-4ZXS4RRN.js → add-DNRNPUU7.js} +1 -1
- package/dist/chunks/{add-G2LGF4HL.js → add-FLVE2M3L.js} +1 -1
- package/dist/chunks/{alerts-3352VWDL.js → alerts-26PDHRBL.js} +1 -1
- package/dist/chunks/{api-endpoints-2IYXPLEG.js → api-endpoints-EY2DO75S.js} +1 -1
- package/dist/chunks/auth-4A5CXZOA.js +7 -0
- package/dist/chunks/auth-ZJV6OHMS.js +7 -0
- package/dist/chunks/{build-3UFKTTS5.js → build-6WTRWW2M.js} +1 -1
- package/dist/chunks/{chunk-D6REP5QQ.js → chunk-2GXP676X.js} +1 -1
- package/dist/chunks/{chunk-MXTC4ZAQ.js → chunk-2ILZM77F.js} +1 -1
- package/dist/chunks/{chunk-OFDTADPQ.js → chunk-2K7U64CN.js} +1 -1
- package/dist/chunks/{chunk-Y4YBQUQM.js → chunk-2STLJAXZ.js} +1 -1
- package/dist/chunks/{chunk-PAHYNO73.js → chunk-2TUJJIYU.js} +1 -1
- package/dist/chunks/chunk-2XQO6C7Q.js +7 -0
- package/dist/chunks/{chunk-DH4A4QMD.js → chunk-33ETNP4M.js} +1 -1
- package/dist/chunks/{chunk-L46V6VL3.js → chunk-37SWAKIV.js} +1 -1
- package/dist/chunks/{chunk-23FY4PR3.js → chunk-3F3WNT5K.js} +1 -1
- package/dist/chunks/{chunk-ZXSZH7N5.js → chunk-3GKXXGSO.js} +1 -1
- package/dist/chunks/{chunk-QSL6AG2B.js → chunk-3HP6FOOL.js} +1 -1
- package/dist/chunks/{chunk-M32HBBPK.js → chunk-3WXQHKSS.js} +1 -1
- package/dist/chunks/{chunk-JELLVPCM.js → chunk-3XMKTJ5T.js} +1 -1
- package/dist/chunks/{chunk-YLXXGQQQ.js → chunk-42D3CPWB.js} +1 -1
- package/dist/chunks/{chunk-5A3DDLQR.js → chunk-42RUDD27.js} +1 -1
- package/dist/chunks/{chunk-HRR57QNP.js → chunk-46R47IE5.js} +1 -1
- package/dist/chunks/{chunk-OOPF73RV.js → chunk-4FPYV37P.js} +1 -1
- package/dist/chunks/{chunk-CAJ2OUSR.js → chunk-4L7AKIX7.js} +1 -1
- package/dist/chunks/{chunk-SGNDE4YS.js → chunk-4MAA4BQD.js} +1 -1
- package/dist/chunks/{chunk-FTNLCQC6.js → chunk-4OOHXEKI.js} +1 -1
- package/dist/chunks/{chunk-NMIB4JYP.js → chunk-4R7ICESH.js} +1 -1
- package/dist/chunks/{chunk-MCYG7CCE.js → chunk-4SIQE2W4.js} +1 -1
- package/dist/chunks/chunk-4WEKKDOL.js +8 -0
- package/dist/chunks/{chunk-TU54LHNW.js → chunk-54W7S4EV.js} +1 -1
- package/dist/chunks/{chunk-NWGBDBZI.js → chunk-5F4RJ32E.js} +1 -1
- package/dist/chunks/{chunk-KRPY5FHJ.js → chunk-5QC4IKRZ.js} +1 -1
- package/dist/chunks/{chunk-2AMO2VMV.js → chunk-64GNDWWX.js} +1 -1
- package/dist/chunks/{chunk-J24BABG4.js → chunk-6G2AZBW5.js} +1 -1
- package/dist/chunks/{chunk-DY643UZ7.js → chunk-6JBKQ5LR.js} +2 -3
- package/dist/chunks/{chunk-AVCLYJNC.js → chunk-6KI5LJIB.js} +1 -1
- package/dist/chunks/{chunk-X755TPX6.js → chunk-6O2LDFGJ.js} +1 -1
- package/dist/chunks/chunk-6OOJFAF5.js +20 -0
- package/dist/chunks/{chunk-E7IN2DGU.js → chunk-6XXXPJBV.js} +1 -1
- package/dist/chunks/chunk-732HWE3P.js +181 -0
- package/dist/chunks/chunk-75TGTOZQ.js +8 -0
- package/dist/chunks/{chunk-4FBOQLPZ.js → chunk-76AOTUM2.js} +1 -1
- package/dist/chunks/{chunk-KXMFGDO4.js → chunk-76XUBFXI.js} +1 -1
- package/dist/chunks/{chunk-VBANKZWM.js → chunk-7CLATJZX.js} +1 -1
- package/dist/chunks/{chunk-UPDIZCP3.js → chunk-7EI554V5.js} +1 -1
- package/dist/chunks/{chunk-IVZNPSHU.js → chunk-7IHVCKUV.js} +1 -1
- package/dist/chunks/{chunk-PSOVLGHP.js → chunk-7O3D3XED.js} +1 -1
- package/dist/chunks/{chunk-YTSUDTAK.js → chunk-7OOCSVWT.js} +1 -1
- package/dist/chunks/{chunk-FXLZM6Q7.js → chunk-7PK2JFEH.js} +1 -1
- package/dist/chunks/chunk-7Q5I3L37.js +68 -0
- package/dist/chunks/{chunk-24SIHFEW.js → chunk-7QHUMMBA.js} +1 -1
- package/dist/chunks/{chunk-5727HGA6.js → chunk-7TREJIPV.js} +1 -1
- package/dist/chunks/{chunk-4HR3I3ML.js → chunk-7TRHPXCG.js} +1 -1
- package/dist/chunks/{chunk-BLUPZPAS.js → chunk-7Y572CPZ.js} +1 -1
- package/dist/chunks/chunk-7ZCM4LWL.js +15 -0
- package/dist/chunks/{chunk-H3ZSF2P3.js → chunk-A7XRIU6Z.js} +1 -1
- package/dist/chunks/chunk-AASXSNBW.js +17 -0
- package/dist/chunks/{chunk-6DBLXAJI.js → chunk-AGFG7WHE.js} +1 -1
- package/dist/chunks/{chunk-Z73UJVGD.js → chunk-AU54JBLF.js} +1 -1
- package/dist/chunks/{chunk-SQ62IODX.js → chunk-AUCQKYL2.js} +1 -1
- package/dist/chunks/{chunk-SCV7XEEO.js → chunk-AX6UCTOC.js} +1 -1
- package/dist/chunks/{chunk-QHGPFYWQ.js → chunk-B7LM2BNN.js} +1 -1
- package/dist/chunks/{chunk-E3AML3VR.js → chunk-BB27VKHS.js} +1 -1
- package/dist/chunks/{chunk-YBAGKQXC.js → chunk-BCD4TRQF.js} +1 -1
- package/dist/chunks/{chunk-OQXHBPPS.js → chunk-BCRZI5IM.js} +1 -1
- package/dist/chunks/{chunk-KA2KG3SY.js → chunk-BDLZ6WL2.js} +1 -1
- package/dist/chunks/chunk-BFS4K2RF.js +7 -0
- package/dist/chunks/chunk-BKJ4H6KK.js +8 -0
- package/dist/chunks/{chunk-COD3WAUI.js → chunk-BNWEJZAC.js} +1 -1
- package/dist/chunks/{chunk-5MDNVAE6.js → chunk-BVFFSUG3.js} +1 -1
- package/dist/chunks/{chunk-LDDXXDN5.js → chunk-C2R5IEN6.js} +1 -1
- package/dist/chunks/{chunk-F7L5SXJM.js → chunk-CDO5IECP.js} +1 -1
- package/dist/chunks/{chunk-YN3HZJXW.js → chunk-CHTFRAXA.js} +1 -1
- package/dist/chunks/{chunk-XOETL6DB.js → chunk-CHY2NJU4.js} +1 -1
- package/dist/chunks/{chunk-MYVALJ4D.js → chunk-CNGI6Z2G.js} +1 -1
- package/dist/chunks/{chunk-4SWS7RKX.js → chunk-CRPZYLIL.js} +1 -1
- package/dist/chunks/{chunk-PVASGBEF.js → chunk-CSU46B7Q.js} +1 -1
- package/dist/chunks/{chunk-DORCX7UB.js → chunk-CUO3CYU3.js} +1 -1
- package/dist/chunks/{chunk-4SAVH3H7.js → chunk-DCFCPAFQ.js} +1 -1
- package/dist/chunks/{chunk-2DH6LTUI.js → chunk-DRDY2UZX.js} +1 -1
- package/dist/chunks/{chunk-D2JNI6UB.js → chunk-DWA7B7TB.js} +1 -1
- package/dist/chunks/chunk-DXFFWNK4.js +8 -0
- package/dist/chunks/chunk-E6VQXHBD.js +11 -0
- package/dist/chunks/chunk-E7ICSU45.js +7 -0
- package/dist/chunks/{chunk-F4KY2TOK.js → chunk-EAQLOKZX.js} +1 -1
- package/dist/chunks/{chunk-ZGM4K3B5.js → chunk-ECQW2R5M.js} +1 -1
- package/dist/chunks/{chunk-VJNTVPUV.js → chunk-EDXNAXEZ.js} +1 -1
- package/dist/chunks/{chunk-B4KA3ZH2.js → chunk-EFGZK6OY.js} +1 -1
- package/dist/chunks/{chunk-MWFHS4HV.js → chunk-EGXRQ73P.js} +1 -1
- package/dist/chunks/chunk-EK7U42I4.js +9 -0
- package/dist/chunks/{chunk-ID663OJ7.js → chunk-EL65DTVZ.js} +1 -1
- package/dist/chunks/{chunk-KNNIA3PS.js → chunk-EPCRR72R.js} +1 -1
- package/dist/chunks/{chunk-3G3FQYMW.js → chunk-ERMHTPO4.js} +1 -1
- package/dist/chunks/chunk-EV2VKG2V.js +8 -0
- package/dist/chunks/{chunk-E5A7E7X6.js → chunk-EZ3HXFLB.js} +1 -1
- package/dist/chunks/{chunk-NMY2YZ6M.js → chunk-F5FBLRH3.js} +1 -1
- package/dist/chunks/{chunk-VWKA6RKB.js → chunk-FHNHVEOX.js} +1 -1
- package/dist/chunks/{chunk-D3M2JG5C.js → chunk-FIICEEXO.js} +1 -1
- package/dist/chunks/{chunk-ZBOTJT5S.js → chunk-FMLRVSWK.js} +1 -1
- package/dist/chunks/chunk-FO7OSSLI.js +13 -0
- package/dist/chunks/{chunk-XC25DYA7.js → chunk-FSM7YM4W.js} +2 -2
- package/dist/chunks/chunk-FSMZPHAA.js +33 -0
- package/dist/chunks/chunk-FUH5PBGR.js +7 -0
- package/dist/chunks/{chunk-QPNTR3PA.js → chunk-FVMRKUWL.js} +1 -1
- package/dist/chunks/chunk-GB77JTTX.js +8 -0
- package/dist/chunks/{chunk-BIABM3FB.js → chunk-GILTW5RJ.js} +1 -1
- package/dist/chunks/{chunk-AW5KOUD7.js → chunk-GNQ7KLCN.js} +1 -1
- package/dist/chunks/{chunk-KLBSCTLL.js → chunk-GO64LSUW.js} +1 -1
- package/dist/chunks/{chunk-4NTBYNFR.js → chunk-GOXGA37R.js} +1 -1
- package/dist/chunks/{chunk-DGLE44KA.js → chunk-GPVXJI6X.js} +1 -1
- package/dist/chunks/{chunk-YTSGFU5T.js → chunk-GUFRGEM5.js} +1 -1
- package/dist/chunks/{chunk-WHEA5VLX.js → chunk-H43XHICL.js} +1 -1
- package/dist/chunks/{chunk-U43WXZBP.js → chunk-HAAKXJ4V.js} +1 -1
- package/dist/chunks/chunk-HAM7ZPEC.js +7 -0
- package/dist/chunks/{chunk-ZHGKJCQ2.js → chunk-HDKEES7E.js} +5 -5
- package/dist/chunks/{chunk-BTI5TG6Q.js → chunk-HGXM4UBQ.js} +1 -1
- package/dist/chunks/chunk-HIEFNLLO.js +7 -0
- package/dist/chunks/{chunk-2KXLL3DX.js → chunk-HSQPQ5RV.js} +1 -1
- package/dist/chunks/{chunk-DDZEKNQR.js → chunk-HT3CQEAF.js} +1 -1
- package/dist/chunks/{chunk-7JU5RJ3H.js → chunk-HT5EXCYX.js} +1 -1
- package/dist/chunks/{chunk-Z3YQZSU4.js → chunk-HXIOR7P6.js} +1 -1
- package/dist/chunks/{chunk-6NC2JFUQ.js → chunk-I254SHTL.js} +1 -1
- package/dist/chunks/{chunk-OPORM35X.js → chunk-IFMPBA4K.js} +1 -1
- package/dist/chunks/{chunk-EHAS6SQB.js → chunk-IKOVY76G.js} +1 -1
- package/dist/chunks/{chunk-BUBVZ6SQ.js → chunk-ILNTOWHG.js} +1 -1
- package/dist/chunks/chunk-ILUU3SGP.js +13 -0
- package/dist/chunks/{chunk-MCRKBVZA.js → chunk-IMLHRJ4K.js} +1 -1
- package/dist/chunks/{chunk-DTCQWGHE.js → chunk-IMZD7QEB.js} +2 -2
- package/dist/chunks/chunk-IVJEYHF5.js +8 -0
- package/dist/chunks/{chunk-Q6YPC3GK.js → chunk-IZOKMWU5.js} +1 -1
- package/dist/chunks/{chunk-BPUANOGW.js → chunk-IZV6K7RR.js} +1 -1
- package/dist/chunks/chunk-J5MGMWRV.js +9 -0
- package/dist/chunks/{chunk-BOJDM3O7.js → chunk-JCDPMWKO.js} +1 -1
- package/dist/chunks/{chunk-Y3V4JYK6.js → chunk-JGEJY7AC.js} +1 -1
- package/dist/chunks/chunk-JJTAADC5.js +7 -0
- package/dist/chunks/{chunk-OZKP3WKT.js → chunk-JK3NTR7T.js} +1 -1
- package/dist/chunks/{chunk-76NL3ZRJ.js → chunk-JM7KUCBM.js} +1 -1
- package/dist/chunks/chunk-JPJ6HGAN.js +7 -0
- package/dist/chunks/{chunk-O3YZLVC6.js → chunk-JRUL67UC.js} +3 -3
- package/dist/chunks/{chunk-J5SINMVO.js → chunk-K4J43D5J.js} +1 -1
- package/dist/chunks/{chunk-LUX4PBJL.js → chunk-K5GE24PG.js} +1 -1
- package/dist/chunks/{chunk-25565AGS.js → chunk-K7YK4PZP.js} +1 -1
- package/dist/chunks/{chunk-CTBSRTJW.js → chunk-KDCLHZYL.js} +1 -1
- package/dist/chunks/{chunk-GXWBL6YV.js → chunk-KDIICSD5.js} +1 -1
- package/dist/chunks/{chunk-FBYA6LLM.js → chunk-KHJWQ4WP.js} +1 -1
- package/dist/chunks/{chunk-2FUGD6J7.js → chunk-KNKGJD5J.js} +1 -1
- package/dist/chunks/{chunk-BRQUZ5NC.js → chunk-L4CSJDG7.js} +1 -1
- package/dist/chunks/{chunk-ISWW3DKF.js → chunk-L6MWUMWZ.js} +1 -1
- package/dist/chunks/{chunk-A6CMQOL7.js → chunk-LBJ7EOZM.js} +1 -1
- package/dist/chunks/{chunk-22ZRVWYP.js → chunk-LHK6B4ER.js} +2 -2
- package/dist/chunks/{chunk-ZBZQEDZY.js → chunk-LKFQMY5V.js} +1 -1
- package/dist/chunks/{chunk-KKYNEEM7.js → chunk-LKXPJLOP.js} +1 -1
- package/dist/chunks/{chunk-Q7D7RGXM.js → chunk-LLHXL3SV.js} +1 -1
- package/dist/chunks/{chunk-BS32OUOC.js → chunk-LPYHYTYI.js} +1 -1
- package/dist/chunks/{chunk-6WBEU34Y.js → chunk-LVPY2RTU.js} +1 -1
- package/dist/chunks/{chunk-A2RZZQEP.js → chunk-LY3EY2VG.js} +1 -1
- package/dist/chunks/chunk-M2XLLWK7.js +7 -0
- package/dist/chunks/chunk-M3LYYAQ6.js +7 -0
- package/dist/chunks/{chunk-7WDSOKOY.js → chunk-MAAJGMXM.js} +1 -1
- package/dist/chunks/{chunk-DWZBL4NK.js → chunk-MAIZY5BV.js} +1 -1
- package/dist/chunks/{chunk-5U2YLD56.js → chunk-MEF5BUJ5.js} +1 -1
- package/dist/chunks/{chunk-YHPPP3SF.js → chunk-MF43WTDT.js} +1 -1
- package/dist/chunks/{chunk-YFOBGEOW.js → chunk-MJKDKZ2J.js} +1 -1
- package/dist/chunks/{chunk-6Z5REGCM.js → chunk-MMMX3KE2.js} +1 -1
- package/dist/chunks/{chunk-ISSNEDG5.js → chunk-MN2F4NPH.js} +1 -1
- package/dist/chunks/{chunk-QFE3RPMA.js → chunk-MTPHHAPR.js} +1 -1
- package/dist/chunks/{slugify-NMMUASYK.js → chunk-N3COHC7T.js} +1 -1
- package/dist/chunks/{chunk-5WYJSLCF.js → chunk-N4FZIVIS.js} +1 -1
- package/dist/chunks/{chunk-27FVSW45.js → chunk-N7IBUNFY.js} +1 -1
- package/dist/chunks/{chunk-BZENIQ7N.js → chunk-NBPLUP7C.js} +1 -1
- package/dist/chunks/chunk-NE5RTEMC.js +7 -0
- package/dist/chunks/{chunk-DXFP22OK.js → chunk-NFBFXM6X.js} +1 -1
- package/dist/chunks/chunk-NXUDP37D.js +7 -0
- package/dist/chunks/{chunk-FB37TFVF.js → chunk-O256QMQM.js} +1 -1
- package/dist/chunks/{chunk-D6O5O3CW.js → chunk-OICSITNU.js} +1 -1
- package/dist/chunks/{chunk-PFD7LETF.js → chunk-OM6NML7C.js} +1 -1
- package/dist/chunks/chunk-OTIERMC7.js +7 -0
- package/dist/chunks/chunk-OVVHONX7.js +8 -0
- package/dist/chunks/{chunk-T44RB754.js → chunk-OXQKWOLS.js} +1 -1
- package/dist/chunks/chunk-P7GA2C6N.js +7 -0
- package/dist/chunks/{chunk-XE4SLG5H.js → chunk-PG5BHJVH.js} +1 -1
- package/dist/chunks/{chunk-AW33SRYY.js → chunk-PH2MLBQO.js} +1 -1
- package/dist/chunks/{chunk-DNONVY2L.js → chunk-PIGJVJNM.js} +2 -2
- package/dist/chunks/chunk-PP7BNCIG.js +7 -0
- package/dist/chunks/{chunk-BKFRN6C2.js → chunk-PR4NNS3O.js} +1 -1
- package/dist/chunks/chunk-PSMKLDLV.js +18 -0
- package/dist/chunks/chunk-PW67ZNDU.js +8 -0
- package/dist/chunks/{chunk-O3GQG2ML.js → chunk-Q3R4HAAA.js} +2 -2
- package/dist/chunks/chunk-Q4W3R6U2.js +12 -0
- package/dist/chunks/{chunk-A4LOQ3UK.js → chunk-QAVUE3TR.js} +1 -1
- package/dist/chunks/{chunk-U5SZQUYO.js → chunk-QCYCLWNG.js} +1 -1
- package/dist/chunks/{chunk-MGKNSTU4.js → chunk-QMI7GTT2.js} +1 -1
- package/dist/chunks/{chunk-S3L2OHPO.js → chunk-QNMWYJQW.js} +1 -1
- package/dist/chunks/{chunk-MMMJO2M3.js → chunk-QOIG2FJP.js} +1 -1
- package/dist/chunks/{chunk-BYBELFCP.js → chunk-QPNYOR6O.js} +1 -1
- package/dist/chunks/{chunk-6KNWKZR4.js → chunk-QPPFQREO.js} +1 -1
- package/dist/chunks/{chunk-EYRBV6RM.js → chunk-QROPMCL2.js} +2 -2
- package/dist/chunks/{chunk-MTZYPCZ7.js → chunk-QRPBDCDH.js} +1 -1
- package/dist/chunks/{chunk-R43H4T4L.js → chunk-QYAXCGZA.js} +1 -1
- package/dist/chunks/{chunk-7OZ7OKPS.js → chunk-R3ZPLQDI.js} +1 -1
- package/dist/chunks/{chunk-6TEYSBCT.js → chunk-R5KBPWWS.js} +1 -1
- package/dist/chunks/{chunk-X6JQI64G.js → chunk-RACUGILV.js} +1 -1
- package/dist/chunks/{chunk-GD7AV7BO.js → chunk-RFD7CEL6.js} +1 -1
- package/dist/chunks/{chunk-RYSO5U3E.js → chunk-RIXTYUYN.js} +1 -1
- package/dist/chunks/{chunk-XHBZITV4.js → chunk-RJB5Y7M4.js} +1 -1
- package/dist/chunks/{chunk-7HQZRU25.js → chunk-RRX2AMWY.js} +1 -1
- package/dist/chunks/chunk-S4ARHJGW.js +9 -0
- package/dist/chunks/chunk-S7FMMAST.js +7 -0
- package/dist/chunks/chunk-SIWT2MBT.js +8 -0
- package/dist/chunks/{chunk-AZVSMIPP.js → chunk-STDRVWDW.js} +1 -1
- package/dist/chunks/{chunk-M2Q2DUHO.js → chunk-SUD5V67L.js} +1 -1
- package/dist/chunks/{chunk-7EJQLVWX.js → chunk-SUT2PTL3.js} +1 -1
- package/dist/chunks/{chunk-Q4R34AVE.js → chunk-SWABNAKZ.js} +1 -1
- package/dist/chunks/chunk-SX2JJDHM.js +17 -0
- package/dist/chunks/{chunk-JDDPCL3K.js → chunk-T2IZUTGY.js} +1 -1
- package/dist/chunks/{chunk-3RFQ2NXZ.js → chunk-T4257EDB.js} +1 -1
- package/dist/chunks/chunk-TASNZYJU.js +14 -0
- package/dist/chunks/chunk-TIU3WJH7.js +8 -0
- package/dist/chunks/{chunk-KIDGOY4F.js → chunk-TL4AEZXF.js} +1 -1
- package/dist/chunks/chunk-TTM4VQ4T.js +7 -0
- package/dist/chunks/chunk-TUPVVZ4I.js +7 -0
- package/dist/chunks/{chunk-MDXG7T7M.js → chunk-U3IPJYB6.js} +1 -1
- package/dist/chunks/{chunk-AMZ7AUYX.js → chunk-UFE4RBZV.js} +1 -1
- package/dist/chunks/chunk-UGJRAFRA.js +8 -0
- package/dist/chunks/{chunk-3AFEVHHY.js → chunk-UGVOMXYR.js} +1 -1
- package/dist/chunks/{chunk-NB2WLB3J.js → chunk-UJ7YUIEJ.js} +1 -1
- package/dist/chunks/chunk-UK3VTHT5.js +7 -0
- package/dist/chunks/{chunk-S6TAO4MD.js → chunk-V2J5U5KQ.js} +1 -1
- package/dist/chunks/{chunk-J3U2QD2L.js → chunk-V7VHLSYL.js} +1 -1
- package/dist/chunks/chunk-VB6SQWSB.js +9 -0
- package/dist/chunks/{chunk-DOOBZO4W.js → chunk-VJM3WCEC.js} +1 -1
- package/dist/chunks/{chunk-BYYNR34Q.js → chunk-VNS4Z72T.js} +1 -1
- package/dist/chunks/{chunk-CTMTO2W4.js → chunk-VQAIH2X5.js} +1 -1
- package/dist/chunks/{chunk-ATSAMHUZ.js → chunk-VTAH7VMY.js} +1 -1
- package/dist/chunks/chunk-W2YAOE3Z.js +7 -0
- package/dist/chunks/{chunk-3SF3ILIT.js → chunk-WA4CPW3H.js} +1 -1
- package/dist/chunks/chunk-WKEDN5SX.js +9 -0
- package/dist/chunks/{chunk-JALVF3C2.js → chunk-WMIZ6Y4E.js} +1 -1
- package/dist/chunks/{chunk-Z436ZYLV.js → chunk-WQBNOQUT.js} +1 -1
- package/dist/chunks/{chunk-YOKTRWQX.js → chunk-WRTBYD4I.js} +1 -1
- package/dist/chunks/{chunk-7RABG6HV.js → chunk-WS6UOPMS.js} +1 -1
- package/dist/chunks/{chunk-TLKBGAOL.js → chunk-WWEUGL6W.js} +1 -1
- package/dist/chunks/chunk-X2UJGCIC.js +9 -0
- package/dist/chunks/{chunk-JUAHDOL6.js → chunk-X5YKQ2RJ.js} +1 -1
- package/dist/chunks/{chunk-D5JQZXL7.js → chunk-XHWA436J.js} +1 -1
- package/dist/chunks/chunk-XHXWUAJE.js +32 -0
- package/dist/chunks/{chunk-U4Z2MMOF.js → chunk-XKVKG7CW.js} +1 -1
- package/dist/chunks/{chunk-HYAIA5YC.js → chunk-XL6PE4AA.js} +2 -2
- package/dist/chunks/{chunk-E3WP42P2.js → chunk-XPEWDJV6.js} +1 -1
- package/dist/chunks/{chunk-TGIIE2L3.js → chunk-XPWLEGWA.js} +1 -1
- package/dist/chunks/{chunk-7SLMNM55.js → chunk-XY2GGCHC.js} +1 -1
- package/dist/chunks/{chunk-G24EKATW.js → chunk-XZYVBYUY.js} +1 -1
- package/dist/chunks/chunk-Y2KAVMM4.js +10 -0
- package/dist/chunks/{chunk-46ISU3XI.js → chunk-Y3ETQZSK.js} +2 -2
- package/dist/chunks/{chunk-GRRVPFSB.js → chunk-Y45NZT7C.js} +1 -1
- package/dist/chunks/{chunk-5RMIM4S2.js → chunk-Y7SZI3JV.js} +1 -1
- package/dist/chunks/{chunk-ZRFDZO7Y.js → chunk-YATYCZQJ.js} +1 -1
- package/dist/chunks/chunk-YBWLW6SW.js +7 -0
- package/dist/chunks/{chunk-B7IUFV5P.js → chunk-YDCILYRC.js} +1 -1
- package/dist/chunks/{chunk-67GZ5REA.js → chunk-YHZXIBS7.js} +1 -1
- package/dist/chunks/{chunk-H24KFNPB.js → chunk-YIKXLWSR.js} +1 -1
- package/dist/chunks/{chunk-5CVEW3HD.js → chunk-YLQCB6XY.js} +1 -1
- package/dist/chunks/{chunk-WAOS5OCB.js → chunk-YU33PPKX.js} +1 -1
- package/dist/chunks/{chunk-V3YNYCRV.js → chunk-YVWIDLY4.js} +6 -6
- package/dist/chunks/{chunk-CEA5NDJC.js → chunk-Z2NPMUPM.js} +1 -1
- package/dist/chunks/{chunk-N3ZNAMGR.js → chunk-Z62G57GC.js} +1 -1
- package/dist/chunks/{chunk-D6NVKMRP.js → chunk-ZG7A4P5U.js} +1 -1
- package/dist/chunks/{chunk-NZ2TFADV.js → chunk-ZOJI7HYA.js} +1 -1
- package/dist/chunks/{chunk-TSIKSHYG.js → chunk-ZSJU5MJP.js} +1 -1
- package/dist/chunks/{chunk-47E5IB3C.js → chunk-ZWPASRC2.js} +1 -1
- package/dist/chunks/{clear-GL4SZ2XR.js → clear-4MDTHLLE.js} +1 -1
- package/dist/chunks/{cli-embedded-NR5F35LW.js → cli-embedded-OYBJM5SA.js} +2 -2
- package/dist/chunks/cli-truncate-CylqKOGj-WE5OLB6Q.js +7 -0
- package/dist/chunks/commands-Bx-lrmie-W7FCFL4P.js +10 -0
- package/dist/chunks/compile-vercel-config-A2DMFB2R.js +7 -0
- package/dist/chunks/{config-KSQQQMQQ.js → config-4R62ATWJ.js} +1 -1
- package/dist/chunks/{config-U4GLPYDY.js → config-A7DCP25J.js} +1 -1
- package/dist/chunks/config-HiWLfXRQ-D7JA4E3D.js +43 -0
- package/dist/chunks/connect-U3yG4EtI-XYHDJQT7.js +7 -0
- package/dist/chunks/connect-git-provider-MPYSAOTH.js +7 -0
- package/dist/chunks/cp-aFe-HVrK-UAGAR2BC.js +12 -0
- package/dist/chunks/create-ilHWvzSk-7KWZXBE2.js +7 -0
- package/dist/chunks/create-project-OA7KBPVU.js +7 -0
- package/dist/chunks/{delete-O2VWRQC3.js → delete-DN53BRH7.js} +1 -1
- package/dist/chunks/{delete-D2WLQHVB.js → delete-G4MAUBXZ.js} +1 -1
- package/dist/chunks/{describe-N36SISDN.js → describe-Q5D5GYVG.js} +1 -1
- package/dist/chunks/detect-projects-DHS2E3N4.js +7 -0
- package/dist/chunks/detect-services-VBKVN4A2.js +7 -0
- package/dist/chunks/{disable-EHRVY24G.js → disable-CG3R2VAL.js} +1 -1
- package/dist/chunks/{discard-QW5TMTXX.js → discard-REGFZXFU.js} +1 -1
- package/dist/chunks/dist-4F3LAB5Z.js +7 -0
- package/dist/chunks/{dist-RXYNZPEA.js → dist-S7GEJ656.js} +1 -1
- package/dist/chunks/{dist-33WTJLVQ.js → dist-T2AURD3P.js} +1 -1
- package/dist/chunks/domain-DGvr_U55-PNXSOVDO.js +8 -0
- package/dist/chunks/drives-Bi-Mnt2z-Z4T2YY4P.js +14 -0
- package/dist/chunks/{edit-IZR537PS.js → edit-7AUE6GXE.js} +1 -1
- package/dist/chunks/{edit-WM6KJPSI.js → edit-HHLQDVOP.js} +1 -1
- package/dist/chunks/{enable-5Z72O3NI.js → enable-BV3N6GEL.js} +1 -1
- package/dist/chunks/{engine-C8wCzkw--PYVABGU4.js → engine-C8wCzkw--72P7UD6T.js} +1 -1
- package/dist/chunks/{esm-IYH32MTQ.js → esm-B3P7PUFJ.js} +1 -1
- package/dist/chunks/{esm-5GQXHN7C.js → esm-CMSQLK7G.js} +1 -1
- package/dist/chunks/{esm-LEQXRLFV.js → esm-KWMRMP74.js} +1 -1
- package/dist/chunks/{esm-NHCCFW7Z.js → esm-LRBNA4QO.js} +1 -1
- package/dist/chunks/{esm-FJCIOBBV.js → esm-NVIK2MSG.js} +1 -1
- package/dist/chunks/{esm-T655CG6O.js → esm-RAS56M3I.js} +1 -1
- package/dist/chunks/{esm-QQ3MUOW4.js → esm-WU2ZS2IW.js} +1 -1
- package/dist/chunks/exec-Bwv4MDyN-7YUAVBB2.js +7 -0
- package/dist/chunks/{exec-PCSP64LR.js → exec-NYLXYXB5.js} +3 -3
- package/dist/chunks/{export-IWVMWM2H.js → export-WUPMMHSX.js} +1 -1
- package/dist/chunks/extend-D9tq9Cot-QT72AXGH.js +8 -0
- package/dist/chunks/{fetch-proxy-MOKBS56A.js → fetch-proxy-ZIHXTNFP.js} +1 -1
- package/dist/chunks/fork-DQ6qfKqB-XXTHHUMZ.js +9 -0
- package/dist/chunks/future-DJOUGRV4.js +7 -0
- package/dist/chunks/generate-cert-for-deploy-PZHDFX3W.js +7 -0
- package/dist/chunks/groups-B8JVEeKk-K57VTXSS.js +10 -0
- package/dist/chunks/image-DX2IAUKJ.js +7 -0
- package/dist/chunks/import-builders-IUEC2WN2.js +7 -0
- package/dist/chunks/{inspect-QT3QEFBW.js → inspect-BS5UPI6W.js} +1 -1
- package/dist/chunks/{inspect-6J5DGZZ4.js → inspect-GJXLYJC7.js} +1 -1
- package/dist/chunks/{inspect-6Y672OQ3.js → inspect-IHVP2M4H.js} +1 -1
- package/dist/chunks/{inspect-47FM3OWG.js → inspect-PBSKPN4W.js} +1 -1
- package/dist/chunks/{inspect-SW2I7D6E.js → inspect-Y7VXJEI2.js} +1 -1
- package/dist/chunks/{inspect-ALC2J4BF.js → inspect-YGVXE4HR.js} +1 -1
- package/dist/chunks/{list-TGDHJKDT.js → list-27R4USBV.js} +1 -1
- package/dist/chunks/{list-BIFH4KO5.js → list-2ZCNO6DY.js} +1 -1
- package/dist/chunks/{list-CXXDI5UV.js → list-TUST62E6.js} +1 -1
- package/dist/chunks/{list-2CMCXXP4.js → list-ZSQVIQXC.js} +1 -1
- package/dist/chunks/list-iqQFvOHx-PNAUIUQL.js +7 -0
- package/dist/chunks/log-update-DsqoChS1-DG7F5XJ4.js +11 -0
- package/dist/chunks/{login-IUQDG334.js → login-CUEQHDT5.js} +1 -1
- package/dist/chunks/login-DGxA9ez--ZRIJ24TS.js +13 -0
- package/dist/chunks/login-YCOZROC2.js +7 -0
- package/dist/chunks/logout-OEbPJLu2-7NPM6ALK.js +8 -0
- package/dist/chunks/logs-W4GZLDHE.js +7 -0
- package/dist/chunks/ls-27K5BB7Z.js +11 -0
- package/dist/chunks/{ls-C75Z5FBX.js → ls-EEJQIKNI.js} +1 -1
- package/dist/chunks/ls-PAL6FQB6.js +8 -0
- package/dist/chunks/{ls-GC5MX2HZ.js → ls-TDYTE4HM.js} +1 -1
- package/dist/chunks/{ls-7D73WVOF.js → ls-UMSUUQCG.js} +1 -1
- package/dist/chunks/{ls-ERDQLUT2.js → ls-W7C5I555.js} +1 -1
- package/dist/chunks/{ls-4DNFF35I.js → ls-XYEJ5MR6.js} +1 -1
- package/dist/chunks/migrate-experimental-services-556MHJWK.js +7 -0
- package/dist/chunks/mutate-IELSY6ED.js +9 -0
- package/dist/chunks/{native-self-update-Q3EN6NZK.js → native-self-update-T75AUBHJ.js} +1 -1
- package/dist/chunks/{notifications-2HU4L7WA.js → notifications-GZH7CFZY.js} +1 -1
- package/dist/chunks/{open-MA7QGJKO.js → open-EVYPUPNZ.js} +1 -1
- package/dist/chunks/{openapi-POBVCXS3.js → openapi-S6F32ZQD.js} +1 -1
- package/dist/chunks/{permissions-AU5M5A6G.js → permissions-EHF5MNZP.js} +1 -1
- package/dist/chunks/{plugin-offer-E53UQXXX.js → plugin-offer-RZADKNYF.js} +1 -1
- package/dist/chunks/prompt-missing-credentials-OSAV5B7N.js +7 -0
- package/dist/chunks/{publish-G7NQESCE.js → publish-ZB2Q2YSB.js} +1 -1
- package/dist/chunks/pull-WUFIVXEG.js +7 -0
- package/dist/chunks/purchase-domain-if-available-YVVGT7MZ.js +7 -0
- package/dist/chunks/{push-BG7UEIKY.js → push-YWKZ6SOO.js} +1 -1
- package/dist/chunks/query-G62G25HV.js +7 -0
- package/dist/chunks/{raw-query-QHFSKN55.js → raw-query-WTKAOYCP.js} +1 -1
- package/dist/chunks/read-BTA5slYO-IJLWMNSS.js +8 -0
- package/dist/chunks/{reauthenticate-U2LOFDFP.js → reauthenticate-WQZ5HISG.js} +1 -1
- package/dist/chunks/remove-7PSNAEDY.js +9 -0
- package/dist/chunks/remove-CCa99nz9-LCSNBDLT.js +7 -0
- package/dist/chunks/{reorder-E5UYNMML.js → reorder-OLCKSATY.js} +1 -1
- package/dist/chunks/{reply-DSDFBUAX.js → reply-OVHQNEBO.js} +1 -1
- package/dist/chunks/{repo-info-to-url-XQSULSEO.js → repo-info-to-url-S2YOQIRM.js} +1 -1
- package/dist/chunks/{repo-root-DZ6WFHMP.js → repo-root-STNOAHCH.js} +1 -1
- package/dist/chunks/{resolve-VK5QTUII.js → resolve-TUHO4FHT.js} +1 -1
- package/dist/chunks/{resolve-agent-team-D7RFR6WL.js → resolve-agent-team-NQCRA6ER.js} +1 -1
- package/dist/chunks/{resolve-deployment-framework-preset-BLMQLCIN.js → resolve-deployment-framework-preset-SCQCWANF.js} +1 -1
- package/dist/chunks/{restore-IVNZOVU3.js → restore-5RLBSVYQ.js} +1 -1
- package/dist/chunks/{rm-PAI3WZXJ.js → rm-5RGN33Y5.js} +1 -1
- package/dist/chunks/rm-D7CWGBTV.js +8 -0
- package/dist/chunks/{rm-L2KCHMLS.js → rm-FYU3GBLC.js} +1 -1
- package/dist/chunks/rm-HA752TW6.js +8 -0
- package/dist/chunks/{rm-LWEITUDD.js → rm-P6AGSBXP.js} +1 -1
- package/dist/chunks/routes-7VLRHXT4.js +7 -0
- package/dist/chunks/rule-inspect-Y2MX7LQN.js +8 -0
- package/dist/chunks/run-D8obqfKw-D2EGHTU2.js +7 -0
- package/dist/chunks/{schema-ZOPJJLJC.js → schema-AJAHECZG.js} +1 -1
- package/dist/chunks/{schema-ZIK2W4AX.js → schema-UVTYLX6L.js} +2 -2
- package/dist/chunks/select-org-JBKKKZSN.js +7 -0
- package/dist/chunks/{serving-C1mhZQqH-73TMEGEB.js → serving-C1mhZQqH-XEQUVQZK.js} +1 -1
- package/dist/chunks/sessions-cvWvPgzc-FBOQQPU5.js +7 -0
- package/dist/chunks/{set-MC2CLSA2.js → set-774P7GEL.js} +1 -1
- package/dist/chunks/{set-B5MPNYXG.js → set-OWNTI5SM.js} +1 -1
- package/dist/chunks/setup-and-link-3LD4LQGE.js +7 -0
- package/dist/chunks/sh-7olsIyJh-NFO2QYTK.js +7 -0
- package/dist/chunks/{skills-X5MN3OH2.js → skills-W45E2EWS.js} +1 -1
- package/dist/chunks/slugify-OEOEYGDL.js +7 -0
- package/dist/chunks/snapshot-D9MAspub-UAVA2YSK.js +9 -0
- package/dist/chunks/snapshots-DQjvm6St-DBG4H2HS.js +9 -0
- package/dist/chunks/stamp-THWCZ5IQ.js +7 -0
- package/dist/chunks/{statuspage-K5SC7KAQ.js → statuspage-NCYXH7DR.js} +1 -1
- package/dist/chunks/stop-SQX-uC-Q-CRDQOA5M.js +10 -0
- package/dist/chunks/table-3DCL552W.js +7 -0
- package/dist/chunks/{tags-WRVKKRN7.js → tags-DEIOW5MM.js} +1 -1
- package/dist/chunks/telemetry-KLbte3YE-OAFHJTWE.js +13 -0
- package/dist/chunks/token-DGNBXqnR-37H4S563.js +7 -0
- package/dist/chunks/token-EYEJQ7AP.js +7 -0
- package/dist/chunks/token-LNLX4V5J.js +7 -0
- package/dist/chunks/token-MZBD3R2S.js +7 -0
- package/dist/chunks/token-util-4P4GUSTT.js +7 -0
- package/dist/chunks/token-util-DAhLJ1X4-NJBLJROT.js +7 -0
- package/dist/chunks/token-util-XC5K3DNT.js +7 -0
- package/dist/chunks/token-util-XO4H5VLL.js +7 -0
- package/dist/chunks/{types-PC3JIYPX.js → types-SYUZH46V.js} +1 -1
- package/dist/chunks/update-VG2LHBRV.js +8 -0
- package/dist/chunks/{update-route-version-KWK5S4UW.js → update-route-version-MKFTZPKQ.js} +1 -1
- package/dist/chunks/usage-NF6S3DAZ.js +17 -0
- package/dist/chunks/users-CGEsQ4G8-POYTVZJV.js +9 -0
- package/dist/chunks/{utils-IQZEE4DT.js → utils-XXR7KIRB.js} +1 -1
- package/dist/chunks/validate-config-MJQI5EMD.js +7 -0
- package/dist/chunks/{vercel-cli-3UQLDU2S.js → vercel-cli-RW4WHHOS.js} +1 -1
- package/dist/chunks/{vlt-builder-graph-XL2XRO4V.js → vlt-builder-graph-EU5EX7KY.js} +1 -1
- package/dist/chunks/{vlt-builder-importer-RBUPAB6J.js → vlt-builder-importer-2YSRGPFC.js} +1 -1
- package/dist/chunks/wrap-ansi-CaN_P_HT-MAPHF26X.js +7 -0
- package/dist/chunks/write-DixEhGqz-YYDLLSJE.js +10 -0
- package/dist/chunks/{zod-Y3ZBY67C.js → zod-H7KW2D5Z.js} +1 -1
- package/dist/commands/build/index.js +1 -1
- package/dist/commands/deploy/index.js +11 -11
- package/dist/commands/dev/index.js +5 -9
- package/dist/commands/env/index.js +1 -1
- package/dist/commands/link/index.js +1 -1
- package/dist/commands/list/index.js +1 -1
- package/dist/commands/project/index.js +102 -80
- package/dist/commands/tunnel/index.js +1 -1
- package/dist/commands-account.js +101 -67
- package/dist/commands-ai.js +15 -15
- package/dist/commands-blob.js +3 -3
- package/dist/commands-core.js +9 -9
- package/dist/commands-deployments.js +1 -1
- package/dist/commands-flags.js +7 -7
- package/dist/commands-integrations.js +11 -11
- package/dist/commands-observability.js +2 -2
- package/dist/commands-routing.js +9 -9
- package/dist/help.js +1 -1
- package/dist/index.js +10 -8
- package/dist/internal-build-worker.js +1 -1
- package/dist/internal-build.js +2 -2
- package/dist/package.json +9 -9
- package/dist/root-help-commands.mjs +1 -1
- package/dist/version.mjs +1 -1
- package/package.json +16 -16
- package/dist/chunks/add-RH3RQPGP.js +0 -8
- package/dist/chunks/chunk-37P7O3AQ.js +0 -9
- package/dist/chunks/chunk-3ARTWVQV.js +0 -11
- package/dist/chunks/chunk-4F73GVJZ.js +0 -7
- package/dist/chunks/chunk-6FEMU5YF.js +0 -7
- package/dist/chunks/chunk-6UJIJLQC.js +0 -13
- package/dist/chunks/chunk-CDJ25IKC.js +0 -7
- package/dist/chunks/chunk-EMTZZXMH.js +0 -13
- package/dist/chunks/chunk-HR4ID3MU.js +0 -7
- package/dist/chunks/chunk-INIZJZ3O.js +0 -7
- package/dist/chunks/chunk-JCHZRW4N.js +0 -7
- package/dist/chunks/chunk-MDRI27KN.js +0 -9
- package/dist/chunks/chunk-OAM5NJCU.js +0 -9
- package/dist/chunks/chunk-PX3V7X3Q.js +0 -12
- package/dist/chunks/chunk-RHFNVIFD.js +0 -7
- package/dist/chunks/chunk-T4DOV5S4.js +0 -7
- package/dist/chunks/chunk-XKPB27SC.js +0 -8
- package/dist/chunks/chunk-Z3XKNZDP.js +0 -9
- package/dist/chunks/compile-vercel-config-HMKEDWC4.js +0 -7
- package/dist/chunks/connect-git-provider-WGKVFXW2.js +0 -7
- package/dist/chunks/create-project-BTOHPKZB.js +0 -7
- package/dist/chunks/detect-projects-I7NEHWSM.js +0 -7
- package/dist/chunks/detect-services-4ONC2DH3.js +0 -7
- package/dist/chunks/future-3AUPMPY7.js +0 -7
- package/dist/chunks/generate-cert-for-deploy-OZWVIWOO.js +0 -7
- package/dist/chunks/image-EFBQXTAP.js +0 -7
- package/dist/chunks/import-builders-2G4KVI4T.js +0 -7
- package/dist/chunks/login-WYDX5KZN.js +0 -7
- package/dist/chunks/logs-E3RZLAT2.js +0 -7
- package/dist/chunks/ls-IQUZ6GWG.js +0 -11
- package/dist/chunks/ls-YTKJRKD3.js +0 -8
- package/dist/chunks/migrate-experimental-services-GPGYPN66.js +0 -7
- package/dist/chunks/mutate-YJNE2733.js +0 -9
- package/dist/chunks/prompt-missing-credentials-7F7MUAWK.js +0 -7
- package/dist/chunks/pull-4LISUHDN.js +0 -7
- package/dist/chunks/purchase-domain-if-available-QH2OHRLZ.js +0 -7
- package/dist/chunks/query-QCIU5IB4.js +0 -7
- package/dist/chunks/remove-IB7C6LII.js +0 -9
- package/dist/chunks/rm-GYS4DS2Z.js +0 -8
- package/dist/chunks/rm-PDJE63VV.js +0 -8
- package/dist/chunks/routes-SBMN6SDF.js +0 -7
- package/dist/chunks/rule-inspect-LQISNCBT.js +0 -8
- package/dist/chunks/select-org-EKDOS2CQ.js +0 -7
- package/dist/chunks/setup-and-link-FHHZAU65.js +0 -7
- package/dist/chunks/stamp-TKONNIJ5.js +0 -7
- package/dist/chunks/table-SCLK33K7.js +0 -7
- package/dist/chunks/token-MYYNOUIT.js +0 -7
- package/dist/chunks/token-util-OJHS52JP.js +0 -7
- package/dist/chunks/update-QDIZFM4T.js +0 -8
- package/dist/chunks/usage-JUP36KHN.js +0 -15
- package/dist/chunks/validate-config-K42CVRCZ.js +0 -7
|
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{__export}from"./chunk-BZENIQ7N.js";import{Buffer as Buffer2}from"node:buffer";import{createHash}from"node:crypto";var digest=(algorithm,data)=>createHash(algorithm).update(data).digest(),digest_default=digest;var encoder=new TextEncoder,decoder=new TextDecoder,MAX_INT32=2**32;function concat(...buffers){let size=buffers.reduce((acc,{length})=>acc+length,0),buf=new Uint8Array(size),i=0;for(let buffer of buffers)buf.set(buffer,i),i+=buffer.length;return buf}function p2s(alg,p2sInput){return concat(encoder.encode(alg),new Uint8Array([0]),p2sInput)}function writeUInt32BE(buf,value,offset){if(value<0||value>=MAX_INT32)throw new RangeError(`value must be >= 0 and <= ${MAX_INT32-1}. Received ${value}`);buf.set([value>>>24,value>>>16,value>>>8,value&255],offset)}function uint64be(value){let high=Math.floor(value/MAX_INT32),low=value%MAX_INT32,buf=new Uint8Array(8);return writeUInt32BE(buf,high,0),writeUInt32BE(buf,low,4),buf}function uint32be(value){let buf=new Uint8Array(4);return writeUInt32BE(buf,value),buf}function lengthAndInput(input){return concat(uint32be(input.length),input)}async function concatKdf(secret,bits,value){let iterations=Math.ceil((bits>>3)/32),res=new Uint8Array(iterations*32);for(let iter=0;iter<iterations;iter++){let buf=new Uint8Array(4+secret.length+value.length);buf.set(uint32be(iter+1)),buf.set(secret,4),buf.set(value,4+secret.length),res.set(await digest_default("sha256",buf),iter*32)}return res.slice(0,bits>>3)}function normalize(input){let encoded=input;return encoded instanceof Uint8Array&&(encoded=decoder.decode(encoded)),encoded}var encode=input=>Buffer2.from(input).toString("base64url");var decode=input=>new Uint8Array(Buffer2.from(normalize(input),"base64url"));import{createDecipheriv,KeyObject}from"node:crypto";var JOSEError=class extends Error{static code="ERR_JOSE_GENERIC";code="ERR_JOSE_GENERIC";constructor(message2,options){super(message2,options),this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}},JWTClaimValidationFailed=class extends JOSEError{static code="ERR_JWT_CLAIM_VALIDATION_FAILED";code="ERR_JWT_CLAIM_VALIDATION_FAILED";claim;reason;payload;constructor(message2,payload,claim="unspecified",reason="unspecified"){super(message2,{cause:{claim,reason,payload}}),this.claim=claim,this.reason=reason,this.payload=payload}},JWTExpired=class extends JOSEError{static code="ERR_JWT_EXPIRED";code="ERR_JWT_EXPIRED";claim;reason;payload;constructor(message2,payload,claim="unspecified",reason="unspecified"){super(message2,{cause:{claim,reason,payload}}),this.claim=claim,this.reason=reason,this.payload=payload}},JOSEAlgNotAllowed=class extends JOSEError{static code="ERR_JOSE_ALG_NOT_ALLOWED";code="ERR_JOSE_ALG_NOT_ALLOWED"},JOSENotSupported=class extends JOSEError{static code="ERR_JOSE_NOT_SUPPORTED";code="ERR_JOSE_NOT_SUPPORTED"},JWEDecryptionFailed=class extends JOSEError{static code="ERR_JWE_DECRYPTION_FAILED";code="ERR_JWE_DECRYPTION_FAILED";constructor(message2="decryption operation failed",options){super(message2,options)}},JWEInvalid=class extends JOSEError{static code="ERR_JWE_INVALID";code="ERR_JWE_INVALID"};var JWTInvalid=class extends JOSEError{static code="ERR_JWT_INVALID";code="ERR_JWT_INVALID"};var JWKSMultipleMatchingKeys=class extends JOSEError{[Symbol.asyncIterator];static code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";constructor(message2="multiple matching keys found in the JSON Web Key Set",options){super(message2,options)}};import{randomFillSync}from"node:crypto";function bitLength(alg){switch(alg){case"A128GCM":case"A128GCMKW":case"A192GCM":case"A192GCMKW":case"A256GCM":case"A256GCMKW":return 96;case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return 128;default:throw new JOSENotSupported(`Unsupported JWE Algorithm: ${alg}`)}}var iv_default=alg=>randomFillSync(new Uint8Array(bitLength(alg)>>3));var checkIvLength=(enc,iv)=>{if(iv.length<<3!==bitLength(enc))throw new JWEInvalid("Invalid Initialization Vector length")},check_iv_length_default=checkIvLength;import*as util from"node:util";var is_key_object_default=obj=>util.types.isKeyObject(obj);var checkCekLength=(enc,cek)=>{let expected;switch(enc){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":expected=parseInt(enc.slice(-3),10);break;case"A128GCM":case"A192GCM":case"A256GCM":expected=parseInt(enc.slice(1,4),10);break;default:throw new JOSENotSupported(`Content Encryption Algorithm ${enc} is not supported either by JOSE or your javascript runtime`)}if(cek instanceof Uint8Array){let actual=cek.byteLength<<3;if(actual!==expected)throw new JWEInvalid(`Invalid Content Encryption Key length. Expected ${expected} bits, got ${actual} bits`);return}if(is_key_object_default(cek)&&cek.type==="secret"){let actual=cek.symmetricKeySize<<3;if(actual!==expected)throw new JWEInvalid(`Invalid Content Encryption Key length. Expected ${expected} bits, got ${actual} bits`);return}throw new TypeError("Invalid Content Encryption Key type")},check_cek_length_default=checkCekLength;import{timingSafeEqual as impl}from"node:crypto";var timingSafeEqual=impl,timing_safe_equal_default=timingSafeEqual;import{createHmac}from"node:crypto";function cbcTag(aad,iv,ciphertext,macSize,macKey,keySize){let macData=concat(aad,iv,ciphertext,uint64be(aad.length<<3)),hmac=createHmac(`sha${macSize}`,macKey);return hmac.update(macData),hmac.digest().slice(0,keySize>>3)}import*as crypto from"node:crypto";import*as util2 from"node:util";var webcrypto2=crypto.webcrypto,webcrypto_default=webcrypto2,isCryptoKey=key=>util2.types.isCryptoKey(key);function unusable(name,prop="algorithm.name"){return new TypeError(`CryptoKey does not support this operation, its ${prop} must be ${name}`)}function isAlgorithm(algorithm,name){return algorithm.name===name}function getHashLength(hash){return parseInt(hash.name.slice(4),10)}function checkUsage(key,usages){if(usages.length&&!usages.some(expected=>key.usages.includes(expected))){let msg="CryptoKey does not support this operation, its usages must include ";if(usages.length>2){let last=usages.pop();msg+=`one of ${usages.join(", ")}, or ${last}.`}else usages.length===2?msg+=`one of ${usages[0]} or ${usages[1]}.`:msg+=`${usages[0]}.`;throw new TypeError(msg)}}function checkEncCryptoKey(key,alg,...usages){switch(alg){case"A128GCM":case"A192GCM":case"A256GCM":{if(!isAlgorithm(key.algorithm,"AES-GCM"))throw unusable("AES-GCM");let expected=parseInt(alg.slice(1,4),10);if(key.algorithm.length!==expected)throw unusable(expected,"algorithm.length");break}case"A128KW":case"A192KW":case"A256KW":{if(!isAlgorithm(key.algorithm,"AES-KW"))throw unusable("AES-KW");let expected=parseInt(alg.slice(1,4),10);if(key.algorithm.length!==expected)throw unusable(expected,"algorithm.length");break}case"ECDH":{switch(key.algorithm.name){case"ECDH":case"X25519":case"X448":break;default:throw unusable("ECDH, X25519, or X448")}break}case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":if(!isAlgorithm(key.algorithm,"PBKDF2"))throw unusable("PBKDF2");break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":{if(!isAlgorithm(key.algorithm,"RSA-OAEP"))throw unusable("RSA-OAEP");let expected=parseInt(alg.slice(9),10)||1;if(getHashLength(key.algorithm.hash)!==expected)throw unusable(`SHA-${expected}`,"algorithm.hash");break}default:throw new TypeError("CryptoKey does not support this operation")}checkUsage(key,usages)}function message(msg,actual,...types4){if(types4=types4.filter(Boolean),types4.length>2){let last=types4.pop();msg+=`one of type ${types4.join(", ")}, or ${last}.`}else types4.length===2?msg+=`one of type ${types4[0]} or ${types4[1]}.`:msg+=`of type ${types4[0]}.`;return actual==null?msg+=` Received ${actual}`:typeof actual=="function"&&actual.name?msg+=` Received function ${actual.name}`:typeof actual=="object"&&actual!=null&&actual.constructor?.name&&(msg+=` Received an instance of ${actual.constructor.name}`),msg}var invalid_key_input_default=(actual,...types4)=>message("Key must be ",actual,...types4);function withAlg(alg,actual,...types4){return message(`Key for the ${alg} algorithm must be `,actual,...types4)}import{getCiphers}from"node:crypto";var ciphers,ciphers_default=algorithm=>(ciphers||=new Set(getCiphers()),ciphers.has(algorithm));var is_key_like_default=key=>is_key_object_default(key)||isCryptoKey(key),types3=["KeyObject"];(globalThis.CryptoKey||webcrypto_default?.CryptoKey)&&types3.push("CryptoKey");function cbcDecrypt(enc,cek,ciphertext,iv,tag2,aad){let keySize=parseInt(enc.slice(1,4),10);is_key_object_default(cek)&&(cek=cek.export());let encKey=cek.subarray(keySize>>3),macKey=cek.subarray(0,keySize>>3),macSize=parseInt(enc.slice(-3),10),algorithm=`aes-${keySize}-cbc`;if(!ciphers_default(algorithm))throw new JOSENotSupported(`alg ${enc} is not supported by your javascript runtime`);let expectedTag=cbcTag(aad,iv,ciphertext,macSize,macKey,keySize),macCheckPassed;try{macCheckPassed=timing_safe_equal_default(tag2,expectedTag)}catch{}if(!macCheckPassed)throw new JWEDecryptionFailed;let plaintext;try{let decipher=createDecipheriv(algorithm,encKey,iv);plaintext=concat(decipher.update(ciphertext),decipher.final())}catch{}if(!plaintext)throw new JWEDecryptionFailed;return plaintext}function gcmDecrypt(enc,cek,ciphertext,iv,tag2,aad){let algorithm=`aes-${parseInt(enc.slice(1,4),10)}-gcm`;if(!ciphers_default(algorithm))throw new JOSENotSupported(`alg ${enc} is not supported by your javascript runtime`);try{let decipher=createDecipheriv(algorithm,cek,iv,{authTagLength:16});decipher.setAuthTag(tag2),aad.byteLength&&decipher.setAAD(aad,{plaintextLength:ciphertext.length});let plaintext=decipher.update(ciphertext);return decipher.final(),plaintext}catch{throw new JWEDecryptionFailed}}var decrypt=(enc,cek,ciphertext,iv,tag2,aad)=>{let key;if(isCryptoKey(cek))checkEncCryptoKey(cek,enc,"decrypt"),key=KeyObject.from(cek);else if(cek instanceof Uint8Array||is_key_object_default(cek))key=cek;else throw new TypeError(invalid_key_input_default(cek,...types3,"Uint8Array"));if(!iv)throw new JWEInvalid("JWE Initialization Vector missing");if(!tag2)throw new JWEInvalid("JWE Authentication Tag missing");switch(check_cek_length_default(enc,key),check_iv_length_default(enc,iv),enc){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return cbcDecrypt(enc,key,ciphertext,iv,tag2,aad);case"A128GCM":case"A192GCM":case"A256GCM":return gcmDecrypt(enc,key,ciphertext,iv,tag2,aad);default:throw new JOSENotSupported("Unsupported JWE Content Encryption Algorithm")}},decrypt_default=decrypt;var isDisjoint=(...headers)=>{let sources=headers.filter(Boolean);if(sources.length===0||sources.length===1)return!0;let acc;for(let header of sources){let parameters=Object.keys(header);if(!acc||acc.size===0){acc=new Set(parameters);continue}for(let parameter of parameters){if(acc.has(parameter))return!1;acc.add(parameter)}}return!0},is_disjoint_default=isDisjoint;function isObjectLike(value){return typeof value=="object"&&value!==null}function isObject(input){if(!isObjectLike(input)||Object.prototype.toString.call(input)!=="[object Object]")return!1;if(Object.getPrototypeOf(input)===null)return!0;let proto=input;for(;Object.getPrototypeOf(proto)!==null;)proto=Object.getPrototypeOf(proto);return Object.getPrototypeOf(input)===proto}import{Buffer as Buffer3}from"node:buffer";import{KeyObject as KeyObject2,createDecipheriv as createDecipheriv2,createCipheriv,createSecretKey}from"node:crypto";function checkKeySize(key,alg){if(key.symmetricKeySize<<3!==parseInt(alg.slice(1,4),10))throw new TypeError(`Invalid key size for alg: ${alg}`)}function ensureKeyObject(key,alg,usage){if(is_key_object_default(key))return key;if(key instanceof Uint8Array)return createSecretKey(key);if(isCryptoKey(key))return checkEncCryptoKey(key,alg,usage),KeyObject2.from(key);throw new TypeError(invalid_key_input_default(key,...types3,"Uint8Array"))}var wrap=(alg,key,cek)=>{let algorithm=`aes${parseInt(alg.slice(1,4),10)}-wrap`;if(!ciphers_default(algorithm))throw new JOSENotSupported(`alg ${alg} is not supported either by JOSE or your javascript runtime`);let keyObject=ensureKeyObject(key,alg,"wrapKey");checkKeySize(keyObject,alg);let cipher=createCipheriv(algorithm,keyObject,Buffer3.alloc(8,166));return concat(cipher.update(cek),cipher.final())},unwrap=(alg,key,encryptedKey)=>{let algorithm=`aes${parseInt(alg.slice(1,4),10)}-wrap`;if(!ciphers_default(algorithm))throw new JOSENotSupported(`alg ${alg} is not supported either by JOSE or your javascript runtime`);let keyObject=ensureKeyObject(key,alg,"unwrapKey");checkKeySize(keyObject,alg);let cipher=createDecipheriv2(algorithm,keyObject,Buffer3.alloc(8,166));return concat(cipher.update(encryptedKey),cipher.final())};import{diffieHellman,generateKeyPair as generateKeyPairCb,KeyObject as KeyObject4}from"node:crypto";import{promisify}from"node:util";import{KeyObject as KeyObject3}from"node:crypto";function isJWK(key){return isObject(key)&&typeof key.kty=="string"}function isPrivateJWK(key){return key.kty!=="oct"&&typeof key.d=="string"}function isPublicJWK(key){return key.kty!=="oct"&&typeof key.d>"u"}function isSecretJWK(key){return isJWK(key)&&key.kty==="oct"&&typeof key.k=="string"}var namedCurveToJOSE=namedCurve=>{switch(namedCurve){case"prime256v1":return"P-256";case"secp384r1":return"P-384";case"secp521r1":return"P-521";case"secp256k1":return"secp256k1";default:throw new JOSENotSupported("Unsupported key curve for this operation")}},getNamedCurve=(kee,raw)=>{let key;if(isCryptoKey(kee))key=KeyObject3.from(kee);else if(is_key_object_default(kee))key=kee;else{if(isJWK(kee))return kee.crv;throw new TypeError(invalid_key_input_default(kee,...types3))}if(key.type==="secret")throw new TypeError('only "private" or "public" type keys can be used for this operation');switch(key.asymmetricKeyType){case"ed25519":case"ed448":return`Ed${key.asymmetricKeyType.slice(2)}`;case"x25519":case"x448":return`X${key.asymmetricKeyType.slice(1)}`;case"ec":{let namedCurve=key.asymmetricKeyDetails.namedCurve;return raw?namedCurve:namedCurveToJOSE(namedCurve)}default:throw new TypeError("Invalid asymmetric key type for this operation")}},get_named_curve_default=getNamedCurve;var generateKeyPair=promisify(generateKeyPairCb);async function deriveKey(publicKee,privateKee,algorithm,keyLength,apu=new Uint8Array(0),apv=new Uint8Array(0)){let publicKey;if(isCryptoKey(publicKee))checkEncCryptoKey(publicKee,"ECDH"),publicKey=KeyObject4.from(publicKee);else if(is_key_object_default(publicKee))publicKey=publicKee;else throw new TypeError(invalid_key_input_default(publicKee,...types3));let privateKey;if(isCryptoKey(privateKee))checkEncCryptoKey(privateKee,"ECDH","deriveBits"),privateKey=KeyObject4.from(privateKee);else if(is_key_object_default(privateKee))privateKey=privateKee;else throw new TypeError(invalid_key_input_default(privateKee,...types3));let value=concat(lengthAndInput(encoder.encode(algorithm)),lengthAndInput(apu),lengthAndInput(apv),uint32be(keyLength)),sharedSecret=diffieHellman({privateKey,publicKey});return concatKdf(sharedSecret,keyLength,value)}async function generateEpk(kee){let key;if(isCryptoKey(kee))key=KeyObject4.from(kee);else if(is_key_object_default(kee))key=kee;else throw new TypeError(invalid_key_input_default(kee,...types3));switch(key.asymmetricKeyType){case"x25519":return generateKeyPair("x25519");case"x448":return generateKeyPair("x448");case"ec":{let namedCurve=get_named_curve_default(key);return generateKeyPair("ec",{namedCurve})}default:throw new JOSENotSupported("Invalid or unsupported EPK")}}var ecdhAllowed=key=>["P-256","P-384","P-521","X25519","X448"].includes(get_named_curve_default(key));import{promisify as promisify2}from"node:util";import{KeyObject as KeyObject5,pbkdf2 as pbkdf2cb}from"node:crypto";function checkP2s(p2s2){if(!(p2s2 instanceof Uint8Array)||p2s2.length<8)throw new JWEInvalid("PBES2 Salt Input must be 8 or more octets")}var pbkdf2=promisify2(pbkdf2cb);function getPassword(key,alg){if(is_key_object_default(key))return key.export();if(key instanceof Uint8Array)return key;if(isCryptoKey(key))return checkEncCryptoKey(key,alg,"deriveBits","deriveKey"),KeyObject5.from(key).export();throw new TypeError(invalid_key_input_default(key,...types3,"Uint8Array"))}var encrypt=async(alg,key,cek,p2c=2048,p2s2=randomFillSync(new Uint8Array(16)))=>{checkP2s(p2s2);let salt=p2s(alg,p2s2),keylen=parseInt(alg.slice(13,16),10)>>3,password=getPassword(key,alg),derivedKey=await pbkdf2(password,salt,p2c,keylen,`sha${alg.slice(8,11)}`);return{encryptedKey:await wrap(alg.slice(-6),derivedKey,cek),p2c,p2s:encode(p2s2)}},decrypt2=async(alg,key,encryptedKey,p2c,p2s2)=>{checkP2s(p2s2);let salt=p2s(alg,p2s2),keylen=parseInt(alg.slice(13,16),10)>>3,password=getPassword(key,alg),derivedKey=await pbkdf2(password,salt,p2c,keylen,`sha${alg.slice(8,11)}`);return unwrap(alg.slice(-6),derivedKey,encryptedKey)};import{KeyObject as KeyObject7,publicEncrypt,constants,privateDecrypt}from"node:crypto";import{deprecate}from"node:util";import{KeyObject as KeyObject6}from"node:crypto";var check_key_length_default=(key,alg)=>{let modulusLength;try{key instanceof KeyObject6?modulusLength=key.asymmetricKeyDetails?.modulusLength:modulusLength=Buffer.from(key.n,"base64url").byteLength<<3}catch{}if(typeof modulusLength!="number"||modulusLength<2048)throw new TypeError(`${alg} requires key modulusLength to be 2048 bits or larger`)};var checkKey=(key,alg)=>{if(key.asymmetricKeyType!=="rsa")throw new TypeError("Invalid key for this operation, its asymmetricKeyType must be rsa");check_key_length_default(key,alg)},RSA1_5=deprecate(()=>constants.RSA_PKCS1_PADDING,'The RSA1_5 "alg" (JWE Algorithm) is deprecated and will be removed in the next major revision.'),resolvePadding=alg=>{switch(alg){case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":return constants.RSA_PKCS1_OAEP_PADDING;case"RSA1_5":return RSA1_5();default:return}},resolveOaepHash=alg=>{switch(alg){case"RSA-OAEP":return"sha1";case"RSA-OAEP-256":return"sha256";case"RSA-OAEP-384":return"sha384";case"RSA-OAEP-512":return"sha512";default:return}};function ensureKeyObject2(key,alg,...usages){if(is_key_object_default(key))return key;if(isCryptoKey(key))return checkEncCryptoKey(key,alg,...usages),KeyObject7.from(key);throw new TypeError(invalid_key_input_default(key,...types3))}var encrypt2=(alg,key,cek)=>{let padding=resolvePadding(alg),oaepHash=resolveOaepHash(alg),keyObject=ensureKeyObject2(key,alg,"wrapKey","encrypt");return checkKey(keyObject,alg),publicEncrypt({key:keyObject,oaepHash,padding},cek)},decrypt3=(alg,key,encryptedKey)=>{let padding=resolvePadding(alg),oaepHash=resolveOaepHash(alg),keyObject=ensureKeyObject2(key,alg,"unwrapKey","decrypt");return checkKey(keyObject,alg),privateDecrypt({key:keyObject,oaepHash,padding},encryptedKey)};var normalize_key_default={};function bitLength2(alg){switch(alg){case"A128GCM":return 128;case"A192GCM":return 192;case"A256GCM":case"A128CBC-HS256":return 256;case"A192CBC-HS384":return 384;case"A256CBC-HS512":return 512;default:throw new JOSENotSupported(`Unsupported JWE Algorithm: ${alg}`)}}var cek_default=alg=>randomFillSync(new Uint8Array(bitLength2(alg)>>3));import{createPrivateKey,createPublicKey}from"node:crypto";var parse=key=>key.d?createPrivateKey({format:"jwk",key}):createPublicKey({format:"jwk",key}),jwk_to_key_default=parse;async function importJWK(jwk,alg){if(!isObject(jwk))throw new TypeError("JWK must be an object");switch(alg||=jwk.alg,jwk.kty){case"oct":if(typeof jwk.k!="string"||!jwk.k)throw new TypeError('missing "k" (Key Value) Parameter value');return decode(jwk.k);case"RSA":if(jwk.oth!==void 0)throw new JOSENotSupported('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');case"EC":case"OKP":return jwk_to_key_default({...jwk,alg});default:throw new JOSENotSupported('Unsupported "kty" (Key Type) Parameter value')}}var tag=key=>key?.[Symbol.toStringTag],jwkMatchesOp=(alg,key,usage)=>{if(key.use!==void 0&&key.use!=="sig")throw new TypeError("Invalid key for this operation, when present its use must be sig");if(key.key_ops!==void 0&&key.key_ops.includes?.(usage)!==!0)throw new TypeError(`Invalid key for this operation, when present its key_ops must include ${usage}`);if(key.alg!==void 0&&key.alg!==alg)throw new TypeError(`Invalid key for this operation, when present its alg must be ${alg}`);return!0},symmetricTypeCheck=(alg,key,usage,allowJwk)=>{if(!(key instanceof Uint8Array)){if(allowJwk&&isJWK(key)){if(isSecretJWK(key)&&jwkMatchesOp(alg,key,usage))return;throw new TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present')}if(!is_key_like_default(key))throw new TypeError(withAlg(alg,key,...types3,"Uint8Array",allowJwk?"JSON Web Key":null));if(key.type!=="secret")throw new TypeError(`${tag(key)} instances for symmetric algorithms must be of type "secret"`)}},asymmetricTypeCheck=(alg,key,usage,allowJwk)=>{if(allowJwk&&isJWK(key))switch(usage){case"sign":if(isPrivateJWK(key)&&jwkMatchesOp(alg,key,usage))return;throw new TypeError("JSON Web Key for this operation be a private JWK");case"verify":if(isPublicJWK(key)&&jwkMatchesOp(alg,key,usage))return;throw new TypeError("JSON Web Key for this operation be a public JWK")}if(!is_key_like_default(key))throw new TypeError(withAlg(alg,key,...types3,allowJwk?"JSON Web Key":null));if(key.type==="secret")throw new TypeError(`${tag(key)} instances for asymmetric algorithms must not be of type "secret"`);if(usage==="sign"&&key.type==="public")throw new TypeError(`${tag(key)} instances for asymmetric algorithm signing must be of type "private"`);if(usage==="decrypt"&&key.type==="public")throw new TypeError(`${tag(key)} instances for asymmetric algorithm decryption must be of type "private"`);if(key.algorithm&&usage==="verify"&&key.type==="private")throw new TypeError(`${tag(key)} instances for asymmetric algorithm verifying must be of type "public"`);if(key.algorithm&&usage==="encrypt"&&key.type==="private")throw new TypeError(`${tag(key)} instances for asymmetric algorithm encryption must be of type "public"`)};function checkKeyType(allowJwk,alg,key,usage){alg.startsWith("HS")||alg==="dir"||alg.startsWith("PBES2")||/^A\d{3}(?:GCM)?KW$/.test(alg)?symmetricTypeCheck(alg,key,usage,allowJwk):asymmetricTypeCheck(alg,key,usage,allowJwk)}var check_key_type_default=checkKeyType.bind(void 0,!1),checkKeyTypeWithJwk=checkKeyType.bind(void 0,!0);import{createCipheriv as createCipheriv2,KeyObject as KeyObject8}from"node:crypto";function cbcEncrypt(enc,plaintext,cek,iv,aad){let keySize=parseInt(enc.slice(1,4),10);is_key_object_default(cek)&&(cek=cek.export());let encKey=cek.subarray(keySize>>3),macKey=cek.subarray(0,keySize>>3),algorithm=`aes-${keySize}-cbc`;if(!ciphers_default(algorithm))throw new JOSENotSupported(`alg ${enc} is not supported by your javascript runtime`);let cipher=createCipheriv2(algorithm,encKey,iv),ciphertext=concat(cipher.update(plaintext),cipher.final()),macSize=parseInt(enc.slice(-3),10),tag2=cbcTag(aad,iv,ciphertext,macSize,macKey,keySize);return{ciphertext,tag:tag2,iv}}function gcmEncrypt(enc,plaintext,cek,iv,aad){let algorithm=`aes-${parseInt(enc.slice(1,4),10)}-gcm`;if(!ciphers_default(algorithm))throw new JOSENotSupported(`alg ${enc} is not supported by your javascript runtime`);let cipher=createCipheriv2(algorithm,cek,iv,{authTagLength:16});aad.byteLength&&cipher.setAAD(aad,{plaintextLength:plaintext.length});let ciphertext=cipher.update(plaintext);cipher.final();let tag2=cipher.getAuthTag();return{ciphertext,tag:tag2,iv}}var encrypt3=(enc,plaintext,cek,iv,aad)=>{let key;if(isCryptoKey(cek))checkEncCryptoKey(cek,enc,"encrypt"),key=KeyObject8.from(cek);else if(cek instanceof Uint8Array||is_key_object_default(cek))key=cek;else throw new TypeError(invalid_key_input_default(cek,...types3,"Uint8Array"));switch(check_cek_length_default(enc,key),iv?check_iv_length_default(enc,iv):iv=iv_default(enc),enc){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return cbcEncrypt(enc,plaintext,key,iv,aad);case"A128GCM":case"A192GCM":case"A256GCM":return gcmEncrypt(enc,plaintext,key,iv,aad);default:throw new JOSENotSupported("Unsupported JWE Content Encryption Algorithm")}},encrypt_default=encrypt3;async function wrap2(alg,key,cek,iv){let jweAlgorithm=alg.slice(0,7),wrapped=await encrypt_default(jweAlgorithm,cek,key,iv,new Uint8Array(0));return{encryptedKey:wrapped.ciphertext,iv:encode(wrapped.iv),tag:encode(wrapped.tag)}}async function unwrap2(alg,key,encryptedKey,iv,tag2){let jweAlgorithm=alg.slice(0,7);return decrypt_default(jweAlgorithm,key,encryptedKey,iv,tag2,new Uint8Array(0))}async function decryptKeyManagement(alg,key,encryptedKey,joseHeader,options){switch(check_key_type_default(alg,key,"decrypt"),key=await normalize_key_default.normalizePrivateKey?.(key,alg)||key,alg){case"dir":{if(encryptedKey!==void 0)throw new JWEInvalid("Encountered unexpected JWE Encrypted Key");return key}case"ECDH-ES":if(encryptedKey!==void 0)throw new JWEInvalid("Encountered unexpected JWE Encrypted Key");case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{if(!isObject(joseHeader.epk))throw new JWEInvalid('JOSE Header "epk" (Ephemeral Public Key) missing or invalid');if(!ecdhAllowed(key))throw new JOSENotSupported("ECDH with the provided key is not allowed or not supported by your javascript runtime");let epk=await importJWK(joseHeader.epk,alg),partyUInfo,partyVInfo;if(joseHeader.apu!==void 0){if(typeof joseHeader.apu!="string")throw new JWEInvalid('JOSE Header "apu" (Agreement PartyUInfo) invalid');try{partyUInfo=decode(joseHeader.apu)}catch{throw new JWEInvalid("Failed to base64url decode the apu")}}if(joseHeader.apv!==void 0){if(typeof joseHeader.apv!="string")throw new JWEInvalid('JOSE Header "apv" (Agreement PartyVInfo) invalid');try{partyVInfo=decode(joseHeader.apv)}catch{throw new JWEInvalid("Failed to base64url decode the apv")}}let sharedSecret=await deriveKey(epk,key,alg==="ECDH-ES"?joseHeader.enc:alg,alg==="ECDH-ES"?bitLength2(joseHeader.enc):parseInt(alg.slice(-5,-2),10),partyUInfo,partyVInfo);if(alg==="ECDH-ES")return sharedSecret;if(encryptedKey===void 0)throw new JWEInvalid("JWE Encrypted Key missing");return unwrap(alg.slice(-6),sharedSecret,encryptedKey)}case"RSA1_5":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":{if(encryptedKey===void 0)throw new JWEInvalid("JWE Encrypted Key missing");return decrypt3(alg,key,encryptedKey)}case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{if(encryptedKey===void 0)throw new JWEInvalid("JWE Encrypted Key missing");if(typeof joseHeader.p2c!="number")throw new JWEInvalid('JOSE Header "p2c" (PBES2 Count) missing or invalid');let p2cLimit=options?.maxPBES2Count||1e4;if(joseHeader.p2c>p2cLimit)throw new JWEInvalid('JOSE Header "p2c" (PBES2 Count) out is of acceptable bounds');if(typeof joseHeader.p2s!="string")throw new JWEInvalid('JOSE Header "p2s" (PBES2 Salt) missing or invalid');let p2s2;try{p2s2=decode(joseHeader.p2s)}catch{throw new JWEInvalid("Failed to base64url decode the p2s")}return decrypt2(alg,key,encryptedKey,joseHeader.p2c,p2s2)}case"A128KW":case"A192KW":case"A256KW":{if(encryptedKey===void 0)throw new JWEInvalid("JWE Encrypted Key missing");return unwrap(alg,key,encryptedKey)}case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":{if(encryptedKey===void 0)throw new JWEInvalid("JWE Encrypted Key missing");if(typeof joseHeader.iv!="string")throw new JWEInvalid('JOSE Header "iv" (Initialization Vector) missing or invalid');if(typeof joseHeader.tag!="string")throw new JWEInvalid('JOSE Header "tag" (Authentication Tag) missing or invalid');let iv;try{iv=decode(joseHeader.iv)}catch{throw new JWEInvalid("Failed to base64url decode the iv")}let tag2;try{tag2=decode(joseHeader.tag)}catch{throw new JWEInvalid("Failed to base64url decode the tag")}return unwrap2(alg,key,encryptedKey,iv,tag2)}default:throw new JOSENotSupported('Invalid or unsupported "alg" (JWE Algorithm) header value')}}var decrypt_key_management_default=decryptKeyManagement;function validateCrit(Err,recognizedDefault,recognizedOption,protectedHeader,joseHeader){if(joseHeader.crit!==void 0&&protectedHeader?.crit===void 0)throw new Err('"crit" (Critical) Header Parameter MUST be integrity protected');if(!protectedHeader||protectedHeader.crit===void 0)return new Set;if(!Array.isArray(protectedHeader.crit)||protectedHeader.crit.length===0||protectedHeader.crit.some(input=>typeof input!="string"||input.length===0))throw new Err('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let recognized;recognizedOption!==void 0?recognized=new Map([...Object.entries(recognizedOption),...recognizedDefault.entries()]):recognized=recognizedDefault;for(let parameter of protectedHeader.crit){if(!recognized.has(parameter))throw new JOSENotSupported(`Extension Header Parameter "${parameter}" is not recognized`);if(joseHeader[parameter]===void 0)throw new Err(`Extension Header Parameter "${parameter}" is missing`);if(recognized.get(parameter)&&protectedHeader[parameter]===void 0)throw new Err(`Extension Header Parameter "${parameter}" MUST be integrity protected`)}return new Set(protectedHeader.crit)}var validate_crit_default=validateCrit;var validateAlgorithms=(option,algorithms)=>{if(algorithms!==void 0&&(!Array.isArray(algorithms)||algorithms.some(s=>typeof s!="string")))throw new TypeError(`"${option}" option must be an array of strings`);if(algorithms)return new Set(algorithms)},validate_algorithms_default=validateAlgorithms;async function flattenedDecrypt(jwe,key,options){if(!isObject(jwe))throw new JWEInvalid("Flattened JWE must be an object");if(jwe.protected===void 0&&jwe.header===void 0&&jwe.unprotected===void 0)throw new JWEInvalid("JOSE Header missing");if(jwe.iv!==void 0&&typeof jwe.iv!="string")throw new JWEInvalid("JWE Initialization Vector incorrect type");if(typeof jwe.ciphertext!="string")throw new JWEInvalid("JWE Ciphertext missing or incorrect type");if(jwe.tag!==void 0&&typeof jwe.tag!="string")throw new JWEInvalid("JWE Authentication Tag incorrect type");if(jwe.protected!==void 0&&typeof jwe.protected!="string")throw new JWEInvalid("JWE Protected Header incorrect type");if(jwe.encrypted_key!==void 0&&typeof jwe.encrypted_key!="string")throw new JWEInvalid("JWE Encrypted Key incorrect type");if(jwe.aad!==void 0&&typeof jwe.aad!="string")throw new JWEInvalid("JWE AAD incorrect type");if(jwe.header!==void 0&&!isObject(jwe.header))throw new JWEInvalid("JWE Shared Unprotected Header incorrect type");if(jwe.unprotected!==void 0&&!isObject(jwe.unprotected))throw new JWEInvalid("JWE Per-Recipient Unprotected Header incorrect type");let parsedProt;if(jwe.protected)try{let protectedHeader2=decode(jwe.protected);parsedProt=JSON.parse(decoder.decode(protectedHeader2))}catch{throw new JWEInvalid("JWE Protected Header is invalid")}if(!is_disjoint_default(parsedProt,jwe.header,jwe.unprotected))throw new JWEInvalid("JWE Protected, JWE Unprotected Header, and JWE Per-Recipient Unprotected Header Parameter names must be disjoint");let joseHeader={...parsedProt,...jwe.header,...jwe.unprotected};if(validate_crit_default(JWEInvalid,new Map,options?.crit,parsedProt,joseHeader),joseHeader.zip!==void 0)throw new JOSENotSupported('JWE "zip" (Compression Algorithm) Header Parameter is not supported.');let{alg,enc}=joseHeader;if(typeof alg!="string"||!alg)throw new JWEInvalid("missing JWE Algorithm (alg) in JWE Header");if(typeof enc!="string"||!enc)throw new JWEInvalid("missing JWE Encryption Algorithm (enc) in JWE Header");let keyManagementAlgorithms=options&&validate_algorithms_default("keyManagementAlgorithms",options.keyManagementAlgorithms),contentEncryptionAlgorithms=options&&validate_algorithms_default("contentEncryptionAlgorithms",options.contentEncryptionAlgorithms);if(keyManagementAlgorithms&&!keyManagementAlgorithms.has(alg)||!keyManagementAlgorithms&&alg.startsWith("PBES2"))throw new JOSEAlgNotAllowed('"alg" (Algorithm) Header Parameter value not allowed');if(contentEncryptionAlgorithms&&!contentEncryptionAlgorithms.has(enc))throw new JOSEAlgNotAllowed('"enc" (Encryption Algorithm) Header Parameter value not allowed');let encryptedKey;if(jwe.encrypted_key!==void 0)try{encryptedKey=decode(jwe.encrypted_key)}catch{throw new JWEInvalid("Failed to base64url decode the encrypted_key")}let resolvedKey=!1;typeof key=="function"&&(key=await key(parsedProt,jwe),resolvedKey=!0);let cek;try{cek=await decrypt_key_management_default(alg,key,encryptedKey,joseHeader,options)}catch(err){if(err instanceof TypeError||err instanceof JWEInvalid||err instanceof JOSENotSupported)throw err;cek=cek_default(enc)}let iv,tag2;if(jwe.iv!==void 0)try{iv=decode(jwe.iv)}catch{throw new JWEInvalid("Failed to base64url decode the iv")}if(jwe.tag!==void 0)try{tag2=decode(jwe.tag)}catch{throw new JWEInvalid("Failed to base64url decode the tag")}let protectedHeader=encoder.encode(jwe.protected??""),additionalData;jwe.aad!==void 0?additionalData=concat(protectedHeader,encoder.encode("."),encoder.encode(jwe.aad)):additionalData=protectedHeader;let ciphertext;try{ciphertext=decode(jwe.ciphertext)}catch{throw new JWEInvalid("Failed to base64url decode the ciphertext")}let result={plaintext:await decrypt_default(enc,cek,ciphertext,iv,tag2,additionalData)};if(jwe.protected!==void 0&&(result.protectedHeader=parsedProt),jwe.aad!==void 0)try{result.additionalAuthenticatedData=decode(jwe.aad)}catch{throw new JWEInvalid("Failed to base64url decode the aad")}return jwe.unprotected!==void 0&&(result.sharedUnprotectedHeader=jwe.unprotected),jwe.header!==void 0&&(result.unprotectedHeader=jwe.header),resolvedKey?{...result,key}:result}async function compactDecrypt(jwe,key,options){if(jwe instanceof Uint8Array&&(jwe=decoder.decode(jwe)),typeof jwe!="string")throw new JWEInvalid("Compact JWE must be a string or Uint8Array");let{0:protectedHeader,1:encryptedKey,2:iv,3:ciphertext,4:tag2,length}=jwe.split(".");if(length!==5)throw new JWEInvalid("Invalid Compact JWE");let decrypted=await flattenedDecrypt({ciphertext,iv:iv||void 0,protected:protectedHeader,tag:tag2||void 0,encrypted_key:encryptedKey||void 0},key,options),result={plaintext:decrypted.plaintext,protectedHeader:decrypted.protectedHeader};return typeof key=="function"?{...result,key:decrypted.key}:result}var epoch_default=date=>Math.floor(date.getTime()/1e3);var REGEX=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i,secs_default=str=>{let matched=REGEX.exec(str);if(!matched||matched[4]&&matched[1])throw new TypeError("Invalid time period format");let value=parseFloat(matched[2]),unit=matched[3].toLowerCase(),numericDate;switch(unit){case"sec":case"secs":case"second":case"seconds":case"s":numericDate=Math.round(value);break;case"minute":case"minutes":case"min":case"mins":case"m":numericDate=Math.round(value*60);break;case"hour":case"hours":case"hr":case"hrs":case"h":numericDate=Math.round(value*3600);break;case"day":case"days":case"d":numericDate=Math.round(value*86400);break;case"week":case"weeks":case"w":numericDate=Math.round(value*604800);break;default:numericDate=Math.round(value*31557600);break}return matched[1]==="-"||matched[4]==="ago"?-numericDate:numericDate};var normalizeTyp=value=>value.toLowerCase().replace(/^application\//,""),checkAudiencePresence=(audPayload,audOption)=>typeof audPayload=="string"?audOption.includes(audPayload):Array.isArray(audPayload)?audOption.some(Set.prototype.has.bind(new Set(audPayload))):!1,jwt_claims_set_default=(protectedHeader,encodedPayload,options={})=>{let payload;try{payload=JSON.parse(decoder.decode(encodedPayload))}catch{}if(!isObject(payload))throw new JWTInvalid("JWT Claims Set must be a top-level JSON object");let{typ}=options;if(typ&&(typeof protectedHeader.typ!="string"||normalizeTyp(protectedHeader.typ)!==normalizeTyp(typ)))throw new JWTClaimValidationFailed('unexpected "typ" JWT header value',payload,"typ","check_failed");let{requiredClaims=[],issuer,subject,audience,maxTokenAge}=options,presenceCheck=[...requiredClaims];maxTokenAge!==void 0&&presenceCheck.push("iat"),audience!==void 0&&presenceCheck.push("aud"),subject!==void 0&&presenceCheck.push("sub"),issuer!==void 0&&presenceCheck.push("iss");for(let claim of new Set(presenceCheck.reverse()))if(!(claim in payload))throw new JWTClaimValidationFailed(`missing required "${claim}" claim`,payload,claim,"missing");if(issuer&&!(Array.isArray(issuer)?issuer:[issuer]).includes(payload.iss))throw new JWTClaimValidationFailed('unexpected "iss" claim value',payload,"iss","check_failed");if(subject&&payload.sub!==subject)throw new JWTClaimValidationFailed('unexpected "sub" claim value',payload,"sub","check_failed");if(audience&&!checkAudiencePresence(payload.aud,typeof audience=="string"?[audience]:audience))throw new JWTClaimValidationFailed('unexpected "aud" claim value',payload,"aud","check_failed");let tolerance;switch(typeof options.clockTolerance){case"string":tolerance=secs_default(options.clockTolerance);break;case"number":tolerance=options.clockTolerance;break;case"undefined":tolerance=0;break;default:throw new TypeError("Invalid clockTolerance option type")}let{currentDate}=options,now=epoch_default(currentDate||new Date);if((payload.iat!==void 0||maxTokenAge)&&typeof payload.iat!="number")throw new JWTClaimValidationFailed('"iat" claim must be a number',payload,"iat","invalid");if(payload.nbf!==void 0){if(typeof payload.nbf!="number")throw new JWTClaimValidationFailed('"nbf" claim must be a number',payload,"nbf","invalid");if(payload.nbf>now+tolerance)throw new JWTClaimValidationFailed('"nbf" claim timestamp check failed',payload,"nbf","check_failed")}if(payload.exp!==void 0){if(typeof payload.exp!="number")throw new JWTClaimValidationFailed('"exp" claim must be a number',payload,"exp","invalid");if(payload.exp<=now-tolerance)throw new JWTExpired('"exp" claim timestamp check failed',payload,"exp","check_failed")}if(maxTokenAge){let age=now-payload.iat,max=typeof maxTokenAge=="number"?maxTokenAge:secs_default(maxTokenAge);if(age-tolerance>max)throw new JWTExpired('"iat" claim timestamp check failed (too far in the past)',payload,"iat","check_failed");if(age<0-tolerance)throw new JWTClaimValidationFailed('"iat" claim timestamp check failed (it should be in the past)',payload,"iat","check_failed")}return payload};async function jwtDecrypt(jwt,key,options){let decrypted=await compactDecrypt(jwt,key,options),payload=jwt_claims_set_default(decrypted.protectedHeader,decrypted.plaintext,options),{protectedHeader}=decrypted;if(protectedHeader.iss!==void 0&&protectedHeader.iss!==payload.iss)throw new JWTClaimValidationFailed('replicated "iss" claim header parameter mismatch',payload,"iss","mismatch");if(protectedHeader.sub!==void 0&&protectedHeader.sub!==payload.sub)throw new JWTClaimValidationFailed('replicated "sub" claim header parameter mismatch',payload,"sub","mismatch");if(protectedHeader.aud!==void 0&&JSON.stringify(protectedHeader.aud)!==JSON.stringify(payload.aud))throw new JWTClaimValidationFailed('replicated "aud" claim header parameter mismatch',payload,"aud","mismatch");let result={payload,protectedHeader};return typeof key=="function"?{...result,key:decrypted.key}:result}var unprotected=Symbol();import{KeyObject as KeyObject9}from"node:crypto";var keyToJWK=key=>{let keyObject;if(isCryptoKey(key)){if(!key.extractable)throw new TypeError("CryptoKey is not extractable");keyObject=KeyObject9.from(key)}else if(is_key_object_default(key))keyObject=key;else{if(key instanceof Uint8Array)return{kty:"oct",k:encode(key)};throw new TypeError(invalid_key_input_default(key,...types3,"Uint8Array"))}if(keyObject.type!=="secret"&&!["rsa","ec","ed25519","x25519","ed448","x448"].includes(keyObject.asymmetricKeyType))throw new JOSENotSupported("Unsupported key asymmetricKeyType");return keyObject.export({format:"jwk"})},key_to_jwk_default=keyToJWK;async function exportJWK(key){return key_to_jwk_default(key)}async function encryptKeyManagement(alg,enc,key,providedCek,providedParameters={}){let encryptedKey,parameters,cek;switch(check_key_type_default(alg,key,"encrypt"),key=await normalize_key_default.normalizePublicKey?.(key,alg)||key,alg){case"dir":{cek=key;break}case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{if(!ecdhAllowed(key))throw new JOSENotSupported("ECDH with the provided key is not allowed or not supported by your javascript runtime");let{apu,apv}=providedParameters,{epk:ephemeralKey}=providedParameters;ephemeralKey||=(await generateEpk(key)).privateKey;let{x,y,crv,kty}=await exportJWK(ephemeralKey),sharedSecret=await deriveKey(key,ephemeralKey,alg==="ECDH-ES"?enc:alg,alg==="ECDH-ES"?bitLength2(enc):parseInt(alg.slice(-5,-2),10),apu,apv);if(parameters={epk:{x,crv,kty}},kty==="EC"&&(parameters.epk.y=y),apu&&(parameters.apu=encode(apu)),apv&&(parameters.apv=encode(apv)),alg==="ECDH-ES"){cek=sharedSecret;break}cek=providedCek||cek_default(enc);let kwAlg=alg.slice(-6);encryptedKey=await wrap(kwAlg,sharedSecret,cek);break}case"RSA1_5":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":{cek=providedCek||cek_default(enc),encryptedKey=await encrypt2(alg,key,cek);break}case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{cek=providedCek||cek_default(enc);let{p2c,p2s:p2s2}=providedParameters;({encryptedKey,...parameters}=await encrypt(alg,key,cek,p2c,p2s2));break}case"A128KW":case"A192KW":case"A256KW":{cek=providedCek||cek_default(enc),encryptedKey=await wrap(alg,key,cek);break}case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":{cek=providedCek||cek_default(enc);let{iv}=providedParameters;({encryptedKey,...parameters}=await wrap2(alg,key,cek,iv));break}default:throw new JOSENotSupported('Invalid or unsupported "alg" (JWE Algorithm) header value')}return{cek,encryptedKey,parameters}}var encrypt_key_management_default=encryptKeyManagement;var FlattenedEncrypt=class{_plaintext;_protectedHeader;_sharedUnprotectedHeader;_unprotectedHeader;_aad;_cek;_iv;_keyManagementParameters;constructor(plaintext){if(!(plaintext instanceof Uint8Array))throw new TypeError("plaintext must be an instance of Uint8Array");this._plaintext=plaintext}setKeyManagementParameters(parameters){if(this._keyManagementParameters)throw new TypeError("setKeyManagementParameters can only be called once");return this._keyManagementParameters=parameters,this}setProtectedHeader(protectedHeader){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=protectedHeader,this}setSharedUnprotectedHeader(sharedUnprotectedHeader){if(this._sharedUnprotectedHeader)throw new TypeError("setSharedUnprotectedHeader can only be called once");return this._sharedUnprotectedHeader=sharedUnprotectedHeader,this}setUnprotectedHeader(unprotectedHeader){if(this._unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this._unprotectedHeader=unprotectedHeader,this}setAdditionalAuthenticatedData(aad){return this._aad=aad,this}setContentEncryptionKey(cek){if(this._cek)throw new TypeError("setContentEncryptionKey can only be called once");return this._cek=cek,this}setInitializationVector(iv){if(this._iv)throw new TypeError("setInitializationVector can only be called once");return this._iv=iv,this}async encrypt(key,options){if(!this._protectedHeader&&!this._unprotectedHeader&&!this._sharedUnprotectedHeader)throw new JWEInvalid("either setProtectedHeader, setUnprotectedHeader, or sharedUnprotectedHeader must be called before #encrypt()");if(!is_disjoint_default(this._protectedHeader,this._unprotectedHeader,this._sharedUnprotectedHeader))throw new JWEInvalid("JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint");let joseHeader={...this._protectedHeader,...this._unprotectedHeader,...this._sharedUnprotectedHeader};if(validate_crit_default(JWEInvalid,new Map,options?.crit,this._protectedHeader,joseHeader),joseHeader.zip!==void 0)throw new JOSENotSupported('JWE "zip" (Compression Algorithm) Header Parameter is not supported.');let{alg,enc}=joseHeader;if(typeof alg!="string"||!alg)throw new JWEInvalid('JWE "alg" (Algorithm) Header Parameter missing or invalid');if(typeof enc!="string"||!enc)throw new JWEInvalid('JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid');let encryptedKey;if(this._cek&&(alg==="dir"||alg==="ECDH-ES"))throw new TypeError(`setContentEncryptionKey cannot be called with JWE "alg" (Algorithm) Header ${alg}`);let cek;{let parameters;({cek,encryptedKey,parameters}=await encrypt_key_management_default(alg,enc,key,this._cek,this._keyManagementParameters)),parameters&&(options&&unprotected in options?this._unprotectedHeader?this._unprotectedHeader={...this._unprotectedHeader,...parameters}:this.setUnprotectedHeader(parameters):this._protectedHeader?this._protectedHeader={...this._protectedHeader,...parameters}:this.setProtectedHeader(parameters))}let additionalData,protectedHeader,aadMember;this._protectedHeader?protectedHeader=encoder.encode(encode(JSON.stringify(this._protectedHeader))):protectedHeader=encoder.encode(""),this._aad?(aadMember=encode(this._aad),additionalData=concat(protectedHeader,encoder.encode("."),encoder.encode(aadMember))):additionalData=protectedHeader;let{ciphertext,tag:tag2,iv}=await encrypt_default(enc,this._plaintext,cek,this._iv,additionalData),jwe={ciphertext:encode(ciphertext)};return iv&&(jwe.iv=encode(iv)),tag2&&(jwe.tag=encode(tag2)),encryptedKey&&(jwe.encrypted_key=encode(encryptedKey)),aadMember&&(jwe.aad=aadMember),this._protectedHeader&&(jwe.protected=decoder.decode(protectedHeader)),this._sharedUnprotectedHeader&&(jwe.unprotected=this._sharedUnprotectedHeader),this._unprotectedHeader&&(jwe.header=this._unprotectedHeader),jwe}};var CompactEncrypt=class{_flattened;constructor(plaintext){this._flattened=new FlattenedEncrypt(plaintext)}setContentEncryptionKey(cek){return this._flattened.setContentEncryptionKey(cek),this}setInitializationVector(iv){return this._flattened.setInitializationVector(iv),this}setProtectedHeader(protectedHeader){return this._flattened.setProtectedHeader(protectedHeader),this}setKeyManagementParameters(parameters){return this._flattened.setKeyManagementParameters(parameters),this}async encrypt(key,options){let jwe=await this._flattened.encrypt(key,options);return[jwe.protected,jwe.encrypted_key,jwe.iv,jwe.ciphertext,jwe.tag].join(".")}};function validateInput(label,input){if(!Number.isFinite(input))throw new TypeError(`Invalid ${label} input`);return input}var ProduceJWT=class{_payload;constructor(payload={}){if(!isObject(payload))throw new TypeError("JWT Claims Set MUST be an object");this._payload=payload}setIssuer(issuer){return this._payload={...this._payload,iss:issuer},this}setSubject(subject){return this._payload={...this._payload,sub:subject},this}setAudience(audience){return this._payload={...this._payload,aud:audience},this}setJti(jwtId){return this._payload={...this._payload,jti:jwtId},this}setNotBefore(input){return typeof input=="number"?this._payload={...this._payload,nbf:validateInput("setNotBefore",input)}:input instanceof Date?this._payload={...this._payload,nbf:validateInput("setNotBefore",epoch_default(input))}:this._payload={...this._payload,nbf:epoch_default(new Date)+secs_default(input)},this}setExpirationTime(input){return typeof input=="number"?this._payload={...this._payload,exp:validateInput("setExpirationTime",input)}:input instanceof Date?this._payload={...this._payload,exp:validateInput("setExpirationTime",epoch_default(input))}:this._payload={...this._payload,exp:epoch_default(new Date)+secs_default(input)},this}setIssuedAt(input){return typeof input>"u"?this._payload={...this._payload,iat:epoch_default(new Date)}:input instanceof Date?this._payload={...this._payload,iat:validateInput("setIssuedAt",epoch_default(input))}:typeof input=="string"?this._payload={...this._payload,iat:validateInput("setIssuedAt",epoch_default(new Date)+secs_default(input))}:this._payload={...this._payload,iat:validateInput("setIssuedAt",input)},this}};var EncryptJWT=class extends ProduceJWT{_cek;_iv;_keyManagementParameters;_protectedHeader;_replicateIssuerAsHeader;_replicateSubjectAsHeader;_replicateAudienceAsHeader;setProtectedHeader(protectedHeader){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=protectedHeader,this}setKeyManagementParameters(parameters){if(this._keyManagementParameters)throw new TypeError("setKeyManagementParameters can only be called once");return this._keyManagementParameters=parameters,this}setContentEncryptionKey(cek){if(this._cek)throw new TypeError("setContentEncryptionKey can only be called once");return this._cek=cek,this}setInitializationVector(iv){if(this._iv)throw new TypeError("setInitializationVector can only be called once");return this._iv=iv,this}replicateIssuerAsHeader(){return this._replicateIssuerAsHeader=!0,this}replicateSubjectAsHeader(){return this._replicateSubjectAsHeader=!0,this}replicateAudienceAsHeader(){return this._replicateAudienceAsHeader=!0,this}async encrypt(key,options){let enc=new CompactEncrypt(encoder.encode(JSON.stringify(this._payload)));return this._replicateIssuerAsHeader&&(this._protectedHeader={...this._protectedHeader,iss:this._payload.iss}),this._replicateSubjectAsHeader&&(this._protectedHeader={...this._protectedHeader,sub:this._payload.sub}),this._replicateAudienceAsHeader&&(this._protectedHeader={...this._protectedHeader,aud:this._payload.aud}),enc.setProtectedHeader(this._protectedHeader),this._iv&&enc.setInitializationVector(this._iv),this._cek&&enc.setContentEncryptionKey(this._cek),this._keyManagementParameters&&enc.setKeyManagementParameters(this._keyManagementParameters),enc.encrypt(key,options)}};var base64url_exports={};__export(base64url_exports,{decode:()=>decode2,encode:()=>encode2});var encode2=encode,decode2=decode;function decodeJwt(jwt){if(typeof jwt!="string")throw new JWTInvalid("JWTs must use Compact JWS serialization, JWT must be a string");let{1:payload,length}=jwt.split(".");if(length===5)throw new JWTInvalid("Only JWTs using Compact JWS serialization can be decoded");if(length!==3)throw new JWTInvalid("Invalid JWT");if(!payload)throw new JWTInvalid("JWTs must contain a payload");let decoded;try{decoded=decode2(payload)}catch{throw new JWTInvalid("Failed to base64url decode the payload")}let result;try{result=JSON.parse(decoder.decode(decoded))}catch{throw new JWTInvalid("Failed to parse the decoded payload as JSON")}if(!isObject(result))throw new JWTInvalid("Invalid JWT Claims Set");return result}export{jwtDecrypt,EncryptJWT,base64url_exports,decodeJwt};
|
|
7
|
+
import{__export}from"./chunk-NBPLUP7C.js";import{Buffer as Buffer2}from"node:buffer";import{createHash}from"node:crypto";var digest=(algorithm,data)=>createHash(algorithm).update(data).digest(),digest_default=digest;var encoder=new TextEncoder,decoder=new TextDecoder,MAX_INT32=2**32;function concat(...buffers){let size=buffers.reduce((acc,{length})=>acc+length,0),buf=new Uint8Array(size),i=0;for(let buffer of buffers)buf.set(buffer,i),i+=buffer.length;return buf}function p2s(alg,p2sInput){return concat(encoder.encode(alg),new Uint8Array([0]),p2sInput)}function writeUInt32BE(buf,value,offset){if(value<0||value>=MAX_INT32)throw new RangeError(`value must be >= 0 and <= ${MAX_INT32-1}. Received ${value}`);buf.set([value>>>24,value>>>16,value>>>8,value&255],offset)}function uint64be(value){let high=Math.floor(value/MAX_INT32),low=value%MAX_INT32,buf=new Uint8Array(8);return writeUInt32BE(buf,high,0),writeUInt32BE(buf,low,4),buf}function uint32be(value){let buf=new Uint8Array(4);return writeUInt32BE(buf,value),buf}function lengthAndInput(input){return concat(uint32be(input.length),input)}async function concatKdf(secret,bits,value){let iterations=Math.ceil((bits>>3)/32),res=new Uint8Array(iterations*32);for(let iter=0;iter<iterations;iter++){let buf=new Uint8Array(4+secret.length+value.length);buf.set(uint32be(iter+1)),buf.set(secret,4),buf.set(value,4+secret.length),res.set(await digest_default("sha256",buf),iter*32)}return res.slice(0,bits>>3)}function normalize(input){let encoded=input;return encoded instanceof Uint8Array&&(encoded=decoder.decode(encoded)),encoded}var encode=input=>Buffer2.from(input).toString("base64url");var decode=input=>new Uint8Array(Buffer2.from(normalize(input),"base64url"));import{createDecipheriv,KeyObject}from"node:crypto";var JOSEError=class extends Error{static code="ERR_JOSE_GENERIC";code="ERR_JOSE_GENERIC";constructor(message2,options){super(message2,options),this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}},JWTClaimValidationFailed=class extends JOSEError{static code="ERR_JWT_CLAIM_VALIDATION_FAILED";code="ERR_JWT_CLAIM_VALIDATION_FAILED";claim;reason;payload;constructor(message2,payload,claim="unspecified",reason="unspecified"){super(message2,{cause:{claim,reason,payload}}),this.claim=claim,this.reason=reason,this.payload=payload}},JWTExpired=class extends JOSEError{static code="ERR_JWT_EXPIRED";code="ERR_JWT_EXPIRED";claim;reason;payload;constructor(message2,payload,claim="unspecified",reason="unspecified"){super(message2,{cause:{claim,reason,payload}}),this.claim=claim,this.reason=reason,this.payload=payload}},JOSEAlgNotAllowed=class extends JOSEError{static code="ERR_JOSE_ALG_NOT_ALLOWED";code="ERR_JOSE_ALG_NOT_ALLOWED"},JOSENotSupported=class extends JOSEError{static code="ERR_JOSE_NOT_SUPPORTED";code="ERR_JOSE_NOT_SUPPORTED"},JWEDecryptionFailed=class extends JOSEError{static code="ERR_JWE_DECRYPTION_FAILED";code="ERR_JWE_DECRYPTION_FAILED";constructor(message2="decryption operation failed",options){super(message2,options)}},JWEInvalid=class extends JOSEError{static code="ERR_JWE_INVALID";code="ERR_JWE_INVALID"};var JWTInvalid=class extends JOSEError{static code="ERR_JWT_INVALID";code="ERR_JWT_INVALID"};var JWKSMultipleMatchingKeys=class extends JOSEError{[Symbol.asyncIterator];static code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";constructor(message2="multiple matching keys found in the JSON Web Key Set",options){super(message2,options)}};import{randomFillSync}from"node:crypto";function bitLength(alg){switch(alg){case"A128GCM":case"A128GCMKW":case"A192GCM":case"A192GCMKW":case"A256GCM":case"A256GCMKW":return 96;case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return 128;default:throw new JOSENotSupported(`Unsupported JWE Algorithm: ${alg}`)}}var iv_default=alg=>randomFillSync(new Uint8Array(bitLength(alg)>>3));var checkIvLength=(enc,iv)=>{if(iv.length<<3!==bitLength(enc))throw new JWEInvalid("Invalid Initialization Vector length")},check_iv_length_default=checkIvLength;import*as util from"node:util";var is_key_object_default=obj=>util.types.isKeyObject(obj);var checkCekLength=(enc,cek)=>{let expected;switch(enc){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":expected=parseInt(enc.slice(-3),10);break;case"A128GCM":case"A192GCM":case"A256GCM":expected=parseInt(enc.slice(1,4),10);break;default:throw new JOSENotSupported(`Content Encryption Algorithm ${enc} is not supported either by JOSE or your javascript runtime`)}if(cek instanceof Uint8Array){let actual=cek.byteLength<<3;if(actual!==expected)throw new JWEInvalid(`Invalid Content Encryption Key length. Expected ${expected} bits, got ${actual} bits`);return}if(is_key_object_default(cek)&&cek.type==="secret"){let actual=cek.symmetricKeySize<<3;if(actual!==expected)throw new JWEInvalid(`Invalid Content Encryption Key length. Expected ${expected} bits, got ${actual} bits`);return}throw new TypeError("Invalid Content Encryption Key type")},check_cek_length_default=checkCekLength;import{timingSafeEqual as impl}from"node:crypto";var timingSafeEqual=impl,timing_safe_equal_default=timingSafeEqual;import{createHmac}from"node:crypto";function cbcTag(aad,iv,ciphertext,macSize,macKey,keySize){let macData=concat(aad,iv,ciphertext,uint64be(aad.length<<3)),hmac=createHmac(`sha${macSize}`,macKey);return hmac.update(macData),hmac.digest().slice(0,keySize>>3)}import*as crypto from"node:crypto";import*as util2 from"node:util";var webcrypto2=crypto.webcrypto,webcrypto_default=webcrypto2,isCryptoKey=key=>util2.types.isCryptoKey(key);function unusable(name,prop="algorithm.name"){return new TypeError(`CryptoKey does not support this operation, its ${prop} must be ${name}`)}function isAlgorithm(algorithm,name){return algorithm.name===name}function getHashLength(hash){return parseInt(hash.name.slice(4),10)}function checkUsage(key,usages){if(usages.length&&!usages.some(expected=>key.usages.includes(expected))){let msg="CryptoKey does not support this operation, its usages must include ";if(usages.length>2){let last=usages.pop();msg+=`one of ${usages.join(", ")}, or ${last}.`}else usages.length===2?msg+=`one of ${usages[0]} or ${usages[1]}.`:msg+=`${usages[0]}.`;throw new TypeError(msg)}}function checkEncCryptoKey(key,alg,...usages){switch(alg){case"A128GCM":case"A192GCM":case"A256GCM":{if(!isAlgorithm(key.algorithm,"AES-GCM"))throw unusable("AES-GCM");let expected=parseInt(alg.slice(1,4),10);if(key.algorithm.length!==expected)throw unusable(expected,"algorithm.length");break}case"A128KW":case"A192KW":case"A256KW":{if(!isAlgorithm(key.algorithm,"AES-KW"))throw unusable("AES-KW");let expected=parseInt(alg.slice(1,4),10);if(key.algorithm.length!==expected)throw unusable(expected,"algorithm.length");break}case"ECDH":{switch(key.algorithm.name){case"ECDH":case"X25519":case"X448":break;default:throw unusable("ECDH, X25519, or X448")}break}case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":if(!isAlgorithm(key.algorithm,"PBKDF2"))throw unusable("PBKDF2");break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":{if(!isAlgorithm(key.algorithm,"RSA-OAEP"))throw unusable("RSA-OAEP");let expected=parseInt(alg.slice(9),10)||1;if(getHashLength(key.algorithm.hash)!==expected)throw unusable(`SHA-${expected}`,"algorithm.hash");break}default:throw new TypeError("CryptoKey does not support this operation")}checkUsage(key,usages)}function message(msg,actual,...types4){if(types4=types4.filter(Boolean),types4.length>2){let last=types4.pop();msg+=`one of type ${types4.join(", ")}, or ${last}.`}else types4.length===2?msg+=`one of type ${types4[0]} or ${types4[1]}.`:msg+=`of type ${types4[0]}.`;return actual==null?msg+=` Received ${actual}`:typeof actual=="function"&&actual.name?msg+=` Received function ${actual.name}`:typeof actual=="object"&&actual!=null&&actual.constructor?.name&&(msg+=` Received an instance of ${actual.constructor.name}`),msg}var invalid_key_input_default=(actual,...types4)=>message("Key must be ",actual,...types4);function withAlg(alg,actual,...types4){return message(`Key for the ${alg} algorithm must be `,actual,...types4)}import{getCiphers}from"node:crypto";var ciphers,ciphers_default=algorithm=>(ciphers||=new Set(getCiphers()),ciphers.has(algorithm));var is_key_like_default=key=>is_key_object_default(key)||isCryptoKey(key),types3=["KeyObject"];(globalThis.CryptoKey||webcrypto_default?.CryptoKey)&&types3.push("CryptoKey");function cbcDecrypt(enc,cek,ciphertext,iv,tag2,aad){let keySize=parseInt(enc.slice(1,4),10);is_key_object_default(cek)&&(cek=cek.export());let encKey=cek.subarray(keySize>>3),macKey=cek.subarray(0,keySize>>3),macSize=parseInt(enc.slice(-3),10),algorithm=`aes-${keySize}-cbc`;if(!ciphers_default(algorithm))throw new JOSENotSupported(`alg ${enc} is not supported by your javascript runtime`);let expectedTag=cbcTag(aad,iv,ciphertext,macSize,macKey,keySize),macCheckPassed;try{macCheckPassed=timing_safe_equal_default(tag2,expectedTag)}catch{}if(!macCheckPassed)throw new JWEDecryptionFailed;let plaintext;try{let decipher=createDecipheriv(algorithm,encKey,iv);plaintext=concat(decipher.update(ciphertext),decipher.final())}catch{}if(!plaintext)throw new JWEDecryptionFailed;return plaintext}function gcmDecrypt(enc,cek,ciphertext,iv,tag2,aad){let algorithm=`aes-${parseInt(enc.slice(1,4),10)}-gcm`;if(!ciphers_default(algorithm))throw new JOSENotSupported(`alg ${enc} is not supported by your javascript runtime`);try{let decipher=createDecipheriv(algorithm,cek,iv,{authTagLength:16});decipher.setAuthTag(tag2),aad.byteLength&&decipher.setAAD(aad,{plaintextLength:ciphertext.length});let plaintext=decipher.update(ciphertext);return decipher.final(),plaintext}catch{throw new JWEDecryptionFailed}}var decrypt=(enc,cek,ciphertext,iv,tag2,aad)=>{let key;if(isCryptoKey(cek))checkEncCryptoKey(cek,enc,"decrypt"),key=KeyObject.from(cek);else if(cek instanceof Uint8Array||is_key_object_default(cek))key=cek;else throw new TypeError(invalid_key_input_default(cek,...types3,"Uint8Array"));if(!iv)throw new JWEInvalid("JWE Initialization Vector missing");if(!tag2)throw new JWEInvalid("JWE Authentication Tag missing");switch(check_cek_length_default(enc,key),check_iv_length_default(enc,iv),enc){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return cbcDecrypt(enc,key,ciphertext,iv,tag2,aad);case"A128GCM":case"A192GCM":case"A256GCM":return gcmDecrypt(enc,key,ciphertext,iv,tag2,aad);default:throw new JOSENotSupported("Unsupported JWE Content Encryption Algorithm")}},decrypt_default=decrypt;var isDisjoint=(...headers)=>{let sources=headers.filter(Boolean);if(sources.length===0||sources.length===1)return!0;let acc;for(let header of sources){let parameters=Object.keys(header);if(!acc||acc.size===0){acc=new Set(parameters);continue}for(let parameter of parameters){if(acc.has(parameter))return!1;acc.add(parameter)}}return!0},is_disjoint_default=isDisjoint;function isObjectLike(value){return typeof value=="object"&&value!==null}function isObject(input){if(!isObjectLike(input)||Object.prototype.toString.call(input)!=="[object Object]")return!1;if(Object.getPrototypeOf(input)===null)return!0;let proto=input;for(;Object.getPrototypeOf(proto)!==null;)proto=Object.getPrototypeOf(proto);return Object.getPrototypeOf(input)===proto}import{Buffer as Buffer3}from"node:buffer";import{KeyObject as KeyObject2,createDecipheriv as createDecipheriv2,createCipheriv,createSecretKey}from"node:crypto";function checkKeySize(key,alg){if(key.symmetricKeySize<<3!==parseInt(alg.slice(1,4),10))throw new TypeError(`Invalid key size for alg: ${alg}`)}function ensureKeyObject(key,alg,usage){if(is_key_object_default(key))return key;if(key instanceof Uint8Array)return createSecretKey(key);if(isCryptoKey(key))return checkEncCryptoKey(key,alg,usage),KeyObject2.from(key);throw new TypeError(invalid_key_input_default(key,...types3,"Uint8Array"))}var wrap=(alg,key,cek)=>{let algorithm=`aes${parseInt(alg.slice(1,4),10)}-wrap`;if(!ciphers_default(algorithm))throw new JOSENotSupported(`alg ${alg} is not supported either by JOSE or your javascript runtime`);let keyObject=ensureKeyObject(key,alg,"wrapKey");checkKeySize(keyObject,alg);let cipher=createCipheriv(algorithm,keyObject,Buffer3.alloc(8,166));return concat(cipher.update(cek),cipher.final())},unwrap=(alg,key,encryptedKey)=>{let algorithm=`aes${parseInt(alg.slice(1,4),10)}-wrap`;if(!ciphers_default(algorithm))throw new JOSENotSupported(`alg ${alg} is not supported either by JOSE or your javascript runtime`);let keyObject=ensureKeyObject(key,alg,"unwrapKey");checkKeySize(keyObject,alg);let cipher=createDecipheriv2(algorithm,keyObject,Buffer3.alloc(8,166));return concat(cipher.update(encryptedKey),cipher.final())};import{diffieHellman,generateKeyPair as generateKeyPairCb,KeyObject as KeyObject4}from"node:crypto";import{promisify}from"node:util";import{KeyObject as KeyObject3}from"node:crypto";function isJWK(key){return isObject(key)&&typeof key.kty=="string"}function isPrivateJWK(key){return key.kty!=="oct"&&typeof key.d=="string"}function isPublicJWK(key){return key.kty!=="oct"&&typeof key.d>"u"}function isSecretJWK(key){return isJWK(key)&&key.kty==="oct"&&typeof key.k=="string"}var namedCurveToJOSE=namedCurve=>{switch(namedCurve){case"prime256v1":return"P-256";case"secp384r1":return"P-384";case"secp521r1":return"P-521";case"secp256k1":return"secp256k1";default:throw new JOSENotSupported("Unsupported key curve for this operation")}},getNamedCurve=(kee,raw)=>{let key;if(isCryptoKey(kee))key=KeyObject3.from(kee);else if(is_key_object_default(kee))key=kee;else{if(isJWK(kee))return kee.crv;throw new TypeError(invalid_key_input_default(kee,...types3))}if(key.type==="secret")throw new TypeError('only "private" or "public" type keys can be used for this operation');switch(key.asymmetricKeyType){case"ed25519":case"ed448":return`Ed${key.asymmetricKeyType.slice(2)}`;case"x25519":case"x448":return`X${key.asymmetricKeyType.slice(1)}`;case"ec":{let namedCurve=key.asymmetricKeyDetails.namedCurve;return raw?namedCurve:namedCurveToJOSE(namedCurve)}default:throw new TypeError("Invalid asymmetric key type for this operation")}},get_named_curve_default=getNamedCurve;var generateKeyPair=promisify(generateKeyPairCb);async function deriveKey(publicKee,privateKee,algorithm,keyLength,apu=new Uint8Array(0),apv=new Uint8Array(0)){let publicKey;if(isCryptoKey(publicKee))checkEncCryptoKey(publicKee,"ECDH"),publicKey=KeyObject4.from(publicKee);else if(is_key_object_default(publicKee))publicKey=publicKee;else throw new TypeError(invalid_key_input_default(publicKee,...types3));let privateKey;if(isCryptoKey(privateKee))checkEncCryptoKey(privateKee,"ECDH","deriveBits"),privateKey=KeyObject4.from(privateKee);else if(is_key_object_default(privateKee))privateKey=privateKee;else throw new TypeError(invalid_key_input_default(privateKee,...types3));let value=concat(lengthAndInput(encoder.encode(algorithm)),lengthAndInput(apu),lengthAndInput(apv),uint32be(keyLength)),sharedSecret=diffieHellman({privateKey,publicKey});return concatKdf(sharedSecret,keyLength,value)}async function generateEpk(kee){let key;if(isCryptoKey(kee))key=KeyObject4.from(kee);else if(is_key_object_default(kee))key=kee;else throw new TypeError(invalid_key_input_default(kee,...types3));switch(key.asymmetricKeyType){case"x25519":return generateKeyPair("x25519");case"x448":return generateKeyPair("x448");case"ec":{let namedCurve=get_named_curve_default(key);return generateKeyPair("ec",{namedCurve})}default:throw new JOSENotSupported("Invalid or unsupported EPK")}}var ecdhAllowed=key=>["P-256","P-384","P-521","X25519","X448"].includes(get_named_curve_default(key));import{promisify as promisify2}from"node:util";import{KeyObject as KeyObject5,pbkdf2 as pbkdf2cb}from"node:crypto";function checkP2s(p2s2){if(!(p2s2 instanceof Uint8Array)||p2s2.length<8)throw new JWEInvalid("PBES2 Salt Input must be 8 or more octets")}var pbkdf2=promisify2(pbkdf2cb);function getPassword(key,alg){if(is_key_object_default(key))return key.export();if(key instanceof Uint8Array)return key;if(isCryptoKey(key))return checkEncCryptoKey(key,alg,"deriveBits","deriveKey"),KeyObject5.from(key).export();throw new TypeError(invalid_key_input_default(key,...types3,"Uint8Array"))}var encrypt=async(alg,key,cek,p2c=2048,p2s2=randomFillSync(new Uint8Array(16)))=>{checkP2s(p2s2);let salt=p2s(alg,p2s2),keylen=parseInt(alg.slice(13,16),10)>>3,password=getPassword(key,alg),derivedKey=await pbkdf2(password,salt,p2c,keylen,`sha${alg.slice(8,11)}`);return{encryptedKey:await wrap(alg.slice(-6),derivedKey,cek),p2c,p2s:encode(p2s2)}},decrypt2=async(alg,key,encryptedKey,p2c,p2s2)=>{checkP2s(p2s2);let salt=p2s(alg,p2s2),keylen=parseInt(alg.slice(13,16),10)>>3,password=getPassword(key,alg),derivedKey=await pbkdf2(password,salt,p2c,keylen,`sha${alg.slice(8,11)}`);return unwrap(alg.slice(-6),derivedKey,encryptedKey)};import{KeyObject as KeyObject7,publicEncrypt,constants,privateDecrypt}from"node:crypto";import{deprecate}from"node:util";import{KeyObject as KeyObject6}from"node:crypto";var check_key_length_default=(key,alg)=>{let modulusLength;try{key instanceof KeyObject6?modulusLength=key.asymmetricKeyDetails?.modulusLength:modulusLength=Buffer.from(key.n,"base64url").byteLength<<3}catch{}if(typeof modulusLength!="number"||modulusLength<2048)throw new TypeError(`${alg} requires key modulusLength to be 2048 bits or larger`)};var checkKey=(key,alg)=>{if(key.asymmetricKeyType!=="rsa")throw new TypeError("Invalid key for this operation, its asymmetricKeyType must be rsa");check_key_length_default(key,alg)},RSA1_5=deprecate(()=>constants.RSA_PKCS1_PADDING,'The RSA1_5 "alg" (JWE Algorithm) is deprecated and will be removed in the next major revision.'),resolvePadding=alg=>{switch(alg){case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":return constants.RSA_PKCS1_OAEP_PADDING;case"RSA1_5":return RSA1_5();default:return}},resolveOaepHash=alg=>{switch(alg){case"RSA-OAEP":return"sha1";case"RSA-OAEP-256":return"sha256";case"RSA-OAEP-384":return"sha384";case"RSA-OAEP-512":return"sha512";default:return}};function ensureKeyObject2(key,alg,...usages){if(is_key_object_default(key))return key;if(isCryptoKey(key))return checkEncCryptoKey(key,alg,...usages),KeyObject7.from(key);throw new TypeError(invalid_key_input_default(key,...types3))}var encrypt2=(alg,key,cek)=>{let padding=resolvePadding(alg),oaepHash=resolveOaepHash(alg),keyObject=ensureKeyObject2(key,alg,"wrapKey","encrypt");return checkKey(keyObject,alg),publicEncrypt({key:keyObject,oaepHash,padding},cek)},decrypt3=(alg,key,encryptedKey)=>{let padding=resolvePadding(alg),oaepHash=resolveOaepHash(alg),keyObject=ensureKeyObject2(key,alg,"unwrapKey","decrypt");return checkKey(keyObject,alg),privateDecrypt({key:keyObject,oaepHash,padding},encryptedKey)};var normalize_key_default={};function bitLength2(alg){switch(alg){case"A128GCM":return 128;case"A192GCM":return 192;case"A256GCM":case"A128CBC-HS256":return 256;case"A192CBC-HS384":return 384;case"A256CBC-HS512":return 512;default:throw new JOSENotSupported(`Unsupported JWE Algorithm: ${alg}`)}}var cek_default=alg=>randomFillSync(new Uint8Array(bitLength2(alg)>>3));import{createPrivateKey,createPublicKey}from"node:crypto";var parse=key=>key.d?createPrivateKey({format:"jwk",key}):createPublicKey({format:"jwk",key}),jwk_to_key_default=parse;async function importJWK(jwk,alg){if(!isObject(jwk))throw new TypeError("JWK must be an object");switch(alg||=jwk.alg,jwk.kty){case"oct":if(typeof jwk.k!="string"||!jwk.k)throw new TypeError('missing "k" (Key Value) Parameter value');return decode(jwk.k);case"RSA":if(jwk.oth!==void 0)throw new JOSENotSupported('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');case"EC":case"OKP":return jwk_to_key_default({...jwk,alg});default:throw new JOSENotSupported('Unsupported "kty" (Key Type) Parameter value')}}var tag=key=>key?.[Symbol.toStringTag],jwkMatchesOp=(alg,key,usage)=>{if(key.use!==void 0&&key.use!=="sig")throw new TypeError("Invalid key for this operation, when present its use must be sig");if(key.key_ops!==void 0&&key.key_ops.includes?.(usage)!==!0)throw new TypeError(`Invalid key for this operation, when present its key_ops must include ${usage}`);if(key.alg!==void 0&&key.alg!==alg)throw new TypeError(`Invalid key for this operation, when present its alg must be ${alg}`);return!0},symmetricTypeCheck=(alg,key,usage,allowJwk)=>{if(!(key instanceof Uint8Array)){if(allowJwk&&isJWK(key)){if(isSecretJWK(key)&&jwkMatchesOp(alg,key,usage))return;throw new TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present')}if(!is_key_like_default(key))throw new TypeError(withAlg(alg,key,...types3,"Uint8Array",allowJwk?"JSON Web Key":null));if(key.type!=="secret")throw new TypeError(`${tag(key)} instances for symmetric algorithms must be of type "secret"`)}},asymmetricTypeCheck=(alg,key,usage,allowJwk)=>{if(allowJwk&&isJWK(key))switch(usage){case"sign":if(isPrivateJWK(key)&&jwkMatchesOp(alg,key,usage))return;throw new TypeError("JSON Web Key for this operation be a private JWK");case"verify":if(isPublicJWK(key)&&jwkMatchesOp(alg,key,usage))return;throw new TypeError("JSON Web Key for this operation be a public JWK")}if(!is_key_like_default(key))throw new TypeError(withAlg(alg,key,...types3,allowJwk?"JSON Web Key":null));if(key.type==="secret")throw new TypeError(`${tag(key)} instances for asymmetric algorithms must not be of type "secret"`);if(usage==="sign"&&key.type==="public")throw new TypeError(`${tag(key)} instances for asymmetric algorithm signing must be of type "private"`);if(usage==="decrypt"&&key.type==="public")throw new TypeError(`${tag(key)} instances for asymmetric algorithm decryption must be of type "private"`);if(key.algorithm&&usage==="verify"&&key.type==="private")throw new TypeError(`${tag(key)} instances for asymmetric algorithm verifying must be of type "public"`);if(key.algorithm&&usage==="encrypt"&&key.type==="private")throw new TypeError(`${tag(key)} instances for asymmetric algorithm encryption must be of type "public"`)};function checkKeyType(allowJwk,alg,key,usage){alg.startsWith("HS")||alg==="dir"||alg.startsWith("PBES2")||/^A\d{3}(?:GCM)?KW$/.test(alg)?symmetricTypeCheck(alg,key,usage,allowJwk):asymmetricTypeCheck(alg,key,usage,allowJwk)}var check_key_type_default=checkKeyType.bind(void 0,!1),checkKeyTypeWithJwk=checkKeyType.bind(void 0,!0);import{createCipheriv as createCipheriv2,KeyObject as KeyObject8}from"node:crypto";function cbcEncrypt(enc,plaintext,cek,iv,aad){let keySize=parseInt(enc.slice(1,4),10);is_key_object_default(cek)&&(cek=cek.export());let encKey=cek.subarray(keySize>>3),macKey=cek.subarray(0,keySize>>3),algorithm=`aes-${keySize}-cbc`;if(!ciphers_default(algorithm))throw new JOSENotSupported(`alg ${enc} is not supported by your javascript runtime`);let cipher=createCipheriv2(algorithm,encKey,iv),ciphertext=concat(cipher.update(plaintext),cipher.final()),macSize=parseInt(enc.slice(-3),10),tag2=cbcTag(aad,iv,ciphertext,macSize,macKey,keySize);return{ciphertext,tag:tag2,iv}}function gcmEncrypt(enc,plaintext,cek,iv,aad){let algorithm=`aes-${parseInt(enc.slice(1,4),10)}-gcm`;if(!ciphers_default(algorithm))throw new JOSENotSupported(`alg ${enc} is not supported by your javascript runtime`);let cipher=createCipheriv2(algorithm,cek,iv,{authTagLength:16});aad.byteLength&&cipher.setAAD(aad,{plaintextLength:plaintext.length});let ciphertext=cipher.update(plaintext);cipher.final();let tag2=cipher.getAuthTag();return{ciphertext,tag:tag2,iv}}var encrypt3=(enc,plaintext,cek,iv,aad)=>{let key;if(isCryptoKey(cek))checkEncCryptoKey(cek,enc,"encrypt"),key=KeyObject8.from(cek);else if(cek instanceof Uint8Array||is_key_object_default(cek))key=cek;else throw new TypeError(invalid_key_input_default(cek,...types3,"Uint8Array"));switch(check_cek_length_default(enc,key),iv?check_iv_length_default(enc,iv):iv=iv_default(enc),enc){case"A128CBC-HS256":case"A192CBC-HS384":case"A256CBC-HS512":return cbcEncrypt(enc,plaintext,key,iv,aad);case"A128GCM":case"A192GCM":case"A256GCM":return gcmEncrypt(enc,plaintext,key,iv,aad);default:throw new JOSENotSupported("Unsupported JWE Content Encryption Algorithm")}},encrypt_default=encrypt3;async function wrap2(alg,key,cek,iv){let jweAlgorithm=alg.slice(0,7),wrapped=await encrypt_default(jweAlgorithm,cek,key,iv,new Uint8Array(0));return{encryptedKey:wrapped.ciphertext,iv:encode(wrapped.iv),tag:encode(wrapped.tag)}}async function unwrap2(alg,key,encryptedKey,iv,tag2){let jweAlgorithm=alg.slice(0,7);return decrypt_default(jweAlgorithm,key,encryptedKey,iv,tag2,new Uint8Array(0))}async function decryptKeyManagement(alg,key,encryptedKey,joseHeader,options){switch(check_key_type_default(alg,key,"decrypt"),key=await normalize_key_default.normalizePrivateKey?.(key,alg)||key,alg){case"dir":{if(encryptedKey!==void 0)throw new JWEInvalid("Encountered unexpected JWE Encrypted Key");return key}case"ECDH-ES":if(encryptedKey!==void 0)throw new JWEInvalid("Encountered unexpected JWE Encrypted Key");case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{if(!isObject(joseHeader.epk))throw new JWEInvalid('JOSE Header "epk" (Ephemeral Public Key) missing or invalid');if(!ecdhAllowed(key))throw new JOSENotSupported("ECDH with the provided key is not allowed or not supported by your javascript runtime");let epk=await importJWK(joseHeader.epk,alg),partyUInfo,partyVInfo;if(joseHeader.apu!==void 0){if(typeof joseHeader.apu!="string")throw new JWEInvalid('JOSE Header "apu" (Agreement PartyUInfo) invalid');try{partyUInfo=decode(joseHeader.apu)}catch{throw new JWEInvalid("Failed to base64url decode the apu")}}if(joseHeader.apv!==void 0){if(typeof joseHeader.apv!="string")throw new JWEInvalid('JOSE Header "apv" (Agreement PartyVInfo) invalid');try{partyVInfo=decode(joseHeader.apv)}catch{throw new JWEInvalid("Failed to base64url decode the apv")}}let sharedSecret=await deriveKey(epk,key,alg==="ECDH-ES"?joseHeader.enc:alg,alg==="ECDH-ES"?bitLength2(joseHeader.enc):parseInt(alg.slice(-5,-2),10),partyUInfo,partyVInfo);if(alg==="ECDH-ES")return sharedSecret;if(encryptedKey===void 0)throw new JWEInvalid("JWE Encrypted Key missing");return unwrap(alg.slice(-6),sharedSecret,encryptedKey)}case"RSA1_5":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":{if(encryptedKey===void 0)throw new JWEInvalid("JWE Encrypted Key missing");return decrypt3(alg,key,encryptedKey)}case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{if(encryptedKey===void 0)throw new JWEInvalid("JWE Encrypted Key missing");if(typeof joseHeader.p2c!="number")throw new JWEInvalid('JOSE Header "p2c" (PBES2 Count) missing or invalid');let p2cLimit=options?.maxPBES2Count||1e4;if(joseHeader.p2c>p2cLimit)throw new JWEInvalid('JOSE Header "p2c" (PBES2 Count) out is of acceptable bounds');if(typeof joseHeader.p2s!="string")throw new JWEInvalid('JOSE Header "p2s" (PBES2 Salt) missing or invalid');let p2s2;try{p2s2=decode(joseHeader.p2s)}catch{throw new JWEInvalid("Failed to base64url decode the p2s")}return decrypt2(alg,key,encryptedKey,joseHeader.p2c,p2s2)}case"A128KW":case"A192KW":case"A256KW":{if(encryptedKey===void 0)throw new JWEInvalid("JWE Encrypted Key missing");return unwrap(alg,key,encryptedKey)}case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":{if(encryptedKey===void 0)throw new JWEInvalid("JWE Encrypted Key missing");if(typeof joseHeader.iv!="string")throw new JWEInvalid('JOSE Header "iv" (Initialization Vector) missing or invalid');if(typeof joseHeader.tag!="string")throw new JWEInvalid('JOSE Header "tag" (Authentication Tag) missing or invalid');let iv;try{iv=decode(joseHeader.iv)}catch{throw new JWEInvalid("Failed to base64url decode the iv")}let tag2;try{tag2=decode(joseHeader.tag)}catch{throw new JWEInvalid("Failed to base64url decode the tag")}return unwrap2(alg,key,encryptedKey,iv,tag2)}default:throw new JOSENotSupported('Invalid or unsupported "alg" (JWE Algorithm) header value')}}var decrypt_key_management_default=decryptKeyManagement;function validateCrit(Err,recognizedDefault,recognizedOption,protectedHeader,joseHeader){if(joseHeader.crit!==void 0&&protectedHeader?.crit===void 0)throw new Err('"crit" (Critical) Header Parameter MUST be integrity protected');if(!protectedHeader||protectedHeader.crit===void 0)return new Set;if(!Array.isArray(protectedHeader.crit)||protectedHeader.crit.length===0||protectedHeader.crit.some(input=>typeof input!="string"||input.length===0))throw new Err('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let recognized;recognizedOption!==void 0?recognized=new Map([...Object.entries(recognizedOption),...recognizedDefault.entries()]):recognized=recognizedDefault;for(let parameter of protectedHeader.crit){if(!recognized.has(parameter))throw new JOSENotSupported(`Extension Header Parameter "${parameter}" is not recognized`);if(joseHeader[parameter]===void 0)throw new Err(`Extension Header Parameter "${parameter}" is missing`);if(recognized.get(parameter)&&protectedHeader[parameter]===void 0)throw new Err(`Extension Header Parameter "${parameter}" MUST be integrity protected`)}return new Set(protectedHeader.crit)}var validate_crit_default=validateCrit;var validateAlgorithms=(option,algorithms)=>{if(algorithms!==void 0&&(!Array.isArray(algorithms)||algorithms.some(s=>typeof s!="string")))throw new TypeError(`"${option}" option must be an array of strings`);if(algorithms)return new Set(algorithms)},validate_algorithms_default=validateAlgorithms;async function flattenedDecrypt(jwe,key,options){if(!isObject(jwe))throw new JWEInvalid("Flattened JWE must be an object");if(jwe.protected===void 0&&jwe.header===void 0&&jwe.unprotected===void 0)throw new JWEInvalid("JOSE Header missing");if(jwe.iv!==void 0&&typeof jwe.iv!="string")throw new JWEInvalid("JWE Initialization Vector incorrect type");if(typeof jwe.ciphertext!="string")throw new JWEInvalid("JWE Ciphertext missing or incorrect type");if(jwe.tag!==void 0&&typeof jwe.tag!="string")throw new JWEInvalid("JWE Authentication Tag incorrect type");if(jwe.protected!==void 0&&typeof jwe.protected!="string")throw new JWEInvalid("JWE Protected Header incorrect type");if(jwe.encrypted_key!==void 0&&typeof jwe.encrypted_key!="string")throw new JWEInvalid("JWE Encrypted Key incorrect type");if(jwe.aad!==void 0&&typeof jwe.aad!="string")throw new JWEInvalid("JWE AAD incorrect type");if(jwe.header!==void 0&&!isObject(jwe.header))throw new JWEInvalid("JWE Shared Unprotected Header incorrect type");if(jwe.unprotected!==void 0&&!isObject(jwe.unprotected))throw new JWEInvalid("JWE Per-Recipient Unprotected Header incorrect type");let parsedProt;if(jwe.protected)try{let protectedHeader2=decode(jwe.protected);parsedProt=JSON.parse(decoder.decode(protectedHeader2))}catch{throw new JWEInvalid("JWE Protected Header is invalid")}if(!is_disjoint_default(parsedProt,jwe.header,jwe.unprotected))throw new JWEInvalid("JWE Protected, JWE Unprotected Header, and JWE Per-Recipient Unprotected Header Parameter names must be disjoint");let joseHeader={...parsedProt,...jwe.header,...jwe.unprotected};if(validate_crit_default(JWEInvalid,new Map,options?.crit,parsedProt,joseHeader),joseHeader.zip!==void 0)throw new JOSENotSupported('JWE "zip" (Compression Algorithm) Header Parameter is not supported.');let{alg,enc}=joseHeader;if(typeof alg!="string"||!alg)throw new JWEInvalid("missing JWE Algorithm (alg) in JWE Header");if(typeof enc!="string"||!enc)throw new JWEInvalid("missing JWE Encryption Algorithm (enc) in JWE Header");let keyManagementAlgorithms=options&&validate_algorithms_default("keyManagementAlgorithms",options.keyManagementAlgorithms),contentEncryptionAlgorithms=options&&validate_algorithms_default("contentEncryptionAlgorithms",options.contentEncryptionAlgorithms);if(keyManagementAlgorithms&&!keyManagementAlgorithms.has(alg)||!keyManagementAlgorithms&&alg.startsWith("PBES2"))throw new JOSEAlgNotAllowed('"alg" (Algorithm) Header Parameter value not allowed');if(contentEncryptionAlgorithms&&!contentEncryptionAlgorithms.has(enc))throw new JOSEAlgNotAllowed('"enc" (Encryption Algorithm) Header Parameter value not allowed');let encryptedKey;if(jwe.encrypted_key!==void 0)try{encryptedKey=decode(jwe.encrypted_key)}catch{throw new JWEInvalid("Failed to base64url decode the encrypted_key")}let resolvedKey=!1;typeof key=="function"&&(key=await key(parsedProt,jwe),resolvedKey=!0);let cek;try{cek=await decrypt_key_management_default(alg,key,encryptedKey,joseHeader,options)}catch(err){if(err instanceof TypeError||err instanceof JWEInvalid||err instanceof JOSENotSupported)throw err;cek=cek_default(enc)}let iv,tag2;if(jwe.iv!==void 0)try{iv=decode(jwe.iv)}catch{throw new JWEInvalid("Failed to base64url decode the iv")}if(jwe.tag!==void 0)try{tag2=decode(jwe.tag)}catch{throw new JWEInvalid("Failed to base64url decode the tag")}let protectedHeader=encoder.encode(jwe.protected??""),additionalData;jwe.aad!==void 0?additionalData=concat(protectedHeader,encoder.encode("."),encoder.encode(jwe.aad)):additionalData=protectedHeader;let ciphertext;try{ciphertext=decode(jwe.ciphertext)}catch{throw new JWEInvalid("Failed to base64url decode the ciphertext")}let result={plaintext:await decrypt_default(enc,cek,ciphertext,iv,tag2,additionalData)};if(jwe.protected!==void 0&&(result.protectedHeader=parsedProt),jwe.aad!==void 0)try{result.additionalAuthenticatedData=decode(jwe.aad)}catch{throw new JWEInvalid("Failed to base64url decode the aad")}return jwe.unprotected!==void 0&&(result.sharedUnprotectedHeader=jwe.unprotected),jwe.header!==void 0&&(result.unprotectedHeader=jwe.header),resolvedKey?{...result,key}:result}async function compactDecrypt(jwe,key,options){if(jwe instanceof Uint8Array&&(jwe=decoder.decode(jwe)),typeof jwe!="string")throw new JWEInvalid("Compact JWE must be a string or Uint8Array");let{0:protectedHeader,1:encryptedKey,2:iv,3:ciphertext,4:tag2,length}=jwe.split(".");if(length!==5)throw new JWEInvalid("Invalid Compact JWE");let decrypted=await flattenedDecrypt({ciphertext,iv:iv||void 0,protected:protectedHeader,tag:tag2||void 0,encrypted_key:encryptedKey||void 0},key,options),result={plaintext:decrypted.plaintext,protectedHeader:decrypted.protectedHeader};return typeof key=="function"?{...result,key:decrypted.key}:result}var epoch_default=date=>Math.floor(date.getTime()/1e3);var REGEX=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i,secs_default=str=>{let matched=REGEX.exec(str);if(!matched||matched[4]&&matched[1])throw new TypeError("Invalid time period format");let value=parseFloat(matched[2]),unit=matched[3].toLowerCase(),numericDate;switch(unit){case"sec":case"secs":case"second":case"seconds":case"s":numericDate=Math.round(value);break;case"minute":case"minutes":case"min":case"mins":case"m":numericDate=Math.round(value*60);break;case"hour":case"hours":case"hr":case"hrs":case"h":numericDate=Math.round(value*3600);break;case"day":case"days":case"d":numericDate=Math.round(value*86400);break;case"week":case"weeks":case"w":numericDate=Math.round(value*604800);break;default:numericDate=Math.round(value*31557600);break}return matched[1]==="-"||matched[4]==="ago"?-numericDate:numericDate};var normalizeTyp=value=>value.toLowerCase().replace(/^application\//,""),checkAudiencePresence=(audPayload,audOption)=>typeof audPayload=="string"?audOption.includes(audPayload):Array.isArray(audPayload)?audOption.some(Set.prototype.has.bind(new Set(audPayload))):!1,jwt_claims_set_default=(protectedHeader,encodedPayload,options={})=>{let payload;try{payload=JSON.parse(decoder.decode(encodedPayload))}catch{}if(!isObject(payload))throw new JWTInvalid("JWT Claims Set must be a top-level JSON object");let{typ}=options;if(typ&&(typeof protectedHeader.typ!="string"||normalizeTyp(protectedHeader.typ)!==normalizeTyp(typ)))throw new JWTClaimValidationFailed('unexpected "typ" JWT header value',payload,"typ","check_failed");let{requiredClaims=[],issuer,subject,audience,maxTokenAge}=options,presenceCheck=[...requiredClaims];maxTokenAge!==void 0&&presenceCheck.push("iat"),audience!==void 0&&presenceCheck.push("aud"),subject!==void 0&&presenceCheck.push("sub"),issuer!==void 0&&presenceCheck.push("iss");for(let claim of new Set(presenceCheck.reverse()))if(!(claim in payload))throw new JWTClaimValidationFailed(`missing required "${claim}" claim`,payload,claim,"missing");if(issuer&&!(Array.isArray(issuer)?issuer:[issuer]).includes(payload.iss))throw new JWTClaimValidationFailed('unexpected "iss" claim value',payload,"iss","check_failed");if(subject&&payload.sub!==subject)throw new JWTClaimValidationFailed('unexpected "sub" claim value',payload,"sub","check_failed");if(audience&&!checkAudiencePresence(payload.aud,typeof audience=="string"?[audience]:audience))throw new JWTClaimValidationFailed('unexpected "aud" claim value',payload,"aud","check_failed");let tolerance;switch(typeof options.clockTolerance){case"string":tolerance=secs_default(options.clockTolerance);break;case"number":tolerance=options.clockTolerance;break;case"undefined":tolerance=0;break;default:throw new TypeError("Invalid clockTolerance option type")}let{currentDate}=options,now=epoch_default(currentDate||new Date);if((payload.iat!==void 0||maxTokenAge)&&typeof payload.iat!="number")throw new JWTClaimValidationFailed('"iat" claim must be a number',payload,"iat","invalid");if(payload.nbf!==void 0){if(typeof payload.nbf!="number")throw new JWTClaimValidationFailed('"nbf" claim must be a number',payload,"nbf","invalid");if(payload.nbf>now+tolerance)throw new JWTClaimValidationFailed('"nbf" claim timestamp check failed',payload,"nbf","check_failed")}if(payload.exp!==void 0){if(typeof payload.exp!="number")throw new JWTClaimValidationFailed('"exp" claim must be a number',payload,"exp","invalid");if(payload.exp<=now-tolerance)throw new JWTExpired('"exp" claim timestamp check failed',payload,"exp","check_failed")}if(maxTokenAge){let age=now-payload.iat,max=typeof maxTokenAge=="number"?maxTokenAge:secs_default(maxTokenAge);if(age-tolerance>max)throw new JWTExpired('"iat" claim timestamp check failed (too far in the past)',payload,"iat","check_failed");if(age<0-tolerance)throw new JWTClaimValidationFailed('"iat" claim timestamp check failed (it should be in the past)',payload,"iat","check_failed")}return payload};async function jwtDecrypt(jwt,key,options){let decrypted=await compactDecrypt(jwt,key,options),payload=jwt_claims_set_default(decrypted.protectedHeader,decrypted.plaintext,options),{protectedHeader}=decrypted;if(protectedHeader.iss!==void 0&&protectedHeader.iss!==payload.iss)throw new JWTClaimValidationFailed('replicated "iss" claim header parameter mismatch',payload,"iss","mismatch");if(protectedHeader.sub!==void 0&&protectedHeader.sub!==payload.sub)throw new JWTClaimValidationFailed('replicated "sub" claim header parameter mismatch',payload,"sub","mismatch");if(protectedHeader.aud!==void 0&&JSON.stringify(protectedHeader.aud)!==JSON.stringify(payload.aud))throw new JWTClaimValidationFailed('replicated "aud" claim header parameter mismatch',payload,"aud","mismatch");let result={payload,protectedHeader};return typeof key=="function"?{...result,key:decrypted.key}:result}var unprotected=Symbol();import{KeyObject as KeyObject9}from"node:crypto";var keyToJWK=key=>{let keyObject;if(isCryptoKey(key)){if(!key.extractable)throw new TypeError("CryptoKey is not extractable");keyObject=KeyObject9.from(key)}else if(is_key_object_default(key))keyObject=key;else{if(key instanceof Uint8Array)return{kty:"oct",k:encode(key)};throw new TypeError(invalid_key_input_default(key,...types3,"Uint8Array"))}if(keyObject.type!=="secret"&&!["rsa","ec","ed25519","x25519","ed448","x448"].includes(keyObject.asymmetricKeyType))throw new JOSENotSupported("Unsupported key asymmetricKeyType");return keyObject.export({format:"jwk"})},key_to_jwk_default=keyToJWK;async function exportJWK(key){return key_to_jwk_default(key)}async function encryptKeyManagement(alg,enc,key,providedCek,providedParameters={}){let encryptedKey,parameters,cek;switch(check_key_type_default(alg,key,"encrypt"),key=await normalize_key_default.normalizePublicKey?.(key,alg)||key,alg){case"dir":{cek=key;break}case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{if(!ecdhAllowed(key))throw new JOSENotSupported("ECDH with the provided key is not allowed or not supported by your javascript runtime");let{apu,apv}=providedParameters,{epk:ephemeralKey}=providedParameters;ephemeralKey||=(await generateEpk(key)).privateKey;let{x,y,crv,kty}=await exportJWK(ephemeralKey),sharedSecret=await deriveKey(key,ephemeralKey,alg==="ECDH-ES"?enc:alg,alg==="ECDH-ES"?bitLength2(enc):parseInt(alg.slice(-5,-2),10),apu,apv);if(parameters={epk:{x,crv,kty}},kty==="EC"&&(parameters.epk.y=y),apu&&(parameters.apu=encode(apu)),apv&&(parameters.apv=encode(apv)),alg==="ECDH-ES"){cek=sharedSecret;break}cek=providedCek||cek_default(enc);let kwAlg=alg.slice(-6);encryptedKey=await wrap(kwAlg,sharedSecret,cek);break}case"RSA1_5":case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":{cek=providedCek||cek_default(enc),encryptedKey=await encrypt2(alg,key,cek);break}case"PBES2-HS256+A128KW":case"PBES2-HS384+A192KW":case"PBES2-HS512+A256KW":{cek=providedCek||cek_default(enc);let{p2c,p2s:p2s2}=providedParameters;({encryptedKey,...parameters}=await encrypt(alg,key,cek,p2c,p2s2));break}case"A128KW":case"A192KW":case"A256KW":{cek=providedCek||cek_default(enc),encryptedKey=await wrap(alg,key,cek);break}case"A128GCMKW":case"A192GCMKW":case"A256GCMKW":{cek=providedCek||cek_default(enc);let{iv}=providedParameters;({encryptedKey,...parameters}=await wrap2(alg,key,cek,iv));break}default:throw new JOSENotSupported('Invalid or unsupported "alg" (JWE Algorithm) header value')}return{cek,encryptedKey,parameters}}var encrypt_key_management_default=encryptKeyManagement;var FlattenedEncrypt=class{_plaintext;_protectedHeader;_sharedUnprotectedHeader;_unprotectedHeader;_aad;_cek;_iv;_keyManagementParameters;constructor(plaintext){if(!(plaintext instanceof Uint8Array))throw new TypeError("plaintext must be an instance of Uint8Array");this._plaintext=plaintext}setKeyManagementParameters(parameters){if(this._keyManagementParameters)throw new TypeError("setKeyManagementParameters can only be called once");return this._keyManagementParameters=parameters,this}setProtectedHeader(protectedHeader){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=protectedHeader,this}setSharedUnprotectedHeader(sharedUnprotectedHeader){if(this._sharedUnprotectedHeader)throw new TypeError("setSharedUnprotectedHeader can only be called once");return this._sharedUnprotectedHeader=sharedUnprotectedHeader,this}setUnprotectedHeader(unprotectedHeader){if(this._unprotectedHeader)throw new TypeError("setUnprotectedHeader can only be called once");return this._unprotectedHeader=unprotectedHeader,this}setAdditionalAuthenticatedData(aad){return this._aad=aad,this}setContentEncryptionKey(cek){if(this._cek)throw new TypeError("setContentEncryptionKey can only be called once");return this._cek=cek,this}setInitializationVector(iv){if(this._iv)throw new TypeError("setInitializationVector can only be called once");return this._iv=iv,this}async encrypt(key,options){if(!this._protectedHeader&&!this._unprotectedHeader&&!this._sharedUnprotectedHeader)throw new JWEInvalid("either setProtectedHeader, setUnprotectedHeader, or sharedUnprotectedHeader must be called before #encrypt()");if(!is_disjoint_default(this._protectedHeader,this._unprotectedHeader,this._sharedUnprotectedHeader))throw new JWEInvalid("JWE Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint");let joseHeader={...this._protectedHeader,...this._unprotectedHeader,...this._sharedUnprotectedHeader};if(validate_crit_default(JWEInvalid,new Map,options?.crit,this._protectedHeader,joseHeader),joseHeader.zip!==void 0)throw new JOSENotSupported('JWE "zip" (Compression Algorithm) Header Parameter is not supported.');let{alg,enc}=joseHeader;if(typeof alg!="string"||!alg)throw new JWEInvalid('JWE "alg" (Algorithm) Header Parameter missing or invalid');if(typeof enc!="string"||!enc)throw new JWEInvalid('JWE "enc" (Encryption Algorithm) Header Parameter missing or invalid');let encryptedKey;if(this._cek&&(alg==="dir"||alg==="ECDH-ES"))throw new TypeError(`setContentEncryptionKey cannot be called with JWE "alg" (Algorithm) Header ${alg}`);let cek;{let parameters;({cek,encryptedKey,parameters}=await encrypt_key_management_default(alg,enc,key,this._cek,this._keyManagementParameters)),parameters&&(options&&unprotected in options?this._unprotectedHeader?this._unprotectedHeader={...this._unprotectedHeader,...parameters}:this.setUnprotectedHeader(parameters):this._protectedHeader?this._protectedHeader={...this._protectedHeader,...parameters}:this.setProtectedHeader(parameters))}let additionalData,protectedHeader,aadMember;this._protectedHeader?protectedHeader=encoder.encode(encode(JSON.stringify(this._protectedHeader))):protectedHeader=encoder.encode(""),this._aad?(aadMember=encode(this._aad),additionalData=concat(protectedHeader,encoder.encode("."),encoder.encode(aadMember))):additionalData=protectedHeader;let{ciphertext,tag:tag2,iv}=await encrypt_default(enc,this._plaintext,cek,this._iv,additionalData),jwe={ciphertext:encode(ciphertext)};return iv&&(jwe.iv=encode(iv)),tag2&&(jwe.tag=encode(tag2)),encryptedKey&&(jwe.encrypted_key=encode(encryptedKey)),aadMember&&(jwe.aad=aadMember),this._protectedHeader&&(jwe.protected=decoder.decode(protectedHeader)),this._sharedUnprotectedHeader&&(jwe.unprotected=this._sharedUnprotectedHeader),this._unprotectedHeader&&(jwe.header=this._unprotectedHeader),jwe}};var CompactEncrypt=class{_flattened;constructor(plaintext){this._flattened=new FlattenedEncrypt(plaintext)}setContentEncryptionKey(cek){return this._flattened.setContentEncryptionKey(cek),this}setInitializationVector(iv){return this._flattened.setInitializationVector(iv),this}setProtectedHeader(protectedHeader){return this._flattened.setProtectedHeader(protectedHeader),this}setKeyManagementParameters(parameters){return this._flattened.setKeyManagementParameters(parameters),this}async encrypt(key,options){let jwe=await this._flattened.encrypt(key,options);return[jwe.protected,jwe.encrypted_key,jwe.iv,jwe.ciphertext,jwe.tag].join(".")}};function validateInput(label,input){if(!Number.isFinite(input))throw new TypeError(`Invalid ${label} input`);return input}var ProduceJWT=class{_payload;constructor(payload={}){if(!isObject(payload))throw new TypeError("JWT Claims Set MUST be an object");this._payload=payload}setIssuer(issuer){return this._payload={...this._payload,iss:issuer},this}setSubject(subject){return this._payload={...this._payload,sub:subject},this}setAudience(audience){return this._payload={...this._payload,aud:audience},this}setJti(jwtId){return this._payload={...this._payload,jti:jwtId},this}setNotBefore(input){return typeof input=="number"?this._payload={...this._payload,nbf:validateInput("setNotBefore",input)}:input instanceof Date?this._payload={...this._payload,nbf:validateInput("setNotBefore",epoch_default(input))}:this._payload={...this._payload,nbf:epoch_default(new Date)+secs_default(input)},this}setExpirationTime(input){return typeof input=="number"?this._payload={...this._payload,exp:validateInput("setExpirationTime",input)}:input instanceof Date?this._payload={...this._payload,exp:validateInput("setExpirationTime",epoch_default(input))}:this._payload={...this._payload,exp:epoch_default(new Date)+secs_default(input)},this}setIssuedAt(input){return typeof input>"u"?this._payload={...this._payload,iat:epoch_default(new Date)}:input instanceof Date?this._payload={...this._payload,iat:validateInput("setIssuedAt",epoch_default(input))}:typeof input=="string"?this._payload={...this._payload,iat:validateInput("setIssuedAt",epoch_default(new Date)+secs_default(input))}:this._payload={...this._payload,iat:validateInput("setIssuedAt",input)},this}};var EncryptJWT=class extends ProduceJWT{_cek;_iv;_keyManagementParameters;_protectedHeader;_replicateIssuerAsHeader;_replicateSubjectAsHeader;_replicateAudienceAsHeader;setProtectedHeader(protectedHeader){if(this._protectedHeader)throw new TypeError("setProtectedHeader can only be called once");return this._protectedHeader=protectedHeader,this}setKeyManagementParameters(parameters){if(this._keyManagementParameters)throw new TypeError("setKeyManagementParameters can only be called once");return this._keyManagementParameters=parameters,this}setContentEncryptionKey(cek){if(this._cek)throw new TypeError("setContentEncryptionKey can only be called once");return this._cek=cek,this}setInitializationVector(iv){if(this._iv)throw new TypeError("setInitializationVector can only be called once");return this._iv=iv,this}replicateIssuerAsHeader(){return this._replicateIssuerAsHeader=!0,this}replicateSubjectAsHeader(){return this._replicateSubjectAsHeader=!0,this}replicateAudienceAsHeader(){return this._replicateAudienceAsHeader=!0,this}async encrypt(key,options){let enc=new CompactEncrypt(encoder.encode(JSON.stringify(this._payload)));return this._replicateIssuerAsHeader&&(this._protectedHeader={...this._protectedHeader,iss:this._payload.iss}),this._replicateSubjectAsHeader&&(this._protectedHeader={...this._protectedHeader,sub:this._payload.sub}),this._replicateAudienceAsHeader&&(this._protectedHeader={...this._protectedHeader,aud:this._payload.aud}),enc.setProtectedHeader(this._protectedHeader),this._iv&&enc.setInitializationVector(this._iv),this._cek&&enc.setContentEncryptionKey(this._cek),this._keyManagementParameters&&enc.setKeyManagementParameters(this._keyManagementParameters),enc.encrypt(key,options)}};var base64url_exports={};__export(base64url_exports,{decode:()=>decode2,encode:()=>encode2});var encode2=encode,decode2=decode;function decodeJwt(jwt){if(typeof jwt!="string")throw new JWTInvalid("JWTs must use Compact JWS serialization, JWT must be a string");let{1:payload,length}=jwt.split(".");if(length===5)throw new JWTInvalid("Only JWTs using Compact JWS serialization can be decoded");if(length!==3)throw new JWTInvalid("Invalid JWT");if(!payload)throw new JWTInvalid("JWTs must contain a payload");let decoded;try{decoded=decode2(payload)}catch{throw new JWTInvalid("Failed to base64url decode the payload")}let result;try{result=JSON.parse(decoder.decode(decoded))}catch{throw new JWTInvalid("Failed to parse the decoded payload as JSON")}if(!isObject(result))throw new JWTInvalid("Invalid JWT Claims Set");return result}export{jwtDecrypt,EncryptJWT,base64url_exports,decodeJwt};
|
|
@@ -4,6 +4,6 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{humanizeIdentifier}from"./chunk-GHAY4PSD.js";import{indent_default}from"./chunk-GZNDA6SV.js";import{table}from"./chunk-
|
|
7
|
+
import{humanizeIdentifier}from"./chunk-GHAY4PSD.js";import{indent_default}from"./chunk-GZNDA6SV.js";import{table}from"./chunk-QCYCLWNG.js";function renderAlertTable(rows,hsep=3){return indent_default(table(rows,{hsep}).split(`
|
|
8
8
|
`).map(line=>line.trimEnd()).join(`
|
|
9
9
|
`),2)}function normalizeTimestamp(value){if(!(value===void 0||!Number.isFinite(value)))return Math.abs(value)<1e12?value*1e3:value}function getPrimaryAlert(group){return group.alerts?.[0]}function getGroupTitle(group){return group.ai?.title||group.title||getPrimaryAlert(group)?.title||"Alert group"}function getGroupType(group){return group.type||getPrimaryAlert(group)?.type||"-"}function getGroupStartedAt(group){let primaryAlert=getPrimaryAlert(group);return normalizeTimestamp(group.recordedStartedAt??primaryAlert?.recordedStartedAt??primaryAlert?.startedAt)}function formatTriggerOperator(value){switch(value){case"gt":return">";case"gte":return">=";case"lt":return"<";case"lte":return"<=";default:return}}function humanizeReference(value,opts={}){return value.split("/").map(part=>{let label=humanizeIdentifier(part);return opts.case==="title"?label:label.toLowerCase()}).join(" / ")}export{renderAlertTable,normalizeTimestamp,getGroupTitle,getGroupType,getGroupStartedAt,formatTriggerOperator,humanizeReference};
|
|
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{warnDeprecatedInput}from"./chunk-KA2KG3SY.js";import{packageName,require_lib}from"./chunk-B4KA3ZH2.js";import{require_dist}from"./chunk-24SIHFEW.js";import{confirmNameOption,deploymentOption,environmentOption,forceOption,formatOption,gitBranchOption,jsonOption,projectOption,yesOption}from"./chunk-DORCX7UB.js";import{__toESM}from"./chunk-BZENIQ7N.js";var import_constants=__toESM(require_dist(),1),import_title=__toESM(require_lib(),1);var envTargetChoices=import_constants.PROJECT_ENV_TARGET.map(t=>({name:(0,import_title.default)(t),value:t}));function isValidEnvTarget(target){return typeof target>"u"||envTargetChoices.map(c=>c.value).includes(target)}function getEnvTargetPlaceholder(){return`<${envTargetChoices.map(c=>c.value).join(" | ")}>`}function parseEnvTargetArg(arg){return Array.from(new Set(arg.split(",").map(t=>t.trim()).filter(Boolean)))}function resolveEnvTargetInput(client,input){let environment=Array.isArray(input.environment)?input.environment.join(","):input.environment;return input.legacyEnvironment!==void 0&&environment!==void 0?{error:"Can't use an environment argument with --environment. Use --environment, and --git-branch for a Git branch."}:input.legacyGitBranch!==void 0&&input.gitBranch!==void 0?{error:"Can't use a Git branch argument with --git-branch. Use --git-branch."}:(input.legacyEnvironment!==void 0&&warnDeprecatedInput(client,"The environment argument","--environment"),input.legacyGitBranch!==void 0&&warnDeprecatedInput(client,"The Git branch argument","--git-branch"),{environment:environment??input.legacyEnvironment,gitBranch:input.gitBranch??input.legacyGitBranch})}var targetPlaceholder=getEnvTargetPlaceholder(),listSubcommand={name:"list",aliases:["ls"],description:"List all Environment Variables for a Project",arguments:[],options:[{...environmentOption,description:"List only the variables for this environment"},{...gitBranchOption,description:"List only the variables for this Git branch"},{...formatOption,description:"Specify the output format (json, including readable Environment Variable values)"},{...jsonOption,description:"Output as JSON, including readable Environment Variable values"},projectOption,{name:"guidance",description:"Receive command suggestions once command is complete",shorthand:null,type:Boolean,deprecated:!1}],examples:[]},addSubcommand={name:"add",aliases:[],description:"Add an Environment Variable",arguments:[{name:"name",required:!0}],options:[projectOption,{...environmentOption,type:[String],description:"Environments to add the variable to; repeatable or comma-separated. Prompts when omitted"},{...gitBranchOption,description:"Set the Git branch for a Preview Environment Variable"},{name:"sensitive",description:"Store the value as a Secret",shorthand:null,type:Boolean,deprecated:!1},{name:"no-sensitive",description:"Store the value as Config",shorthand:null,type:Boolean,deprecated:!1},{name:"type",description:"Set the Environment Variable type (`config` or `secret`)",shorthand:null,type:String,argument:"TYPE",deprecated:!1},{name:"visibility",description:"Deprecated alias for `--type`",shorthand:null,type:String,argument:"VISIBILITY",deprecated:!0},{...forceOption,description:"Overwrite an existing variable in the same environment",shorthand:null},{...yesOption,description:"Accept default choices when adding an Environment Variable"},{name:"guidance",description:"Show command suggestions after completion",shorthand:null,type:Boolean,deprecated:!1},{name:"value",description:"Set the variable value for non-interactive use; otherwise use stdin or the prompt",shorthand:null,type:String,argument:"VALUE",deprecated:!1},jsonOption],examples:[{name:"Add a new variable (prompts for value and Environments)",placeholders:["<name>"],value:`${packageName} env add <name>`},{name:"Add a new Environment Variable to a specific Environment",placeholders:["<name>",targetPlaceholder],value:`${packageName} env add <name> --environment ${targetPlaceholder}`},{name:"Add one variable to multiple Environments (comma-separated)",placeholders:["<name>","<environment>"],value:`${packageName} env add <name> --environment <environment>[,<environment>]`},{name:"Override an existing Environment Variable in the same environment (production, preview, development)",value:`${packageName} env add API_TOKEN --force`},{name:"Add a Config Environment Variable that remains readable later",value:`${packageName} env add API_TOKEN --no-sensitive`},{name:"Add a new Environment Variable for a specific Environment and Git Branch",placeholders:["<name>","<BRANCH>",targetPlaceholder],value:`${packageName} env add <name> --environment ${targetPlaceholder} --git-branch <BRANCH>`},{name:"Add a variable from piped input",placeholders:["<file>","<name>",targetPlaceholder],value:`cat <file> | ${packageName} env add <name> --environment ${targetPlaceholder}`},{name:"Add a variable from a file",placeholders:["<file>","<name>",targetPlaceholder],value:`${packageName} env add <name> --environment ${targetPlaceholder} < <file>`},{name:"Add with --value for non-interactive use",placeholders:["<value>"],value:`${packageName} env add API_TOKEN --environment production --value "<value>" --yes`}]},removeSubcommand={name:"remove",aliases:["rm"],description:"Remove an Environment Variable (see examples below)",arguments:[{name:"name",required:!0}],options:[projectOption,{...environmentOption,description:"Remove the variable from this environment only. Without it, the variable is removed from all of its environments"},{...gitBranchOption,description:"Remove the variable for this Git branch only"},{...confirmNameOption,description:"Approve the removal by naming the variable"},{...yesOption,description:"Deprecated: use --confirm-name. Agents can't approve with --yes"},jsonOption],examples:[{name:"Remove a variable from multiple Environments",placeholders:["<name>"],value:`${packageName} env remove <name>`},{name:"Remove a variable from a specific Environment",placeholders:["<name>",targetPlaceholder],value:`${packageName} env remove <name> --environment ${targetPlaceholder}`},{name:"Remove a variable from a specific Environment and Git Branch",placeholders:["<name>","<BRANCH>",targetPlaceholder],value:`${packageName} env remove <name> --environment ${targetPlaceholder} --git-branch <BRANCH>`},{name:"Remove a variable without a prompt, once a person approves",placeholders:["<name>",targetPlaceholder],value:`${packageName} env remove <name> --environment ${targetPlaceholder} --confirm-name <name>`}],consequence:"destructive"},pullSubcommand={name:"pull",aliases:[],description:"Pull Environment Variables into a local file (default: .env.local)",arguments:[{name:"filename",required:!1}],options:[projectOption,{name:"environment",description:"Select the environment to pull (default: development)",shorthand:"e",type:String,argument:"ENVIRONMENT",deprecated:!1},{...gitBranchOption,description:"Specify the Git branch to pull specific Environment Variables for"},{...deploymentOption,description:"Pull Environment Variables for a specific deployment (e.g. dpl_xxx)"},{name:"id",shorthand:null,type:String,deprecated:!0},{...yesOption,description:"Skip the confirmation prompt when overwriting an existing file"}],examples:[{name:"Pull Development Environment Variables into a custom file (check .gitignore)",placeholders:["<file>"],value:`${packageName} env pull <file>`},{name:"Pull Environment Variables for a specific deployment",value:`${packageName} env pull --deployment dpl_xxx`}]},runSubcommand={name:"run",aliases:[],description:"Run a command with environment variables from the linked Vercel project",arguments:[{name:"command",required:!0,multiple:!0}],options:[projectOption,{name:"environment",description:"Specify the environment to pull variables from (default: development)",shorthand:"e",type:String,argument:"ENVIRONMENT",deprecated:!1},{...gitBranchOption,description:"Specify the Git branch to pull specific Environment Variables for"}],examples:[{name:"Run Next.js dev server with development environment variables",value:`${packageName} env run -- next dev`},{name:"Run tests with preview environment variables for a specific branch",value:`${packageName} env run -e preview --git-branch feature-x -- npm test`}]},updateSubcommand={name:"update",aliases:[],description:"Update the value of an existing Environment Variable (see examples below)",arguments:[{name:"name",required:!0}],options:[projectOption,{...environmentOption,description:"Pick the variable to update by an environment it covers. The new value applies to all of its environments"},{...gitBranchOption,description:"Pick the variable to update by its Git branch"},{name:"sensitive",description:"Store the updated value as a Secret",shorthand:null,type:Boolean,deprecated:!1},{name:"type",description:"Set the Environment Variable type (`config` or `secret`)",shorthand:null,type:String,argument:"TYPE",deprecated:!1},{name:"visibility",description:"Deprecated alias for `--type`",shorthand:null,type:String,argument:"VISIBILITY",deprecated:!0},{...yesOption,description:"Skip the confirmation prompt when updating an Environment Variable"},{name:"value",description:"New value for the variable (non-interactive). Otherwise use stdin or you will be prompted.",shorthand:null,type:String,argument:"VALUE",deprecated:!1}],examples:[{name:"Update a variable in all Environments",placeholders:["<name>"],value:`${packageName} env update <name>`},{name:"Update the variable that covers a specific Environment",placeholders:["<name>",targetPlaceholder],value:`${packageName} env update <name> --environment ${targetPlaceholder}`},{name:"Update the variable for a specific Environment and Git Branch",placeholders:["<name>","<BRANCH>",targetPlaceholder],value:`${packageName} env update <name> --environment ${targetPlaceholder} --git-branch <BRANCH>`},{name:"Update a variable from piped input",placeholders:["<file>","<name>",targetPlaceholder],value:`cat <file> | ${packageName} env update <name> --environment ${targetPlaceholder}`},{name:"Update a variable from a file",placeholders:["<file>","<name>",targetPlaceholder],value:`${packageName} env update <name> --environment ${targetPlaceholder} < <file>`}]},envCommand={name:"env",aliases:[],description:"Interact with Environment Variables for a Project",arguments:[],subcommands:[addSubcommand,listSubcommand,pullSubcommand,removeSubcommand,runSubcommand,updateSubcommand],options:[],examples:[{name:"Run a command with Environment Variables from the linked Project",placeholders:["<command>"],value:`${packageName} env run -- <command>`},{name:"Add one variable to multiple Environments",value:`${packageName} env add API_URL --environment production,preview,development`}]};export{envTargetChoices,isValidEnvTarget,getEnvTargetPlaceholder,parseEnvTargetArg,resolveEnvTargetInput,listSubcommand,addSubcommand,removeSubcommand,pullSubcommand,runSubcommand,updateSubcommand,envCommand};
|
|
7
|
+
import{warnDeprecatedInput}from"./chunk-BDLZ6WL2.js";import{packageName,require_lib}from"./chunk-EFGZK6OY.js";import{require_dist}from"./chunk-7QHUMMBA.js";import{confirmNameOption,deploymentOption,environmentOption,forceOption,formatOption,gitBranchOption,jsonOption,projectOption,yesOption}from"./chunk-CUO3CYU3.js";import{__toESM}from"./chunk-NBPLUP7C.js";var import_constants=__toESM(require_dist(),1),import_title=__toESM(require_lib(),1);var envTargetChoices=import_constants.PROJECT_ENV_TARGET.map(t=>({name:(0,import_title.default)(t),value:t}));function isValidEnvTarget(target){return typeof target>"u"||envTargetChoices.map(c=>c.value).includes(target)}function getEnvTargetPlaceholder(){return`<${envTargetChoices.map(c=>c.value).join(" | ")}>`}function parseEnvTargetArg(arg){return Array.from(new Set(arg.split(",").map(t=>t.trim()).filter(Boolean)))}function resolveEnvTargetInput(client,input){let environment=Array.isArray(input.environment)?input.environment.join(","):input.environment;return input.legacyEnvironment!==void 0&&environment!==void 0?{error:"Can't use an environment argument with --environment. Use --environment, and --git-branch for a Git branch."}:input.legacyGitBranch!==void 0&&input.gitBranch!==void 0?{error:"Can't use a Git branch argument with --git-branch. Use --git-branch."}:(input.legacyEnvironment!==void 0&&warnDeprecatedInput(client,"The environment argument","--environment"),input.legacyGitBranch!==void 0&&warnDeprecatedInput(client,"The Git branch argument","--git-branch"),{environment:environment??input.legacyEnvironment,gitBranch:input.gitBranch??input.legacyGitBranch})}var targetPlaceholder=getEnvTargetPlaceholder(),listSubcommand={name:"list",aliases:["ls"],description:"List all Environment Variables for a Project",arguments:[],options:[{...environmentOption,description:"List only the variables for this environment"},{...gitBranchOption,description:"List only the variables for this Git branch"},{...formatOption,description:"Specify the output format (json, including readable Environment Variable values)"},{...jsonOption,description:"Output as JSON, including readable Environment Variable values"},projectOption,{name:"guidance",description:"Receive command suggestions once command is complete",shorthand:null,type:Boolean,deprecated:!1}],examples:[]},addSubcommand={name:"add",aliases:[],description:"Add an Environment Variable",arguments:[{name:"name",required:!0}],options:[projectOption,{...environmentOption,type:[String],description:"Environments to add the variable to; repeatable or comma-separated. Prompts when omitted"},{...gitBranchOption,description:"Set the Git branch for a Preview Environment Variable"},{name:"sensitive",description:"Store the value as a Secret",shorthand:null,type:Boolean,deprecated:!1},{name:"no-sensitive",description:"Store the value as Config",shorthand:null,type:Boolean,deprecated:!1},{name:"type",description:"Set the Environment Variable type (`config` or `secret`)",shorthand:null,type:String,argument:"TYPE",deprecated:!1},{name:"visibility",description:"Deprecated alias for `--type`",shorthand:null,type:String,argument:"VISIBILITY",deprecated:!0},{...forceOption,description:"Overwrite an existing variable in the same environment",shorthand:null},{...yesOption,description:"Accept default choices when adding an Environment Variable"},{name:"guidance",description:"Show command suggestions after completion",shorthand:null,type:Boolean,deprecated:!1},{name:"value",description:"Set the variable value for non-interactive use; otherwise use stdin or the prompt",shorthand:null,type:String,argument:"VALUE",deprecated:!1},jsonOption],examples:[{name:"Add a new variable (prompts for value and Environments)",placeholders:["<name>"],value:`${packageName} env add <name>`},{name:"Add a new Environment Variable to a specific Environment",placeholders:["<name>",targetPlaceholder],value:`${packageName} env add <name> --environment ${targetPlaceholder}`},{name:"Add one variable to multiple Environments (comma-separated)",placeholders:["<name>","<environment>"],value:`${packageName} env add <name> --environment <environment>[,<environment>]`},{name:"Override an existing Environment Variable in the same environment (production, preview, development)",value:`${packageName} env add API_TOKEN --force`},{name:"Add a Config Environment Variable that remains readable later",value:`${packageName} env add API_TOKEN --no-sensitive`},{name:"Add a new Environment Variable for a specific Environment and Git Branch",placeholders:["<name>","<BRANCH>",targetPlaceholder],value:`${packageName} env add <name> --environment ${targetPlaceholder} --git-branch <BRANCH>`},{name:"Add a variable from piped input",placeholders:["<file>","<name>",targetPlaceholder],value:`cat <file> | ${packageName} env add <name> --environment ${targetPlaceholder}`},{name:"Add a variable from a file",placeholders:["<file>","<name>",targetPlaceholder],value:`${packageName} env add <name> --environment ${targetPlaceholder} < <file>`},{name:"Add with --value for non-interactive use",placeholders:["<value>"],value:`${packageName} env add API_TOKEN --environment production --value "<value>" --yes`}]},removeSubcommand={name:"remove",aliases:["rm"],description:"Remove an Environment Variable (see examples below)",arguments:[{name:"name",required:!0}],options:[projectOption,{...environmentOption,description:"Remove the variable from this environment only. Without it, the variable is removed from all of its environments"},{...gitBranchOption,description:"Remove the variable for this Git branch only"},{...confirmNameOption,description:"Approve the removal by naming the variable"},{...yesOption,description:"Deprecated: use --confirm-name. Agents can't approve with --yes"},jsonOption],examples:[{name:"Remove a variable from multiple Environments",placeholders:["<name>"],value:`${packageName} env remove <name>`},{name:"Remove a variable from a specific Environment",placeholders:["<name>",targetPlaceholder],value:`${packageName} env remove <name> --environment ${targetPlaceholder}`},{name:"Remove a variable from a specific Environment and Git Branch",placeholders:["<name>","<BRANCH>",targetPlaceholder],value:`${packageName} env remove <name> --environment ${targetPlaceholder} --git-branch <BRANCH>`},{name:"Remove a variable without a prompt, once a person approves",placeholders:["<name>",targetPlaceholder],value:`${packageName} env remove <name> --environment ${targetPlaceholder} --confirm-name <name>`}],consequence:"destructive"},pullSubcommand={name:"pull",aliases:[],description:"Pull Environment Variables into a local file (default: .env.local)",arguments:[{name:"filename",required:!1}],options:[projectOption,{name:"environment",description:"Select the environment to pull (default: development)",shorthand:"e",type:String,argument:"ENVIRONMENT",deprecated:!1},{...gitBranchOption,description:"Specify the Git branch to pull specific Environment Variables for"},{...deploymentOption,description:"Pull Environment Variables for a specific deployment (e.g. dpl_xxx)"},{name:"id",shorthand:null,type:String,deprecated:!0},{...yesOption,description:"Skip the confirmation prompt when overwriting an existing file"}],examples:[{name:"Pull Development Environment Variables into a custom file (check .gitignore)",placeholders:["<file>"],value:`${packageName} env pull <file>`},{name:"Pull Environment Variables for a specific deployment",value:`${packageName} env pull --deployment dpl_xxx`}]},runSubcommand={name:"run",aliases:[],description:"Run a command with environment variables from the linked Vercel project",arguments:[{name:"command",required:!0,multiple:!0}],options:[projectOption,{name:"environment",description:"Specify the environment to pull variables from (default: development)",shorthand:"e",type:String,argument:"ENVIRONMENT",deprecated:!1},{...gitBranchOption,description:"Specify the Git branch to pull specific Environment Variables for"}],examples:[{name:"Run Next.js dev server with development environment variables",value:`${packageName} env run -- next dev`},{name:"Run tests with preview environment variables for a specific branch",value:`${packageName} env run -e preview --git-branch feature-x -- npm test`}]},updateSubcommand={name:"update",aliases:[],description:"Update the value of an existing Environment Variable (see examples below)",arguments:[{name:"name",required:!0}],options:[projectOption,{...environmentOption,description:"Pick the variable to update by an environment it covers. The new value applies to all of its environments"},{...gitBranchOption,description:"Pick the variable to update by its Git branch"},{name:"sensitive",description:"Store the updated value as a Secret",shorthand:null,type:Boolean,deprecated:!1},{name:"type",description:"Set the Environment Variable type (`config` or `secret`)",shorthand:null,type:String,argument:"TYPE",deprecated:!1},{name:"visibility",description:"Deprecated alias for `--type`",shorthand:null,type:String,argument:"VISIBILITY",deprecated:!0},{...yesOption,description:"Skip the confirmation prompt when updating an Environment Variable"},{name:"value",description:"New value for the variable (non-interactive). Otherwise use stdin or you will be prompted.",shorthand:null,type:String,argument:"VALUE",deprecated:!1}],examples:[{name:"Update a variable in all Environments",placeholders:["<name>"],value:`${packageName} env update <name>`},{name:"Update the variable that covers a specific Environment",placeholders:["<name>",targetPlaceholder],value:`${packageName} env update <name> --environment ${targetPlaceholder}`},{name:"Update the variable for a specific Environment and Git Branch",placeholders:["<name>","<BRANCH>",targetPlaceholder],value:`${packageName} env update <name> --environment ${targetPlaceholder} --git-branch <BRANCH>`},{name:"Update a variable from piped input",placeholders:["<file>","<name>",targetPlaceholder],value:`cat <file> | ${packageName} env update <name> --environment ${targetPlaceholder}`},{name:"Update a variable from a file",placeholders:["<file>","<name>",targetPlaceholder],value:`${packageName} env update <name> --environment ${targetPlaceholder} < <file>`}]},envCommand={name:"env",aliases:[],description:"Interact with Environment Variables for a Project",arguments:[],subcommands:[addSubcommand,listSubcommand,pullSubcommand,removeSubcommand,runSubcommand,updateSubcommand],options:[],examples:[{name:"Run a command with Environment Variables from the linked Project",placeholders:["<command>"],value:`${packageName} env run -- <command>`},{name:"Add one variable to multiple Environments",value:`${packageName} env add API_URL --environment production,preview,development`}]};export{envTargetChoices,isValidEnvTarget,getEnvTargetPlaceholder,parseEnvTargetArg,resolveEnvTargetInput,listSubcommand,addSubcommand,removeSubcommand,pullSubcommand,runSubcommand,updateSubcommand,envCommand};
|
|
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{packageName}from"./chunk-
|
|
7
|
+
import{packageName}from"./chunk-EFGZK6OY.js";import{formatOption,jsonOption,limitOption,nextCursorOption,projectOption,sinceOption,untilOption}from"./chunk-CUO3CYU3.js";var typesSubcommand={name:"types",aliases:[],description:"List available event types with descriptions.",arguments:[],options:[formatOption,jsonOption],examples:[{name:"List all event types",value:`${packageName} activity types`},{name:"Output JSON",value:`${packageName} activity types --json`}]},activityCommand={name:"activity",aliases:[],description:"List user activity events.",arguments:[],subcommands:[{name:"ls",aliases:["list"],description:"",default:!0,hidden:!0,arguments:[],options:[],examples:[]},typesSubcommand],options:[{name:"type",shorthand:null,type:[String],argument:"TYPE",deprecated:!1,description:"Filter by event type. Repeatable and comma-separated (e.g. --type deployment --type project-created or --type deployment,project-created)."},sinceOption,untilOption,{...projectOption,shorthand:"p",description:"Filter by project (overrides auto-detected linked project)."},{name:"all",shorthand:"a",type:Boolean,deprecated:!1,description:"Show all team events (ignore linked project auto-scoping)."},limitOption,nextCursorOption,formatOption,jsonOption],examples:[{name:"List events for the linked project",value:`${packageName} activity`},{name:"Filter events by multiple types",value:`${packageName} activity --type deployment --type project-created --since 7d`},{name:"Filter events by comma-separated types",value:`${packageName} activity --type deployment,project-created --since 7d`},{name:"List all team events",value:`${packageName} activity --all --since 30d`},{name:"Output JSON",value:`${packageName} activity --json | jq '.events[]'`},{name:"List activity event types",value:`${packageName} activity types`}]};export{typesSubcommand,activityCommand};
|
|
@@ -4,9 +4,9 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{require_graceful_fs,require_load_json_file,require_pify}from"./chunk-4NTBYNFR.js";import{UNCLASSIFIED_ERROR_CODE,output_manager_default,peekCliError}from"./chunk-RYSO5U3E.js";import{require_signal_exit}from"./chunk-BLUPZPAS.js";import{require_build_utils}from"./chunk-5MDNVAE6.js";import{require_dist}from"./chunk-24SIHFEW.js";import{__commonJS,__require,__toESM}from"./chunk-BZENIQ7N.js";var require_vendors=__commonJS({"../../node_modules/.pnpm/ci-info@4.1.0/node_modules/ci-info/vendors.json"(exports,module){module.exports=[{name:"Agola CI",constant:"AGOLA",env:"AGOLA_GIT_REF",pr:"AGOLA_PULL_REQUEST_ID"},{name:"Appcircle",constant:"APPCIRCLE",env:"AC_APPCIRCLE",pr:{env:"AC_GIT_PR",ne:"false"}},{name:"AppVeyor",constant:"APPVEYOR",env:"APPVEYOR",pr:"APPVEYOR_PULL_REQUEST_NUMBER"},{name:"AWS CodeBuild",constant:"CODEBUILD",env:"CODEBUILD_BUILD_ARN",pr:{env:"CODEBUILD_WEBHOOK_EVENT",any:["PULL_REQUEST_CREATED","PULL_REQUEST_UPDATED","PULL_REQUEST_REOPENED"]}},{name:"Azure Pipelines",constant:"AZURE_PIPELINES",env:"TF_BUILD",pr:{BUILD_REASON:"PullRequest"}},{name:"Bamboo",constant:"BAMBOO",env:"bamboo_planKey"},{name:"Bitbucket Pipelines",constant:"BITBUCKET",env:"BITBUCKET_COMMIT",pr:"BITBUCKET_PR_ID"},{name:"Bitrise",constant:"BITRISE",env:"BITRISE_IO",pr:"BITRISE_PULL_REQUEST"},{name:"Buddy",constant:"BUDDY",env:"BUDDY_WORKSPACE_ID",pr:"BUDDY_EXECUTION_PULL_REQUEST_ID"},{name:"Buildkite",constant:"BUILDKITE",env:"BUILDKITE",pr:{env:"BUILDKITE_PULL_REQUEST",ne:"false"}},{name:"CircleCI",constant:"CIRCLE",env:"CIRCLECI",pr:"CIRCLE_PULL_REQUEST"},{name:"Cirrus CI",constant:"CIRRUS",env:"CIRRUS_CI",pr:"CIRRUS_PR"},{name:"Codefresh",constant:"CODEFRESH",env:"CF_BUILD_ID",pr:{any:["CF_PULL_REQUEST_NUMBER","CF_PULL_REQUEST_ID"]}},{name:"Codemagic",constant:"CODEMAGIC",env:"CM_BUILD_ID",pr:"CM_PULL_REQUEST"},{name:"Codeship",constant:"CODESHIP",env:{CI_NAME:"codeship"}},{name:"Drone",constant:"DRONE",env:"DRONE",pr:{DRONE_BUILD_EVENT:"pull_request"}},{name:"dsari",constant:"DSARI",env:"DSARI"},{name:"Earthly",constant:"EARTHLY",env:"EARTHLY_CI"},{name:"Expo Application Services",constant:"EAS",env:"EAS_BUILD"},{name:"Gerrit",constant:"GERRIT",env:"GERRIT_PROJECT"},{name:"Gitea Actions",constant:"GITEA_ACTIONS",env:"GITEA_ACTIONS"},{name:"GitHub Actions",constant:"GITHUB_ACTIONS",env:"GITHUB_ACTIONS",pr:{GITHUB_EVENT_NAME:"pull_request"}},{name:"GitLab CI",constant:"GITLAB",env:"GITLAB_CI",pr:"CI_MERGE_REQUEST_ID"},{name:"GoCD",constant:"GOCD",env:"GO_PIPELINE_LABEL"},{name:"Google Cloud Build",constant:"GOOGLE_CLOUD_BUILD",env:"BUILDER_OUTPUT"},{name:"Harness CI",constant:"HARNESS",env:"HARNESS_BUILD_ID"},{name:"Heroku",constant:"HEROKU",env:{env:"NODE",includes:"/app/.heroku/node/bin/node"}},{name:"Hudson",constant:"HUDSON",env:"HUDSON_URL"},{name:"Jenkins",constant:"JENKINS",env:["JENKINS_URL","BUILD_ID"],pr:{any:["ghprbPullId","CHANGE_ID"]}},{name:"LayerCI",constant:"LAYERCI",env:"LAYERCI",pr:"LAYERCI_PULL_REQUEST"},{name:"Magnum CI",constant:"MAGNUM",env:"MAGNUM"},{name:"Netlify CI",constant:"NETLIFY",env:"NETLIFY",pr:{env:"PULL_REQUEST",ne:"false"}},{name:"Nevercode",constant:"NEVERCODE",env:"NEVERCODE",pr:{env:"NEVERCODE_PULL_REQUEST",ne:"false"}},{name:"Prow",constant:"PROW",env:"PROW_JOB_ID"},{name:"ReleaseHub",constant:"RELEASEHUB",env:"RELEASE_BUILD_ID"},{name:"Render",constant:"RENDER",env:"RENDER",pr:{IS_PULL_REQUEST:"true"}},{name:"Sail CI",constant:"SAIL",env:"SAILCI",pr:"SAIL_PULL_REQUEST_NUMBER"},{name:"Screwdriver",constant:"SCREWDRIVER",env:"SCREWDRIVER",pr:{env:"SD_PULL_REQUEST",ne:"false"}},{name:"Semaphore",constant:"SEMAPHORE",env:"SEMAPHORE",pr:"PULL_REQUEST_NUMBER"},{name:"Sourcehut",constant:"SOURCEHUT",env:{CI_NAME:"sourcehut"}},{name:"Strider CD",constant:"STRIDER",env:"STRIDER"},{name:"TaskCluster",constant:"TASKCLUSTER",env:["TASK_ID","RUN_ID"]},{name:"TeamCity",constant:"TEAMCITY",env:"TEAMCITY_VERSION"},{name:"Travis CI",constant:"TRAVIS",env:"TRAVIS",pr:{env:"TRAVIS_PULL_REQUEST",ne:"false"}},{name:"Vela",constant:"VELA",env:"VELA",pr:{VELA_PULL_REQUEST:"1"}},{name:"Vercel",constant:"VERCEL",env:{any:["NOW_BUILDER","VERCEL"]},pr:"VERCEL_GIT_PULL_REQUEST_ID"},{name:"Visual Studio App Center",constant:"APPCENTER",env:"APPCENTER_BUILD_ID"},{name:"Woodpecker",constant:"WOODPECKER",env:{CI:"woodpecker"},pr:{CI_BUILD_EVENT:"pull_request"}},{name:"Xcode Cloud",constant:"XCODE_CLOUD",env:"CI_XCODE_PROJECT",pr:"CI_PULL_REQUEST_NUMBER"},{name:"Xcode Server",constant:"XCODE_SERVER",env:"XCS"}]}});var require_ci_info=__commonJS({"../../node_modules/.pnpm/ci-info@4.1.0/node_modules/ci-info/index.js"(exports){"use strict";var vendors=require_vendors(),env=process.env;Object.defineProperty(exports,"_vendors",{value:vendors.map(function(v){return v.constant})});exports.name=null;exports.isPR=null;exports.id=null;vendors.forEach(function(vendor){let isCI=(Array.isArray(vendor.env)?vendor.env:[vendor.env]).every(function(obj){return checkEnv(obj)});exports[vendor.constant]=isCI,isCI&&(exports.name=vendor.name,exports.isPR=checkPR(vendor),exports.id=vendor.constant)});exports.isCI=!!(env.CI!=="false"&&(env.BUILD_ID||env.BUILD_NUMBER||env.CI||env.CI_APP_ID||env.CI_BUILD_ID||env.CI_BUILD_NUMBER||env.CI_NAME||env.CONTINUOUS_INTEGRATION||env.RUN_ID||exports.name));function checkEnv(obj){return typeof obj=="string"?!!env[obj]:"env"in obj?env[obj.env]&&env[obj.env].includes(obj.includes):"any"in obj?obj.any.some(function(k){return!!env[k]}):Object.keys(obj).every(function(k){return env[k]===obj[k]})}function checkPR(vendor){switch(typeof vendor.pr){case"string":return!!env[vendor.pr];case"object":return"env"in vendor.pr?"any"in vendor.pr?vendor.pr.any.some(function(key){return env[vendor.pr.env]===key}):vendor.pr.env in env&&env[vendor.pr.env]!==vendor.pr.ne:"any"in vendor.pr?vendor.pr.any.some(function(key){return!!env[key]}):checkEnv(vendor.pr);default:return null}}}});var require_imurmurhash=__commonJS({"../../node_modules/.pnpm/imurmurhash@0.1.4/node_modules/imurmurhash/imurmurhash.js"(exports,module){(function(){var cache;function MurmurHash3(key,seed){var m=this instanceof MurmurHash3?this:cache;if(m.reset(seed),typeof key=="string"&&key.length>0&&m.hash(key),m!==this)return m}MurmurHash3.prototype.hash=function(key){var h1,k1,i,top,len;switch(len=key.length,this.len+=len,k1=this.k1,i=0,this.rem){case 0:k1^=len>i?key.charCodeAt(i++)&65535:0;case 1:k1^=len>i?(key.charCodeAt(i++)&65535)<<8:0;case 2:k1^=len>i?(key.charCodeAt(i++)&65535)<<16:0;case 3:k1^=len>i?(key.charCodeAt(i)&255)<<24:0,k1^=len>i?(key.charCodeAt(i++)&65280)>>8:0}if(this.rem=len+this.rem&3,len-=this.rem,len>0){for(h1=this.h1;k1=k1*11601+(k1&65535)*3432906752&4294967295,k1=k1<<15|k1>>>17,k1=k1*13715+(k1&65535)*461832192&4294967295,h1^=k1,h1=h1<<13|h1>>>19,h1=h1*5+3864292196&4294967295,!(i>=len);)k1=key.charCodeAt(i++)&65535^(key.charCodeAt(i++)&65535)<<8^(key.charCodeAt(i++)&65535)<<16,top=key.charCodeAt(i++),k1^=(top&255)<<24^(top&65280)>>8;switch(k1=0,this.rem){case 3:k1^=(key.charCodeAt(i+2)&65535)<<16;case 2:k1^=(key.charCodeAt(i+1)&65535)<<8;case 1:k1^=key.charCodeAt(i)&65535}this.h1=h1}return this.k1=k1,this},MurmurHash3.prototype.result=function(){var k1,h1;return k1=this.k1,h1=this.h1,k1>0&&(k1=k1*11601+(k1&65535)*3432906752&4294967295,k1=k1<<15|k1>>>17,k1=k1*13715+(k1&65535)*461832192&4294967295,h1^=k1),h1^=this.len,h1^=h1>>>16,h1=h1*51819+(h1&65535)*2246770688&4294967295,h1^=h1>>>13,h1=h1*44597+(h1&65535)*3266445312&4294967295,h1^=h1>>>16,h1>>>0},MurmurHash3.prototype.reset=function(seed){return this.h1=typeof seed=="number"?seed:0,this.rem=this.k1=this.len=0,this},cache=new MurmurHash3,typeof module<"u"?module.exports=MurmurHash3:this.MurmurHash3=MurmurHash3})()}});var require_write_file_atomic=__commonJS({"../../node_modules/.pnpm/write-file-atomic@2.4.3/node_modules/write-file-atomic/index.js"(exports,module){"use strict";module.exports=writeFile;module.exports.sync=writeFileSync2;module.exports._getTmpname=getTmpname;module.exports._cleanupOnExit=cleanupOnExit;var fs=require_graceful_fs(),MurmurHash3=require_imurmurhash(),onExit=require_signal_exit(),path=__require("path"),activeFiles={},threadId=function(){try{var workerThreads=__require("worker_threads");return workerThreads.threadId}catch{return 0}}(),invocations=0;function getTmpname(filename){return filename+"."+MurmurHash3(__filename).hash(String(process.pid)).hash(String(threadId)).hash(String(++invocations)).result()}function cleanupOnExit(tmpfile){return function(){try{fs.unlinkSync(typeof tmpfile=="function"?tmpfile():tmpfile)}catch{}}}function writeFile(filename,data,options,callback){options?options instanceof Function?(callback=options,options={}):typeof options=="string"&&(options={encoding:options}):options={};var Promise2=options.Promise||global.Promise,truename,fd,tmpfile,removeOnExitHandler=onExit(cleanupOnExit(()=>tmpfile)),absoluteName=path.resolve(filename);new Promise2(function(resolve){activeFiles[absoluteName]||(activeFiles[absoluteName]=[]),activeFiles[absoluteName].push(resolve),activeFiles[absoluteName].length===1&&resolve()}).then(function(){return new Promise2(function(resolve){fs.realpath(filename,function(_,realname){truename=realname||filename,tmpfile=getTmpname(truename),resolve()})})}).then(function(){return new Promise2(function(resolve){options.mode&&options.chown?resolve():fs.stat(truename,function(err,stats){err||!stats||(options=Object.assign({},options),options.mode==null&&(options.mode=stats.mode),options.chown==null&&process.getuid&&(options.chown={uid:stats.uid,gid:stats.gid})),resolve()})})}).then(function(){return new Promise2(function(resolve,reject){fs.open(tmpfile,"w",options.mode,function(err,_fd){fd=_fd,err?reject(err):resolve()})})}).then(function(){return new Promise2(function(resolve,reject){Buffer.isBuffer(data)?fs.write(fd,data,0,data.length,0,function(err){err?reject(err):resolve()}):data!=null?fs.write(fd,String(data),0,String(options.encoding||"utf8"),function(err){err?reject(err):resolve()}):resolve()})}).then(function(){return new Promise2(function(resolve,reject){options.fsync!==!1?fs.fsync(fd,function(err){err?fs.close(fd,()=>reject(err)):fs.close(fd,resolve)}):fs.close(fd,resolve)})}).then(function(){if(fd=null,options.chown)return new Promise2(function(resolve,reject){fs.chown(tmpfile,options.chown.uid,options.chown.gid,function(err){err?reject(err):resolve()})})}).then(function(){if(options.mode)return new Promise2(function(resolve,reject){fs.chmod(tmpfile,options.mode,function(err){err?reject(err):resolve()})})}).then(function(){return new Promise2(function(resolve,reject){fs.rename(tmpfile,truename,function(err){err?reject(err):resolve()})})}).then(function(){removeOnExitHandler(),callback()},function(err){return new Promise2(resolve=>fd?fs.close(fd,resolve):resolve()).then(()=>{removeOnExitHandler(),fs.unlink(tmpfile,function(){callback(err)})})}).then(function(){activeFiles[absoluteName].shift(),activeFiles[absoluteName].length>0?activeFiles[absoluteName][0]():delete activeFiles[absoluteName]})}function writeFileSync2(filename,data,options){typeof options=="string"?options={encoding:options}:options||(options={});try{filename=fs.realpathSync(filename)}catch{}var tmpfile=getTmpname(filename);if(!options.mode||!options.chown)try{var stats=fs.statSync(filename);options=Object.assign({},options),options.mode||(options.mode=stats.mode),!options.chown&&process.getuid&&(options.chown={uid:stats.uid,gid:stats.gid})}catch{}var fd,cleanup=cleanupOnExit(tmpfile),removeOnExitHandler=onExit(cleanup);try{fd=fs.openSync(tmpfile,"w",options.mode),Buffer.isBuffer(data)?fs.writeSync(fd,data,0,data.length,0):data!=null&&fs.writeSync(fd,String(data),0,String(options.encoding||"utf8")),options.fsync!==!1&&fs.fsyncSync(fd),fs.closeSync(fd),options.chown&&fs.chownSync(tmpfile,options.chown.uid,options.chown.gid),options.mode&&fs.chmodSync(tmpfile,options.mode),fs.renameSync(tmpfile,filename),removeOnExitHandler()}catch(err){if(fd)try{fs.closeSync(fd)}catch{}throw removeOnExitHandler(),cleanup(),err}}}});var require_is_plain_obj=__commonJS({"../../node_modules/.pnpm/is-plain-obj@1.1.0/node_modules/is-plain-obj/index.js"(exports,module){"use strict";var toString=Object.prototype.toString;module.exports=function(x){var prototype;return toString.call(x)==="[object Object]"&&(prototype=Object.getPrototypeOf(x),prototype===null||prototype===Object.getPrototypeOf({}))}}});var require_sort_keys=__commonJS({"../../node_modules/.pnpm/sort-keys@1.1.2/node_modules/sort-keys/index.js"(exports,module){"use strict";var isPlainObj=require_is_plain_obj();module.exports=function(obj,opts){if(!isPlainObj(obj))throw new TypeError("Expected a plain object");opts=opts||{},typeof opts=="function"&&(opts={compare:opts});var deep=opts.deep,seenInput=[],seenOutput=[],sortKeys=function(x){var seenIndex=seenInput.indexOf(x);if(seenIndex!==-1)return seenOutput[seenIndex];var ret={},keys=Object.keys(x).sort(opts.compare);seenInput.push(x),seenOutput.push(ret);for(var i=0;i<keys.length;i++){var key=keys[i],val=x[key];ret[key]=deep&&isPlainObj(val)?sortKeys(val):val}return ret};return sortKeys(obj)}}});var require_pify2=__commonJS({"../../node_modules/.pnpm/pify@3.0.0/node_modules/pify/index.js"(exports,module){"use strict";var processFn=(fn,opts)=>function(){let P=opts.promiseModule,args=new Array(arguments.length);for(let i=0;i<arguments.length;i++)args[i]=arguments[i];return new P((resolve,reject)=>{opts.errorFirst?args.push(function(err,result){if(opts.multiArgs){let results=new Array(arguments.length-1);for(let i=1;i<arguments.length;i++)results[i-1]=arguments[i];err?(results.unshift(err),reject(results)):resolve(results)}else err?reject(err):resolve(result)}):args.push(function(result){if(opts.multiArgs){let results=new Array(arguments.length-1);for(let i=0;i<arguments.length;i++)results[i]=arguments[i];resolve(results)}else resolve(result)}),fn.apply(this,args)})};module.exports=(obj,opts)=>{opts=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},opts);let filter=key=>{let match=pattern=>typeof pattern=="string"?key===pattern:pattern.test(key);return opts.include?opts.include.some(match):!opts.exclude.some(match)},ret;typeof obj=="function"?ret=function(){return opts.excludeMain?obj.apply(this,arguments):processFn(obj,opts).apply(this,arguments)}:ret=Object.create(Object.getPrototypeOf(obj));for(let key in obj){let x=obj[key];ret[key]=typeof x=="function"&&filter(key)?processFn(x,opts):x}return ret}}});var require_make_dir=__commonJS({"../../node_modules/.pnpm/make-dir@1.3.0/node_modules/make-dir/index.js"(exports,module){"use strict";var fs=__require("fs"),path=__require("path"),pify=require_pify2(),defaults={mode:511&~process.umask(),fs},checkPath=pth=>{if(process.platform==="win32"&&/[<>:"|?*]/.test(pth.replace(path.parse(pth).root,""))){let err=new Error(`Path contains invalid characters: ${pth}`);throw err.code="EINVAL",err}};module.exports=(input,opts)=>Promise.resolve().then(()=>{checkPath(input),opts=Object.assign({},defaults,opts);let mkdir=pify(opts.fs.mkdir),stat=pify(opts.fs.stat),make=pth=>mkdir(pth,opts.mode).then(()=>pth).catch(err=>{if(err.code==="ENOENT"){if(err.message.includes("null bytes")||path.dirname(pth)===pth)throw err;return make(path.dirname(pth)).then(()=>make(pth))}return stat(pth).then(stats=>stats.isDirectory()?pth:Promise.reject()).catch(()=>{throw err})});return make(path.resolve(input))});module.exports.sync=(input,opts)=>{checkPath(input),opts=Object.assign({},defaults,opts);let make=pth=>{try{opts.fs.mkdirSync(pth,opts.mode)}catch(err){if(err.code==="ENOENT"){if(err.message.includes("null bytes")||path.dirname(pth)===pth)throw err;return make(path.dirname(pth)),make(pth)}try{if(!opts.fs.statSync(pth).isDirectory())throw new Error("The path is not a directory")}catch{throw err}}return pth};return make(path.resolve(input))}}});var require_detect_indent=__commonJS({"../../node_modules/.pnpm/detect-indent@5.0.0/node_modules/detect-indent/index.js"(exports,module){"use strict";var INDENT_RE=/^(?:( )+|\t+)/;function getMostUsed(indents){let result=0,maxUsed=0,maxWeight=0;for(let entry of indents){let key=entry[0],val=entry[1],u=val[0],w=val[1];(u>maxUsed||u===maxUsed&&w>maxWeight)&&(maxUsed=u,maxWeight=w,result=Number(key))}return result}module.exports=str=>{if(typeof str!="string")throw new TypeError("Expected a string");let tabs=0,spaces=0,prev=0,indents=new Map,current,isIndent;for(let line of str.split(/\n/g)){if(!line)continue;let indent2,matches=line.match(INDENT_RE);matches?(indent2=matches[0].length,matches[1]?spaces++:tabs++):indent2=0;let diff=indent2-prev;prev=indent2,diff?(isIndent=diff>0,current=indents.get(isIndent?diff:-diff),current?current[0]++:(current=[1,0],indents.set(diff,current))):current&&(current[1]+=Number(isIndent))}let amount=getMostUsed(indents),type,indent;return amount?spaces>=tabs?(type="space",indent=" ".repeat(amount)):(type="tab",indent=" ".repeat(amount)):(type=null,indent=""),{amount,type,indent}}}});var require_write_json_file=__commonJS({"../../node_modules/.pnpm/write-json-file@2.2.0/node_modules/write-json-file/index.js"(exports,module){"use strict";var path=__require("path"),fs=require_graceful_fs(),writeFileAtomic=require_write_file_atomic(),sortKeys=require_sort_keys(),makeDir=require_make_dir(),pify=require_pify(),detectIndent=require_detect_indent(),init=(fn,fp,data,opts)=>{if(!fp)throw new TypeError("Expected a filepath");if(data===void 0)throw new TypeError("Expected data to stringify");return opts=Object.assign({indent:" ",sortKeys:!1},opts),opts.sortKeys&&(data=sortKeys(data,{deep:!0,compare:typeof opts.sortKeys=="function"&&opts.sortKeys})),fn(fp,data,opts)},readFile=fp=>pify(fs.readFile)(fp,"utf8").catch(()=>{}),main=(fp,data,opts)=>(opts.detectIndent?readFile(fp):Promise.resolve()).then(str=>{let indent=str?detectIndent(str).indent:opts.indent,json=JSON.stringify(data,opts.replacer,indent);return pify(writeFileAtomic)(fp,`${json}
|
|
7
|
+
import{require_graceful_fs,require_load_json_file,require_pify}from"./chunk-GOXGA37R.js";import{UNCLASSIFIED_ERROR_CODE,output_manager_default,peekCliError}from"./chunk-RIXTYUYN.js";import{require_signal_exit}from"./chunk-7Y572CPZ.js";import{require_build_utils}from"./chunk-BVFFSUG3.js";import{require_dist}from"./chunk-7QHUMMBA.js";import{__commonJS,__require,__toESM}from"./chunk-NBPLUP7C.js";var require_vendors=__commonJS({"../../node_modules/.pnpm/ci-info@4.1.0/node_modules/ci-info/vendors.json"(exports,module){module.exports=[{name:"Agola CI",constant:"AGOLA",env:"AGOLA_GIT_REF",pr:"AGOLA_PULL_REQUEST_ID"},{name:"Appcircle",constant:"APPCIRCLE",env:"AC_APPCIRCLE",pr:{env:"AC_GIT_PR",ne:"false"}},{name:"AppVeyor",constant:"APPVEYOR",env:"APPVEYOR",pr:"APPVEYOR_PULL_REQUEST_NUMBER"},{name:"AWS CodeBuild",constant:"CODEBUILD",env:"CODEBUILD_BUILD_ARN",pr:{env:"CODEBUILD_WEBHOOK_EVENT",any:["PULL_REQUEST_CREATED","PULL_REQUEST_UPDATED","PULL_REQUEST_REOPENED"]}},{name:"Azure Pipelines",constant:"AZURE_PIPELINES",env:"TF_BUILD",pr:{BUILD_REASON:"PullRequest"}},{name:"Bamboo",constant:"BAMBOO",env:"bamboo_planKey"},{name:"Bitbucket Pipelines",constant:"BITBUCKET",env:"BITBUCKET_COMMIT",pr:"BITBUCKET_PR_ID"},{name:"Bitrise",constant:"BITRISE",env:"BITRISE_IO",pr:"BITRISE_PULL_REQUEST"},{name:"Buddy",constant:"BUDDY",env:"BUDDY_WORKSPACE_ID",pr:"BUDDY_EXECUTION_PULL_REQUEST_ID"},{name:"Buildkite",constant:"BUILDKITE",env:"BUILDKITE",pr:{env:"BUILDKITE_PULL_REQUEST",ne:"false"}},{name:"CircleCI",constant:"CIRCLE",env:"CIRCLECI",pr:"CIRCLE_PULL_REQUEST"},{name:"Cirrus CI",constant:"CIRRUS",env:"CIRRUS_CI",pr:"CIRRUS_PR"},{name:"Codefresh",constant:"CODEFRESH",env:"CF_BUILD_ID",pr:{any:["CF_PULL_REQUEST_NUMBER","CF_PULL_REQUEST_ID"]}},{name:"Codemagic",constant:"CODEMAGIC",env:"CM_BUILD_ID",pr:"CM_PULL_REQUEST"},{name:"Codeship",constant:"CODESHIP",env:{CI_NAME:"codeship"}},{name:"Drone",constant:"DRONE",env:"DRONE",pr:{DRONE_BUILD_EVENT:"pull_request"}},{name:"dsari",constant:"DSARI",env:"DSARI"},{name:"Earthly",constant:"EARTHLY",env:"EARTHLY_CI"},{name:"Expo Application Services",constant:"EAS",env:"EAS_BUILD"},{name:"Gerrit",constant:"GERRIT",env:"GERRIT_PROJECT"},{name:"Gitea Actions",constant:"GITEA_ACTIONS",env:"GITEA_ACTIONS"},{name:"GitHub Actions",constant:"GITHUB_ACTIONS",env:"GITHUB_ACTIONS",pr:{GITHUB_EVENT_NAME:"pull_request"}},{name:"GitLab CI",constant:"GITLAB",env:"GITLAB_CI",pr:"CI_MERGE_REQUEST_ID"},{name:"GoCD",constant:"GOCD",env:"GO_PIPELINE_LABEL"},{name:"Google Cloud Build",constant:"GOOGLE_CLOUD_BUILD",env:"BUILDER_OUTPUT"},{name:"Harness CI",constant:"HARNESS",env:"HARNESS_BUILD_ID"},{name:"Heroku",constant:"HEROKU",env:{env:"NODE",includes:"/app/.heroku/node/bin/node"}},{name:"Hudson",constant:"HUDSON",env:"HUDSON_URL"},{name:"Jenkins",constant:"JENKINS",env:["JENKINS_URL","BUILD_ID"],pr:{any:["ghprbPullId","CHANGE_ID"]}},{name:"LayerCI",constant:"LAYERCI",env:"LAYERCI",pr:"LAYERCI_PULL_REQUEST"},{name:"Magnum CI",constant:"MAGNUM",env:"MAGNUM"},{name:"Netlify CI",constant:"NETLIFY",env:"NETLIFY",pr:{env:"PULL_REQUEST",ne:"false"}},{name:"Nevercode",constant:"NEVERCODE",env:"NEVERCODE",pr:{env:"NEVERCODE_PULL_REQUEST",ne:"false"}},{name:"Prow",constant:"PROW",env:"PROW_JOB_ID"},{name:"ReleaseHub",constant:"RELEASEHUB",env:"RELEASE_BUILD_ID"},{name:"Render",constant:"RENDER",env:"RENDER",pr:{IS_PULL_REQUEST:"true"}},{name:"Sail CI",constant:"SAIL",env:"SAILCI",pr:"SAIL_PULL_REQUEST_NUMBER"},{name:"Screwdriver",constant:"SCREWDRIVER",env:"SCREWDRIVER",pr:{env:"SD_PULL_REQUEST",ne:"false"}},{name:"Semaphore",constant:"SEMAPHORE",env:"SEMAPHORE",pr:"PULL_REQUEST_NUMBER"},{name:"Sourcehut",constant:"SOURCEHUT",env:{CI_NAME:"sourcehut"}},{name:"Strider CD",constant:"STRIDER",env:"STRIDER"},{name:"TaskCluster",constant:"TASKCLUSTER",env:["TASK_ID","RUN_ID"]},{name:"TeamCity",constant:"TEAMCITY",env:"TEAMCITY_VERSION"},{name:"Travis CI",constant:"TRAVIS",env:"TRAVIS",pr:{env:"TRAVIS_PULL_REQUEST",ne:"false"}},{name:"Vela",constant:"VELA",env:"VELA",pr:{VELA_PULL_REQUEST:"1"}},{name:"Vercel",constant:"VERCEL",env:{any:["NOW_BUILDER","VERCEL"]},pr:"VERCEL_GIT_PULL_REQUEST_ID"},{name:"Visual Studio App Center",constant:"APPCENTER",env:"APPCENTER_BUILD_ID"},{name:"Woodpecker",constant:"WOODPECKER",env:{CI:"woodpecker"},pr:{CI_BUILD_EVENT:"pull_request"}},{name:"Xcode Cloud",constant:"XCODE_CLOUD",env:"CI_XCODE_PROJECT",pr:"CI_PULL_REQUEST_NUMBER"},{name:"Xcode Server",constant:"XCODE_SERVER",env:"XCS"}]}});var require_ci_info=__commonJS({"../../node_modules/.pnpm/ci-info@4.1.0/node_modules/ci-info/index.js"(exports){"use strict";var vendors=require_vendors(),env=process.env;Object.defineProperty(exports,"_vendors",{value:vendors.map(function(v){return v.constant})});exports.name=null;exports.isPR=null;exports.id=null;vendors.forEach(function(vendor){let isCI=(Array.isArray(vendor.env)?vendor.env:[vendor.env]).every(function(obj){return checkEnv(obj)});exports[vendor.constant]=isCI,isCI&&(exports.name=vendor.name,exports.isPR=checkPR(vendor),exports.id=vendor.constant)});exports.isCI=!!(env.CI!=="false"&&(env.BUILD_ID||env.BUILD_NUMBER||env.CI||env.CI_APP_ID||env.CI_BUILD_ID||env.CI_BUILD_NUMBER||env.CI_NAME||env.CONTINUOUS_INTEGRATION||env.RUN_ID||exports.name));function checkEnv(obj){return typeof obj=="string"?!!env[obj]:"env"in obj?env[obj.env]&&env[obj.env].includes(obj.includes):"any"in obj?obj.any.some(function(k){return!!env[k]}):Object.keys(obj).every(function(k){return env[k]===obj[k]})}function checkPR(vendor){switch(typeof vendor.pr){case"string":return!!env[vendor.pr];case"object":return"env"in vendor.pr?"any"in vendor.pr?vendor.pr.any.some(function(key){return env[vendor.pr.env]===key}):vendor.pr.env in env&&env[vendor.pr.env]!==vendor.pr.ne:"any"in vendor.pr?vendor.pr.any.some(function(key){return!!env[key]}):checkEnv(vendor.pr);default:return null}}}});var require_imurmurhash=__commonJS({"../../node_modules/.pnpm/imurmurhash@0.1.4/node_modules/imurmurhash/imurmurhash.js"(exports,module){(function(){var cache;function MurmurHash3(key,seed){var m=this instanceof MurmurHash3?this:cache;if(m.reset(seed),typeof key=="string"&&key.length>0&&m.hash(key),m!==this)return m}MurmurHash3.prototype.hash=function(key){var h1,k1,i,top,len;switch(len=key.length,this.len+=len,k1=this.k1,i=0,this.rem){case 0:k1^=len>i?key.charCodeAt(i++)&65535:0;case 1:k1^=len>i?(key.charCodeAt(i++)&65535)<<8:0;case 2:k1^=len>i?(key.charCodeAt(i++)&65535)<<16:0;case 3:k1^=len>i?(key.charCodeAt(i)&255)<<24:0,k1^=len>i?(key.charCodeAt(i++)&65280)>>8:0}if(this.rem=len+this.rem&3,len-=this.rem,len>0){for(h1=this.h1;k1=k1*11601+(k1&65535)*3432906752&4294967295,k1=k1<<15|k1>>>17,k1=k1*13715+(k1&65535)*461832192&4294967295,h1^=k1,h1=h1<<13|h1>>>19,h1=h1*5+3864292196&4294967295,!(i>=len);)k1=key.charCodeAt(i++)&65535^(key.charCodeAt(i++)&65535)<<8^(key.charCodeAt(i++)&65535)<<16,top=key.charCodeAt(i++),k1^=(top&255)<<24^(top&65280)>>8;switch(k1=0,this.rem){case 3:k1^=(key.charCodeAt(i+2)&65535)<<16;case 2:k1^=(key.charCodeAt(i+1)&65535)<<8;case 1:k1^=key.charCodeAt(i)&65535}this.h1=h1}return this.k1=k1,this},MurmurHash3.prototype.result=function(){var k1,h1;return k1=this.k1,h1=this.h1,k1>0&&(k1=k1*11601+(k1&65535)*3432906752&4294967295,k1=k1<<15|k1>>>17,k1=k1*13715+(k1&65535)*461832192&4294967295,h1^=k1),h1^=this.len,h1^=h1>>>16,h1=h1*51819+(h1&65535)*2246770688&4294967295,h1^=h1>>>13,h1=h1*44597+(h1&65535)*3266445312&4294967295,h1^=h1>>>16,h1>>>0},MurmurHash3.prototype.reset=function(seed){return this.h1=typeof seed=="number"?seed:0,this.rem=this.k1=this.len=0,this},cache=new MurmurHash3,typeof module<"u"?module.exports=MurmurHash3:this.MurmurHash3=MurmurHash3})()}});var require_write_file_atomic=__commonJS({"../../node_modules/.pnpm/write-file-atomic@2.4.3/node_modules/write-file-atomic/index.js"(exports,module){"use strict";module.exports=writeFile;module.exports.sync=writeFileSync2;module.exports._getTmpname=getTmpname;module.exports._cleanupOnExit=cleanupOnExit;var fs=require_graceful_fs(),MurmurHash3=require_imurmurhash(),onExit=require_signal_exit(),path=__require("path"),activeFiles={},threadId=function(){try{var workerThreads=__require("worker_threads");return workerThreads.threadId}catch{return 0}}(),invocations=0;function getTmpname(filename){return filename+"."+MurmurHash3(__filename).hash(String(process.pid)).hash(String(threadId)).hash(String(++invocations)).result()}function cleanupOnExit(tmpfile){return function(){try{fs.unlinkSync(typeof tmpfile=="function"?tmpfile():tmpfile)}catch{}}}function writeFile(filename,data,options,callback){options?options instanceof Function?(callback=options,options={}):typeof options=="string"&&(options={encoding:options}):options={};var Promise2=options.Promise||global.Promise,truename,fd,tmpfile,removeOnExitHandler=onExit(cleanupOnExit(()=>tmpfile)),absoluteName=path.resolve(filename);new Promise2(function(resolve){activeFiles[absoluteName]||(activeFiles[absoluteName]=[]),activeFiles[absoluteName].push(resolve),activeFiles[absoluteName].length===1&&resolve()}).then(function(){return new Promise2(function(resolve){fs.realpath(filename,function(_,realname){truename=realname||filename,tmpfile=getTmpname(truename),resolve()})})}).then(function(){return new Promise2(function(resolve){options.mode&&options.chown?resolve():fs.stat(truename,function(err,stats){err||!stats||(options=Object.assign({},options),options.mode==null&&(options.mode=stats.mode),options.chown==null&&process.getuid&&(options.chown={uid:stats.uid,gid:stats.gid})),resolve()})})}).then(function(){return new Promise2(function(resolve,reject){fs.open(tmpfile,"w",options.mode,function(err,_fd){fd=_fd,err?reject(err):resolve()})})}).then(function(){return new Promise2(function(resolve,reject){Buffer.isBuffer(data)?fs.write(fd,data,0,data.length,0,function(err){err?reject(err):resolve()}):data!=null?fs.write(fd,String(data),0,String(options.encoding||"utf8"),function(err){err?reject(err):resolve()}):resolve()})}).then(function(){return new Promise2(function(resolve,reject){options.fsync!==!1?fs.fsync(fd,function(err){err?fs.close(fd,()=>reject(err)):fs.close(fd,resolve)}):fs.close(fd,resolve)})}).then(function(){if(fd=null,options.chown)return new Promise2(function(resolve,reject){fs.chown(tmpfile,options.chown.uid,options.chown.gid,function(err){err?reject(err):resolve()})})}).then(function(){if(options.mode)return new Promise2(function(resolve,reject){fs.chmod(tmpfile,options.mode,function(err){err?reject(err):resolve()})})}).then(function(){return new Promise2(function(resolve,reject){fs.rename(tmpfile,truename,function(err){err?reject(err):resolve()})})}).then(function(){removeOnExitHandler(),callback()},function(err){return new Promise2(resolve=>fd?fs.close(fd,resolve):resolve()).then(()=>{removeOnExitHandler(),fs.unlink(tmpfile,function(){callback(err)})})}).then(function(){activeFiles[absoluteName].shift(),activeFiles[absoluteName].length>0?activeFiles[absoluteName][0]():delete activeFiles[absoluteName]})}function writeFileSync2(filename,data,options){typeof options=="string"?options={encoding:options}:options||(options={});try{filename=fs.realpathSync(filename)}catch{}var tmpfile=getTmpname(filename);if(!options.mode||!options.chown)try{var stats=fs.statSync(filename);options=Object.assign({},options),options.mode||(options.mode=stats.mode),!options.chown&&process.getuid&&(options.chown={uid:stats.uid,gid:stats.gid})}catch{}var fd,cleanup=cleanupOnExit(tmpfile),removeOnExitHandler=onExit(cleanup);try{fd=fs.openSync(tmpfile,"w",options.mode),Buffer.isBuffer(data)?fs.writeSync(fd,data,0,data.length,0):data!=null&&fs.writeSync(fd,String(data),0,String(options.encoding||"utf8")),options.fsync!==!1&&fs.fsyncSync(fd),fs.closeSync(fd),options.chown&&fs.chownSync(tmpfile,options.chown.uid,options.chown.gid),options.mode&&fs.chmodSync(tmpfile,options.mode),fs.renameSync(tmpfile,filename),removeOnExitHandler()}catch(err){if(fd)try{fs.closeSync(fd)}catch{}throw removeOnExitHandler(),cleanup(),err}}}});var require_is_plain_obj=__commonJS({"../../node_modules/.pnpm/is-plain-obj@1.1.0/node_modules/is-plain-obj/index.js"(exports,module){"use strict";var toString=Object.prototype.toString;module.exports=function(x){var prototype;return toString.call(x)==="[object Object]"&&(prototype=Object.getPrototypeOf(x),prototype===null||prototype===Object.getPrototypeOf({}))}}});var require_sort_keys=__commonJS({"../../node_modules/.pnpm/sort-keys@1.1.2/node_modules/sort-keys/index.js"(exports,module){"use strict";var isPlainObj=require_is_plain_obj();module.exports=function(obj,opts){if(!isPlainObj(obj))throw new TypeError("Expected a plain object");opts=opts||{},typeof opts=="function"&&(opts={compare:opts});var deep=opts.deep,seenInput=[],seenOutput=[],sortKeys=function(x){var seenIndex=seenInput.indexOf(x);if(seenIndex!==-1)return seenOutput[seenIndex];var ret={},keys=Object.keys(x).sort(opts.compare);seenInput.push(x),seenOutput.push(ret);for(var i=0;i<keys.length;i++){var key=keys[i],val=x[key];ret[key]=deep&&isPlainObj(val)?sortKeys(val):val}return ret};return sortKeys(obj)}}});var require_pify2=__commonJS({"../../node_modules/.pnpm/pify@3.0.0/node_modules/pify/index.js"(exports,module){"use strict";var processFn=(fn,opts)=>function(){let P=opts.promiseModule,args=new Array(arguments.length);for(let i=0;i<arguments.length;i++)args[i]=arguments[i];return new P((resolve,reject)=>{opts.errorFirst?args.push(function(err,result){if(opts.multiArgs){let results=new Array(arguments.length-1);for(let i=1;i<arguments.length;i++)results[i-1]=arguments[i];err?(results.unshift(err),reject(results)):resolve(results)}else err?reject(err):resolve(result)}):args.push(function(result){if(opts.multiArgs){let results=new Array(arguments.length-1);for(let i=0;i<arguments.length;i++)results[i]=arguments[i];resolve(results)}else resolve(result)}),fn.apply(this,args)})};module.exports=(obj,opts)=>{opts=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},opts);let filter=key=>{let match=pattern=>typeof pattern=="string"?key===pattern:pattern.test(key);return opts.include?opts.include.some(match):!opts.exclude.some(match)},ret;typeof obj=="function"?ret=function(){return opts.excludeMain?obj.apply(this,arguments):processFn(obj,opts).apply(this,arguments)}:ret=Object.create(Object.getPrototypeOf(obj));for(let key in obj){let x=obj[key];ret[key]=typeof x=="function"&&filter(key)?processFn(x,opts):x}return ret}}});var require_make_dir=__commonJS({"../../node_modules/.pnpm/make-dir@1.3.0/node_modules/make-dir/index.js"(exports,module){"use strict";var fs=__require("fs"),path=__require("path"),pify=require_pify2(),defaults={mode:511&~process.umask(),fs},checkPath=pth=>{if(process.platform==="win32"&&/[<>:"|?*]/.test(pth.replace(path.parse(pth).root,""))){let err=new Error(`Path contains invalid characters: ${pth}`);throw err.code="EINVAL",err}};module.exports=(input,opts)=>Promise.resolve().then(()=>{checkPath(input),opts=Object.assign({},defaults,opts);let mkdir=pify(opts.fs.mkdir),stat=pify(opts.fs.stat),make=pth=>mkdir(pth,opts.mode).then(()=>pth).catch(err=>{if(err.code==="ENOENT"){if(err.message.includes("null bytes")||path.dirname(pth)===pth)throw err;return make(path.dirname(pth)).then(()=>make(pth))}return stat(pth).then(stats=>stats.isDirectory()?pth:Promise.reject()).catch(()=>{throw err})});return make(path.resolve(input))});module.exports.sync=(input,opts)=>{checkPath(input),opts=Object.assign({},defaults,opts);let make=pth=>{try{opts.fs.mkdirSync(pth,opts.mode)}catch(err){if(err.code==="ENOENT"){if(err.message.includes("null bytes")||path.dirname(pth)===pth)throw err;return make(path.dirname(pth)),make(pth)}try{if(!opts.fs.statSync(pth).isDirectory())throw new Error("The path is not a directory")}catch{throw err}}return pth};return make(path.resolve(input))}}});var require_detect_indent=__commonJS({"../../node_modules/.pnpm/detect-indent@5.0.0/node_modules/detect-indent/index.js"(exports,module){"use strict";var INDENT_RE=/^(?:( )+|\t+)/;function getMostUsed(indents){let result=0,maxUsed=0,maxWeight=0;for(let entry of indents){let key=entry[0],val=entry[1],u=val[0],w=val[1];(u>maxUsed||u===maxUsed&&w>maxWeight)&&(maxUsed=u,maxWeight=w,result=Number(key))}return result}module.exports=str=>{if(typeof str!="string")throw new TypeError("Expected a string");let tabs=0,spaces=0,prev=0,indents=new Map,current,isIndent;for(let line of str.split(/\n/g)){if(!line)continue;let indent2,matches=line.match(INDENT_RE);matches?(indent2=matches[0].length,matches[1]?spaces++:tabs++):indent2=0;let diff=indent2-prev;prev=indent2,diff?(isIndent=diff>0,current=indents.get(isIndent?diff:-diff),current?current[0]++:(current=[1,0],indents.set(diff,current))):current&&(current[1]+=Number(isIndent))}let amount=getMostUsed(indents),type,indent;return amount?spaces>=tabs?(type="space",indent=" ".repeat(amount)):(type="tab",indent=" ".repeat(amount)):(type=null,indent=""),{amount,type,indent}}}});var require_write_json_file=__commonJS({"../../node_modules/.pnpm/write-json-file@2.2.0/node_modules/write-json-file/index.js"(exports,module){"use strict";var path=__require("path"),fs=require_graceful_fs(),writeFileAtomic=require_write_file_atomic(),sortKeys=require_sort_keys(),makeDir=require_make_dir(),pify=require_pify(),detectIndent=require_detect_indent(),init=(fn,fp,data,opts)=>{if(!fp)throw new TypeError("Expected a filepath");if(data===void 0)throw new TypeError("Expected data to stringify");return opts=Object.assign({indent:" ",sortKeys:!1},opts),opts.sortKeys&&(data=sortKeys(data,{deep:!0,compare:typeof opts.sortKeys=="function"&&opts.sortKeys})),fn(fp,data,opts)},readFile=fp=>pify(fs.readFile)(fp,"utf8").catch(()=>{}),main=(fp,data,opts)=>(opts.detectIndent?readFile(fp):Promise.resolve()).then(str=>{let indent=str?detectIndent(str).indent:opts.indent,json=JSON.stringify(data,opts.replacer,indent);return pify(writeFileAtomic)(fp,`${json}
|
|
8
8
|
`,{mode:opts.mode})}),mainSync=(fp,data,opts)=>{let indent=opts.indent;if(opts.detectIndent)try{let file=fs.readFileSync(fp,"utf8");indent=detectIndent(file).indent}catch(err){if(err.code!=="ENOENT")throw err}let json=JSON.stringify(data,opts.replacer,indent);return writeFileAtomic.sync(fp,`${json}
|
|
9
|
-
`,{mode:opts.mode})};module.exports=(fp,data,opts)=>makeDir(path.dirname(fp),{fs}).then(()=>init(main,fp,data,opts));module.exports.sync=(fp,data,opts)=>{makeDir.sync(path.dirname(fp),{fs}),init(mainSync,fp,data,opts)}}});var import_ci_info=__toESM(require_ci_info(),1);var launchTargets=["cli-support","darwin-arm64","darwin-x64","linux-arm64","linux-arm64-musl","linux-x64","linux-x64-musl","win32-arm64","win32-x64"],launchFallbackReasons=["target_missing","ENOENT","EACCES","ENOEXEC","EPERM","EFTYPE","UNKNOWN","inherited_native_env","download_failed","cache_unwritable","cache_unresolved","not_in_node_modules"],launchSources=["download","cache"],nativePackageStates=["not_found","other_version","no_binary"],cacheErrors=["import","path"],installKinds=["npx","pnpm_dlx","bunx","project","global"];function nodeMajor(value){return typeof value=="string"&&/^\d{1,3}$/.test(value)?value:"other"}var downloadErrors=["timed_out","proxy_refused","proxy_auth_required","dns","connection_refused","connection_reset","connect_timeout","network","tls","http_403","http_404","http_other","checksum_mismatch","bad_metadata","no_binary","binary_did_not_start","binary_killed","binary_exited","version_mismatch","filesystem","other"],downloadPhases=["setup","metadata","tarball","extract","check","install"],downloadCodes=["ENOTFOUND","EAI_AGAIN","ECONNREFUSED","ECONNRESET","ETIMEDOUT","EHOSTUNREACH","ENETUNREACH","ENETDOWN","EPIPE","UND_ERR_CONNECT_TIMEOUT","UND_ERR_HEADERS_TIMEOUT","UND_ERR_BODY_TIMEOUT","UND_ERR_SOCKET","EACCES","EPERM","ENOSPC","EROFS","EEXIST","ENOENT","EISDIR","ENOTDIR","EDQUOT","EMFILE","Z_DATA_ERROR","Z_BUF_ERROR","SELF_SIGNED_CERT_IN_CHAIN","DEPTH_ZERO_SELF_SIGNED_CERT","UNABLE_TO_GET_ISSUER_CERT_LOCALLY","UNABLE_TO_VERIFY_LEAF_SIGNATURE","CERT_HAS_EXPIRED","ERR_TLS_CERT_ALTNAME_INVALID","ENOEXEC","E2BIG","SIGKILL","SIGTERM","SIGABRT","SIGSEGV","SIGBUS","SIGILL","SIGTRAP"],downloadTimeouts=["metadata","stall","total"],downloadAttempts=["1","2"],downloadFailures=["1","2","3_or_more"],downloadProgress=["none","under_half","over_half","complete","unknown"],launchValues=["native","cli-support","other","true","false","default","custom",...launchTargets,...launchFallbackReasons,...launchSources,...nativePackageStates,...installKinds,...cacheErrors,...downloadErrors,...downloadPhases,...downloadCodes,...downloadTimeouts,...downloadAttempts,...downloadFailures,...downloadProgress];function oneOf(value,allowed){return typeof value=="string"&&allowed.includes(value)?value:"other"}function readLaunch(){let launch=globalThis[Symbol.for("vercel.cli.launch")];if(launch?.runtime==="native")return launch.source===void 0?{runtime:"native"}:{runtime:"native",source:oneOf(launch.source,launchSources),...launch.downloadAttempts!==void 0&&{downloadAttempts:oneOf(launch.downloadAttempts,downloadAttempts)}};if(launch?.runtime==="cli-support")return launch.reason===void 0?{runtime:"cli-support"}:{runtime:"cli-support",...launch.target!==void 0&&{target:oneOf(launch.target,launchTargets)},reason:oneOf(launch.reason,launchFallbackReasons),...launch.nativePackage!==void 0&&{nativePackage:oneOf(launch.nativePackage,nativePackageStates)},...launch.cacheError!==void 0&&{cacheError:oneOf(launch.cacheError,cacheErrors)},...launch.install!==void 0&&{install:oneOf(launch.install,installKinds)},...launch.nodeMajor!==void 0&&{nodeMajor:nodeMajor(launch.nodeMajor)},...launch.downloadError!==void 0&&{downloadError:oneOf(launch.downloadError,downloadErrors)},...launch.downloadPhase!==void 0&&{downloadPhase:oneOf(launch.downloadPhase,downloadPhases)},...launch.downloadCode!==void 0&&{downloadCode:oneOf(launch.downloadCode,downloadCodes)},...launch.downloadAttempts!==void 0&&{downloadAttempts:oneOf(launch.downloadAttempts,downloadAttempts)},...launch.downloadFailures!==void 0&&{downloadFailures:oneOf(launch.downloadFailures,downloadFailures)},...launch.downloadTimeout!==void 0&&{downloadTimeout:oneOf(launch.downloadTimeout,downloadTimeouts)},...launch.downloadProgress!==void 0&&{downloadProgress:oneOf(launch.downloadProgress,downloadProgress)},...launch.downloadProxy!==void 0&&{downloadProxy:oneOf(launch.downloadProxy,["true","false"])},...launch.npmRegistry!==void 0&&{npmRegistry:oneOf(launch.npmRegistry,["default","custom"])},...launch.npmProxy!==void 0&&{npmProxy:oneOf(launch.npmProxy,["true","false"])},...launch.npmTls!==void 0&&{npmTls:oneOf(launch.npmTls,["true","false"])}}}function launchTags(launch){return launch?launch.runtime==="native"?{launcher:"native",...launch.source&&{launcher_source:launch.source}}:launch.reason?{launcher:"cli-support",...launch.target&&{launcher_target:launch.target},launcher_fallback:launch.reason,...launch.downloadError&&{launcher_download_error:launch.downloadError}}:{launcher:"cli-support"}:{}}var BRIDGE_TAG=/^[a-zA-Z0-9_.:-]{1,80}$/,ERROR_CODE=/^[A-Za-z][A-Za-z0-9_-]{0,79}$/;function getStartupDurationMs(excludedMs=0){let entryAt=Reflect.get(globalThis,Symbol.for("vercel.cli.entry-at"));return typeof entryAt=="number"?Math.max(0,performance.now()-entryAt-excludedMs):void 0}function getOutcome({exitCode,completion}){return exitCode===130?"canceled":exitCode!==0?"failure":completion==="process_exit"?"unknown":"success"}function toCommandTrace(event,context){let tags={command:context.command,invocation_id:context.invocationId,cli_version:context.cliVersion,release_channel:context.releaseChannel,platform:process.platform,arch:process.arch,is_agent:String(context.isAgent),exit_code:String(context.exitCode),completion:context.completion,outcome:getOutcome(context)};if(tags.outcome==="failure"){let details=peekCliError();tags.error_code=details?.code&&ERROR_CODE.test(details.code)?details.code:UNCLASSIFIED_ERROR_CODE,tags.error_source=context.errorSource??(details?"recorded":"unknown")}return context.agentName&&BRIDGE_TAG.test(context.agentName)&&(tags.agent_name=context.agentName),import_ci_info.default.id&&(tags.ci=import_ci_info.default.id),context.subcommand&&BRIDGE_TAG.test(context.subcommand)&&(tags.subcommand=context.subcommand),context.startupDurationMs!==void 0&&(tags.startup_duration_ms=context.startupDurationMs.toFixed(3)),Object.assign(tags,launchTags(readLaunch())),{id:event.id,name:event.name,timestamp:event.timestamp,startTime:event.startTime,duration:event.duration,tags}}var SPAN_NAME=/^vc(?:\.[a-zA-Z0-9_.]{1,77})?$/,safeCount=value=>/^(0|[1-9][0-9]{0,15})$/.test(value)&&Number.isSafeInteger(Number(value))?value:void 0,SAFE_TAGS={phase:value=>BRIDGE_TAG.test(value)?value:void 0,http_method:value=>/^[A-Z]{1,7}$/.test(value)?value:void 0,http_route:value=>/^[a-z0-9/:*_-]{1,80}$/i.test(value)?value:void 0,http_status_code:value=>/^[1-5][0-9]{2}$/.test(value)?value:void 0,error:()=>"true",file_count:safeCount,byte_count:safeCount,function_count:safeCount,layer_count:safeCount,attempt:safeCount,dropped_spans:safeCount,cache_hit:value=>["true","false"].includes(value)?value:void 0,deployment_state:value=>["INITIALIZING","ANALYZING","BUILDING","DEPLOYING","READY","QUEUED","CANCELED","ERROR"].includes(value)?value:void 0},MAX_SPANS=1e3;function localWaterfall(command,events){let runId=command.parentId;if(!runId)return[];let candidates=events.filter(event=>event.name!=="vc.cli.command"&&event.id!==runId&&SPAN_NAME.test(event.name)),byId=new Map(candidates.map(event=>[event.id,event])),selected=new Map;for(let span of candidates){let chain=[],seen=new Set,current=span,complete=!1;for(;current&&!(seen.has(current.id)||chain.length>=31);){if(seen.add(current.id),chain.push(current),current.parentId===runId||current.parentId===command.id){complete=!0;break}current=byId.get(current.parentId??"")}let missing=chain.filter(ancestor=>!selected.has(ancestor.id));if(!(!complete||selected.size+missing.length>MAX_SPANS))for(let ancestor of missing.reverse())selected.set(ancestor.id,ancestor)}let commandEnd=command.timestamp+command.duration,spans=[...selected.values()].sort((a,b)=>a.timestamp-b.timestamp).map(span=>({id:span.id,name:span.name,timestamp:span.timestamp,startTime:span.startTime,duration:span.duration,parentId:span.parentId===runId&&span.timestamp>=command.timestamp&&span.timestamp<commandEnd?command.id:span.parentId,tags:Object.fromEntries(Object.entries(SAFE_TAGS).flatMap(([key,safe])=>{let value=span.tags[key]&&safe(span.tags[key]);return value?[[key,value]]:[]}))}));if(!spans.length)return[];let start=Math.min(command.timestamp,...spans.map(span=>span.timestamp)),end=Math.max(command.timestamp+command.duration,...spans.map(span=>span.timestamp+span.duration));return[{id:runId,name:"vc.cli.run",timestamp:start,startTime:command.startTime+Math.floor((start-command.timestamp)/1e3),duration:end-start,tags:selected.size<candidates.length?{dropped_spans:String(candidates.length-selected.size)}:{}},...spans]}import{randomUUID}from"node:crypto";function timings(){return Reflect.get(globalThis,Symbol.for("vercel.cli.startup-timings"))}function markStartup(phase){timings()?.marks.push({phase,timestamp:Number(process.hrtime.bigint()/BigInt(1e3))})}function startupEvents(command){let marks=timings()?.marks.filter(mark=>mark.timestamp<=command.timestamp);if(!marks?.length||!command.parentId)return[];let group={id:randomUUID(),parentId:command.parentId,name:"vc.cli.startup",timestamp:marks[0].timestamp,startTime:command.startTime+Math.floor((marks[0].timestamp-command.timestamp)/1e3),duration:command.timestamp-marks[0].timestamp,tags:{}};return[group,...marks.map((mark,index)=>({id:randomUUID(),parentId:group.id,name:`vc.cli.startup.${mark.phase}`,timestamp:mark.timestamp,startTime:command.startTime+Math.floor((mark.timestamp-command.timestamp)/1e3),duration:(marks[index+1]?.timestamp??command.timestamp)-mark.timestamp,tags:{}}))]}import{randomUUID as randomUUID3}from"node:crypto";import os from"node:os";var import_constants=__toESM(require_dist(),1),import_build_utils=__toESM(require_build_utils(),1);import{spawn}from"node:child_process";var import_load_json_file=__toESM(require_load_json_file(),1),import_write_json_file=__toESM(require_write_json_file(),1);import{randomUUID as randomUUID2}from"node:crypto";import{mkdirSync,renameSync,rmSync,writeFileSync}from"node:fs";import{dirname}from"node:path";import{readdirSync}from"node:fs";function isLibc(value){return value==="glibc"||value==="musl"}function hasMuslLoader(){try{return readdirSync("/lib").some(name=>name.startsWith("ld-musl-")&&name.endsWith(".so.1"))}catch{return!1}}function detectLibcFromReport(){let report=process.report;if(!report||typeof report.getReport!="function")return;let originalExcludeNetwork=report.excludeNetwork;try{report.excludeNetwork=!0;let{header}=report.getReport();return header?.glibcVersionRuntime?"glibc":"musl"}catch{return}finally{report.excludeNetwork=originalExcludeNetwork}}function detectLibc(){if(process.platform==="linux")return detectLibcFromReport()??(hasMuslLoader()?"musl":"glibc")}var DEFAULT_CLI_SESSION_INACTIVITY_TIMEOUT_MS=30*60*1e3,DEFAULT_CLI_SESSION_MAX_LIFETIME_MS=24*60*60*1e3;function isPersistedCliSession(value){if(!value||typeof value!="object")return!1;let session=value;return typeof session.id=="string"&&typeof session.createdAt=="number"&&Number.isFinite(session.createdAt)&&typeof session.lastSeenAt=="number"&&Number.isFinite(session.lastSeenAt)}function isPersistedCliDevice(value){if(!value||typeof value!="object")return!1;let device=value;return typeof device.id=="string"&&(device.libc===void 0||isLibc(device.libc))}function readPersistedCliSession(filePath){try{let session=import_load_json_file.default.sync(filePath);return isPersistedCliSession(session)?session:null}catch{return null}}function writePersistedCliSession(filePath,session){let temporaryPath=`${filePath}.${process.pid}.${randomUUID2()}.tmp`;try{mkdirSync(dirname(filePath),{recursive:!0}),writeFileSync(temporaryPath,`${JSON.stringify(session,null,2)}
|
|
9
|
+
`,{mode:opts.mode})};module.exports=(fp,data,opts)=>makeDir(path.dirname(fp),{fs}).then(()=>init(main,fp,data,opts));module.exports.sync=(fp,data,opts)=>{makeDir.sync(path.dirname(fp),{fs}),init(mainSync,fp,data,opts)}}});var import_ci_info=__toESM(require_ci_info(),1);var launchTargets=["cli-support","darwin-arm64","darwin-x64","linux-arm64","linux-arm64-musl","linux-x64","linux-x64-musl","win32-arm64","win32-x64"],launchFallbackReasons=["target_missing","ENOENT","EACCES","ENOEXEC","EPERM","EFTYPE","UNKNOWN","inherited_native_env","download_failed","cache_unwritable","cache_unresolved","not_in_node_modules"],launchSources=["download","cache"],nativePackageStates=["not_found","other_version","no_binary"],cacheErrors=["import","path"],installKinds=["npx","pnpm_dlx","bunx","project","global"];function nodeMajor(value){return typeof value=="string"&&/^\d{1,3}$/.test(value)?value:"other"}var downloadErrors=["timed_out","proxy_refused","proxy_auth_required","dns","connection_refused","connection_reset","connect_timeout","network","tls","http_403","http_404","http_other","checksum_mismatch","bad_metadata","no_binary","binary_did_not_start","binary_killed","binary_exited","version_mismatch","filesystem","other"],downloadPhases=["setup","metadata","tarball","extract","check","install"],downloadCodes=["ENOTFOUND","EAI_AGAIN","ECONNREFUSED","ECONNRESET","ETIMEDOUT","EHOSTUNREACH","ENETUNREACH","ENETDOWN","EPIPE","UND_ERR_CONNECT_TIMEOUT","UND_ERR_HEADERS_TIMEOUT","UND_ERR_BODY_TIMEOUT","UND_ERR_SOCKET","EACCES","EPERM","ENOSPC","EROFS","EEXIST","ENOENT","EISDIR","ENOTDIR","EDQUOT","EMFILE","Z_DATA_ERROR","Z_BUF_ERROR","SELF_SIGNED_CERT_IN_CHAIN","DEPTH_ZERO_SELF_SIGNED_CERT","UNABLE_TO_GET_ISSUER_CERT_LOCALLY","UNABLE_TO_VERIFY_LEAF_SIGNATURE","CERT_HAS_EXPIRED","ERR_TLS_CERT_ALTNAME_INVALID","ENOEXEC","E2BIG","SIGKILL","SIGTERM","SIGABRT","SIGSEGV","SIGBUS","SIGILL","SIGTRAP"],downloadTimeouts=["metadata","stall","total"],downloadAttempts=["1","2"],downloadFailures=["1","2","3_or_more"],downloadProgress=["none","under_half","over_half","complete","unknown"],launchValues=["native","cli-support","other","true","false","default","custom",...launchTargets,...launchFallbackReasons,...launchSources,...nativePackageStates,...installKinds,...cacheErrors,...downloadErrors,...downloadPhases,...downloadCodes,...downloadTimeouts,...downloadAttempts,...downloadFailures,...downloadProgress];function oneOf(value,allowed){return typeof value=="string"&&allowed.includes(value)?value:"other"}function readLaunch(){let launch=globalThis[Symbol.for("vercel.cli.launch")];if(launch?.runtime==="native")return launch.source===void 0?{runtime:"native"}:{runtime:"native",source:oneOf(launch.source,launchSources),...launch.downloadAttempts!==void 0&&{downloadAttempts:oneOf(launch.downloadAttempts,downloadAttempts)}};if(launch?.runtime==="cli-support")return launch.reason===void 0?{runtime:"cli-support"}:{runtime:"cli-support",...launch.target!==void 0&&{target:oneOf(launch.target,launchTargets)},reason:oneOf(launch.reason,launchFallbackReasons),...launch.nativePackage!==void 0&&{nativePackage:oneOf(launch.nativePackage,nativePackageStates)},...launch.cacheError!==void 0&&{cacheError:oneOf(launch.cacheError,cacheErrors)},...launch.install!==void 0&&{install:oneOf(launch.install,installKinds)},...launch.nodeMajor!==void 0&&{nodeMajor:nodeMajor(launch.nodeMajor)},...launch.downloadError!==void 0&&{downloadError:oneOf(launch.downloadError,downloadErrors)},...launch.downloadPhase!==void 0&&{downloadPhase:oneOf(launch.downloadPhase,downloadPhases)},...launch.downloadCode!==void 0&&{downloadCode:oneOf(launch.downloadCode,downloadCodes)},...launch.downloadAttempts!==void 0&&{downloadAttempts:oneOf(launch.downloadAttempts,downloadAttempts)},...launch.downloadFailures!==void 0&&{downloadFailures:oneOf(launch.downloadFailures,downloadFailures)},...launch.downloadTimeout!==void 0&&{downloadTimeout:oneOf(launch.downloadTimeout,downloadTimeouts)},...launch.downloadProgress!==void 0&&{downloadProgress:oneOf(launch.downloadProgress,downloadProgress)},...launch.downloadProxy!==void 0&&{downloadProxy:oneOf(launch.downloadProxy,["true","false"])},...launch.npmRegistry!==void 0&&{npmRegistry:oneOf(launch.npmRegistry,["default","custom"])},...launch.npmProxy!==void 0&&{npmProxy:oneOf(launch.npmProxy,["true","false"])},...launch.npmTls!==void 0&&{npmTls:oneOf(launch.npmTls,["true","false"])}}}function launchTags(launch){return launch?launch.runtime==="native"?{launcher:"native",...launch.source&&{launcher_source:launch.source}}:launch.reason?{launcher:"cli-support",...launch.target&&{launcher_target:launch.target},launcher_fallback:launch.reason,...launch.downloadError&&{launcher_download_error:launch.downloadError}}:{launcher:"cli-support"}:{}}var BRIDGE_TAG=/^[a-zA-Z0-9_.:-]{1,80}$/,ERROR_CODE=/^[A-Za-z][A-Za-z0-9_-]{0,79}$/,UUID=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function getStartupDurationMs(excludedMs=0){let entryAt=Reflect.get(globalThis,Symbol.for("vercel.cli.entry-at"));return typeof entryAt=="number"?Math.max(0,performance.now()-entryAt-excludedMs):void 0}function getOutcome({exitCode,completion}){return exitCode===130?"canceled":exitCode!==0?"failure":completion==="process_exit"?"unknown":"success"}function toCommandTrace(event,context){let tags={command:context.command,invocation_id:context.invocationId,cli_version:context.cliVersion,release_channel:context.releaseChannel,platform:process.platform,arch:process.arch,is_agent:String(context.isAgent),exit_code:String(context.exitCode),completion:context.completion,outcome:getOutcome(context)};if(tags.outcome==="failure"){let details=peekCliError();tags.error_code=details?.code&&ERROR_CODE.test(details.code)?details.code:UNCLASSIFIED_ERROR_CODE,tags.error_source=context.errorSource??(details?"recorded":"unknown")}return context.agentName&&BRIDGE_TAG.test(context.agentName)&&(tags.agent_name=context.agentName),context.sessionId&&UUID.test(context.sessionId)&&(tags.session_id=context.sessionId),import_ci_info.default.id&&(tags.ci=import_ci_info.default.id),context.subcommand&&BRIDGE_TAG.test(context.subcommand)&&(tags.subcommand=context.subcommand),context.startupDurationMs!==void 0&&(tags.startup_duration_ms=context.startupDurationMs.toFixed(3)),Object.assign(tags,launchTags(readLaunch())),{id:event.id,name:event.name,timestamp:event.timestamp,startTime:event.startTime,duration:event.duration,tags}}var SPAN_NAME=/^vc(?:\.[a-zA-Z0-9_.]{1,77})?$/,safeCount=value=>/^(0|[1-9][0-9]{0,15})$/.test(value)&&Number.isSafeInteger(Number(value))?value:void 0,SAFE_TAGS={phase:value=>BRIDGE_TAG.test(value)?value:void 0,http_method:value=>/^[A-Z]{1,7}$/.test(value)?value:void 0,http_route:value=>/^[a-z0-9/:*_-]{1,80}$/i.test(value)?value:void 0,http_status_code:value=>/^[1-5][0-9]{2}$/.test(value)?value:void 0,error:()=>"true",file_count:safeCount,byte_count:safeCount,function_count:safeCount,layer_count:safeCount,attempt:safeCount,dropped_spans:safeCount,cache_hit:value=>["true","false"].includes(value)?value:void 0,deployment_state:value=>["INITIALIZING","ANALYZING","BUILDING","DEPLOYING","READY","QUEUED","CANCELED","ERROR"].includes(value)?value:void 0},MAX_SPANS=1e3;function localWaterfall(command,events){let runId=command.parentId;if(!runId)return[];let candidates=events.filter(event=>event.name!=="vc.cli.command"&&event.id!==runId&&SPAN_NAME.test(event.name)),byId=new Map(candidates.map(event=>[event.id,event])),selected=new Map;for(let span of candidates){let chain=[],seen=new Set,current=span,complete=!1;for(;current&&!(seen.has(current.id)||chain.length>=31);){if(seen.add(current.id),chain.push(current),current.parentId===runId||current.parentId===command.id){complete=!0;break}current=byId.get(current.parentId??"")}let missing=chain.filter(ancestor=>!selected.has(ancestor.id));if(!(!complete||selected.size+missing.length>MAX_SPANS))for(let ancestor of missing.reverse())selected.set(ancestor.id,ancestor)}let commandEnd=command.timestamp+command.duration,spans=[...selected.values()].sort((a,b)=>a.timestamp-b.timestamp).map(span=>({id:span.id,name:span.name,timestamp:span.timestamp,startTime:span.startTime,duration:span.duration,parentId:span.parentId===runId&&span.timestamp>=command.timestamp&&span.timestamp<commandEnd?command.id:span.parentId,tags:Object.fromEntries(Object.entries(SAFE_TAGS).flatMap(([key,safe])=>{let value=span.tags[key]&&safe(span.tags[key]);return value?[[key,value]]:[]}))}));if(!spans.length)return[];let start=Math.min(command.timestamp,...spans.map(span=>span.timestamp)),end=Math.max(command.timestamp+command.duration,...spans.map(span=>span.timestamp+span.duration));return[{id:runId,name:"vc.cli.run",timestamp:start,startTime:command.startTime+Math.floor((start-command.timestamp)/1e3),duration:end-start,tags:selected.size<candidates.length?{dropped_spans:String(candidates.length-selected.size)}:{}},...spans]}import{randomUUID}from"node:crypto";function timings(){return Reflect.get(globalThis,Symbol.for("vercel.cli.startup-timings"))}function markStartup(phase){timings()?.marks.push({phase,timestamp:Number(process.hrtime.bigint()/BigInt(1e3))})}function startupEvents(command){let marks=timings()?.marks.filter(mark=>mark.timestamp<=command.timestamp);if(!marks?.length||!command.parentId)return[];let group={id:randomUUID(),parentId:command.parentId,name:"vc.cli.startup",timestamp:marks[0].timestamp,startTime:command.startTime+Math.floor((marks[0].timestamp-command.timestamp)/1e3),duration:command.timestamp-marks[0].timestamp,tags:{}};return[group,...marks.map((mark,index)=>({id:randomUUID(),parentId:group.id,name:`vc.cli.startup.${mark.phase}`,timestamp:mark.timestamp,startTime:command.startTime+Math.floor((mark.timestamp-command.timestamp)/1e3),duration:(marks[index+1]?.timestamp??command.timestamp)-mark.timestamp,tags:{}}))]}import{randomUUID as randomUUID3}from"node:crypto";import os from"node:os";var import_constants=__toESM(require_dist(),1),import_build_utils=__toESM(require_build_utils(),1);import{spawn}from"node:child_process";var import_load_json_file=__toESM(require_load_json_file(),1),import_write_json_file=__toESM(require_write_json_file(),1);import{randomUUID as randomUUID2}from"node:crypto";import{mkdirSync,renameSync,rmSync,writeFileSync}from"node:fs";import{dirname}from"node:path";import{readdirSync}from"node:fs";function isLibc(value){return value==="glibc"||value==="musl"}function hasMuslLoader(){try{return readdirSync("/lib").some(name=>name.startsWith("ld-musl-")&&name.endsWith(".so.1"))}catch{return!1}}function detectLibcFromReport(){let report=process.report;if(!report||typeof report.getReport!="function")return;let originalExcludeNetwork=report.excludeNetwork;try{report.excludeNetwork=!0;let{header}=report.getReport();return header?.glibcVersionRuntime?"glibc":"musl"}catch{return}finally{report.excludeNetwork=originalExcludeNetwork}}function detectLibc(){if(process.platform==="linux")return detectLibcFromReport()??(hasMuslLoader()?"musl":"glibc")}var DEFAULT_CLI_SESSION_INACTIVITY_TIMEOUT_MS=30*60*1e3,DEFAULT_CLI_SESSION_MAX_LIFETIME_MS=24*60*60*1e3;function isPersistedCliSession(value){if(!value||typeof value!="object")return!1;let session=value;return typeof session.id=="string"&&typeof session.createdAt=="number"&&Number.isFinite(session.createdAt)&&typeof session.lastSeenAt=="number"&&Number.isFinite(session.lastSeenAt)}function isPersistedCliDevice(value){if(!value||typeof value!="object")return!1;let device=value;return typeof device.id=="string"&&(device.libc===void 0||isLibc(device.libc))}function readPersistedCliSession(filePath){try{let session=import_load_json_file.default.sync(filePath);return isPersistedCliSession(session)?session:null}catch{return null}}function writePersistedCliSession(filePath,session){let temporaryPath=`${filePath}.${process.pid}.${randomUUID2()}.tmp`;try{mkdirSync(dirname(filePath),{recursive:!0}),writeFileSync(temporaryPath,`${JSON.stringify(session,null,2)}
|
|
10
10
|
`,{flag:"wx",mode:384}),renameSync(temporaryPath,filePath)}catch{}finally{try{rmSync(temporaryPath,{force:!0})}catch{}}}function readPersistedCliDevice(filePath){try{let device=import_load_json_file.default.sync(filePath);return isPersistedCliDevice(device)?device:null}catch{return null}}function writePersistedCliDevice(filePath,device){try{mkdirSync(dirname(filePath),{recursive:!0}),import_write_json_file.default.sync(filePath,device,{indent:2})}catch{}}function getOrCreatePersistedCliSession(opts){let now=opts.now?.()??Date.now(),inactivityTimeoutMs=opts.inactivityTimeoutMs??DEFAULT_CLI_SESSION_INACTIVITY_TIMEOUT_MS,maxLifetimeMs=opts.maxLifetimeMs??DEFAULT_CLI_SESSION_MAX_LIFETIME_MS,existing=readPersistedCliSession(opts.filePath),session=existing&&now-existing.lastSeenAt<=inactivityTimeoutMs&&now-existing.createdAt<=maxLifetimeMs?{...existing,lastSeenAt:now}:{id:randomUUID2(),createdAt:now,lastSeenAt:now};return writePersistedCliSession(opts.filePath,session),session}function touchPersistedCliSession(opts,session){let nextSession={...session,lastSeenAt:opts.now?.()??Date.now()};return writePersistedCliSession(opts.filePath,nextSession),nextSession}function getOrCreatePersistedCliDevice(opts){let existing=readPersistedCliDevice(opts.filePath);if(existing?.libc)return existing;let libc=(opts.detectLibc??detectLibc)(),device={id:existing?.id??randomUUID2(),...libc?{libc}:{}};return(!existing||libc)&&writePersistedCliDevice(opts.filePath,device),device}import{gzipSync,gunzipSync}from"node:zlib";var COMPRESSION_THRESHOLD=64*1024,MAX_DECOMPRESSED_BYTES=4*1024*1024;function encodeHandoff(payload){let serialized=JSON.stringify(payload),bytes=Buffer.byteLength(serialized);return bytes>COMPRESSION_THRESHOLD&&bytes<=MAX_DECOMPRESSED_BYTES?gzipSync(serialized,{level:1}):serialized}function decodeHandoff(bytes){return(bytes[0]===31&&bytes[1]===139?gunzipSync(new Uint8Array(bytes),{maxOutputLength:MAX_DECOMPRESSED_BYTES}):bytes).toString("utf8")}var LogLabel="['telemetry']:",MAX_ERROR_SERVER_MESSAGE_LENGTH=500,TelemetryClient=class{constructor({opts}){this.redactedValue="[REDACTED]";this.noValueToTriggerPrompt="[TRIGGER_PROMPT]";this.redactedArgumentsLength=args=>args&&args.length===1?"ONE":args.length>1?"MANY":"NONE";this.redactedTargetName=target=>import_constants.PROJECT_ENV_TARGET.includes(target)?target:this.redactedValue;this.isDebug=opts.isDebug||!1,this.store=opts.store}track(eventData){this.isDebug&&output_manager_default.debug(`${LogLabel} ${eventData.key}:${eventData.value}`);let event={id:randomUUID3(),eventTime:Date.now(),...eventData};this.store.add(event)}trackCliCommand(eventData){this.track({key:`command:${eventData.command}`,value:eventData.value})}trackCliSubcommand(eventData){this.store.commandSubcommand=eventData.subcommand,this.track({key:`subcommand:${eventData.subcommand}`,value:eventData.value})}trackCliArgument(eventData){eventData.value&&this.track({key:`argument:${eventData.arg}`,value:eventData.value})}trackCliOption(eventData){this.track({key:`option:${eventData.option}`,value:eventData.value})}trackRedactedCliOption(option,value){value&&this.trackCliOption({option,value:this.redactedValue})}trackTargetEnvironment(targetEnvironment){this.track({key:"target_environment",value:targetEnvironment})}trackCommandOutput(eventData){this.track({key:`output:${eventData.key}`,value:eventData.value})}trackCliFlag(flag){this.track({key:`flag:${flag}`,value:"TRUE"})}trackDeprecatedShorthand(shorthand){this.track({key:"deprecated_shorthand",value:shorthand})}trackOidcTokenRefresh(count){this.track({key:"oidc-token-refresh",value:`${count}`})}trackDpopKeyStorage(storage){this.track({key:"dpop-key",value:storage})}trackPluginInstall(agent,status){this.track({key:`plugin_install:${agent}`,value:status})}trackPluginOffer(outcome){this.track({key:"plugin_offer",value:outcome})}trackCPUs(){this.track({key:"cpu_count",value:String(os.cpus().length)})}trackAgenticUse(agent){agent&&this.track({key:"agent",value:agent})}trackPlatform(){this.track({key:"platform",value:os.platform()})}trackArch(){this.track({key:"arch",value:os.arch()})}trackLibc(libc){libc&&this.track({key:"libc",value:libc})}trackLaunch(launch){this.track({key:"launcher",value:launch.runtime}),launch.runtime==="native"&&launch.source&&this.track({key:"launcher_source",value:launch.source}),launch.runtime==="native"&&launch.downloadAttempts&&this.track({key:"launcher_download_attempts",value:launch.downloadAttempts}),!(launch.runtime!=="cli-support"||!launch.reason)&&(launch.target&&this.track({key:"launcher_target",value:launch.target}),this.track({key:"launcher_fallback",value:launch.reason}),launch.nativePackage&&this.track({key:"launcher_native_package",value:launch.nativePackage}),launch.cacheError&&this.track({key:"launcher_cache_error",value:launch.cacheError}),launch.install&&this.track({key:"launcher_install",value:launch.install}),launch.nodeMajor&&this.track({key:"launcher_node_major",value:launch.nodeMajor}),launch.downloadError&&this.track({key:"launcher_download_error",value:launch.downloadError}),launch.downloadAttempts&&this.track({key:"launcher_download_attempts",value:launch.downloadAttempts}),launch.downloadFailures&&this.track({key:"launcher_download_failures",value:launch.downloadFailures}),launch.downloadPhase&&this.track({key:"launcher_download_phase",value:launch.downloadPhase}),launch.downloadCode&&this.track({key:"launcher_download_code",value:launch.downloadCode}),launch.downloadTimeout&&this.track({key:"launcher_download_timeout",value:launch.downloadTimeout}),launch.downloadProgress&&this.track({key:"launcher_download_progress",value:launch.downloadProgress}),launch.downloadProxy&&this.track({key:"launcher_download_proxy",value:launch.downloadProxy}),launch.npmRegistry&&this.track({key:"launcher_npm_registry",value:launch.npmRegistry}),launch.npmProxy&&this.track({key:"launcher_npm_proxy",value:launch.npmProxy}),launch.npmTls&&this.track({key:"launcher_npm_tls",value:launch.npmTls}))}trackCI(ciVendorName){ciVendorName&&this.track({key:"ci",value:ciVendorName})}trackStdinIsTTY(isTTY){this.track({key:"stdin_is_tty",value:isTTY?"true":"false"})}trackVersion(version){version&&this.track({key:"version",value:version})}trackDefaultDeploy(){this.track({key:"default-deploy",value:"TRUE"})}trackProjectId(projectId){projectId&&this.track({key:"project_id",value:projectId})}trackInvocationId(invocationId){invocationId&&this.track({key:"invocation_id",value:invocationId})}trackDeviceId(deviceId){deviceId&&this.track({key:"device_id",value:deviceId})}trackVercelPluginActiveSession(){this.track({key:"vercel_plugin_active_session",value:"TRUE"})}trackVercelPluginVersion(version){version&&this.track({key:"vercel_plugin_version",value:version})}trackErrorStatus(status){typeof status<"u"&&this.track({key:"error_status",value:String(status)})}trackErrorCode(code){code&&this.track({key:"error_code",value:code})}trackErrorSlug(slug){slug&&this.track({key:"error_slug",value:slug})}trackErrorAction(action){action&&this.track({key:"error_action",value:action})}trackErrorServerMessage(serverMessage){if(serverMessage){let normalizedServerMessage=serverMessage.trim().replace(/\s+/g," ");this.track({key:"error_server_message",value:normalizedServerMessage.slice(0,MAX_ERROR_SERVER_MESSAGE_LENGTH)})}}trackExtension(){this.track({key:"extension",value:this.redactedValue})}trackLoginState(state){state==="started"&&(this.loginAttempt=randomUUID3()),this.loginAttempt&&this.track({key:`login:attempt:${this.loginAttempt}`,value:state}),state!=="started"&&(this.loginAttempt=void 0)}trackCliFlagHelp(command,subcommands){let subcommand;subcommands&&(subcommand=Array.isArray(subcommands)?subcommands[0]:subcommands),this.track({key:"flag:help",value:subcommand?`${command}:${subcommand}`:command})}trackCliOptionFormat(format){if(format){let allowedFormat=["json"].includes(format)?format:this.redactedValue;this.trackCliOption({option:"format",value:allowedFormat})}}trackCliOptionProject(value){value&&(Array.isArray(value)&&value.length===0||this.trackCliOption({option:"project",value:this.redactedValue}))}};function currentDirectory(){try{return process.cwd()}catch{return}}var TelemetryEventStore=class{constructor(opts){this.localEvents=[];this.teamId="NO_TEAM_ID";this.userId="NO_USER_ID";this.projectId="NO_PROJECT_ID";this.sendOptOut=!1;this.#startupEnv={...process.env};this.#startupCwd=currentDirectory();this.isDebug=opts?.isDebug||!1,this.events=[],this.config=opts?.config,this.globalConfigDir=opts?.globalConfigDir,this.cliDeviceOptions=opts?.cliDevice,this.cliSessionOptions=opts?.cliSession,this.invocationId=randomUUID3(),this.deviceId=randomUUID3(),this.cliDeviceOptions&&(this.cliDevice=getOrCreatePersistedCliDevice(this.cliDeviceOptions),this.deviceId=this.cliDevice.id),this.cliSessionOptions?(this.cliSession=getOrCreatePersistedCliSession(this.cliSessionOptions),this.sessionId=this.cliSession.id):this.sessionId=randomUUID3()}#startupEnv;#startupCwd;add(event){event.sessionId=this.sessionId,event.invocationId=this.invocationId,event.teamId=this.teamId,event.userId=this.userId,event.projectId=this.projectId,this.events.push(event)}updateConfig(config){this.config=config}updateTeamId(teamId){teamId&&(this.teamId=teamId)}updateUserId(userId){userId&&(this.userId=userId)}updateProjectId(projectId){projectId&&(this.projectId=projectId)}get hasUserId(){return this.userId!=="NO_USER_ID"}get currentProjectId(){return this.projectId}get currentInvocationId(){return this.invocationId}get currentDeviceId(){return this.deviceId}get currentLibc(){return this.cliDevice?.libc}get currentSessionId(){return this.sessionId}get readonlyEvents(){return Array.from(this.events)}reset(){this.events=[],this.commandTrace=void 0,this.localCommandEvent=void 0,this.localEvents=[]}allowOptOutSend(){this.sendOptOut=!0}get enabled(){return process.env.VERCEL_TELEMETRY_DISABLED?!1:this.config?.enabled??!0}setCommandTrace(event,buildLabel,localEvent,localEvents=[]){this.commandTrace={event,buildLabel},this.localCommandEvent=localEvent,this.localEvents=localEvents}getCommandTrace(){let local=this.localCommandEvent;if(!this.commandTrace||!local)return this.commandTrace;let spans=localWaterfall(local,[...startupEvents(local),...this.localEvents]);return spans.length?{...this.commandTrace,event:{...this.commandTrace.event,parentId:local.parentId},spans}:this.commandTrace}async save({detach=!1}={}){if(this.cliSession&&this.cliSessionOptions&&(this.cliSession=touchPersistedCliSession(this.cliSessionOptions,this.cliSession)),this.isDebug){output_manager_default.log(`${LogLabel} Flushing Events`);for(let event of this.events)event.teamId=this.teamId,event.userId=this.userId,event.projectId=this.projectId,output_manager_default.log(JSON.stringify(event));let commandTrace=this.getCommandTrace();commandTrace&&output_manager_default.log(`${LogLabel} Command trace ${JSON.stringify(commandTrace)}`);return}if(this.enabled||this.sendOptOut){this.sendOptOut=!1;let commandTrace=this.getCommandTrace(),sessionId=this.events[0]?.sessionId;if(!sessionId){output_manager_default.debug("Unable to send metrics: no session ID");return}let events=this.events.map(event=>{let{eventTime,invocationId,...rest}=event;return delete rest.sessionId,delete rest.teamId,delete rest.userId,delete rest.projectId,{event_time:eventTime,invocation_id:invocationId,team_id:this.teamId,user_id:this.userId,project_id:this.projectId,...rest}});if(detach&&commandTrace?.spans&&Buffer.byteLength(JSON.stringify(commandTrace))>16384){let{parentId:_parentId,...event}=commandTrace.event;commandTrace={event,buildLabel:commandTrace.buildLabel}}let payload={invocationId:this.invocationId,headers:{"Client-id":"vercel-cli","x-vercel-cli-topic-id":"generic","x-vercel-cli-session-id":sessionId},body:events,...commandTrace?{commandTrace}:{}};await this.sendToSubprocess(payload,output_manager_default.debugEnabled&&!detach)}}async sendToSubprocess(payload,outputDebugEnabled){let serialized=encodeHandoff(payload),flushArgs=["telemetry","flush"];this.globalConfigDir&&flushArgs.push("--global-config",this.globalConfigDir);let script;if(readLaunch()?.runtime==="native")script=flushArgs;else{let cliEntryPoint=process.argv[1];if(!cliEntryPoint)return;script=[cliEntryPoint,...flushArgs]}let nodeBinaryPath=process.execPath,env=(0,import_build_utils.cloneEnv)(this.#startupEnv,{VERCEL_TELEMETRY_DISABLED:"1"});for(let key of Object.keys(env))key.toUpperCase()==="VERCEL_VC_NATIVE"&&delete env[key];if(outputDebugEnabled)return new Promise(resolve=>{let childProcess=spawn(nodeBinaryPath,script,{cwd:this.#startupCwd,env,stdio:["pipe","pipe","pipe"]});childProcess.stdin.on("error",()=>{}),childProcess.stdin.end(serialized),childProcess.stderr.on("data",data=>output_manager_default.debug(data.toString())),childProcess.stdout.on("data",data=>output_manager_default.debug(data.toString())),childProcess.on("error",d=>{output_manager_default.debug(d),clearTimeout(timeout),resolve()});let timeout=setTimeout(()=>{output_manager_default.debug("Telemetry subprocess killed due to timeout"),childProcess.kill()},2e3);childProcess.on("exit",code=>{output_manager_default.debug(`Telemetry subprocess exited with code ${code}`),childProcess.unref(),clearTimeout(timeout),resolve()})});{let childProcess=spawn(nodeBinaryPath,script,{stdio:["pipe","ignore","ignore"],cwd:this.#startupCwd,env,windowsHide:!0,detached:!0});childProcess.on("error",()=>{}),childProcess.stdin.on("error",()=>{}),childProcess.stdin.end(serialized),childProcess.unref()}}};export{readLaunch,require_ci_info,getStartupDurationMs,toCommandTrace,markStartup,decodeHandoff,TelemetryClient,TelemetryEventStore};
|
|
11
11
|
/*! Bundled license information:
|
|
12
12
|
|
|
@@ -4,4 +4,4 @@ import { dirname as __dirname_ } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __dirname_(__filename);
|
|
7
|
-
import{pkg_default}from"./chunk-
|
|
7
|
+
import{pkg_default}from"./chunk-JCDPMWKO.js";import os from"os";var ua_default=`${pkg_default.name} ${pkg_default.version} node-${process.version} ${os.platform()} (${os.arch()})`;export{ua_default};
|