@semiont/cli 0.5.2 → 0.5.3
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/cli.mjs +44 -10
- package/dist/frontend/dist/assets/{CookiePreferences-5feiOAX4.js → CookiePreferences-BizeRUGG.js} +2 -2
- package/dist/frontend/dist/assets/{CookiePreferences-5feiOAX4.js.map → CookiePreferences-BizeRUGG.js.map} +1 -1
- package/dist/frontend/dist/assets/{PdfAnnotationCanvas.client-5QESNO5H-Cxm4Es_X.js → PdfAnnotationCanvas.client-5QESNO5H-C_S4hy6Q.js} +2 -2
- package/dist/frontend/dist/assets/{PdfAnnotationCanvas.client-5QESNO5H-Cxm4Es_X.js.map → PdfAnnotationCanvas.client-5QESNO5H-C_S4hy6Q.js.map} +1 -1
- package/dist/frontend/dist/assets/{ToolbarPanels-D5L18Wxk.js → ToolbarPanels-Cz2uv68j.js} +2 -2
- package/dist/frontend/dist/assets/{ToolbarPanels-D5L18Wxk.js.map → ToolbarPanels-Cz2uv68j.js.map} +1 -1
- package/dist/frontend/dist/assets/ar-UUMMNQKF-xeh4Cwx2.js +2 -0
- package/dist/frontend/dist/assets/ar-UUMMNQKF-xeh4Cwx2.js.map +1 -0
- package/dist/frontend/dist/assets/bn-AL5BJSR3-Dz19S8vN.js +2 -0
- package/dist/frontend/dist/assets/bn-AL5BJSR3-Dz19S8vN.js.map +1 -0
- package/dist/frontend/dist/assets/{client-CTyYgbIC.js → client-BrB8xl9P.js} +2 -2
- package/dist/frontend/dist/assets/{client-CTyYgbIC.js.map → client-BrB8xl9P.js.map} +1 -1
- package/dist/frontend/dist/assets/{client-BmABw25x.js → client-C5p1ZZtM.js} +2 -2
- package/dist/frontend/dist/assets/{client-BmABw25x.js.map → client-C5p1ZZtM.js.map} +1 -1
- package/dist/frontend/dist/assets/{client-D7w_vlsg.js → client-D6q4B6bq.js} +2 -2
- package/dist/frontend/dist/assets/{client-D7w_vlsg.js.map → client-D6q4B6bq.js.map} +1 -1
- package/dist/frontend/dist/assets/{client-Cjf1Te8y.js → client-SkLMw-j7.js} +2 -2
- package/dist/frontend/dist/assets/{client-Cjf1Te8y.js.map → client-SkLMw-j7.js.map} +1 -1
- package/dist/frontend/dist/assets/cs-UMINALSU-HHT-dcWL.js +2 -0
- package/dist/frontend/dist/assets/cs-UMINALSU-HHT-dcWL.js.map +1 -0
- package/dist/frontend/dist/assets/da-FKUX6CDL-BpdJ67RW.js +2 -0
- package/dist/frontend/dist/assets/da-FKUX6CDL-BpdJ67RW.js.map +1 -0
- package/dist/frontend/dist/assets/de-XSJ3E25S-DJ6EvHYY.js +2 -0
- package/dist/frontend/dist/assets/de-XSJ3E25S-DJ6EvHYY.js.map +1 -0
- package/dist/frontend/dist/assets/el-UJXNRCBP-DhRdKHlx.js +2 -0
- package/dist/frontend/dist/assets/el-UJXNRCBP-DhRdKHlx.js.map +1 -0
- package/dist/frontend/dist/assets/es-VURP62BU-CgnB380t.js +2 -0
- package/dist/frontend/dist/assets/es-VURP62BU-CgnB380t.js.map +1 -0
- package/dist/frontend/dist/assets/{fa-V6JZJDYP-C8CwCeSd.js → fa-TIT5ZPZY-D28qBiUW.js} +2 -2
- package/dist/frontend/dist/assets/fa-TIT5ZPZY-D28qBiUW.js.map +1 -0
- package/dist/frontend/dist/assets/fi-F7VTGT4H-BeG0kw0Q.js +2 -0
- package/dist/frontend/dist/assets/fi-F7VTGT4H-BeG0kw0Q.js.map +1 -0
- package/dist/frontend/dist/assets/fr-2ZR26VF7-BwamaA96.js +2 -0
- package/dist/frontend/dist/assets/fr-2ZR26VF7-BwamaA96.js.map +1 -0
- package/dist/frontend/dist/assets/he-BXP2KYVZ-DuKmwNm_.js +2 -0
- package/dist/frontend/dist/assets/he-BXP2KYVZ-DuKmwNm_.js.map +1 -0
- package/dist/frontend/dist/assets/hi-PSWTP3NC-B7v6ttqy.js +2 -0
- package/dist/frontend/dist/assets/hi-PSWTP3NC-B7v6ttqy.js.map +1 -0
- package/dist/frontend/dist/assets/id-HO6TXGTO-Dj1JW3-q.js +2 -0
- package/dist/frontend/dist/assets/id-HO6TXGTO-Dj1JW3-q.js.map +1 -0
- package/dist/frontend/dist/assets/{index-BVOR3arc.js → index-QjYSiWWG.js} +53 -53
- package/dist/frontend/dist/assets/index-QjYSiWWG.js.map +1 -0
- package/dist/frontend/dist/assets/it-AGTDMBL3-Bq_I1CA1.js +2 -0
- package/dist/frontend/dist/assets/it-AGTDMBL3-Bq_I1CA1.js.map +1 -0
- package/dist/frontend/dist/assets/ja-TTGOVF5K-CkAQueln.js +2 -0
- package/dist/frontend/dist/assets/ja-TTGOVF5K-CkAQueln.js.map +1 -0
- package/dist/frontend/dist/assets/ko-FF77IQ7N-fJgs5Roz.js +2 -0
- package/dist/frontend/dist/assets/ko-FF77IQ7N-fJgs5Roz.js.map +1 -0
- package/dist/frontend/dist/assets/{layout-B1HJjFMW.js → layout-BO_gP65g.js} +2 -2
- package/dist/frontend/dist/assets/{layout-B1HJjFMW.js.map → layout-BO_gP65g.js.map} +1 -1
- package/dist/frontend/dist/assets/{layout-B7mIcfJU.js → layout-C-P8uUyx.js} +2 -2
- package/dist/frontend/dist/assets/{layout-B7mIcfJU.js.map → layout-C-P8uUyx.js.map} +1 -1
- package/dist/frontend/dist/assets/{layout-Cw-T4GPy.js → layout-C7qxASOF.js} +2 -2
- package/dist/frontend/dist/assets/{layout-Cw-T4GPy.js.map → layout-C7qxASOF.js.map} +1 -1
- package/dist/frontend/dist/assets/{layout-BK6OF3Hx.js → layout-DVrTweI_.js} +2 -2
- package/dist/frontend/dist/assets/{layout-BK6OF3Hx.js.map → layout-DVrTweI_.js.map} +1 -1
- package/dist/frontend/dist/assets/ms-UPQWWIL4-DEDFniGv.js +2 -0
- package/dist/frontend/dist/assets/ms-UPQWWIL4-DEDFniGv.js.map +1 -0
- package/dist/frontend/dist/assets/nl-W75HEPFL-D2_VQYac.js +2 -0
- package/dist/frontend/dist/assets/nl-W75HEPFL-D2_VQYac.js.map +1 -0
- package/dist/frontend/dist/assets/no-R4W7W7ZU-Duk86nrT.js +2 -0
- package/dist/frontend/dist/assets/no-R4W7W7ZU-Duk86nrT.js.map +1 -0
- package/dist/frontend/dist/assets/{not-found-uRBdv-bF.js → not-found-CVsHHn2n.js} +2 -2
- package/dist/frontend/dist/assets/{not-found-uRBdv-bF.js.map → not-found-CVsHHn2n.js.map} +1 -1
- package/dist/frontend/dist/assets/{page-CBL0MuAo.js → page-3CgxsYbh.js} +2 -2
- package/dist/frontend/dist/assets/{page-CBL0MuAo.js.map → page-3CgxsYbh.js.map} +1 -1
- package/dist/frontend/dist/assets/{page-BLt9SJto.js → page-8S-MQzsq.js} +2 -2
- package/dist/frontend/dist/assets/{page-BLt9SJto.js.map → page-8S-MQzsq.js.map} +1 -1
- package/dist/frontend/dist/assets/{page-Bnawjb1Y.js → page-B-leMN2k.js} +2 -2
- package/dist/frontend/dist/assets/{page-Bnawjb1Y.js.map → page-B-leMN2k.js.map} +1 -1
- package/dist/frontend/dist/assets/{page-CKCKmPQO.js → page-B5Dz_Nh-.js} +2 -2
- package/dist/frontend/dist/assets/{page-CKCKmPQO.js.map → page-B5Dz_Nh-.js.map} +1 -1
- package/dist/frontend/dist/assets/{page-5wC1as95.js → page-BfKm2iQ2.js} +2 -2
- package/dist/frontend/dist/assets/{page-5wC1as95.js.map → page-BfKm2iQ2.js.map} +1 -1
- package/dist/frontend/dist/assets/{page-wxqWVnqc.js → page-Br5SeiDL.js} +2 -2
- package/dist/frontend/dist/assets/{page-wxqWVnqc.js.map → page-Br5SeiDL.js.map} +1 -1
- package/dist/frontend/dist/assets/page-C6_MlYjr.js +2 -0
- package/dist/frontend/dist/assets/{page-C7vfVcap.js.map → page-C6_MlYjr.js.map} +1 -1
- package/dist/frontend/dist/assets/page-CXE3Zhkq.js +2 -0
- package/dist/frontend/dist/assets/page-CXE3Zhkq.js.map +1 -0
- package/dist/frontend/dist/assets/{page-CdqGKYBH.js → page-Cg1IhnH2.js} +2 -2
- package/dist/frontend/dist/assets/{page-CdqGKYBH.js.map → page-Cg1IhnH2.js.map} +1 -1
- package/dist/frontend/dist/assets/{page-BlU7QK_-.js → page-CqV1yD4w.js} +2 -2
- package/dist/frontend/dist/assets/{page-BlU7QK_-.js.map → page-CqV1yD4w.js.map} +1 -1
- package/dist/frontend/dist/assets/{page-Bcljtfsa.js → page-D6saO7D3.js} +2 -2
- package/dist/frontend/dist/assets/{page-Bcljtfsa.js.map → page-D6saO7D3.js.map} +1 -1
- package/dist/frontend/dist/assets/{page-Dgqi9Orl.js → page-D7ZN9Yo5.js} +2 -2
- package/dist/frontend/dist/assets/{page-Dgqi9Orl.js.map → page-D7ZN9Yo5.js.map} +1 -1
- package/dist/frontend/dist/assets/{page-CfMLSllg.js → page-DaL8x94G.js} +2 -2
- package/dist/frontend/dist/assets/{page-CfMLSllg.js.map → page-DaL8x94G.js.map} +1 -1
- package/dist/frontend/dist/assets/{page-BNaAGnc3.js → page-Dj5UZ_d6.js} +2 -2
- package/dist/frontend/dist/assets/{page-BNaAGnc3.js.map → page-Dj5UZ_d6.js.map} +1 -1
- package/dist/frontend/dist/assets/{page-SrDV7XYv.js → page-DyGU2n2w.js} +2 -2
- package/dist/frontend/dist/assets/{page-SrDV7XYv.js.map → page-DyGU2n2w.js.map} +1 -1
- package/dist/frontend/dist/assets/{page-D7w7NNd7.js → page-E4A7Vkwl.js} +2 -2
- package/dist/frontend/dist/assets/{page-D7w7NNd7.js.map → page-E4A7Vkwl.js.map} +1 -1
- package/dist/frontend/dist/assets/{page-Bf4MMijQ.js → page-OFxNMOoF.js} +2 -2
- package/dist/frontend/dist/assets/{page-Bf4MMijQ.js.map → page-OFxNMOoF.js.map} +1 -1
- package/dist/frontend/dist/assets/{page-DAH06BM4.js → page-RRMlL_4-.js} +2 -2
- package/dist/frontend/dist/assets/{page-DAH06BM4.js.map → page-RRMlL_4-.js.map} +1 -1
- package/dist/frontend/dist/assets/pl-GQC2ELWO-CYs9xZGI.js +2 -0
- package/dist/frontend/dist/assets/pl-GQC2ELWO-CYs9xZGI.js.map +1 -0
- package/dist/frontend/dist/assets/{privacy-Kk_oWnpO.js → privacy-Rbj4Ycw9.js} +2 -2
- package/dist/frontend/dist/assets/{privacy-Kk_oWnpO.js.map → privacy-Rbj4Ycw9.js.map} +1 -1
- package/dist/frontend/dist/assets/pt-YGVT62RU-pnVyr-_6.js +2 -0
- package/dist/frontend/dist/assets/pt-YGVT62RU-pnVyr-_6.js.map +1 -0
- package/dist/frontend/dist/assets/ro-TST6XS6X-CRozzX2s.js +2 -0
- package/dist/frontend/dist/assets/ro-TST6XS6X-CRozzX2s.js.map +1 -0
- package/dist/frontend/dist/assets/{routing-CKNCPdYO.js → routing-CUnWbO2L.js} +2 -2
- package/dist/frontend/dist/assets/{routing-CKNCPdYO.js.map → routing-CUnWbO2L.js.map} +1 -1
- package/dist/frontend/dist/assets/{routing-CGghUc0N.js → routing-CxPkffyg.js} +2 -2
- package/dist/frontend/dist/assets/{routing-CGghUc0N.js.map → routing-CxPkffyg.js.map} +1 -1
- package/dist/frontend/dist/assets/sv-TQLF6HV7-DNDzEE6l.js +2 -0
- package/dist/frontend/dist/assets/sv-TQLF6HV7-DNDzEE6l.js.map +1 -0
- package/dist/frontend/dist/assets/th-HJUIETVR-C8TRIJwR.js +2 -0
- package/dist/frontend/dist/assets/th-HJUIETVR-C8TRIJwR.js.map +1 -0
- package/dist/frontend/dist/assets/tr-CW3C46TW-wpHSGdDw.js +2 -0
- package/dist/frontend/dist/assets/tr-CW3C46TW-wpHSGdDw.js.map +1 -0
- package/dist/frontend/dist/assets/uk-WTHZQB2U-3kAkt5-3.js +2 -0
- package/dist/frontend/dist/assets/uk-WTHZQB2U-3kAkt5-3.js.map +1 -0
- package/dist/frontend/dist/assets/vi-PHWHJLKP-DYHi4xUC.js +2 -0
- package/dist/frontend/dist/assets/vi-PHWHJLKP-DYHi4xUC.js.map +1 -0
- package/dist/frontend/dist/assets/{web-DdXPBk3h.js → web-C8yeWrxL.js} +2 -2
- package/dist/frontend/dist/assets/{web-DdXPBk3h.js.map → web-C8yeWrxL.js.map} +1 -1
- package/dist/frontend/dist/assets/zh-MO3FCUD6-CLkb7wBO.js +2 -0
- package/dist/frontend/dist/assets/zh-MO3FCUD6-CLkb7wBO.js.map +1 -0
- package/dist/frontend/dist/index.html +1 -1
- package/dist/frontend/dist/messages/ar.json +1 -16
- package/dist/frontend/dist/messages/bn.json +1 -16
- package/dist/frontend/dist/messages/cs.json +1 -16
- package/dist/frontend/dist/messages/da.json +1 -16
- package/dist/frontend/dist/messages/de.json +1 -16
- package/dist/frontend/dist/messages/el.json +1 -16
- package/dist/frontend/dist/messages/en.json +1 -16
- package/dist/frontend/dist/messages/es.json +1 -16
- package/dist/frontend/dist/messages/fa.json +1 -16
- package/dist/frontend/dist/messages/fi.json +1 -16
- package/dist/frontend/dist/messages/fr.json +1 -16
- package/dist/frontend/dist/messages/he.json +1 -16
- package/dist/frontend/dist/messages/hi.json +1 -16
- package/dist/frontend/dist/messages/id.json +1 -16
- package/dist/frontend/dist/messages/it.json +1 -16
- package/dist/frontend/dist/messages/ja.json +1 -16
- package/dist/frontend/dist/messages/ko.json +1 -16
- package/dist/frontend/dist/messages/ms.json +1 -16
- package/dist/frontend/dist/messages/nl.json +1 -16
- package/dist/frontend/dist/messages/no.json +1 -16
- package/dist/frontend/dist/messages/pl.json +1 -16
- package/dist/frontend/dist/messages/pt.json +1 -16
- package/dist/frontend/dist/messages/ro.json +1 -16
- package/dist/frontend/dist/messages/sv.json +1 -16
- package/dist/frontend/dist/messages/th.json +1 -16
- package/dist/frontend/dist/messages/tr.json +1 -16
- package/dist/frontend/dist/messages/uk.json +1 -16
- package/dist/frontend/dist/messages/vi.json +1 -16
- package/dist/frontend/dist/messages/zh.json +1 -16
- package/dist/frontend/package.json +1 -1
- package/package.json +8 -8
- package/dist/frontend/dist/assets/ar-3W37O3R3-BJ1fDUvB.js +0 -2
- package/dist/frontend/dist/assets/ar-3W37O3R3-BJ1fDUvB.js.map +0 -1
- package/dist/frontend/dist/assets/bn-JZTJLMVE-k1gI6ffq.js +0 -2
- package/dist/frontend/dist/assets/bn-JZTJLMVE-k1gI6ffq.js.map +0 -1
- package/dist/frontend/dist/assets/cs-XYHH7HNE-BqQWIWM9.js +0 -2
- package/dist/frontend/dist/assets/cs-XYHH7HNE-BqQWIWM9.js.map +0 -1
- package/dist/frontend/dist/assets/da-MZKIECVT-pufSb0d_.js +0 -2
- package/dist/frontend/dist/assets/da-MZKIECVT-pufSb0d_.js.map +0 -1
- package/dist/frontend/dist/assets/de-AYXTMRQW-BRMduIa0.js +0 -2
- package/dist/frontend/dist/assets/de-AYXTMRQW-BRMduIa0.js.map +0 -1
- package/dist/frontend/dist/assets/el-A6CVQWAW-DycBhXUi.js +0 -2
- package/dist/frontend/dist/assets/el-A6CVQWAW-DycBhXUi.js.map +0 -1
- package/dist/frontend/dist/assets/es-M2HXLJGT-BFQ6WIpw.js +0 -2
- package/dist/frontend/dist/assets/es-M2HXLJGT-BFQ6WIpw.js.map +0 -1
- package/dist/frontend/dist/assets/fa-V6JZJDYP-C8CwCeSd.js.map +0 -1
- package/dist/frontend/dist/assets/fi-ONDTZ5H7-aby5--Ip.js +0 -2
- package/dist/frontend/dist/assets/fi-ONDTZ5H7-aby5--Ip.js.map +0 -1
- package/dist/frontend/dist/assets/fr-PAPV4H4G-D9SFT8MA.js +0 -2
- package/dist/frontend/dist/assets/fr-PAPV4H4G-D9SFT8MA.js.map +0 -1
- package/dist/frontend/dist/assets/he-F6VTLJLW-B8Rc1C-m.js +0 -2
- package/dist/frontend/dist/assets/he-F6VTLJLW-B8Rc1C-m.js.map +0 -1
- package/dist/frontend/dist/assets/hi-CFUAV4BF-CuWy2y7I.js +0 -2
- package/dist/frontend/dist/assets/hi-CFUAV4BF-CuWy2y7I.js.map +0 -1
- package/dist/frontend/dist/assets/id-NBKLCCI7-DnMwKKq7.js +0 -2
- package/dist/frontend/dist/assets/id-NBKLCCI7-DnMwKKq7.js.map +0 -1
- package/dist/frontend/dist/assets/index-BVOR3arc.js.map +0 -1
- package/dist/frontend/dist/assets/it-SLSOWVVU-hrlm8f9F.js +0 -2
- package/dist/frontend/dist/assets/it-SLSOWVVU-hrlm8f9F.js.map +0 -1
- package/dist/frontend/dist/assets/ja-L5IG4ECE-BvMVB5sy.js +0 -2
- package/dist/frontend/dist/assets/ja-L5IG4ECE-BvMVB5sy.js.map +0 -1
- package/dist/frontend/dist/assets/ko-QYMTULKK-CNEZe0oy.js +0 -2
- package/dist/frontend/dist/assets/ko-QYMTULKK-CNEZe0oy.js.map +0 -1
- package/dist/frontend/dist/assets/ms-5DGSFKM2-BlyezW6W.js +0 -2
- package/dist/frontend/dist/assets/ms-5DGSFKM2-BlyezW6W.js.map +0 -1
- package/dist/frontend/dist/assets/nl-VZPCGONO-BJ0llUPS.js +0 -2
- package/dist/frontend/dist/assets/nl-VZPCGONO-BJ0llUPS.js.map +0 -1
- package/dist/frontend/dist/assets/no-MF6F352I-Wf2ZNjHx.js +0 -2
- package/dist/frontend/dist/assets/no-MF6F352I-Wf2ZNjHx.js.map +0 -1
- package/dist/frontend/dist/assets/page-B6XEk2Ue.js +0 -2
- package/dist/frontend/dist/assets/page-B6XEk2Ue.js.map +0 -1
- package/dist/frontend/dist/assets/page-C7vfVcap.js +0 -2
- package/dist/frontend/dist/assets/pl-WIK72JUO-wOGg7Me5.js +0 -2
- package/dist/frontend/dist/assets/pl-WIK72JUO-wOGg7Me5.js.map +0 -1
- package/dist/frontend/dist/assets/pt-RRP5ZF6A-C32Vedhv.js +0 -2
- package/dist/frontend/dist/assets/pt-RRP5ZF6A-C32Vedhv.js.map +0 -1
- package/dist/frontend/dist/assets/ro-XHQLC3T7-uGs3uHRp.js +0 -2
- package/dist/frontend/dist/assets/ro-XHQLC3T7-uGs3uHRp.js.map +0 -1
- package/dist/frontend/dist/assets/sv-EWULDN6E-CkRBfwt9.js +0 -2
- package/dist/frontend/dist/assets/sv-EWULDN6E-CkRBfwt9.js.map +0 -1
- package/dist/frontend/dist/assets/th-TGOBHFG4-BGt_aO5K.js +0 -2
- package/dist/frontend/dist/assets/th-TGOBHFG4-BGt_aO5K.js.map +0 -1
- package/dist/frontend/dist/assets/tr-LMMPBMV7-CrGE1PKA.js +0 -2
- package/dist/frontend/dist/assets/tr-LMMPBMV7-CrGE1PKA.js.map +0 -1
- package/dist/frontend/dist/assets/uk-IPGRRJY6-CPaxgpd8.js +0 -2
- package/dist/frontend/dist/assets/uk-IPGRRJY6-CPaxgpd8.js.map +0 -1
- package/dist/frontend/dist/assets/vi-Q676OJQS-DpyIm6R1.js +0 -2
- package/dist/frontend/dist/assets/vi-Q676OJQS-DpyIm6R1.js.map +0 -1
- package/dist/frontend/dist/assets/zh-F3MTWQDX-C09t_PFf.js +0 -2
- package/dist/frontend/dist/assets/zh-F3MTWQDX-C09t_PFf.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var qt=Object.defineProperty;var Wt=(e,t,r)=>t in e?qt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var o=(e,t,r)=>Wt(e,typeof t!="symbol"?t+"":t,r);import{aj as Jt,ak as Zt,al as te,am as I,an as S,ao as It,ap as P,aq as D,ar as ee,as as T,at as re,au as ne,av as se,aw as R}from"./index-BVOR3arc.js";import"./vendor-DJo4KD8w.js";import"./i18n-BbpF47i1.js";var k;(function(e){e[e.NOT_RECORD=0]="NOT_RECORD",e[e.RECORD=1]="RECORD",e[e.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(k||(k={}));var d=Jt.instance();class ie{constructor(t){o(this,"_delegate");this._delegate=t}export(t,r){this._delegate.export(t,r)}forceFlush(){return this._delegate.forceFlush()}shutdown(){return this._delegate.shutdown()}}class ht extends Error{constructor(r,n,s){super(r);o(this,"code");o(this,"name","OTLPExporterError");o(this,"data");this.data=s,this.code=n}}function oe(e){if(Number.isFinite(e)&&e>0)return e;throw new Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${e}')`)}function ae(e){if(e!=null)return async()=>e}function ce(e,t,r){return{timeoutMillis:oe(e.timeoutMillis??t.timeoutMillis??r.timeoutMillis),concurrencyLimit:e.concurrencyLimit??t.concurrencyLimit??r.concurrencyLimit,compression:e.compression??t.compression??r.compression}}function ue(){return{timeoutMillis:1e4,concurrencyLimit:30,compression:"none"}}class le{constructor(t){o(this,"_concurrencyLimit");o(this,"_sendingPromises",[]);this._concurrencyLimit=t}pushPromise(t){if(this.hasReachedLimit())throw new Error("Concurrency Limit reached");this._sendingPromises.push(t);const r=()=>{const n=this._sendingPromises.indexOf(t);this._sendingPromises.splice(n,1)};t.then(r,r)}hasReachedLimit(){return this._sendingPromises.length>=this._concurrencyLimit}async awaitAll(){await Promise.all(this._sendingPromises)}}function de(e){return new le(e.concurrencyLimit)}const Nt=Zt("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function he(e){return e.setValue(Nt,!0)}function ut(e){return e.getValue(Nt)===!0}const pe="=",Mt=";",nt=",",X="baggage",fe=180,_e=4096,me=8192;function Se(e){return e.reduce((t,r)=>{const n=`${t}${t!==""?nt:""}${r}`;return n.length>me?t:n},"")}function ge(e){return e.getAllEntries().map(([t,r])=>{let n=`${encodeURIComponent(t)}=${encodeURIComponent(r.value)}`;return r.metadata!==void 0&&(n+=Mt+r.metadata.toString()),n})}function Ee(e){if(!e)return;const t=e.indexOf(Mt),r=t===-1?e:e.substring(0,t),n=r.indexOf(pe);if(n<=0)return;const s=r.substring(0,n).trim(),i=r.substring(n+1).trim();if(!s||!i)return;let a,c;try{a=decodeURIComponent(s),c=decodeURIComponent(i)}catch{return}let u;if(t!==-1&&t<e.length-1){const l=e.substring(t+1);u=te(l)}return{key:a,value:c,metadata:u}}class Ae{inject(t,r,n){const s=I.getBaggage(t);if(!s||ut(t))return;const i=ge(s).filter(c=>c.length<=_e).slice(0,fe),a=Se(i);a.length>0&&n.set(r,X,a)}extract(t,r,n){const s=n.get(r,X),i=Array.isArray(s)?s.join(nt):s;if(!i)return t;const a={};return i.length===0||(i.split(nt).forEach(u=>{const l=Ee(u);if(l){const h={value:l.value};l.metadata&&(h.metadata=l.metadata),a[l.key]=h}}),Object.entries(a).length===0)?t:I.setBaggage(t,I.createBaggage(a))}fields(){return[X]}}function N(e){const t={};if(typeof e!="object"||e==null)return t;for(const r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;if(!be(r)){d.warn(`Invalid attribute key: ${r}`);continue}const n=e[r];if(!Dt(n)){d.warn(`Invalid attribute value set for key: ${r}`);continue}Array.isArray(n)?t[r]=n.slice():t[r]=n}return t}function be(e){return typeof e=="string"&&e!==""}function Dt(e){return e==null?!0:Array.isArray(e)?Te(e):vt(typeof e)}function Te(e){let t;for(const r of e){if(r==null)continue;const n=typeof r;if(n!==t){if(!t){if(vt(n)){t=n;continue}return!1}return!1}}return!0}function vt(e){switch(e){case"number":case"boolean":case"string":return!0}return!1}function ye(){return e=>{d.error(we(e))}}function we(e){return typeof e=="string"?e:JSON.stringify(Le(e))}function Le(e){const t={};let r=e;for(;r!==null;)Object.getOwnPropertyNames(r).forEach(n=>{if(t[n])return;const s=r[n];s&&(t[n]=String(s))}),r=Object.getPrototypeOf(r);return t}let Pe=ye();function C(e){try{Pe(e)}catch{}}const Ce="2.7.0",Q="exception.message",Re="exception.stacktrace",Y="exception.type",Ut="service.name",Oe="service.version",st="telemetry.sdk.language",xe="webjs",it="telemetry.sdk.name",ot="telemetry.sdk.version",Ie="process.runtime.name",q={[it]:"opentelemetry",[Ie]:"browser",[st]:xe,[ot]:Ce},y=performance,Ne=9,Me=6,De=Math.pow(10,Me),F=Math.pow(10,Ne);function w(e){const t=e/1e3,r=Math.trunc(t),n=Math.round(e%1e3*De);return[r,n]}function ve(e){const t=w(y.timeOrigin),r=w(typeof e=="number"?e:y.now());return $t(t,r)}function Ue(e,t){let r=t[0]-e[0],n=t[1]-e[1];return n<0&&(r-=1,n+=F),[r,n]}function Be(e){return e[0]*F+e[1]}function pt(e){return e[0]*1e6+e[1]/1e3}function Bt(e){return Array.isArray(e)&&e.length===2&&typeof e[0]=="number"&&typeof e[1]=="number"}function ft(e){return Bt(e)||typeof e=="number"||e instanceof Date}function $t(e,t){const r=[e[0]+t[0],e[1]+t[1]];return r[1]>=F&&(r[1]-=F,r[0]+=1),r}var _;(function(e){e[e.SUCCESS=0]="SUCCESS",e[e.FAILED=1]="FAILED"})(_||(_={}));class $e{constructor(t={}){o(this,"_propagators");o(this,"_fields");this._propagators=t.propagators??[],this._fields=Array.from(new Set(this._propagators.map(r=>typeof r.fields=="function"?r.fields():[]).reduce((r,n)=>r.concat(n),[])))}inject(t,r,n){for(const s of this._propagators)try{s.inject(t,r,n)}catch(i){d.warn(`Failed to inject with ${s.constructor.name}. Err: ${i.message}`)}}extract(t,r,n){return this._propagators.reduce((s,i)=>{try{return i.extract(s,r,n)}catch(a){d.warn(`Failed to extract with ${i.constructor.name}. Err: ${a.message}`)}return s},t)}fields(){return this._fields.slice()}}const at="[_0-9a-z-*/]",ke=`[a-z]${at}{0,255}`,Fe=`[a-z0-9]${at}{0,240}@[a-z]${at}{0,13}`,je=new RegExp(`^(?:${ke}|${Fe})$`),ze=/^[ -~]{0,255}[!-~]$/,Ve=/,|=/;function Ge(e){return je.test(e)}function He(e){return ze.test(e)&&!Ve.test(e)}const _t=32,Ke=512,mt=",",St="=";class lt{constructor(t){o(this,"_internalState",new Map);t&&this._parse(t)}set(t,r){const n=this._clone();return n._internalState.has(t)&&n._internalState.delete(t),n._internalState.set(t,r),n}unset(t){const r=this._clone();return r._internalState.delete(t),r}get(t){return this._internalState.get(t)}serialize(){return this._keys().reduce((t,r)=>(t.push(r+St+this.get(r)),t),[]).join(mt)}_parse(t){t.length>Ke||(this._internalState=t.split(mt).reverse().reduce((r,n)=>{const s=n.trim(),i=s.indexOf(St);if(i!==-1){const a=s.slice(0,i),c=s.slice(i+1,n.length);Ge(a)&&He(c)&&r.set(a,c)}return r},new Map),this._internalState.size>_t&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,_t))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){const t=new lt;return t._internalState=new Map(this._internalState),t}}const W="traceparent",J="tracestate",Xe="00",Qe="(?!ff)[\\da-f]{2}",Ye="(?![0]{32})[\\da-f]{32}",qe="(?![0]{16})[\\da-f]{16}",We="[\\da-f]{2}",Je=new RegExp(`^\\s?(${Qe})-(${Ye})-(${qe})-(${We})(-.*)?\\s?$`);function Ze(e){const t=Je.exec(e);return!t||t[1]==="00"&&t[5]?null:{traceId:t[2],spanId:t[3],traceFlags:parseInt(t[4],16)}}class tr{inject(t,r,n){const s=S.getSpanContext(t);if(!s||ut(t)||!It(s))return;const i=`${Xe}-${s.traceId}-${s.spanId}-0${Number(s.traceFlags||P.NONE).toString(16)}`;n.set(r,W,i),s.traceState&&n.set(r,J,s.traceState.serialize())}extract(t,r,n){const s=n.get(r,W);if(!s)return t;const i=Array.isArray(s)?s[0]:s;if(typeof i!="string")return t;const a=Ze(i);if(!a)return t;a.isRemote=!0;const c=n.get(r,J);if(c){const u=Array.isArray(c)?c.join(","):c;a.traceState=new lt(typeof u=="string"?u:void 0)}return S.setSpanContext(t,a)}fields(){return[W,J]}}const er="[object Object]",rr="[object Null]",nr="[object Undefined]",sr=Function.prototype,kt=sr.toString,ir=kt.call(Object),or=Object.getPrototypeOf,Ft=Object.prototype,jt=Ft.hasOwnProperty,A=Symbol?Symbol.toStringTag:void 0,zt=Ft.toString;function gt(e){if(!ar(e)||cr(e)!==er)return!1;const t=or(e);if(t===null)return!0;const r=jt.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&kt.call(r)===ir}function ar(e){return e!=null&&typeof e=="object"}function cr(e){return e==null?e===void 0?nr:rr:A&&A in Object(e)?ur(e):lr(e)}function ur(e){const t=jt.call(e,A),r=e[A];let n=!1;try{e[A]=void 0,n=!0}catch{}const s=zt.call(e);return n&&(t?e[A]=r:delete e[A]),s}function lr(e){return zt.call(e)}const dr=20;function hr(...e){let t=e.shift();const r=new WeakMap;for(;e.length>0;)t=Vt(t,e.shift(),0,r);return t}function Z(e){return j(e)?e.slice():e}function Vt(e,t,r=0,n){let s;if(!(r>dr)){if(r++,$(e)||$(t)||Gt(t))s=Z(t);else if(j(e)){if(s=e.slice(),j(t))for(let i=0,a=t.length;i<a;i++)s.push(Z(t[i]));else if(O(t)){const i=Object.keys(t);for(let a=0,c=i.length;a<c;a++){const u=i[a];u==="__proto__"||u==="constructor"||u==="prototype"||(s[u]=Z(t[u]))}}}else if(O(e))if(O(t)){if(!pr(e,t))return t;s=Object.assign({},e);const i=Object.keys(t);for(let a=0,c=i.length;a<c;a++){const u=i[a];if(u==="__proto__"||u==="constructor"||u==="prototype")continue;const l=t[u];if($(l))typeof l>"u"?delete s[u]:s[u]=l;else{const h=s[u],p=l;if(Et(e,u,n)||Et(t,u,n))delete s[u];else{if(O(h)&&O(p)){const E=n.get(h)||[],f=n.get(p)||[];E.push({obj:e,key:u}),f.push({obj:t,key:u}),n.set(h,E),n.set(p,f)}s[u]=Vt(s[u],l,r,n)}}}}else s=t;return s}}function Et(e,t,r){const n=r.get(e[t])||[];for(let s=0,i=n.length;s<i;s++){const a=n[s];if(a.key===t&&a.obj===e)return!0}return!1}function j(e){return Array.isArray(e)}function Gt(e){return typeof e=="function"}function O(e){return!$(e)&&!j(e)&&!Gt(e)&&typeof e=="object"}function $(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e>"u"||e instanceof Date||e instanceof RegExp||e===null}function pr(e,t){return!(!gt(e)||!gt(t))}class fr{constructor(){o(this,"_promise");o(this,"_resolve");o(this,"_reject");this._promise=new Promise((t,r)=>{this._resolve=t,this._reject=r})}get promise(){return this._promise}resolve(t){this._resolve(t)}reject(t){this._reject(t)}}class _r{constructor(t,r){o(this,"_isCalled",!1);o(this,"_deferred",new fr);o(this,"_callback");o(this,"_that");this._callback=t,this._that=r}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...t){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...t)).then(r=>this._deferred.resolve(r),r=>this._deferred.reject(r))}catch(r){this._deferred.reject(r)}}return this._deferred.promise}}function mr(e){return Object.prototype.hasOwnProperty.call(e,"partialSuccess")}function Sr(){return{handleResponse(e){e==null||!mr(e)||e.partialSuccess==null||Object.keys(e.partialSuccess).length===0||d.warn("Received Partial Success response:",JSON.stringify(e.partialSuccess))}}}class gr{constructor(t,r,n,s,i){o(this,"_diagLogger");o(this,"_transport");o(this,"_serializer");o(this,"_responseHandler");o(this,"_promiseQueue");o(this,"_timeout");this._transport=t,this._serializer=r,this._responseHandler=n,this._promiseQueue=s,this._timeout=i,this._diagLogger=d.createComponentLogger({namespace:"OTLPExportDelegate"})}export(t,r){if(this._diagLogger.debug("items to be sent",t),this._promiseQueue.hasReachedLimit()){r({code:_.FAILED,error:new Error("Concurrent export limit reached")});return}const n=this._serializer.serializeRequest(t);if(n==null){r({code:_.FAILED,error:new Error("Nothing to send")});return}this._promiseQueue.pushPromise(this._transport.send(n,this._timeout).then(s=>{if(s.status==="success"){if(s.data!=null)try{this._responseHandler.handleResponse(this._serializer.deserializeResponse(s.data))}catch(i){this._diagLogger.warn("Export succeeded but could not deserialize response - is the response specification compliant?",i,s.data)}r({code:_.SUCCESS});return}else if(s.status==="failure"&&s.error){r({code:_.FAILED,error:s.error});return}else s.status==="retryable"?r({code:_.FAILED,error:s.error??new ht("Export failed with retryable status")}):r({code:_.FAILED,error:new ht("Export failed with unknown error")})},s=>r({code:_.FAILED,error:s})))}forceFlush(){return this._promiseQueue.awaitAll()}async shutdown(){this._diagLogger.debug("shutdown started"),await this.forceFlush(),this._transport.shutdown()}}function Er(e,t){return new gr(e.transport,e.serializer,Sr(),e.promiseHandler,t.timeout)}function Ar(e,t,r){return Er({transport:r,serializer:t,promiseHandler:de(e)},{timeout:e.timeoutMillis})}let v;function br(){if(v===void 0)try{const e=globalThis.process.argv0;v=e?`unknown_service:${e}`:"unknown_service"}catch{v="unknown_service"}return v}const x=e=>e!==null&&typeof e=="object"&&typeof e.then=="function";class z{constructor(t,r){o(this,"_rawAttributes");o(this,"_asyncAttributesPending",!1);o(this,"_schemaUrl");o(this,"_memoizedAttributes");const n=t.attributes??{};this._rawAttributes=Object.entries(n).map(([s,i])=>(x(i)&&(this._asyncAttributesPending=!0),[s,i])),this._rawAttributes=At(this._rawAttributes),this._schemaUrl=yr(r==null?void 0:r.schemaUrl)}static FromAttributeList(t,r){const n=new z({},r);return n._rawAttributes=At(t),n._asyncAttributesPending=t.filter(([s,i])=>x(i)).length>0,n}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let t=0;t<this._rawAttributes.length;t++){const[r,n]=this._rawAttributes[t];this._rawAttributes[t]=[r,x(n)?await n:n]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&d.error("Accessing resource attributes before async attributes settled"),this._memoizedAttributes)return this._memoizedAttributes;const t={};for(const[r,n]of this._rawAttributes){if(x(n)){d.debug(`Unsettled resource attribute ${r} skipped`);continue}n!=null&&(t[r]??(t[r]=n))}return this._asyncAttributesPending||(this._memoizedAttributes=t),t}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(t){if(t==null)return this;const r=wr(this,t),n=r?{schemaUrl:r}:void 0;return z.FromAttributeList([...t.getRawAttributes(),...this.getRawAttributes()],n)}}function Ht(e,t){return z.FromAttributeList(Object.entries(e),t)}function Tr(){return Ht({[Ut]:br(),[st]:q[st],[it]:q[it],[ot]:q[ot]})}function At(e){return e.map(([t,r])=>x(r)?[t,r.catch(n=>{d.debug("promise rejection for resource attribute: %s - %s",t,n)})]:[t,r])}function yr(e){if(typeof e=="string"||e===void 0)return e;d.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.",e)}function wr(e,t){const r=e==null?void 0:e.schemaUrl,n=t==null?void 0:t.schemaUrl,s=r===void 0||r==="",i=n===void 0||n==="";if(s)return n;if(i||r===n)return r;d.warn('Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.',r,n)}function Lr(e,t){const r={attributes:G(e.attributes,t),droppedAttributesCount:0},n=e.schemaUrl;return n&&n!==""&&(r.schemaUrl=n),r}function Pr(e){return{name:e.name,version:e.version}}function G(e,t){return Object.keys(e).map(r=>Cr(r,e[r],t))}function Cr(e,t,r){return{key:e,value:ct(t,r)}}function ct(e,t){const r=typeof e;if(r==="string")return{stringValue:e};if(r==="number")return Number.isInteger(e)?{intValue:e}:{doubleValue:e};if(r==="boolean")return{boolValue:e};if(e instanceof Uint8Array)return{bytesValue:t.encodeUint8Array(e)};if(Array.isArray(e)){const n=new Array(e.length);for(let s=0;s<e.length;s++)n[s]=ct(e[s],t);return{arrayValue:{values:n}}}if(r==="object"&&e!=null){const n=Object.keys(e),s=new Array(n.length);for(let i=0;i<n.length;i++)s[i]={key:n[i],value:ct(e[n[i]],t)};return{kvlistValue:{values:s}}}return{}}function Rr(e){const t=BigInt(1e9);return BigInt(Math.trunc(e[0]))*t+BigInt(Math.trunc(e[1]))}function Or(e){return Rr(e).toString()}const xr=typeof BigInt<"u"?Or:Be;function bt(e){return e}const Ir={encodeHrTime:xr,encodeSpanContext:bt,encodeOptionalSpanContext:bt,encodeUint8Array:e=>{if(typeof Buffer<"u")return Buffer.from(e).toString("base64");const t=new Array(e.length);for(let r=0;r<e.length;r++)t[r]=String.fromCharCode(e[r]);return btoa(t.join(""))}},Nr=256,Mr=512;function Kt(e,t){let r=e&255|Nr;return t&&(r|=Mr),r}function Dr(e,t){var i,a,c,u;const r=e.spanContext(),n=e.status,s=(i=e.parentSpanContext)!=null&&i.spanId?t.encodeSpanContext((a=e.parentSpanContext)==null?void 0:a.spanId):void 0;return{traceId:t.encodeSpanContext(r.traceId),spanId:t.encodeSpanContext(r.spanId),parentSpanId:s,traceState:(c=r.traceState)==null?void 0:c.serialize(),name:e.name,kind:e.kind==null?0:e.kind+1,startTimeUnixNano:t.encodeHrTime(e.startTime),endTimeUnixNano:t.encodeHrTime(e.endTime),attributes:G(e.attributes,t),droppedAttributesCount:e.droppedAttributesCount,events:e.events.map(l=>Ur(l,t)),droppedEventsCount:e.droppedEventsCount,status:{code:n.code,message:n.message},links:e.links.map(l=>vr(l,t)),droppedLinksCount:e.droppedLinksCount,flags:Kt(r.traceFlags,(u=e.parentSpanContext)==null?void 0:u.isRemote)}}function vr(e,t){var r;return{attributes:e.attributes?G(e.attributes,t):[],spanId:t.encodeSpanContext(e.context.spanId),traceId:t.encodeSpanContext(e.context.traceId),traceState:(r=e.context.traceState)==null?void 0:r.serialize(),droppedAttributesCount:e.droppedAttributesCount||0,flags:Kt(e.context.traceFlags,e.context.isRemote)}}function Ur(e,t){return{attributes:e.attributes?G(e.attributes,t):[],name:e.name,timeUnixNano:t.encodeHrTime(e.time),droppedAttributesCount:e.droppedAttributesCount||0}}function Br(e,t){return{resourceSpans:kr(e,t)}}function $r(e){const t=new Map;for(const r of e){let n=t.get(r.resource);n||(n=new Map,t.set(r.resource,n));const s=`${r.instrumentationScope.name}@${r.instrumentationScope.version||""}:${r.instrumentationScope.schemaUrl||""}`;let i=n.get(s);i||(i=[],n.set(s,i)),i.push(r)}return t}function kr(e,t){const r=$r(e),n=[],s=r.entries();let i=s.next();for(;!i.done;){const[a,c]=i.value,u=[],l=c.values();let h=l.next();for(;!h.done;){const f=h.value;if(f.length>0){const H=f.map(K=>Dr(K,t));u.push({scope:Pr(f[0].instrumentationScope),spans:H,schemaUrl:f[0].instrumentationScope.schemaUrl})}h=l.next()}const p=Lr(a,t),E={resource:p,scopeSpans:u,schemaUrl:p.schemaUrl};n.push(E),i=s.next()}return n}const Fr={serializeRequest:e=>{const t=Br(e,Ir);return new TextEncoder().encode(JSON.stringify(t))},deserializeResponse:e=>{if(e.length===0)return{};const t=new TextDecoder;try{return JSON.parse(t.decode(e))}catch(r){return d.warn(`Failed to parse trace export response: ${r.message}. Returning empty response`),{}}}},tt=5,jr=1e3,zr=5e3,Vr=1.5,Tt=.2;function Gr(){return Math.random()*(2*Tt)-Tt}class Hr{constructor(t){o(this,"_transport");this._transport=t}retry(t,r,n){return new Promise((s,i)=>{setTimeout(()=>{this._transport.send(t,r).then(s,i)},n)})}async send(t,r){let n=tt,s=jr;const i=Date.now()+r;let a=await this._transport.send(t,r);for(;a.status==="retryable"&&n>0;){n--;const c=Math.max(Math.min(s*(1+Gr()),zr),0);s=s*Vr;const u=a.retryInMillis??c,l=i-Date.now();if(u>l)return d.info(`Export retry time ${Math.round(u)}ms exceeds remaining timeout ${Math.round(l)}ms, not retrying further.`),a;d.verbose(`Scheduling export retry in ${Math.round(u)}ms`),a=await this.retry(t,l,u)}return a.status==="success"?d.verbose(`Export succeeded after ${tt-n} retry attempts.`):a.status==="retryable"?d.info(`Export failed after maximum retry attempts (${tt}).`):d.info(`Export failed with non-retryable error: ${a.error}`),a}shutdown(){return this._transport.shutdown()}}function Kr(e){return new Hr(e.transport)}function Xr(e){return e===429||e===502||e===503||e===504}function Qr(e){if(e==null)return;const t=Number.parseInt(e,10);if(Number.isInteger(t))return t>0?t*1e3:-1;const r=new Date(e).getTime()-Date.now();return r>=0?r:0}const Yr=60*1024,qr=9;let et=0,U=0;class Wr{constructor(t){o(this,"_parameters");this._parameters=t}async send(t,r){const n=new AbortController,s=setTimeout(()=>n.abort(),r);let i=globalThis.fetch;typeof i.__original=="function"&&(i=i.__original);const a=t.byteLength,c=et+a>Yr,u=U>=qr,l=!c&&!u;if(l)et+=a,U++;else{const h=c?"size limit":"count limit";d.debug(`keepalive disabled: ${(a/1024).toFixed(1)}KB payload, ${U} pending (${h})`)}try{const h=new URL(this._parameters.url),p=await i(h.href,{method:"POST",headers:await this._parameters.headers(),body:t,signal:n.signal,keepalive:l,mode:globalThis.location?globalThis.location.origin===h.origin?"same-origin":"cors":"no-cors"});if(p.status>=200&&p.status<=299)return d.debug(`export response success (status: ${p.status})`),{status:"success"};if(Xr(p.status)){d.warn(`export response retryable (status: ${p.status})`);const E=p.headers.get("Retry-After");return{status:"retryable",retryInMillis:Qr(E)}}return d.error(`export response failure (status: ${p.status})`),{status:"failure",error:new Error(`Fetch request failed with non-retryable status ${p.status}`)}}catch(h){return Zr(h)?(d.warn(`export request retryable (network error: ${h})`),{status:"retryable",error:new Error("Fetch request encountered a network error",{cause:h})}):(d.error(`export request failure (error: ${h})`),{status:"failure",error:new Error("Fetch request errored",{cause:h})})}finally{clearTimeout(s),l&&(et-=a,U--)}}shutdown(){}}function Jr(e){return new Wr(e)}function Zr(e){return e instanceof TypeError&&!e.cause}function tn(e,t){return Ar(e,t,Kr({transport:Jr(e)}))}function en(e){const t={};return Object.entries(e??{}).forEach(([r,n])=>{typeof n<"u"?t[r]=String(n):d.warn(`Header "${r}" has invalid value (${n}) and will be ignored`)}),t}function rn(e,t,r){return async()=>{const n={...await r()},s={};return t!=null&&Object.assign(s,await t()),e!=null&&Object.assign(s,en(await e())),Object.assign(s,n)}}function nn(e){var t;if(e!=null)try{const r=(t=globalThis.location)==null?void 0:t.href;return new URL(e,r).href}catch{throw new Error(`Configuration: Could not parse user-provided export URL: '${e}'`)}}function sn(e,t,r){return{...ce(e,t,r),headers:rn(e.headers,t.headers,r.headers),url:nn(e.url)??t.url??r.url}}function on(e,t){return{...ue(),headers:async()=>e,url:"http://localhost:4318/"+t}}function an(e){return typeof e.headers=="function"?e.headers:ae(e.headers)}function cn(e,t,r){return sn({url:e.url,timeoutMillis:e.timeoutMillis,headers:an(e),concurrencyLimit:e.concurrencyLimit},{},on(r,t))}function un(e,t,r,n){const s=cn(e,r,n);return tn(s,t)}class ln extends ie{constructor(t={}){super(un(t,Fr,"v1/traces",{"Content-Type":"application/json"}))}}const dn="exception";class hn{constructor(t){o(this,"_spanContext");o(this,"kind");o(this,"parentSpanContext");o(this,"attributes",{});o(this,"links",[]);o(this,"events",[]);o(this,"startTime");o(this,"resource");o(this,"instrumentationScope");o(this,"_droppedAttributesCount",0);o(this,"_droppedEventsCount",0);o(this,"_droppedLinksCount",0);o(this,"_attributesCount",0);o(this,"name");o(this,"status",{code:D.UNSET});o(this,"endTime",[0,0]);o(this,"_ended",!1);o(this,"_duration",[-1,-1]);o(this,"_spanProcessor");o(this,"_spanLimits");o(this,"_attributeValueLengthLimit");o(this,"_recordEndMetrics");o(this,"_performanceStartTime");o(this,"_performanceOffset");o(this,"_startTimeProvided");const r=Date.now();if(this._spanContext=t.spanContext,this._performanceStartTime=y.now(),this._performanceOffset=r-(this._performanceStartTime+y.timeOrigin),this._startTimeProvided=t.startTime!=null,this._spanLimits=t.spanLimits,this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit??0,this._spanProcessor=t.spanProcessor,this.name=t.name,this.parentSpanContext=t.parentSpanContext,this.kind=t.kind,t.links)for(const n of t.links)this.addLink(n);this.startTime=this._getTime(t.startTime??r),this.resource=t.resource,this.instrumentationScope=t.scope,this._recordEndMetrics=t.recordEndMetrics,t.attributes!=null&&this.setAttributes(t.attributes),this._spanProcessor.onStart(this,t.context)}spanContext(){return this._spanContext}setAttribute(t,r){if(r==null||this._isSpanEnded())return this;if(t.length===0)return d.warn(`Invalid attribute key: ${t}`),this;if(!Dt(r))return d.warn(`Invalid attribute value set for key: ${t}`),this;const{attributeCountLimit:n}=this._spanLimits,s=!Object.prototype.hasOwnProperty.call(this.attributes,t);return n!==void 0&&this._attributesCount>=n&&s?(this._droppedAttributesCount++,this):(this.attributes[t]=this._truncateToSize(r),s&&this._attributesCount++,this)}setAttributes(t){for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&this.setAttribute(r,t[r]);return this}addEvent(t,r,n){if(this._isSpanEnded())return this;const{eventCountLimit:s}=this._spanLimits;if(s===0)return d.warn("No events allowed."),this._droppedEventsCount++,this;s!==void 0&&this.events.length>=s&&(this._droppedEventsCount===0&&d.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),ft(r)&&(ft(n)||(n=r),r=void 0);const i=N(r),{attributePerEventCountLimit:a}=this._spanLimits,c={};let u=0,l=0;for(const h in i){if(!Object.prototype.hasOwnProperty.call(i,h))continue;const p=i[h];if(a!==void 0&&l>=a){u++;continue}c[h]=this._truncateToSize(p),l++}return this.events.push({name:t,attributes:c,time:this._getTime(n),droppedAttributesCount:u}),this}addLink(t){if(this._isSpanEnded())return this;const{linkCountLimit:r}=this._spanLimits;if(r===0)return this._droppedLinksCount++,this;r!==void 0&&this.links.length>=r&&(this._droppedLinksCount===0&&d.debug("Dropping extra links."),this.links.shift(),this._droppedLinksCount++);const{attributePerLinkCountLimit:n}=this._spanLimits,s=N(t.attributes),i={};let a=0,c=0;for(const l in s){if(!Object.prototype.hasOwnProperty.call(s,l))continue;const h=s[l];if(n!==void 0&&c>=n){a++;continue}i[l]=this._truncateToSize(h),c++}const u={context:t.context};return c>0&&(u.attributes=i),a>0&&(u.droppedAttributesCount=a),this.links.push(u),this}addLinks(t){for(const r of t)this.addLink(r);return this}setStatus(t){if(this._isSpanEnded())return this;if(t.code===D.UNSET)return this;if(this.status.code===D.OK)return this;const r={code:t.code};return t.code===D.ERROR&&(typeof t.message=="string"?r.message=t.message:t.message!=null&&d.warn(`Dropping invalid status.message of type '${typeof t.message}', expected 'string'`)),this.status=r,this}updateName(t){return this._isSpanEnded()?this:(this.name=t,this)}end(t){var r;if(this._isSpanEnded()){d.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);return}this.endTime=this._getTime(t),this._duration=Ue(this.startTime,this.endTime),this._duration[0]<0&&(d.warn("Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.",this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0]),this._droppedEventsCount>0&&d.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._droppedLinksCount>0&&d.warn(`Dropped ${this._droppedLinksCount} links because linkCountLimit reached`),this._spanProcessor.onEnding&&this._spanProcessor.onEnding(this),(r=this._recordEndMetrics)==null||r.call(this),this._ended=!0,this._spanProcessor.onEnd(this)}_getTime(t){if(typeof t=="number"&&t<=y.now())return ve(t+this._performanceOffset);if(typeof t=="number")return w(t);if(t instanceof Date)return w(t.getTime());if(Bt(t))return t;if(this._startTimeProvided)return w(Date.now());const r=y.now()-this._performanceStartTime;return $t(this.startTime,w(r))}isRecording(){return this._ended===!1}recordException(t,r){const n={};typeof t=="string"?n[Q]=t:t&&(t.code?n[Y]=t.code.toString():t.name&&(n[Y]=t.name),t.message&&(n[Q]=t.message),t.stack&&(n[Re]=t.stack)),n[Y]||n[Q]?this.addEvent(dn,n,r):d.warn(`Failed to record an exception ${t}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){if(this._ended){const t=new Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);d.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,t)}return this._ended}_truncateToLimitUtil(t,r){return t.length<=r?t:t.substring(0,r)}_truncateToSize(t){const r=this._attributeValueLengthLimit;return r<=0?(d.warn(`Attribute value limit must be positive, got ${r}`),t):typeof t=="string"?this._truncateToLimitUtil(t,r):Array.isArray(t)?t.map(n=>typeof n=="string"?this._truncateToLimitUtil(n,r):n):t}}var g;(function(e){e[e.NOT_RECORD=0]="NOT_RECORD",e[e.RECORD=1]="RECORD",e[e.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(g||(g={}));class V{shouldSample(){return{decision:g.NOT_RECORD}}toString(){return"AlwaysOffSampler"}}class L{shouldSample(){return{decision:g.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}}class B{constructor(t){o(this,"_root");o(this,"_remoteParentSampled");o(this,"_remoteParentNotSampled");o(this,"_localParentSampled");o(this,"_localParentNotSampled");this._root=t.root,this._root||(C(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new L),this._remoteParentSampled=t.remoteParentSampled??new L,this._remoteParentNotSampled=t.remoteParentNotSampled??new V,this._localParentSampled=t.localParentSampled??new L,this._localParentNotSampled=t.localParentNotSampled??new V}shouldSample(t,r,n,s,i,a){const c=S.getSpanContext(t);return!c||!It(c)?this._root.shouldSample(t,r,n,s,i,a):c.isRemote?c.traceFlags&P.SAMPLED?this._remoteParentSampled.shouldSample(t,r,n,s,i,a):this._remoteParentNotSampled.shouldSample(t,r,n,s,i,a):c.traceFlags&P.SAMPLED?this._localParentSampled.shouldSample(t,r,n,s,i,a):this._localParentNotSampled.shouldSample(t,r,n,s,i,a)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}}class yt{constructor(t=0){o(this,"_ratio");o(this,"_upperBound");this._ratio=this._normalize(t),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(t,r){return{decision:ee(r)&&this._accumulate(r)<this._upperBound?g.RECORD_AND_SAMPLED:g.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(t){return typeof t!="number"||isNaN(t)?0:t>=1?1:t<=0?0:t}_accumulate(t){let r=0;for(let n=0;n<t.length/8;n++){const s=n*8,i=parseInt(t.slice(s,s+8),16);r=(r^i)>>>0}return r}}var m;(function(e){e.AlwaysOff="always_off",e.AlwaysOn="always_on",e.ParentBasedAlwaysOff="parentbased_always_off",e.ParentBasedAlwaysOn="parentbased_always_on",e.ParentBasedTraceIdRatio="parentbased_traceidratio",e.TraceIdRatio="traceidratio"})(m||(m={}));const wt=1;function Xt(){return{sampler:Qt(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128},spanLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128,linkCountLimit:128,eventCountLimit:128,attributePerEventCountLimit:128,attributePerLinkCountLimit:128}}}function Qt(){const e=m.ParentBasedAlwaysOn;switch(e){case m.AlwaysOn:return new L;case m.AlwaysOff:return new V;case m.ParentBasedAlwaysOn:return new B({root:new L});case m.ParentBasedAlwaysOff:return new B({root:new V});case m.TraceIdRatio:return new yt(Lt());case m.ParentBasedTraceIdRatio:return new B({root:new yt(Lt())});default:return d.error(`OTEL_TRACES_SAMPLER value "${e}" invalid, defaulting to "${m.ParentBasedAlwaysOn}".`),new B({root:new L})}}function Lt(){return d.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${wt}.`),wt}const pn=128,fn=1/0;function _n(e){const t={sampler:Qt()},r=Xt(),n=Object.assign({},r,t,e);return n.generalLimits=Object.assign({},r.generalLimits,e.generalLimits||{}),n.spanLimits=Object.assign({},r.spanLimits,e.spanLimits||{}),n}function mn(e){var r,n,s,i;const t=Object.assign({},e.spanLimits);return t.attributeCountLimit=((r=e.spanLimits)==null?void 0:r.attributeCountLimit)??((n=e.generalLimits)==null?void 0:n.attributeCountLimit)??void 0??void 0??pn,t.attributeValueLengthLimit=((s=e.spanLimits)==null?void 0:s.attributeValueLengthLimit)??((i=e.generalLimits)==null?void 0:i.attributeValueLengthLimit)??void 0??void 0??fn,Object.assign({},e,{spanLimits:t})}class Sn{constructor(t,r){o(this,"_maxExportBatchSize");o(this,"_maxQueueSize");o(this,"_scheduledDelayMillis");o(this,"_exportTimeoutMillis");o(this,"_exporter");o(this,"_isExporting",!1);o(this,"_finishedSpans",[]);o(this,"_timer");o(this,"_shutdownOnce");o(this,"_droppedSpansCount",0);this._exporter=t,this._maxExportBatchSize=typeof(r==null?void 0:r.maxExportBatchSize)=="number"?r.maxExportBatchSize:512,this._maxQueueSize=typeof(r==null?void 0:r.maxQueueSize)=="number"?r.maxQueueSize:2048,this._scheduledDelayMillis=typeof(r==null?void 0:r.scheduledDelayMillis)=="number"?r.scheduledDelayMillis:5e3,this._exportTimeoutMillis=typeof(r==null?void 0:r.exportTimeoutMillis)=="number"?r.exportTimeoutMillis:3e4,this._shutdownOnce=new _r(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(d.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(t,r){}onEnd(t){this._shutdownOnce.isCalled||(t.spanContext().traceFlags&P.SAMPLED)!==0&&this._addToBuffer(t)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>this._exporter.shutdown())}_addToBuffer(t){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&d.debug("maxQueueSize reached, dropping spans"),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(d.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(t),this._maybeStartTimer()}_flushAll(){return new Promise((t,r)=>{const n=[],s=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let i=0,a=s;i<a;i++)n.push(this._flushOneBatch());Promise.all(n).then(()=>{t()}).catch(r)})}_flushOneBatch(){return this._clearTimer(),this._finishedSpans.length===0?Promise.resolve():new Promise((t,r)=>{const n=setTimeout(()=>{r(new Error("Timeout"))},this._exportTimeoutMillis);T.with(he(T.active()),()=>{let s;this._finishedSpans.length<=this._maxExportBatchSize?(s=this._finishedSpans,this._finishedSpans=[]):s=this._finishedSpans.splice(0,this._maxExportBatchSize);const i=()=>this._exporter.export(s,c=>{clearTimeout(n),c.code===_.SUCCESS?t():r(c.error??new Error("BatchSpanProcessor: span export failed"))});let a=null;for(let c=0,u=s.length;c<u;c++){const l=s[c];l.resource.asyncAttributesPending&&l.resource.waitForAsyncAttributes&&(a??(a=[]),a.push(l.resource.waitForAsyncAttributes()))}a===null?i():Promise.all(a).then(i,c=>{C(c),r(c)})})})}_maybeStartTimer(){if(this._isExporting)return;const t=()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(r=>{this._isExporting=!1,C(r)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return t();this._timer===void 0&&(this._timer=setTimeout(()=>t(),this._scheduledDelayMillis),typeof this._timer!="number"&&this._timer.unref())}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}}class gn extends Sn{constructor(r,n){super(r,n);o(this,"_visibilityChangeListener");o(this,"_pageHideListener");this.onInit(n)}onInit(r){(r==null?void 0:r.disableAutoFlushOnDocumentHide)!==!0&&typeof document<"u"&&(this._visibilityChangeListener=()=>{document.visibilityState==="hidden"&&this.forceFlush().catch(n=>{C(n)})},this._pageHideListener=()=>{this.forceFlush().catch(n=>{C(n)})},document.addEventListener("visibilitychange",this._visibilityChangeListener),document.addEventListener("pagehide",this._pageHideListener))}onShutdown(){typeof document<"u"&&(this._visibilityChangeListener&&document.removeEventListener("visibilitychange",this._visibilityChangeListener),this._pageHideListener&&document.removeEventListener("pagehide",this._pageHideListener))}}const En=16,An=8,Pt=new Uint8Array(En),Ct=new Uint8Array(An),bn=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Rt(e){for(let t=0;t<e.length;t++)e[t]=Math.random()*256>>>0;for(let t=0;t<e.length;t++)if(e[t]>0)return;e[e.length-1]=1}function Ot(e){let t="";for(let r=0;r<e.length;r++)t+=bn[e[r]];return t}class Tn{generateTraceId(){return Rt(Pt),Ot(Pt)}generateSpanId(){return Rt(Ct),Ot(Ct)}}const yn="otel.span.parent.origin",xt="otel.span.sampling_result",wn="otel.sdk.span.live",Ln="otel.sdk.span.started";class Pn{constructor(t){o(this,"startedSpans");o(this,"liveSpans");this.startedSpans=t.createCounter(Ln,{unit:"{span}",description:"The number of created spans."}),this.liveSpans=t.createUpDownCounter(wn,{unit:"{span}",description:"The number of currently live spans."})}startSpan(t,r){const n=Rn(r);if(this.startedSpans.add(1,{[yn]:Cn(t),[xt]:n}),r===g.NOT_RECORD)return()=>{};const s={[xt]:n};return this.liveSpans.add(1,s),()=>{this.liveSpans.add(-1,s)}}}function Cn(e){return e?e.isRemote?"remote":"local":"none"}function Rn(e){switch(e){case g.RECORD_AND_SAMPLED:return"RECORD_AND_SAMPLE";case g.RECORD:return"RECORD_ONLY";case g.NOT_RECORD:return"DROP"}}const On="2.7.0";class xn{constructor(t,r,n,s){o(this,"_sampler");o(this,"_generalLimits");o(this,"_spanLimits");o(this,"_idGenerator");o(this,"instrumentationScope");o(this,"_resource");o(this,"_spanProcessor");o(this,"_tracerMetrics");const i=_n(r);this._sampler=i.sampler,this._generalLimits=i.generalLimits,this._spanLimits=i.spanLimits,this._idGenerator=r.idGenerator||new Tn,this._resource=n,this._spanProcessor=s,this.instrumentationScope=t;const a=i.meterProvider?i.meterProvider.getMeter("@opentelemetry/sdk-trace",On):re();this._tracerMetrics=new Pn(a)}startSpan(t,r={},n=T.active()){r.root&&(n=S.deleteSpan(n));const s=S.getSpan(n);if(ut(n))return d.debug("Instrumentation suppressed, returning Noop Span"),S.wrapSpanContext(ne);const i=s==null?void 0:s.spanContext(),a=this._idGenerator.generateSpanId();let c,u,l;!i||!S.isSpanContextValid(i)?u=this._idGenerator.generateTraceId():(u=i.traceId,l=i.traceState,c=i);const h=r.kind??se.INTERNAL,p=(r.links??[]).map(M=>({context:M.context,attributes:N(M.attributes)})),E=N(r.attributes),f=this._sampler.shouldSample(n,u,t,h,E,p),H=this._tracerMetrics.startSpan(i,f.decision);l=f.traceState??l;const K=f.decision===k.RECORD_AND_SAMPLED?P.SAMPLED:P.NONE,dt={traceId:u,spanId:a,traceFlags:K,traceState:l};if(f.decision===k.NOT_RECORD)return d.debug("Recording is off, propagating context in a non-recording span"),S.wrapSpanContext(dt);const Yt=N(Object.assign(E,f.attributes));return new hn({resource:this._resource,scope:this.instrumentationScope,context:n,spanContext:dt,name:t,kind:h,links:p,parentSpanContext:c,attributes:Yt,startTime:r.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits,recordEndMetrics:H})}startActiveSpan(t,r,n,s){let i,a,c;if(arguments.length<2)return;arguments.length===2?c=r:arguments.length===3?(i=r,c=n):(i=r,a=n,c=s);const u=a??T.active(),l=this.startSpan(t,i,u),h=S.setSpan(u,l);return T.with(h,c,void 0,l)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}}class In{constructor(t){o(this,"_spanProcessors");this._spanProcessors=t}forceFlush(){const t=[];for(const r of this._spanProcessors)t.push(r.forceFlush());return new Promise(r=>{Promise.all(t).then(()=>{r()}).catch(n=>{C(n||new Error("MultiSpanProcessor: forceFlush failed")),r()})})}onStart(t,r){for(const n of this._spanProcessors)n.onStart(t,r)}onEnding(t){for(const r of this._spanProcessors)r.onEnding&&r.onEnding(t)}onEnd(t){for(const r of this._spanProcessors)r.onEnd(t)}shutdown(){const t=[];for(const r of this._spanProcessors)t.push(r.shutdown());return new Promise((r,n)=>{Promise.all(t).then(()=>{r()},n)})}}var b;(function(e){e[e.resolved=0]="resolved",e[e.timeout=1]="timeout",e[e.error=2]="error",e[e.unresolved=3]="unresolved"})(b||(b={}));class Nn{constructor(t={}){o(this,"_config");o(this,"_tracers",new Map);o(this,"_resource");o(this,"_activeSpanProcessor");var s;const r=hr({},Xt(),mn(t));this._resource=r.resource??Tr(),this._config=Object.assign({},r,{resource:this._resource});const n=[];(s=t.spanProcessors)!=null&&s.length&&n.push(...t.spanProcessors),this._activeSpanProcessor=new In(n)}getTracer(t,r,n){const s=`${t}@${r||""}:${(n==null?void 0:n.schemaUrl)||""}`;return this._tracers.has(s)||this._tracers.set(s,new xn({name:t,version:r,schemaUrl:n==null?void 0:n.schemaUrl},this._config,this._resource,this._activeSpanProcessor)),this._tracers.get(s)}forceFlush(){const t=this._config.forceFlushTimeoutMillis,r=this._activeSpanProcessor._spanProcessors.map(n=>new Promise(s=>{let i;const a=setTimeout(()=>{s(new Error(`Span processor did not completed within timeout period of ${t} ms`)),i=b.timeout},t);n.forceFlush().then(()=>{clearTimeout(a),i!==b.timeout&&(i=b.resolved,s(i))}).catch(c=>{clearTimeout(a),i=b.error,s(c)})}));return new Promise((n,s)=>{Promise.all(r).then(i=>{const a=i.filter(c=>c!==b.resolved);a.length>0?s(a):n()}).catch(i=>s([i]))})}shutdown(){return this._activeSpanProcessor.shutdown()}}class Mn{export(t,r){return this._sendSpans(t,r)}shutdown(){return this._sendSpans([]),this.forceFlush()}forceFlush(){return Promise.resolve()}_exportInfo(t){var r;return{resource:{attributes:t.resource.attributes},instrumentationScope:t.instrumentationScope,traceId:t.spanContext().traceId,parentSpanContext:t.parentSpanContext,traceState:(r=t.spanContext().traceState)==null?void 0:r.serialize(),name:t.name,id:t.spanContext().spanId,kind:t.kind,timestamp:pt(t.startTime),duration:pt(t.duration),attributes:t.attributes,status:t.status,events:t.events,links:t.links}}_sendSpans(t,r){for(const n of t)console.dir(this._exportInfo(n),{depth:3});if(r)return r({code:_.SUCCESS})}}class Dn{constructor(){o(this,"_enabled",!1);o(this,"_currentContext",R)}_bindFunction(t=R,r){const n=this,s=function(...i){return n.with(t,()=>r.apply(this,i))};return Object.defineProperty(s,"length",{enumerable:!1,configurable:!0,writable:!1,value:r.length}),s}active(){return this._currentContext}bind(t,r){return t===void 0&&(t=this.active()),typeof r=="function"?this._bindFunction(t,r):r}disable(){return this._currentContext=R,this._enabled=!1,this}enable(){return this._enabled?this:(this._enabled=!0,this._currentContext=R,this)}with(t,r,n,...s){const i=this._currentContext;this._currentContext=t||R;try{return r.call(n,...s)}finally{this._currentContext=i}}}function vn(e){if(e!==null){if(e===void 0){const t=new Dn;t.enable(),T.setGlobalContextManager(t);return}e.enable(),T.setGlobalContextManager(e)}}function Un(e){if(e!==null){if(e===void 0){I.setGlobalPropagator(new $e({propagators:[new tr,new Ae]}));return}I.setGlobalPropagator(e)}}class Bn extends Nn{constructor(t={}){super(t)}register(t={}){S.setGlobalTracerProvider(this),Un(t.propagator),vn(t.contextManager)}}var rt;function Vn(e){if(rt||!(e.enabled??!!e.otlpEndpoint))return!1;const r=e.otlpEndpoint?new ln({url:e.otlpEndpoint,...e.otlpHeaders?{headers:e.otlpHeaders}:{}}):new Mn,n=Ht({[Ut]:e.serviceName,[Oe]:e.serviceVersion??"0.0.0"});return rt=new Bn({resource:n,spanProcessors:[new gn(r)]}),rt.register(),!0}export{Vn as initObservabilityWeb};
|
|
2
|
-
//# sourceMappingURL=web-
|
|
1
|
+
var qt=Object.defineProperty;var Wt=(e,t,r)=>t in e?qt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var o=(e,t,r)=>Wt(e,typeof t!="symbol"?t+"":t,r);import{aj as Jt,ak as Zt,al as te,am as I,an as S,ao as It,ap as P,aq as D,ar as ee,as as T,at as re,au as ne,av as se,aw as R}from"./index-QjYSiWWG.js";import"./vendor-DJo4KD8w.js";import"./i18n-BbpF47i1.js";var k;(function(e){e[e.NOT_RECORD=0]="NOT_RECORD",e[e.RECORD=1]="RECORD",e[e.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(k||(k={}));var d=Jt.instance();class ie{constructor(t){o(this,"_delegate");this._delegate=t}export(t,r){this._delegate.export(t,r)}forceFlush(){return this._delegate.forceFlush()}shutdown(){return this._delegate.shutdown()}}class ht extends Error{constructor(r,n,s){super(r);o(this,"code");o(this,"name","OTLPExporterError");o(this,"data");this.data=s,this.code=n}}function oe(e){if(Number.isFinite(e)&&e>0)return e;throw new Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${e}')`)}function ae(e){if(e!=null)return async()=>e}function ce(e,t,r){return{timeoutMillis:oe(e.timeoutMillis??t.timeoutMillis??r.timeoutMillis),concurrencyLimit:e.concurrencyLimit??t.concurrencyLimit??r.concurrencyLimit,compression:e.compression??t.compression??r.compression}}function ue(){return{timeoutMillis:1e4,concurrencyLimit:30,compression:"none"}}class le{constructor(t){o(this,"_concurrencyLimit");o(this,"_sendingPromises",[]);this._concurrencyLimit=t}pushPromise(t){if(this.hasReachedLimit())throw new Error("Concurrency Limit reached");this._sendingPromises.push(t);const r=()=>{const n=this._sendingPromises.indexOf(t);this._sendingPromises.splice(n,1)};t.then(r,r)}hasReachedLimit(){return this._sendingPromises.length>=this._concurrencyLimit}async awaitAll(){await Promise.all(this._sendingPromises)}}function de(e){return new le(e.concurrencyLimit)}const Nt=Zt("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function he(e){return e.setValue(Nt,!0)}function ut(e){return e.getValue(Nt)===!0}const pe="=",Mt=";",nt=",",X="baggage",fe=180,_e=4096,me=8192;function Se(e){return e.reduce((t,r)=>{const n=`${t}${t!==""?nt:""}${r}`;return n.length>me?t:n},"")}function ge(e){return e.getAllEntries().map(([t,r])=>{let n=`${encodeURIComponent(t)}=${encodeURIComponent(r.value)}`;return r.metadata!==void 0&&(n+=Mt+r.metadata.toString()),n})}function Ee(e){if(!e)return;const t=e.indexOf(Mt),r=t===-1?e:e.substring(0,t),n=r.indexOf(pe);if(n<=0)return;const s=r.substring(0,n).trim(),i=r.substring(n+1).trim();if(!s||!i)return;let a,c;try{a=decodeURIComponent(s),c=decodeURIComponent(i)}catch{return}let u;if(t!==-1&&t<e.length-1){const l=e.substring(t+1);u=te(l)}return{key:a,value:c,metadata:u}}class Ae{inject(t,r,n){const s=I.getBaggage(t);if(!s||ut(t))return;const i=ge(s).filter(c=>c.length<=_e).slice(0,fe),a=Se(i);a.length>0&&n.set(r,X,a)}extract(t,r,n){const s=n.get(r,X),i=Array.isArray(s)?s.join(nt):s;if(!i)return t;const a={};return i.length===0||(i.split(nt).forEach(u=>{const l=Ee(u);if(l){const h={value:l.value};l.metadata&&(h.metadata=l.metadata),a[l.key]=h}}),Object.entries(a).length===0)?t:I.setBaggage(t,I.createBaggage(a))}fields(){return[X]}}function N(e){const t={};if(typeof e!="object"||e==null)return t;for(const r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;if(!be(r)){d.warn(`Invalid attribute key: ${r}`);continue}const n=e[r];if(!Dt(n)){d.warn(`Invalid attribute value set for key: ${r}`);continue}Array.isArray(n)?t[r]=n.slice():t[r]=n}return t}function be(e){return typeof e=="string"&&e!==""}function Dt(e){return e==null?!0:Array.isArray(e)?Te(e):vt(typeof e)}function Te(e){let t;for(const r of e){if(r==null)continue;const n=typeof r;if(n!==t){if(!t){if(vt(n)){t=n;continue}return!1}return!1}}return!0}function vt(e){switch(e){case"number":case"boolean":case"string":return!0}return!1}function ye(){return e=>{d.error(we(e))}}function we(e){return typeof e=="string"?e:JSON.stringify(Le(e))}function Le(e){const t={};let r=e;for(;r!==null;)Object.getOwnPropertyNames(r).forEach(n=>{if(t[n])return;const s=r[n];s&&(t[n]=String(s))}),r=Object.getPrototypeOf(r);return t}let Pe=ye();function C(e){try{Pe(e)}catch{}}const Ce="2.7.0",Q="exception.message",Re="exception.stacktrace",Y="exception.type",Ut="service.name",Oe="service.version",st="telemetry.sdk.language",xe="webjs",it="telemetry.sdk.name",ot="telemetry.sdk.version",Ie="process.runtime.name",q={[it]:"opentelemetry",[Ie]:"browser",[st]:xe,[ot]:Ce},y=performance,Ne=9,Me=6,De=Math.pow(10,Me),F=Math.pow(10,Ne);function w(e){const t=e/1e3,r=Math.trunc(t),n=Math.round(e%1e3*De);return[r,n]}function ve(e){const t=w(y.timeOrigin),r=w(typeof e=="number"?e:y.now());return $t(t,r)}function Ue(e,t){let r=t[0]-e[0],n=t[1]-e[1];return n<0&&(r-=1,n+=F),[r,n]}function Be(e){return e[0]*F+e[1]}function pt(e){return e[0]*1e6+e[1]/1e3}function Bt(e){return Array.isArray(e)&&e.length===2&&typeof e[0]=="number"&&typeof e[1]=="number"}function ft(e){return Bt(e)||typeof e=="number"||e instanceof Date}function $t(e,t){const r=[e[0]+t[0],e[1]+t[1]];return r[1]>=F&&(r[1]-=F,r[0]+=1),r}var _;(function(e){e[e.SUCCESS=0]="SUCCESS",e[e.FAILED=1]="FAILED"})(_||(_={}));class $e{constructor(t={}){o(this,"_propagators");o(this,"_fields");this._propagators=t.propagators??[],this._fields=Array.from(new Set(this._propagators.map(r=>typeof r.fields=="function"?r.fields():[]).reduce((r,n)=>r.concat(n),[])))}inject(t,r,n){for(const s of this._propagators)try{s.inject(t,r,n)}catch(i){d.warn(`Failed to inject with ${s.constructor.name}. Err: ${i.message}`)}}extract(t,r,n){return this._propagators.reduce((s,i)=>{try{return i.extract(s,r,n)}catch(a){d.warn(`Failed to extract with ${i.constructor.name}. Err: ${a.message}`)}return s},t)}fields(){return this._fields.slice()}}const at="[_0-9a-z-*/]",ke=`[a-z]${at}{0,255}`,Fe=`[a-z0-9]${at}{0,240}@[a-z]${at}{0,13}`,je=new RegExp(`^(?:${ke}|${Fe})$`),ze=/^[ -~]{0,255}[!-~]$/,Ve=/,|=/;function Ge(e){return je.test(e)}function He(e){return ze.test(e)&&!Ve.test(e)}const _t=32,Ke=512,mt=",",St="=";class lt{constructor(t){o(this,"_internalState",new Map);t&&this._parse(t)}set(t,r){const n=this._clone();return n._internalState.has(t)&&n._internalState.delete(t),n._internalState.set(t,r),n}unset(t){const r=this._clone();return r._internalState.delete(t),r}get(t){return this._internalState.get(t)}serialize(){return this._keys().reduce((t,r)=>(t.push(r+St+this.get(r)),t),[]).join(mt)}_parse(t){t.length>Ke||(this._internalState=t.split(mt).reverse().reduce((r,n)=>{const s=n.trim(),i=s.indexOf(St);if(i!==-1){const a=s.slice(0,i),c=s.slice(i+1,n.length);Ge(a)&&He(c)&&r.set(a,c)}return r},new Map),this._internalState.size>_t&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,_t))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){const t=new lt;return t._internalState=new Map(this._internalState),t}}const W="traceparent",J="tracestate",Xe="00",Qe="(?!ff)[\\da-f]{2}",Ye="(?![0]{32})[\\da-f]{32}",qe="(?![0]{16})[\\da-f]{16}",We="[\\da-f]{2}",Je=new RegExp(`^\\s?(${Qe})-(${Ye})-(${qe})-(${We})(-.*)?\\s?$`);function Ze(e){const t=Je.exec(e);return!t||t[1]==="00"&&t[5]?null:{traceId:t[2],spanId:t[3],traceFlags:parseInt(t[4],16)}}class tr{inject(t,r,n){const s=S.getSpanContext(t);if(!s||ut(t)||!It(s))return;const i=`${Xe}-${s.traceId}-${s.spanId}-0${Number(s.traceFlags||P.NONE).toString(16)}`;n.set(r,W,i),s.traceState&&n.set(r,J,s.traceState.serialize())}extract(t,r,n){const s=n.get(r,W);if(!s)return t;const i=Array.isArray(s)?s[0]:s;if(typeof i!="string")return t;const a=Ze(i);if(!a)return t;a.isRemote=!0;const c=n.get(r,J);if(c){const u=Array.isArray(c)?c.join(","):c;a.traceState=new lt(typeof u=="string"?u:void 0)}return S.setSpanContext(t,a)}fields(){return[W,J]}}const er="[object Object]",rr="[object Null]",nr="[object Undefined]",sr=Function.prototype,kt=sr.toString,ir=kt.call(Object),or=Object.getPrototypeOf,Ft=Object.prototype,jt=Ft.hasOwnProperty,A=Symbol?Symbol.toStringTag:void 0,zt=Ft.toString;function gt(e){if(!ar(e)||cr(e)!==er)return!1;const t=or(e);if(t===null)return!0;const r=jt.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&kt.call(r)===ir}function ar(e){return e!=null&&typeof e=="object"}function cr(e){return e==null?e===void 0?nr:rr:A&&A in Object(e)?ur(e):lr(e)}function ur(e){const t=jt.call(e,A),r=e[A];let n=!1;try{e[A]=void 0,n=!0}catch{}const s=zt.call(e);return n&&(t?e[A]=r:delete e[A]),s}function lr(e){return zt.call(e)}const dr=20;function hr(...e){let t=e.shift();const r=new WeakMap;for(;e.length>0;)t=Vt(t,e.shift(),0,r);return t}function Z(e){return j(e)?e.slice():e}function Vt(e,t,r=0,n){let s;if(!(r>dr)){if(r++,$(e)||$(t)||Gt(t))s=Z(t);else if(j(e)){if(s=e.slice(),j(t))for(let i=0,a=t.length;i<a;i++)s.push(Z(t[i]));else if(O(t)){const i=Object.keys(t);for(let a=0,c=i.length;a<c;a++){const u=i[a];u==="__proto__"||u==="constructor"||u==="prototype"||(s[u]=Z(t[u]))}}}else if(O(e))if(O(t)){if(!pr(e,t))return t;s=Object.assign({},e);const i=Object.keys(t);for(let a=0,c=i.length;a<c;a++){const u=i[a];if(u==="__proto__"||u==="constructor"||u==="prototype")continue;const l=t[u];if($(l))typeof l>"u"?delete s[u]:s[u]=l;else{const h=s[u],p=l;if(Et(e,u,n)||Et(t,u,n))delete s[u];else{if(O(h)&&O(p)){const E=n.get(h)||[],f=n.get(p)||[];E.push({obj:e,key:u}),f.push({obj:t,key:u}),n.set(h,E),n.set(p,f)}s[u]=Vt(s[u],l,r,n)}}}}else s=t;return s}}function Et(e,t,r){const n=r.get(e[t])||[];for(let s=0,i=n.length;s<i;s++){const a=n[s];if(a.key===t&&a.obj===e)return!0}return!1}function j(e){return Array.isArray(e)}function Gt(e){return typeof e=="function"}function O(e){return!$(e)&&!j(e)&&!Gt(e)&&typeof e=="object"}function $(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e>"u"||e instanceof Date||e instanceof RegExp||e===null}function pr(e,t){return!(!gt(e)||!gt(t))}class fr{constructor(){o(this,"_promise");o(this,"_resolve");o(this,"_reject");this._promise=new Promise((t,r)=>{this._resolve=t,this._reject=r})}get promise(){return this._promise}resolve(t){this._resolve(t)}reject(t){this._reject(t)}}class _r{constructor(t,r){o(this,"_isCalled",!1);o(this,"_deferred",new fr);o(this,"_callback");o(this,"_that");this._callback=t,this._that=r}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...t){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...t)).then(r=>this._deferred.resolve(r),r=>this._deferred.reject(r))}catch(r){this._deferred.reject(r)}}return this._deferred.promise}}function mr(e){return Object.prototype.hasOwnProperty.call(e,"partialSuccess")}function Sr(){return{handleResponse(e){e==null||!mr(e)||e.partialSuccess==null||Object.keys(e.partialSuccess).length===0||d.warn("Received Partial Success response:",JSON.stringify(e.partialSuccess))}}}class gr{constructor(t,r,n,s,i){o(this,"_diagLogger");o(this,"_transport");o(this,"_serializer");o(this,"_responseHandler");o(this,"_promiseQueue");o(this,"_timeout");this._transport=t,this._serializer=r,this._responseHandler=n,this._promiseQueue=s,this._timeout=i,this._diagLogger=d.createComponentLogger({namespace:"OTLPExportDelegate"})}export(t,r){if(this._diagLogger.debug("items to be sent",t),this._promiseQueue.hasReachedLimit()){r({code:_.FAILED,error:new Error("Concurrent export limit reached")});return}const n=this._serializer.serializeRequest(t);if(n==null){r({code:_.FAILED,error:new Error("Nothing to send")});return}this._promiseQueue.pushPromise(this._transport.send(n,this._timeout).then(s=>{if(s.status==="success"){if(s.data!=null)try{this._responseHandler.handleResponse(this._serializer.deserializeResponse(s.data))}catch(i){this._diagLogger.warn("Export succeeded but could not deserialize response - is the response specification compliant?",i,s.data)}r({code:_.SUCCESS});return}else if(s.status==="failure"&&s.error){r({code:_.FAILED,error:s.error});return}else s.status==="retryable"?r({code:_.FAILED,error:s.error??new ht("Export failed with retryable status")}):r({code:_.FAILED,error:new ht("Export failed with unknown error")})},s=>r({code:_.FAILED,error:s})))}forceFlush(){return this._promiseQueue.awaitAll()}async shutdown(){this._diagLogger.debug("shutdown started"),await this.forceFlush(),this._transport.shutdown()}}function Er(e,t){return new gr(e.transport,e.serializer,Sr(),e.promiseHandler,t.timeout)}function Ar(e,t,r){return Er({transport:r,serializer:t,promiseHandler:de(e)},{timeout:e.timeoutMillis})}let v;function br(){if(v===void 0)try{const e=globalThis.process.argv0;v=e?`unknown_service:${e}`:"unknown_service"}catch{v="unknown_service"}return v}const x=e=>e!==null&&typeof e=="object"&&typeof e.then=="function";class z{constructor(t,r){o(this,"_rawAttributes");o(this,"_asyncAttributesPending",!1);o(this,"_schemaUrl");o(this,"_memoizedAttributes");const n=t.attributes??{};this._rawAttributes=Object.entries(n).map(([s,i])=>(x(i)&&(this._asyncAttributesPending=!0),[s,i])),this._rawAttributes=At(this._rawAttributes),this._schemaUrl=yr(r==null?void 0:r.schemaUrl)}static FromAttributeList(t,r){const n=new z({},r);return n._rawAttributes=At(t),n._asyncAttributesPending=t.filter(([s,i])=>x(i)).length>0,n}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let t=0;t<this._rawAttributes.length;t++){const[r,n]=this._rawAttributes[t];this._rawAttributes[t]=[r,x(n)?await n:n]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&d.error("Accessing resource attributes before async attributes settled"),this._memoizedAttributes)return this._memoizedAttributes;const t={};for(const[r,n]of this._rawAttributes){if(x(n)){d.debug(`Unsettled resource attribute ${r} skipped`);continue}n!=null&&(t[r]??(t[r]=n))}return this._asyncAttributesPending||(this._memoizedAttributes=t),t}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(t){if(t==null)return this;const r=wr(this,t),n=r?{schemaUrl:r}:void 0;return z.FromAttributeList([...t.getRawAttributes(),...this.getRawAttributes()],n)}}function Ht(e,t){return z.FromAttributeList(Object.entries(e),t)}function Tr(){return Ht({[Ut]:br(),[st]:q[st],[it]:q[it],[ot]:q[ot]})}function At(e){return e.map(([t,r])=>x(r)?[t,r.catch(n=>{d.debug("promise rejection for resource attribute: %s - %s",t,n)})]:[t,r])}function yr(e){if(typeof e=="string"||e===void 0)return e;d.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.",e)}function wr(e,t){const r=e==null?void 0:e.schemaUrl,n=t==null?void 0:t.schemaUrl,s=r===void 0||r==="",i=n===void 0||n==="";if(s)return n;if(i||r===n)return r;d.warn('Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.',r,n)}function Lr(e,t){const r={attributes:G(e.attributes,t),droppedAttributesCount:0},n=e.schemaUrl;return n&&n!==""&&(r.schemaUrl=n),r}function Pr(e){return{name:e.name,version:e.version}}function G(e,t){return Object.keys(e).map(r=>Cr(r,e[r],t))}function Cr(e,t,r){return{key:e,value:ct(t,r)}}function ct(e,t){const r=typeof e;if(r==="string")return{stringValue:e};if(r==="number")return Number.isInteger(e)?{intValue:e}:{doubleValue:e};if(r==="boolean")return{boolValue:e};if(e instanceof Uint8Array)return{bytesValue:t.encodeUint8Array(e)};if(Array.isArray(e)){const n=new Array(e.length);for(let s=0;s<e.length;s++)n[s]=ct(e[s],t);return{arrayValue:{values:n}}}if(r==="object"&&e!=null){const n=Object.keys(e),s=new Array(n.length);for(let i=0;i<n.length;i++)s[i]={key:n[i],value:ct(e[n[i]],t)};return{kvlistValue:{values:s}}}return{}}function Rr(e){const t=BigInt(1e9);return BigInt(Math.trunc(e[0]))*t+BigInt(Math.trunc(e[1]))}function Or(e){return Rr(e).toString()}const xr=typeof BigInt<"u"?Or:Be;function bt(e){return e}const Ir={encodeHrTime:xr,encodeSpanContext:bt,encodeOptionalSpanContext:bt,encodeUint8Array:e=>{if(typeof Buffer<"u")return Buffer.from(e).toString("base64");const t=new Array(e.length);for(let r=0;r<e.length;r++)t[r]=String.fromCharCode(e[r]);return btoa(t.join(""))}},Nr=256,Mr=512;function Kt(e,t){let r=e&255|Nr;return t&&(r|=Mr),r}function Dr(e,t){var i,a,c,u;const r=e.spanContext(),n=e.status,s=(i=e.parentSpanContext)!=null&&i.spanId?t.encodeSpanContext((a=e.parentSpanContext)==null?void 0:a.spanId):void 0;return{traceId:t.encodeSpanContext(r.traceId),spanId:t.encodeSpanContext(r.spanId),parentSpanId:s,traceState:(c=r.traceState)==null?void 0:c.serialize(),name:e.name,kind:e.kind==null?0:e.kind+1,startTimeUnixNano:t.encodeHrTime(e.startTime),endTimeUnixNano:t.encodeHrTime(e.endTime),attributes:G(e.attributes,t),droppedAttributesCount:e.droppedAttributesCount,events:e.events.map(l=>Ur(l,t)),droppedEventsCount:e.droppedEventsCount,status:{code:n.code,message:n.message},links:e.links.map(l=>vr(l,t)),droppedLinksCount:e.droppedLinksCount,flags:Kt(r.traceFlags,(u=e.parentSpanContext)==null?void 0:u.isRemote)}}function vr(e,t){var r;return{attributes:e.attributes?G(e.attributes,t):[],spanId:t.encodeSpanContext(e.context.spanId),traceId:t.encodeSpanContext(e.context.traceId),traceState:(r=e.context.traceState)==null?void 0:r.serialize(),droppedAttributesCount:e.droppedAttributesCount||0,flags:Kt(e.context.traceFlags,e.context.isRemote)}}function Ur(e,t){return{attributes:e.attributes?G(e.attributes,t):[],name:e.name,timeUnixNano:t.encodeHrTime(e.time),droppedAttributesCount:e.droppedAttributesCount||0}}function Br(e,t){return{resourceSpans:kr(e,t)}}function $r(e){const t=new Map;for(const r of e){let n=t.get(r.resource);n||(n=new Map,t.set(r.resource,n));const s=`${r.instrumentationScope.name}@${r.instrumentationScope.version||""}:${r.instrumentationScope.schemaUrl||""}`;let i=n.get(s);i||(i=[],n.set(s,i)),i.push(r)}return t}function kr(e,t){const r=$r(e),n=[],s=r.entries();let i=s.next();for(;!i.done;){const[a,c]=i.value,u=[],l=c.values();let h=l.next();for(;!h.done;){const f=h.value;if(f.length>0){const H=f.map(K=>Dr(K,t));u.push({scope:Pr(f[0].instrumentationScope),spans:H,schemaUrl:f[0].instrumentationScope.schemaUrl})}h=l.next()}const p=Lr(a,t),E={resource:p,scopeSpans:u,schemaUrl:p.schemaUrl};n.push(E),i=s.next()}return n}const Fr={serializeRequest:e=>{const t=Br(e,Ir);return new TextEncoder().encode(JSON.stringify(t))},deserializeResponse:e=>{if(e.length===0)return{};const t=new TextDecoder;try{return JSON.parse(t.decode(e))}catch(r){return d.warn(`Failed to parse trace export response: ${r.message}. Returning empty response`),{}}}},tt=5,jr=1e3,zr=5e3,Vr=1.5,Tt=.2;function Gr(){return Math.random()*(2*Tt)-Tt}class Hr{constructor(t){o(this,"_transport");this._transport=t}retry(t,r,n){return new Promise((s,i)=>{setTimeout(()=>{this._transport.send(t,r).then(s,i)},n)})}async send(t,r){let n=tt,s=jr;const i=Date.now()+r;let a=await this._transport.send(t,r);for(;a.status==="retryable"&&n>0;){n--;const c=Math.max(Math.min(s*(1+Gr()),zr),0);s=s*Vr;const u=a.retryInMillis??c,l=i-Date.now();if(u>l)return d.info(`Export retry time ${Math.round(u)}ms exceeds remaining timeout ${Math.round(l)}ms, not retrying further.`),a;d.verbose(`Scheduling export retry in ${Math.round(u)}ms`),a=await this.retry(t,l,u)}return a.status==="success"?d.verbose(`Export succeeded after ${tt-n} retry attempts.`):a.status==="retryable"?d.info(`Export failed after maximum retry attempts (${tt}).`):d.info(`Export failed with non-retryable error: ${a.error}`),a}shutdown(){return this._transport.shutdown()}}function Kr(e){return new Hr(e.transport)}function Xr(e){return e===429||e===502||e===503||e===504}function Qr(e){if(e==null)return;const t=Number.parseInt(e,10);if(Number.isInteger(t))return t>0?t*1e3:-1;const r=new Date(e).getTime()-Date.now();return r>=0?r:0}const Yr=60*1024,qr=9;let et=0,U=0;class Wr{constructor(t){o(this,"_parameters");this._parameters=t}async send(t,r){const n=new AbortController,s=setTimeout(()=>n.abort(),r);let i=globalThis.fetch;typeof i.__original=="function"&&(i=i.__original);const a=t.byteLength,c=et+a>Yr,u=U>=qr,l=!c&&!u;if(l)et+=a,U++;else{const h=c?"size limit":"count limit";d.debug(`keepalive disabled: ${(a/1024).toFixed(1)}KB payload, ${U} pending (${h})`)}try{const h=new URL(this._parameters.url),p=await i(h.href,{method:"POST",headers:await this._parameters.headers(),body:t,signal:n.signal,keepalive:l,mode:globalThis.location?globalThis.location.origin===h.origin?"same-origin":"cors":"no-cors"});if(p.status>=200&&p.status<=299)return d.debug(`export response success (status: ${p.status})`),{status:"success"};if(Xr(p.status)){d.warn(`export response retryable (status: ${p.status})`);const E=p.headers.get("Retry-After");return{status:"retryable",retryInMillis:Qr(E)}}return d.error(`export response failure (status: ${p.status})`),{status:"failure",error:new Error(`Fetch request failed with non-retryable status ${p.status}`)}}catch(h){return Zr(h)?(d.warn(`export request retryable (network error: ${h})`),{status:"retryable",error:new Error("Fetch request encountered a network error",{cause:h})}):(d.error(`export request failure (error: ${h})`),{status:"failure",error:new Error("Fetch request errored",{cause:h})})}finally{clearTimeout(s),l&&(et-=a,U--)}}shutdown(){}}function Jr(e){return new Wr(e)}function Zr(e){return e instanceof TypeError&&!e.cause}function tn(e,t){return Ar(e,t,Kr({transport:Jr(e)}))}function en(e){const t={};return Object.entries(e??{}).forEach(([r,n])=>{typeof n<"u"?t[r]=String(n):d.warn(`Header "${r}" has invalid value (${n}) and will be ignored`)}),t}function rn(e,t,r){return async()=>{const n={...await r()},s={};return t!=null&&Object.assign(s,await t()),e!=null&&Object.assign(s,en(await e())),Object.assign(s,n)}}function nn(e){var t;if(e!=null)try{const r=(t=globalThis.location)==null?void 0:t.href;return new URL(e,r).href}catch{throw new Error(`Configuration: Could not parse user-provided export URL: '${e}'`)}}function sn(e,t,r){return{...ce(e,t,r),headers:rn(e.headers,t.headers,r.headers),url:nn(e.url)??t.url??r.url}}function on(e,t){return{...ue(),headers:async()=>e,url:"http://localhost:4318/"+t}}function an(e){return typeof e.headers=="function"?e.headers:ae(e.headers)}function cn(e,t,r){return sn({url:e.url,timeoutMillis:e.timeoutMillis,headers:an(e),concurrencyLimit:e.concurrencyLimit},{},on(r,t))}function un(e,t,r,n){const s=cn(e,r,n);return tn(s,t)}class ln extends ie{constructor(t={}){super(un(t,Fr,"v1/traces",{"Content-Type":"application/json"}))}}const dn="exception";class hn{constructor(t){o(this,"_spanContext");o(this,"kind");o(this,"parentSpanContext");o(this,"attributes",{});o(this,"links",[]);o(this,"events",[]);o(this,"startTime");o(this,"resource");o(this,"instrumentationScope");o(this,"_droppedAttributesCount",0);o(this,"_droppedEventsCount",0);o(this,"_droppedLinksCount",0);o(this,"_attributesCount",0);o(this,"name");o(this,"status",{code:D.UNSET});o(this,"endTime",[0,0]);o(this,"_ended",!1);o(this,"_duration",[-1,-1]);o(this,"_spanProcessor");o(this,"_spanLimits");o(this,"_attributeValueLengthLimit");o(this,"_recordEndMetrics");o(this,"_performanceStartTime");o(this,"_performanceOffset");o(this,"_startTimeProvided");const r=Date.now();if(this._spanContext=t.spanContext,this._performanceStartTime=y.now(),this._performanceOffset=r-(this._performanceStartTime+y.timeOrigin),this._startTimeProvided=t.startTime!=null,this._spanLimits=t.spanLimits,this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit??0,this._spanProcessor=t.spanProcessor,this.name=t.name,this.parentSpanContext=t.parentSpanContext,this.kind=t.kind,t.links)for(const n of t.links)this.addLink(n);this.startTime=this._getTime(t.startTime??r),this.resource=t.resource,this.instrumentationScope=t.scope,this._recordEndMetrics=t.recordEndMetrics,t.attributes!=null&&this.setAttributes(t.attributes),this._spanProcessor.onStart(this,t.context)}spanContext(){return this._spanContext}setAttribute(t,r){if(r==null||this._isSpanEnded())return this;if(t.length===0)return d.warn(`Invalid attribute key: ${t}`),this;if(!Dt(r))return d.warn(`Invalid attribute value set for key: ${t}`),this;const{attributeCountLimit:n}=this._spanLimits,s=!Object.prototype.hasOwnProperty.call(this.attributes,t);return n!==void 0&&this._attributesCount>=n&&s?(this._droppedAttributesCount++,this):(this.attributes[t]=this._truncateToSize(r),s&&this._attributesCount++,this)}setAttributes(t){for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&this.setAttribute(r,t[r]);return this}addEvent(t,r,n){if(this._isSpanEnded())return this;const{eventCountLimit:s}=this._spanLimits;if(s===0)return d.warn("No events allowed."),this._droppedEventsCount++,this;s!==void 0&&this.events.length>=s&&(this._droppedEventsCount===0&&d.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),ft(r)&&(ft(n)||(n=r),r=void 0);const i=N(r),{attributePerEventCountLimit:a}=this._spanLimits,c={};let u=0,l=0;for(const h in i){if(!Object.prototype.hasOwnProperty.call(i,h))continue;const p=i[h];if(a!==void 0&&l>=a){u++;continue}c[h]=this._truncateToSize(p),l++}return this.events.push({name:t,attributes:c,time:this._getTime(n),droppedAttributesCount:u}),this}addLink(t){if(this._isSpanEnded())return this;const{linkCountLimit:r}=this._spanLimits;if(r===0)return this._droppedLinksCount++,this;r!==void 0&&this.links.length>=r&&(this._droppedLinksCount===0&&d.debug("Dropping extra links."),this.links.shift(),this._droppedLinksCount++);const{attributePerLinkCountLimit:n}=this._spanLimits,s=N(t.attributes),i={};let a=0,c=0;for(const l in s){if(!Object.prototype.hasOwnProperty.call(s,l))continue;const h=s[l];if(n!==void 0&&c>=n){a++;continue}i[l]=this._truncateToSize(h),c++}const u={context:t.context};return c>0&&(u.attributes=i),a>0&&(u.droppedAttributesCount=a),this.links.push(u),this}addLinks(t){for(const r of t)this.addLink(r);return this}setStatus(t){if(this._isSpanEnded())return this;if(t.code===D.UNSET)return this;if(this.status.code===D.OK)return this;const r={code:t.code};return t.code===D.ERROR&&(typeof t.message=="string"?r.message=t.message:t.message!=null&&d.warn(`Dropping invalid status.message of type '${typeof t.message}', expected 'string'`)),this.status=r,this}updateName(t){return this._isSpanEnded()?this:(this.name=t,this)}end(t){var r;if(this._isSpanEnded()){d.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);return}this.endTime=this._getTime(t),this._duration=Ue(this.startTime,this.endTime),this._duration[0]<0&&(d.warn("Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.",this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0]),this._droppedEventsCount>0&&d.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._droppedLinksCount>0&&d.warn(`Dropped ${this._droppedLinksCount} links because linkCountLimit reached`),this._spanProcessor.onEnding&&this._spanProcessor.onEnding(this),(r=this._recordEndMetrics)==null||r.call(this),this._ended=!0,this._spanProcessor.onEnd(this)}_getTime(t){if(typeof t=="number"&&t<=y.now())return ve(t+this._performanceOffset);if(typeof t=="number")return w(t);if(t instanceof Date)return w(t.getTime());if(Bt(t))return t;if(this._startTimeProvided)return w(Date.now());const r=y.now()-this._performanceStartTime;return $t(this.startTime,w(r))}isRecording(){return this._ended===!1}recordException(t,r){const n={};typeof t=="string"?n[Q]=t:t&&(t.code?n[Y]=t.code.toString():t.name&&(n[Y]=t.name),t.message&&(n[Q]=t.message),t.stack&&(n[Re]=t.stack)),n[Y]||n[Q]?this.addEvent(dn,n,r):d.warn(`Failed to record an exception ${t}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){if(this._ended){const t=new Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);d.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,t)}return this._ended}_truncateToLimitUtil(t,r){return t.length<=r?t:t.substring(0,r)}_truncateToSize(t){const r=this._attributeValueLengthLimit;return r<=0?(d.warn(`Attribute value limit must be positive, got ${r}`),t):typeof t=="string"?this._truncateToLimitUtil(t,r):Array.isArray(t)?t.map(n=>typeof n=="string"?this._truncateToLimitUtil(n,r):n):t}}var g;(function(e){e[e.NOT_RECORD=0]="NOT_RECORD",e[e.RECORD=1]="RECORD",e[e.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(g||(g={}));class V{shouldSample(){return{decision:g.NOT_RECORD}}toString(){return"AlwaysOffSampler"}}class L{shouldSample(){return{decision:g.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}}class B{constructor(t){o(this,"_root");o(this,"_remoteParentSampled");o(this,"_remoteParentNotSampled");o(this,"_localParentSampled");o(this,"_localParentNotSampled");this._root=t.root,this._root||(C(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new L),this._remoteParentSampled=t.remoteParentSampled??new L,this._remoteParentNotSampled=t.remoteParentNotSampled??new V,this._localParentSampled=t.localParentSampled??new L,this._localParentNotSampled=t.localParentNotSampled??new V}shouldSample(t,r,n,s,i,a){const c=S.getSpanContext(t);return!c||!It(c)?this._root.shouldSample(t,r,n,s,i,a):c.isRemote?c.traceFlags&P.SAMPLED?this._remoteParentSampled.shouldSample(t,r,n,s,i,a):this._remoteParentNotSampled.shouldSample(t,r,n,s,i,a):c.traceFlags&P.SAMPLED?this._localParentSampled.shouldSample(t,r,n,s,i,a):this._localParentNotSampled.shouldSample(t,r,n,s,i,a)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}}class yt{constructor(t=0){o(this,"_ratio");o(this,"_upperBound");this._ratio=this._normalize(t),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(t,r){return{decision:ee(r)&&this._accumulate(r)<this._upperBound?g.RECORD_AND_SAMPLED:g.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(t){return typeof t!="number"||isNaN(t)?0:t>=1?1:t<=0?0:t}_accumulate(t){let r=0;for(let n=0;n<t.length/8;n++){const s=n*8,i=parseInt(t.slice(s,s+8),16);r=(r^i)>>>0}return r}}var m;(function(e){e.AlwaysOff="always_off",e.AlwaysOn="always_on",e.ParentBasedAlwaysOff="parentbased_always_off",e.ParentBasedAlwaysOn="parentbased_always_on",e.ParentBasedTraceIdRatio="parentbased_traceidratio",e.TraceIdRatio="traceidratio"})(m||(m={}));const wt=1;function Xt(){return{sampler:Qt(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128},spanLimits:{attributeValueLengthLimit:1/0,attributeCountLimit:128,linkCountLimit:128,eventCountLimit:128,attributePerEventCountLimit:128,attributePerLinkCountLimit:128}}}function Qt(){const e=m.ParentBasedAlwaysOn;switch(e){case m.AlwaysOn:return new L;case m.AlwaysOff:return new V;case m.ParentBasedAlwaysOn:return new B({root:new L});case m.ParentBasedAlwaysOff:return new B({root:new V});case m.TraceIdRatio:return new yt(Lt());case m.ParentBasedTraceIdRatio:return new B({root:new yt(Lt())});default:return d.error(`OTEL_TRACES_SAMPLER value "${e}" invalid, defaulting to "${m.ParentBasedAlwaysOn}".`),new B({root:new L})}}function Lt(){return d.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${wt}.`),wt}const pn=128,fn=1/0;function _n(e){const t={sampler:Qt()},r=Xt(),n=Object.assign({},r,t,e);return n.generalLimits=Object.assign({},r.generalLimits,e.generalLimits||{}),n.spanLimits=Object.assign({},r.spanLimits,e.spanLimits||{}),n}function mn(e){var r,n,s,i;const t=Object.assign({},e.spanLimits);return t.attributeCountLimit=((r=e.spanLimits)==null?void 0:r.attributeCountLimit)??((n=e.generalLimits)==null?void 0:n.attributeCountLimit)??void 0??void 0??pn,t.attributeValueLengthLimit=((s=e.spanLimits)==null?void 0:s.attributeValueLengthLimit)??((i=e.generalLimits)==null?void 0:i.attributeValueLengthLimit)??void 0??void 0??fn,Object.assign({},e,{spanLimits:t})}class Sn{constructor(t,r){o(this,"_maxExportBatchSize");o(this,"_maxQueueSize");o(this,"_scheduledDelayMillis");o(this,"_exportTimeoutMillis");o(this,"_exporter");o(this,"_isExporting",!1);o(this,"_finishedSpans",[]);o(this,"_timer");o(this,"_shutdownOnce");o(this,"_droppedSpansCount",0);this._exporter=t,this._maxExportBatchSize=typeof(r==null?void 0:r.maxExportBatchSize)=="number"?r.maxExportBatchSize:512,this._maxQueueSize=typeof(r==null?void 0:r.maxQueueSize)=="number"?r.maxQueueSize:2048,this._scheduledDelayMillis=typeof(r==null?void 0:r.scheduledDelayMillis)=="number"?r.scheduledDelayMillis:5e3,this._exportTimeoutMillis=typeof(r==null?void 0:r.exportTimeoutMillis)=="number"?r.exportTimeoutMillis:3e4,this._shutdownOnce=new _r(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(d.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(t,r){}onEnd(t){this._shutdownOnce.isCalled||(t.spanContext().traceFlags&P.SAMPLED)!==0&&this._addToBuffer(t)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>this._exporter.shutdown())}_addToBuffer(t){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&d.debug("maxQueueSize reached, dropping spans"),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(d.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(t),this._maybeStartTimer()}_flushAll(){return new Promise((t,r)=>{const n=[],s=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let i=0,a=s;i<a;i++)n.push(this._flushOneBatch());Promise.all(n).then(()=>{t()}).catch(r)})}_flushOneBatch(){return this._clearTimer(),this._finishedSpans.length===0?Promise.resolve():new Promise((t,r)=>{const n=setTimeout(()=>{r(new Error("Timeout"))},this._exportTimeoutMillis);T.with(he(T.active()),()=>{let s;this._finishedSpans.length<=this._maxExportBatchSize?(s=this._finishedSpans,this._finishedSpans=[]):s=this._finishedSpans.splice(0,this._maxExportBatchSize);const i=()=>this._exporter.export(s,c=>{clearTimeout(n),c.code===_.SUCCESS?t():r(c.error??new Error("BatchSpanProcessor: span export failed"))});let a=null;for(let c=0,u=s.length;c<u;c++){const l=s[c];l.resource.asyncAttributesPending&&l.resource.waitForAsyncAttributes&&(a??(a=[]),a.push(l.resource.waitForAsyncAttributes()))}a===null?i():Promise.all(a).then(i,c=>{C(c),r(c)})})})}_maybeStartTimer(){if(this._isExporting)return;const t=()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(r=>{this._isExporting=!1,C(r)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return t();this._timer===void 0&&(this._timer=setTimeout(()=>t(),this._scheduledDelayMillis),typeof this._timer!="number"&&this._timer.unref())}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}}class gn extends Sn{constructor(r,n){super(r,n);o(this,"_visibilityChangeListener");o(this,"_pageHideListener");this.onInit(n)}onInit(r){(r==null?void 0:r.disableAutoFlushOnDocumentHide)!==!0&&typeof document<"u"&&(this._visibilityChangeListener=()=>{document.visibilityState==="hidden"&&this.forceFlush().catch(n=>{C(n)})},this._pageHideListener=()=>{this.forceFlush().catch(n=>{C(n)})},document.addEventListener("visibilitychange",this._visibilityChangeListener),document.addEventListener("pagehide",this._pageHideListener))}onShutdown(){typeof document<"u"&&(this._visibilityChangeListener&&document.removeEventListener("visibilitychange",this._visibilityChangeListener),this._pageHideListener&&document.removeEventListener("pagehide",this._pageHideListener))}}const En=16,An=8,Pt=new Uint8Array(En),Ct=new Uint8Array(An),bn=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Rt(e){for(let t=0;t<e.length;t++)e[t]=Math.random()*256>>>0;for(let t=0;t<e.length;t++)if(e[t]>0)return;e[e.length-1]=1}function Ot(e){let t="";for(let r=0;r<e.length;r++)t+=bn[e[r]];return t}class Tn{generateTraceId(){return Rt(Pt),Ot(Pt)}generateSpanId(){return Rt(Ct),Ot(Ct)}}const yn="otel.span.parent.origin",xt="otel.span.sampling_result",wn="otel.sdk.span.live",Ln="otel.sdk.span.started";class Pn{constructor(t){o(this,"startedSpans");o(this,"liveSpans");this.startedSpans=t.createCounter(Ln,{unit:"{span}",description:"The number of created spans."}),this.liveSpans=t.createUpDownCounter(wn,{unit:"{span}",description:"The number of currently live spans."})}startSpan(t,r){const n=Rn(r);if(this.startedSpans.add(1,{[yn]:Cn(t),[xt]:n}),r===g.NOT_RECORD)return()=>{};const s={[xt]:n};return this.liveSpans.add(1,s),()=>{this.liveSpans.add(-1,s)}}}function Cn(e){return e?e.isRemote?"remote":"local":"none"}function Rn(e){switch(e){case g.RECORD_AND_SAMPLED:return"RECORD_AND_SAMPLE";case g.RECORD:return"RECORD_ONLY";case g.NOT_RECORD:return"DROP"}}const On="2.7.0";class xn{constructor(t,r,n,s){o(this,"_sampler");o(this,"_generalLimits");o(this,"_spanLimits");o(this,"_idGenerator");o(this,"instrumentationScope");o(this,"_resource");o(this,"_spanProcessor");o(this,"_tracerMetrics");const i=_n(r);this._sampler=i.sampler,this._generalLimits=i.generalLimits,this._spanLimits=i.spanLimits,this._idGenerator=r.idGenerator||new Tn,this._resource=n,this._spanProcessor=s,this.instrumentationScope=t;const a=i.meterProvider?i.meterProvider.getMeter("@opentelemetry/sdk-trace",On):re();this._tracerMetrics=new Pn(a)}startSpan(t,r={},n=T.active()){r.root&&(n=S.deleteSpan(n));const s=S.getSpan(n);if(ut(n))return d.debug("Instrumentation suppressed, returning Noop Span"),S.wrapSpanContext(ne);const i=s==null?void 0:s.spanContext(),a=this._idGenerator.generateSpanId();let c,u,l;!i||!S.isSpanContextValid(i)?u=this._idGenerator.generateTraceId():(u=i.traceId,l=i.traceState,c=i);const h=r.kind??se.INTERNAL,p=(r.links??[]).map(M=>({context:M.context,attributes:N(M.attributes)})),E=N(r.attributes),f=this._sampler.shouldSample(n,u,t,h,E,p),H=this._tracerMetrics.startSpan(i,f.decision);l=f.traceState??l;const K=f.decision===k.RECORD_AND_SAMPLED?P.SAMPLED:P.NONE,dt={traceId:u,spanId:a,traceFlags:K,traceState:l};if(f.decision===k.NOT_RECORD)return d.debug("Recording is off, propagating context in a non-recording span"),S.wrapSpanContext(dt);const Yt=N(Object.assign(E,f.attributes));return new hn({resource:this._resource,scope:this.instrumentationScope,context:n,spanContext:dt,name:t,kind:h,links:p,parentSpanContext:c,attributes:Yt,startTime:r.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits,recordEndMetrics:H})}startActiveSpan(t,r,n,s){let i,a,c;if(arguments.length<2)return;arguments.length===2?c=r:arguments.length===3?(i=r,c=n):(i=r,a=n,c=s);const u=a??T.active(),l=this.startSpan(t,i,u),h=S.setSpan(u,l);return T.with(h,c,void 0,l)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}}class In{constructor(t){o(this,"_spanProcessors");this._spanProcessors=t}forceFlush(){const t=[];for(const r of this._spanProcessors)t.push(r.forceFlush());return new Promise(r=>{Promise.all(t).then(()=>{r()}).catch(n=>{C(n||new Error("MultiSpanProcessor: forceFlush failed")),r()})})}onStart(t,r){for(const n of this._spanProcessors)n.onStart(t,r)}onEnding(t){for(const r of this._spanProcessors)r.onEnding&&r.onEnding(t)}onEnd(t){for(const r of this._spanProcessors)r.onEnd(t)}shutdown(){const t=[];for(const r of this._spanProcessors)t.push(r.shutdown());return new Promise((r,n)=>{Promise.all(t).then(()=>{r()},n)})}}var b;(function(e){e[e.resolved=0]="resolved",e[e.timeout=1]="timeout",e[e.error=2]="error",e[e.unresolved=3]="unresolved"})(b||(b={}));class Nn{constructor(t={}){o(this,"_config");o(this,"_tracers",new Map);o(this,"_resource");o(this,"_activeSpanProcessor");var s;const r=hr({},Xt(),mn(t));this._resource=r.resource??Tr(),this._config=Object.assign({},r,{resource:this._resource});const n=[];(s=t.spanProcessors)!=null&&s.length&&n.push(...t.spanProcessors),this._activeSpanProcessor=new In(n)}getTracer(t,r,n){const s=`${t}@${r||""}:${(n==null?void 0:n.schemaUrl)||""}`;return this._tracers.has(s)||this._tracers.set(s,new xn({name:t,version:r,schemaUrl:n==null?void 0:n.schemaUrl},this._config,this._resource,this._activeSpanProcessor)),this._tracers.get(s)}forceFlush(){const t=this._config.forceFlushTimeoutMillis,r=this._activeSpanProcessor._spanProcessors.map(n=>new Promise(s=>{let i;const a=setTimeout(()=>{s(new Error(`Span processor did not completed within timeout period of ${t} ms`)),i=b.timeout},t);n.forceFlush().then(()=>{clearTimeout(a),i!==b.timeout&&(i=b.resolved,s(i))}).catch(c=>{clearTimeout(a),i=b.error,s(c)})}));return new Promise((n,s)=>{Promise.all(r).then(i=>{const a=i.filter(c=>c!==b.resolved);a.length>0?s(a):n()}).catch(i=>s([i]))})}shutdown(){return this._activeSpanProcessor.shutdown()}}class Mn{export(t,r){return this._sendSpans(t,r)}shutdown(){return this._sendSpans([]),this.forceFlush()}forceFlush(){return Promise.resolve()}_exportInfo(t){var r;return{resource:{attributes:t.resource.attributes},instrumentationScope:t.instrumentationScope,traceId:t.spanContext().traceId,parentSpanContext:t.parentSpanContext,traceState:(r=t.spanContext().traceState)==null?void 0:r.serialize(),name:t.name,id:t.spanContext().spanId,kind:t.kind,timestamp:pt(t.startTime),duration:pt(t.duration),attributes:t.attributes,status:t.status,events:t.events,links:t.links}}_sendSpans(t,r){for(const n of t)console.dir(this._exportInfo(n),{depth:3});if(r)return r({code:_.SUCCESS})}}class Dn{constructor(){o(this,"_enabled",!1);o(this,"_currentContext",R)}_bindFunction(t=R,r){const n=this,s=function(...i){return n.with(t,()=>r.apply(this,i))};return Object.defineProperty(s,"length",{enumerable:!1,configurable:!0,writable:!1,value:r.length}),s}active(){return this._currentContext}bind(t,r){return t===void 0&&(t=this.active()),typeof r=="function"?this._bindFunction(t,r):r}disable(){return this._currentContext=R,this._enabled=!1,this}enable(){return this._enabled?this:(this._enabled=!0,this._currentContext=R,this)}with(t,r,n,...s){const i=this._currentContext;this._currentContext=t||R;try{return r.call(n,...s)}finally{this._currentContext=i}}}function vn(e){if(e!==null){if(e===void 0){const t=new Dn;t.enable(),T.setGlobalContextManager(t);return}e.enable(),T.setGlobalContextManager(e)}}function Un(e){if(e!==null){if(e===void 0){I.setGlobalPropagator(new $e({propagators:[new tr,new Ae]}));return}I.setGlobalPropagator(e)}}class Bn extends Nn{constructor(t={}){super(t)}register(t={}){S.setGlobalTracerProvider(this),Un(t.propagator),vn(t.contextManager)}}var rt;function Vn(e){if(rt||!(e.enabled??!!e.otlpEndpoint))return!1;const r=e.otlpEndpoint?new ln({url:e.otlpEndpoint,...e.otlpHeaders?{headers:e.otlpHeaders}:{}}):new Mn,n=Ht({[Ut]:e.serviceName,[Oe]:e.serviceVersion??"0.0.0"});return rt=new Bn({resource:n,spanProcessors:[new gn(r)]}),rt.register(),!0}export{Vn as initObservabilityWeb};
|
|
2
|
+
//# sourceMappingURL=web-C8yeWrxL.js.map
|